xref: /netbsd-src/sys/arch/x86/include/bios32.h (revision ce099b40997c43048fb78bd578195f81d2456523)
1*ce099b40Smartin /*	$NetBSD: bios32.h,v 1.5 2008/04/28 20:23:40 martin Exp $	*/
28375b2d9Sfvdl 
38375b2d9Sfvdl /*-
48375b2d9Sfvdl  * Copyright (c) 1999 The NetBSD Foundation, Inc.
58375b2d9Sfvdl  * All rights reserved.
68375b2d9Sfvdl  *
78375b2d9Sfvdl  * This code is derived from software contributed to The NetBSD Foundation
88375b2d9Sfvdl  * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
98375b2d9Sfvdl  * NASA Ames Research Center.
108375b2d9Sfvdl  *
118375b2d9Sfvdl  * Redistribution and use in source and binary forms, with or without
128375b2d9Sfvdl  * modification, are permitted provided that the following conditions
138375b2d9Sfvdl  * are met:
148375b2d9Sfvdl  * 1. Redistributions of source code must retain the above copyright
158375b2d9Sfvdl  *    notice, this list of conditions and the following disclaimer.
168375b2d9Sfvdl  * 2. Redistributions in binary form must reproduce the above copyright
178375b2d9Sfvdl  *    notice, this list of conditions and the following disclaimer in the
188375b2d9Sfvdl  *    documentation and/or other materials provided with the distribution.
198375b2d9Sfvdl  *
208375b2d9Sfvdl  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
218375b2d9Sfvdl  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
228375b2d9Sfvdl  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
238375b2d9Sfvdl  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
248375b2d9Sfvdl  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
258375b2d9Sfvdl  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
268375b2d9Sfvdl  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
278375b2d9Sfvdl  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
288375b2d9Sfvdl  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
298375b2d9Sfvdl  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
308375b2d9Sfvdl  * POSSIBILITY OF SUCH DAMAGE.
318375b2d9Sfvdl  */
328375b2d9Sfvdl 
338375b2d9Sfvdl /*
348375b2d9Sfvdl  * Copyright (c) 1999, by UCHIYAMA Yasushi
358375b2d9Sfvdl  * All rights reserved.
368375b2d9Sfvdl  *
378375b2d9Sfvdl  * Redistribution and use in source and binary forms, with or without
388375b2d9Sfvdl  * modification, are permitted provided that the following conditions
398375b2d9Sfvdl  * are met:
408375b2d9Sfvdl  * 1. Redistributions of source code must retain the above copyright
418375b2d9Sfvdl  *    notice, this list of conditions and the following disclaimer.
428375b2d9Sfvdl  * 2. The name of the developer may NOT be used to endorse or promote products
438375b2d9Sfvdl  *    derived from this software without specific prior written permission.
448375b2d9Sfvdl  *
458375b2d9Sfvdl  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
468375b2d9Sfvdl  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
478375b2d9Sfvdl  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
488375b2d9Sfvdl  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
498375b2d9Sfvdl  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
508375b2d9Sfvdl  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
518375b2d9Sfvdl  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
528375b2d9Sfvdl  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
538375b2d9Sfvdl  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
548375b2d9Sfvdl  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
558375b2d9Sfvdl  * SUCH DAMAGE.
568375b2d9Sfvdl  */
578375b2d9Sfvdl 
588375b2d9Sfvdl struct bios32_entry_info {
598375b2d9Sfvdl 	paddr_t		bei_base;
608375b2d9Sfvdl 	psize_t		bei_size;
618375b2d9Sfvdl 	paddr_t		bei_entry;
628375b2d9Sfvdl };
638375b2d9Sfvdl 
648375b2d9Sfvdl typedef struct bios32_entry_info *bios32_entry_info_t;
658375b2d9Sfvdl 
668375b2d9Sfvdl struct bios32_entry {
6753524e44Schristos 	void *		offset;
688375b2d9Sfvdl 	u_int16_t	segment;
69b6a2ef75Sperry } __packed;
708375b2d9Sfvdl 
718375b2d9Sfvdl typedef struct bios32_entry *bios32_entry_t;
728375b2d9Sfvdl 
738375b2d9Sfvdl #define	BIOS32_MAKESIG(a, b, c, d)					\
748375b2d9Sfvdl 	((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
758375b2d9Sfvdl 
768f1ba949Sjunyoung void	bios32_init(void);
778f1ba949Sjunyoung int	bios32_service(u_int32_t, bios32_entry_t, bios32_entry_info_t);
78