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