Home | History | Annotate | Line # | Download | only in include
bootinfo.h revision 1.4.12.1
      1  1.4.12.1    yamt /*      $NetBSD: bootinfo.h,v 1.4.12.1 2012/04/17 00:07:13 yamt Exp $	*/
      2       1.3  nonaka 
      3       1.3  nonaka /*-
      4  1.4.12.1    yamt  * 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.4.12.1    yamt  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17  1.4.12.1    yamt  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     18  1.4.12.1    yamt  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     19  1.4.12.1    yamt  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     20  1.4.12.1    yamt  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     21  1.4.12.1    yamt  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     22  1.4.12.1    yamt  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     23  1.4.12.1    yamt  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     24  1.4.12.1    yamt  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     25  1.4.12.1    yamt  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26       1.3  nonaka  */
     27       1.1    ober 
     28       1.1    ober #ifndef	_ZAURUS_BOOTINFO_H_
     29       1.1    ober #define	_ZAURUS_BOOTINFO_H_
     30       1.1    ober 
     31       1.3  nonaka #define BOOTARGS_BUFSIZ	256
     32       1.1    ober #define	BOOTARGS_MAGIC	0x4f425344
     33       1.1    ober 
     34       1.3  nonaka #define BOOTINFO_MAXSIZE (BOOTARGS_BUFSIZ - sizeof(uint32_t)) /* uint32_t for magic */
     35       1.3  nonaka 
     36       1.4  nonaka #define BTINFO_BOOTDISK		0
     37       1.4  nonaka #define BTINFO_HOWTO		1
     38       1.4  nonaka #define BTINFO_CONSDEV		2
     39       1.4  nonaka #define BTINFO_ROOTDEVICE	3
     40       1.4  nonaka #define BTINFO_MAX		4
     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.4  nonaka struct btinfo_rootdevice {
     73       1.4  nonaka 	struct btinfo_common common;
     74       1.4  nonaka 	char devname[16];
     75       1.4  nonaka };
     76       1.4  nonaka 
     77       1.3  nonaka struct bootinfo {
     78       1.3  nonaka         int nentries;
     79       1.3  nonaka 	char info[BOOTINFO_MAXSIZE - sizeof(int)];
     80       1.3  nonaka };
     81       1.3  nonaka 
     82       1.3  nonaka #endif /* _LOCORE */
     83       1.3  nonaka 
     84       1.3  nonaka #ifdef _KERNEL
     85       1.3  nonaka void *lookup_bootinfo(int type);
     86       1.3  nonaka #endif
     87       1.3  nonaka 
     88       1.1    ober #endif	/* _ZAURUS_BOOTINFO_H_ */
     89