efiboot.h revision 1.2.2.3 1 1.2.2.3 kardel /* $NetBSD: efiboot.h,v 1.2.2.3 2006/06/01 22:34:54 kardel Exp $ */
2 1.2.2.2 simonb
3 1.2.2.2 simonb /*-
4 1.2.2.2 simonb * Copyright (c) 1996
5 1.2.2.2 simonb * Matthias Drochner. All rights reserved.
6 1.2.2.2 simonb *
7 1.2.2.2 simonb * Redistribution and use in source and binary forms, with or without
8 1.2.2.2 simonb * modification, are permitted provided that the following conditions
9 1.2.2.2 simonb * are met:
10 1.2.2.2 simonb * 1. Redistributions of source code must retain the above copyright
11 1.2.2.2 simonb * notice, this list of conditions and the following disclaimer.
12 1.2.2.2 simonb * 2. Redistributions in binary form must reproduce the above copyright
13 1.2.2.2 simonb * notice, this list of conditions and the following disclaimer in the
14 1.2.2.2 simonb * documentation and/or other materials provided with the distribution.
15 1.2.2.2 simonb * 3. All advertising materials mentioning features or use of this software
16 1.2.2.2 simonb * must display the following acknowledgement:
17 1.2.2.2 simonb * This product includes software developed for the NetBSD Project
18 1.2.2.2 simonb * by Matthias Drochner.
19 1.2.2.2 simonb * 4. The name of the author may not be used to endorse or promote products
20 1.2.2.2 simonb * derived from this software without specific prior written permission.
21 1.2.2.2 simonb *
22 1.2.2.2 simonb * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 1.2.2.2 simonb * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 1.2.2.2 simonb * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 1.2.2.2 simonb * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 1.2.2.2 simonb * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 1.2.2.2 simonb * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 1.2.2.2 simonb * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 1.2.2.2 simonb * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 1.2.2.2 simonb * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 1.2.2.2 simonb * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 1.2.2.2 simonb *
33 1.2.2.3 kardel * $FreeBSD$: src/sys/boot/efi/libefi/efiboot.h,v 1.8 2003/08/02 08:22:03 marcel Exp $
34 1.2.2.2 simonb */
35 1.2.2.2 simonb
36 1.2.2.2 simonb /*
37 1.2.2.2 simonb * EFI fully-qualified device descriptor
38 1.2.2.2 simonb */
39 1.2.2.2 simonb struct efi_devdesc {
40 1.2.2.2 simonb struct devsw *d_dev;
41 1.2.2.2 simonb int d_type;
42 1.2.2.2 simonb #define DEVT_NONE 0
43 1.2.2.2 simonb #define DEVT_DISK 1
44 1.2.2.2 simonb #define DEVT_NET 2
45 1.2.2.2 simonb EFI_HANDLE d_handle;
46 1.2.2.2 simonb union {
47 1.2.2.2 simonb struct {
48 1.2.2.2 simonb int unit;
49 1.2.2.2 simonb int slice;
50 1.2.2.2 simonb int partition;
51 1.2.2.2 simonb } efidisk;
52 1.2.2.2 simonb struct {
53 1.2.2.2 simonb int unit; /* XXX net layer lives over these? */
54 1.2.2.2 simonb } netif;
55 1.2.2.2 simonb } d_kind;
56 1.2.2.2 simonb };
57 1.2.2.2 simonb
58 1.2.2.2 simonb extern int efi_getdev(void **vdev, const char *devspec, const char **path);
59 1.2.2.2 simonb extern char *efi_fmtdev(void *vdev);
60 1.2.2.2 simonb extern int efi_setcurrdev(struct env_var *ev, int flags, void *value);
61 1.2.2.2 simonb
62 1.2.2.2 simonb #define MAXDEV 31 /* maximum number of distinct devices */
63 1.2.2.2 simonb
64 1.2.2.2 simonb typedef unsigned long physaddr_t;
65 1.2.2.2 simonb
66 1.2.2.2 simonb /* exported devices XXX rename? */
67 1.2.2.2 simonb extern struct devsw devsw[];
68 1.2.2.2 simonb extern struct netif_driver efi_net;
69 1.2.2.2 simonb
70 1.2.2.2 simonb /* Find EFI network resources */
71 1.2.2.2 simonb /*extern void efinet_init_driver(void); XXX should get this running once we're off the mark */
72 1.2.2.2 simonb
73 1.2.2.2 simonb /* Map handles to units */
74 1.2.2.2 simonb int efifs_get_unit(EFI_HANDLE);
75 1.2.2.2 simonb
76 1.2.2.2 simonb /* Wrapper over EFI filesystems. */
77 1.2.2.2 simonb extern struct fs_ops efi_fsops;
78 1.2.2.2 simonb
79 1.2.2.2 simonb /* this is in startup code */
80 1.2.2.2 simonb extern void delay(int);
81 1.2.2.2 simonb extern void reboot(void);
82 1.2.2.2 simonb
83 1.2.2.2 simonb extern ssize_t efi_copyin(const void *src, vaddr_t dest, size_t len);
84 1.2.2.2 simonb extern ssize_t efi_copyout(const vaddr_t src, void *dest, size_t len);
85 1.2.2.2 simonb extern ssize_t efi_readin(const int fd, vaddr_t dest, size_t len);
86 1.2.2.2 simonb
87 1.2.2.2 simonb extern int efi_boot(void);
88 1.2.2.2 simonb extern int efi_autoload(void);
89 1.2.2.2 simonb
90 1.2.2.2 simonb extern int fpswa_init(u_int64_t *fpswa_interface);
91 1.2.2.2 simonb
92 1.2.2.2 simonb struct bootinfo;
93 1.2.2.2 simonb struct preloaded_file;
94 1.2.2.2 simonb extern int bi_load(struct bootinfo *, struct preloaded_file *,
95 1.2.2.2 simonb UINTN *mapkey, UINTN pages);
96 1.2.2.2 simonb
97