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