efiboot.h revision 1.1.4.3
11.1.4.3Selad/*	$NetBSD: efiboot.h,v 1.1.4.3 2006/05/11 23:26:48 elad Exp $	*/
21.1.4.2Selad
31.1.4.2Selad/*-
41.1.4.2Selad * Copyright (c) 1996
51.1.4.2Selad *	Matthias Drochner.  All rights reserved.
61.1.4.2Selad *
71.1.4.2Selad * Redistribution and use in source and binary forms, with or without
81.1.4.2Selad * modification, are permitted provided that the following conditions
91.1.4.2Selad * are met:
101.1.4.2Selad * 1. Redistributions of source code must retain the above copyright
111.1.4.2Selad *    notice, this list of conditions and the following disclaimer.
121.1.4.2Selad * 2. Redistributions in binary form must reproduce the above copyright
131.1.4.2Selad *    notice, this list of conditions and the following disclaimer in the
141.1.4.2Selad *    documentation and/or other materials provided with the distribution.
151.1.4.2Selad * 3. All advertising materials mentioning features or use of this software
161.1.4.2Selad *    must display the following acknowledgement:
171.1.4.2Selad *	This product includes software developed for the NetBSD Project
181.1.4.2Selad *	by Matthias Drochner.
191.1.4.2Selad * 4. The name of the author may not be used to endorse or promote products
201.1.4.2Selad *    derived from this software without specific prior written permission.
211.1.4.2Selad *
221.1.4.2Selad * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
231.1.4.2Selad * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
241.1.4.2Selad * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
251.1.4.2Selad * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
261.1.4.2Selad * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
271.1.4.2Selad * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
281.1.4.2Selad * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
291.1.4.2Selad * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
301.1.4.2Selad * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
311.1.4.2Selad * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
321.1.4.2Selad *
331.1.4.3Selad * $FreeBSD$: src/sys/boot/efi/libefi/efiboot.h,v 1.8 2003/08/02 08:22:03 marcel Exp $
341.1.4.2Selad */
351.1.4.2Selad
361.1.4.2Selad/*
371.1.4.2Selad * EFI fully-qualified device descriptor
381.1.4.2Selad */
391.1.4.2Seladstruct efi_devdesc {
401.1.4.2Selad	struct	devsw	*d_dev;
411.1.4.2Selad	int		d_type;
421.1.4.2Selad#define	DEVT_NONE	0
431.1.4.2Selad#define	DEVT_DISK	1
441.1.4.2Selad#define	DEVT_NET	2
451.1.4.2Selad	EFI_HANDLE	d_handle;
461.1.4.2Selad	union {
471.1.4.2Selad		struct {
481.1.4.2Selad			int	unit;
491.1.4.2Selad			int	slice;
501.1.4.2Selad			int	partition;
511.1.4.2Selad		} efidisk;
521.1.4.2Selad		struct {
531.1.4.2Selad			int	unit;	/* XXX net layer lives over these? */
541.1.4.2Selad		} netif;
551.1.4.2Selad	} d_kind;
561.1.4.2Selad};
571.1.4.2Selad
581.1.4.2Seladextern int	efi_getdev(void **vdev, const char *devspec, const char **path);
591.1.4.2Seladextern char	*efi_fmtdev(void *vdev);
601.1.4.2Seladextern int	efi_setcurrdev(struct env_var *ev, int flags, void *value);
611.1.4.2Selad
621.1.4.2Selad#define	MAXDEV	31	/* maximum number of distinct devices */
631.1.4.2Selad
641.1.4.2Seladtypedef unsigned long physaddr_t;
651.1.4.2Selad
661.1.4.2Selad/* exported devices XXX rename? */
671.1.4.2Seladextern struct devsw devsw[];
681.1.4.2Seladextern struct netif_driver efi_net;
691.1.4.2Selad
701.1.4.2Selad/* Find EFI network resources */
711.1.4.2Selad/*extern void efinet_init_driver(void); XXX should get this running once we're off the mark */
721.1.4.2Selad
731.1.4.2Selad/* Map handles to units */
741.1.4.2Seladint efifs_get_unit(EFI_HANDLE);
751.1.4.2Selad
761.1.4.2Selad/* Wrapper over EFI filesystems. */
771.1.4.2Seladextern struct fs_ops efi_fsops;
781.1.4.2Selad
791.1.4.2Selad/* this is in startup code */
801.1.4.2Seladextern void		delay(int);
811.1.4.2Seladextern void		reboot(void);
821.1.4.2Selad
831.1.4.2Seladextern ssize_t		efi_copyin(const void *src, vaddr_t dest, size_t len);
841.1.4.2Seladextern ssize_t		efi_copyout(const vaddr_t src, void *dest, size_t len);
851.1.4.2Seladextern ssize_t		efi_readin(const int fd, vaddr_t dest, size_t len);
861.1.4.2Selad
871.1.4.2Seladextern int		efi_boot(void);
881.1.4.2Seladextern int		efi_autoload(void);
891.1.4.2Selad
901.1.4.2Seladextern int		fpswa_init(u_int64_t *fpswa_interface);
911.1.4.2Selad
921.1.4.2Seladstruct bootinfo;
931.1.4.2Seladstruct preloaded_file;
941.1.4.2Seladextern int		bi_load(struct bootinfo *, struct preloaded_file *,
951.1.4.2Selad				UINTN *mapkey, UINTN pages);
961.1.4.2Selad
97