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