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