bootinfo.h revision 1.2.62.1 1 1.2.62.1 skrll /* $NetBSD: bootinfo.h,v 1.2.62.1 2009/03/03 18:29:50 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.1 skrll #define BTINFO_BOOTDISK 0
38 1.2.62.1 skrll #define BTINFO_HOWTO 1
39 1.2.62.1 skrll #define BTINFO_CONSDEV 2
40 1.2.62.1 skrll #define BTINFO_MAX 3
41 1.2.62.1 skrll
42 1.2.62.1 skrll #ifndef _LOCORE
43 1.2.62.1 skrll
44 1.2.62.1 skrll struct btinfo_common {
45 1.2.62.1 skrll int len;
46 1.2.62.1 skrll int type;
47 1.2.62.1 skrll };
48 1.2.62.1 skrll
49 1.2.62.1 skrll struct btinfo_bootdisk {
50 1.2.62.1 skrll struct btinfo_common common;
51 1.2.62.1 skrll int labelsector; /* label valid if != -1 */
52 1.2.62.1 skrll struct {
53 1.2.62.1 skrll uint16_t type, checksum;
54 1.2.62.1 skrll char packname[16];
55 1.2.62.1 skrll } label;
56 1.2.62.1 skrll int biosdev;
57 1.2.62.1 skrll int partition;
58 1.2.62.1 skrll };
59 1.2.62.1 skrll
60 1.2.62.1 skrll struct btinfo_howto {
61 1.2.62.1 skrll struct btinfo_common common;
62 1.2.62.1 skrll u_int howto;
63 1.2.62.1 skrll };
64 1.2.62.1 skrll
65 1.2.62.1 skrll struct btinfo_console {
66 1.2.62.1 skrll struct btinfo_common common;
67 1.2.62.1 skrll char devname[16];
68 1.2.62.1 skrll int addr;
69 1.2.62.1 skrll int speed;
70 1.2.62.1 skrll };
71 1.2.62.1 skrll
72 1.2.62.1 skrll struct bootinfo {
73 1.2.62.1 skrll int nentries;
74 1.2.62.1 skrll char info[BOOTINFO_MAXSIZE - sizeof(int)];
75 1.2.62.1 skrll };
76 1.2.62.1 skrll
77 1.2.62.1 skrll #endif /* _LOCORE */
78 1.2.62.1 skrll
79 1.2.62.1 skrll #ifdef _KERNEL
80 1.2.62.1 skrll void *lookup_bootinfo(int type);
81 1.2.62.1 skrll #endif
82 1.2.62.1 skrll
83 1.1 ober #endif /* _ZAURUS_BOOTINFO_H_ */
84