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