1/* $NetBSD: bootinfo.h,v 1.4 2009/03/11 09:02:04 nonaka Exp $ */ 2 3/*- 4 * Copyright (C) 2009 NONAKA Kimihiro <nonaka@netbsd.org> 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#ifndef _ZAURUS_BOOTINFO_H_ 29#define _ZAURUS_BOOTINFO_H_ 30 31#define BOOTARGS_BUFSIZ 256 32#define BOOTARGS_MAGIC 0x4f425344 33 34#define BOOTINFO_MAXSIZE (BOOTARGS_BUFSIZ - sizeof(uint32_t)) /* uint32_t for magic */ 35 36#define BTINFO_BOOTDISK 0 37#define BTINFO_HOWTO 1 38#define BTINFO_CONSDEV 2 39#define BTINFO_ROOTDEVICE 3 40#define BTINFO_MAX 4 41 42#ifndef _LOCORE 43 44struct btinfo_common { 45 int len; 46 int type; 47}; 48 49struct btinfo_bootdisk { 50 struct btinfo_common common; 51 int labelsector; /* label valid if != -1 */ 52 struct { 53 uint16_t type, checksum; 54 char packname[16]; 55 } label; 56 int biosdev; 57 int partition; 58}; 59 60struct btinfo_howto { 61 struct btinfo_common common; 62 u_int howto; 63}; 64 65struct btinfo_console { 66 struct btinfo_common common; 67 char devname[16]; 68 int addr; 69 int speed; 70}; 71 72struct btinfo_rootdevice { 73 struct btinfo_common common; 74 char devname[16]; 75}; 76 77struct bootinfo { 78 int nentries; 79 char info[BOOTINFO_MAXSIZE - sizeof(int)]; 80}; 81 82#endif /* _LOCORE */ 83 84#ifdef _KERNEL 85void *lookup_bootinfo(int type); 86#endif 87 88#endif /* _ZAURUS_BOOTINFO_H_ */ 89