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