1*1cd76c75SBen Gras /* $NetBSD: bios32.h,v 1.5 2008/04/28 20:23:40 martin Exp $ */ 2*1cd76c75SBen Gras 3*1cd76c75SBen Gras /*- 4*1cd76c75SBen Gras * Copyright (c) 1999 The NetBSD Foundation, Inc. 5*1cd76c75SBen Gras * All rights reserved. 6*1cd76c75SBen Gras * 7*1cd76c75SBen Gras * This code is derived from software contributed to The NetBSD Foundation 8*1cd76c75SBen Gras * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, 9*1cd76c75SBen Gras * NASA Ames Research Center. 10*1cd76c75SBen Gras * 11*1cd76c75SBen Gras * Redistribution and use in source and binary forms, with or without 12*1cd76c75SBen Gras * modification, are permitted provided that the following conditions 13*1cd76c75SBen Gras * are met: 14*1cd76c75SBen Gras * 1. Redistributions of source code must retain the above copyright 15*1cd76c75SBen Gras * notice, this list of conditions and the following disclaimer. 16*1cd76c75SBen Gras * 2. Redistributions in binary form must reproduce the above copyright 17*1cd76c75SBen Gras * notice, this list of conditions and the following disclaimer in the 18*1cd76c75SBen Gras * documentation and/or other materials provided with the distribution. 19*1cd76c75SBen Gras * 20*1cd76c75SBen Gras * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21*1cd76c75SBen Gras * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22*1cd76c75SBen Gras * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23*1cd76c75SBen Gras * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24*1cd76c75SBen Gras * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25*1cd76c75SBen Gras * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26*1cd76c75SBen Gras * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27*1cd76c75SBen Gras * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28*1cd76c75SBen Gras * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29*1cd76c75SBen Gras * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30*1cd76c75SBen Gras * POSSIBILITY OF SUCH DAMAGE. 31*1cd76c75SBen Gras */ 32*1cd76c75SBen Gras 33*1cd76c75SBen Gras /* 34*1cd76c75SBen Gras * Copyright (c) 1999, by UCHIYAMA Yasushi 35*1cd76c75SBen Gras * All rights reserved. 36*1cd76c75SBen Gras * 37*1cd76c75SBen Gras * Redistribution and use in source and binary forms, with or without 38*1cd76c75SBen Gras * modification, are permitted provided that the following conditions 39*1cd76c75SBen Gras * are met: 40*1cd76c75SBen Gras * 1. Redistributions of source code must retain the above copyright 41*1cd76c75SBen Gras * notice, this list of conditions and the following disclaimer. 42*1cd76c75SBen Gras * 2. The name of the developer may NOT be used to endorse or promote products 43*1cd76c75SBen Gras * derived from this software without specific prior written permission. 44*1cd76c75SBen Gras * 45*1cd76c75SBen Gras * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 46*1cd76c75SBen Gras * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 47*1cd76c75SBen Gras * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 48*1cd76c75SBen Gras * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 49*1cd76c75SBen Gras * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 50*1cd76c75SBen Gras * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 51*1cd76c75SBen Gras * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 52*1cd76c75SBen Gras * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 53*1cd76c75SBen Gras * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 54*1cd76c75SBen Gras * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 55*1cd76c75SBen Gras * SUCH DAMAGE. 56*1cd76c75SBen Gras */ 57*1cd76c75SBen Gras 58*1cd76c75SBen Gras struct bios32_entry_info { 59*1cd76c75SBen Gras paddr_t bei_base; 60*1cd76c75SBen Gras psize_t bei_size; 61*1cd76c75SBen Gras paddr_t bei_entry; 62*1cd76c75SBen Gras }; 63*1cd76c75SBen Gras 64*1cd76c75SBen Gras typedef struct bios32_entry_info *bios32_entry_info_t; 65*1cd76c75SBen Gras 66*1cd76c75SBen Gras struct bios32_entry { 67*1cd76c75SBen Gras void * offset; 68*1cd76c75SBen Gras u_int16_t segment; 69*1cd76c75SBen Gras } __packed; 70*1cd76c75SBen Gras 71*1cd76c75SBen Gras typedef struct bios32_entry *bios32_entry_t; 72*1cd76c75SBen Gras 73*1cd76c75SBen Gras #define BIOS32_MAKESIG(a, b, c, d) \ 74*1cd76c75SBen Gras ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24)) 75*1cd76c75SBen Gras 76*1cd76c75SBen Gras void bios32_init(void); 77*1cd76c75SBen Gras int bios32_service(u_int32_t, bios32_entry_t, bios32_entry_info_t); 78