bootspace.h revision 1.1 1 1.1 riastrad /* $NetBSD: bootspace.h,v 1.1 2022/08/20 23:15:37 riastradh Exp $ */
2 1.1 riastrad
3 1.1 riastrad /*
4 1.1 riastrad * Copyright (c) 1997 Charles D. Cranor and Washington University.
5 1.1 riastrad * All rights reserved.
6 1.1 riastrad *
7 1.1 riastrad * Redistribution and use in source and binary forms, with or without
8 1.1 riastrad * modification, are permitted provided that the following conditions
9 1.1 riastrad * are met:
10 1.1 riastrad * 1. Redistributions of source code must retain the above copyright
11 1.1 riastrad * notice, this list of conditions and the following disclaimer.
12 1.1 riastrad * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 riastrad * notice, this list of conditions and the following disclaimer in the
14 1.1 riastrad * documentation and/or other materials provided with the distribution.
15 1.1 riastrad *
16 1.1 riastrad * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 1.1 riastrad * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 1.1 riastrad * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 1.1 riastrad * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 1.1 riastrad * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 1.1 riastrad * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 1.1 riastrad * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 1.1 riastrad * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 1.1 riastrad * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 1.1 riastrad * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 1.1 riastrad */
27 1.1 riastrad
28 1.1 riastrad /*
29 1.1 riastrad * Copyright (c) 2001 Wasabi Systems, Inc.
30 1.1 riastrad * All rights reserved.
31 1.1 riastrad *
32 1.1 riastrad * Written by Frank van der Linden for Wasabi Systems, Inc.
33 1.1 riastrad *
34 1.1 riastrad * Redistribution and use in source and binary forms, with or without
35 1.1 riastrad * modification, are permitted provided that the following conditions
36 1.1 riastrad * are met:
37 1.1 riastrad * 1. Redistributions of source code must retain the above copyright
38 1.1 riastrad * notice, this list of conditions and the following disclaimer.
39 1.1 riastrad * 2. Redistributions in binary form must reproduce the above copyright
40 1.1 riastrad * notice, this list of conditions and the following disclaimer in the
41 1.1 riastrad * documentation and/or other materials provided with the distribution.
42 1.1 riastrad * 3. All advertising materials mentioning features or use of this software
43 1.1 riastrad * must display the following acknowledgement:
44 1.1 riastrad * This product includes software developed for the NetBSD Project by
45 1.1 riastrad * Wasabi Systems, Inc.
46 1.1 riastrad * 4. The name of Wasabi Systems, Inc. may not be used to endorse
47 1.1 riastrad * or promote products derived from this software without specific prior
48 1.1 riastrad * written permission.
49 1.1 riastrad *
50 1.1 riastrad * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
51 1.1 riastrad * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
52 1.1 riastrad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
53 1.1 riastrad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC
54 1.1 riastrad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
55 1.1 riastrad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
56 1.1 riastrad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
57 1.1 riastrad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
58 1.1 riastrad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
59 1.1 riastrad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
60 1.1 riastrad * POSSIBILITY OF SUCH DAMAGE.
61 1.1 riastrad */
62 1.1 riastrad
63 1.1 riastrad #ifndef _X86_BOOTSPACE_H_
64 1.1 riastrad #define _X86_BOOTSPACE_H_
65 1.1 riastrad
66 1.1 riastrad #include <sys/types.h>
67 1.1 riastrad
68 1.1 riastrad #define BTSEG_NONE 0
69 1.1 riastrad #define BTSEG_TEXT 1
70 1.1 riastrad #define BTSEG_RODATA 2
71 1.1 riastrad #define BTSEG_DATA 3
72 1.1 riastrad #define BTSPACE_NSEGS 64
73 1.1 riastrad
74 1.1 riastrad struct bootspace {
75 1.1 riastrad struct {
76 1.1 riastrad vaddr_t va;
77 1.1 riastrad paddr_t pa;
78 1.1 riastrad size_t sz;
79 1.1 riastrad } head;
80 1.1 riastrad
81 1.1 riastrad /* Kernel segments. */
82 1.1 riastrad struct {
83 1.1 riastrad int type;
84 1.1 riastrad vaddr_t va;
85 1.1 riastrad paddr_t pa;
86 1.1 riastrad size_t sz;
87 1.1 riastrad } segs[BTSPACE_NSEGS];
88 1.1 riastrad
89 1.1 riastrad /*
90 1.1 riastrad * The area used by the early kernel bootstrap. It contains the kernel
91 1.1 riastrad * symbols, the preloaded modules, the bootstrap tables, and the ISA I/O
92 1.1 riastrad * mem.
93 1.1 riastrad */
94 1.1 riastrad struct {
95 1.1 riastrad vaddr_t va;
96 1.1 riastrad paddr_t pa;
97 1.1 riastrad size_t sz;
98 1.1 riastrad } boot;
99 1.1 riastrad
100 1.1 riastrad /* A magic VA usable by the bootstrap code. */
101 1.1 riastrad vaddr_t spareva;
102 1.1 riastrad
103 1.1 riastrad /* Virtual address of the page directory. */
104 1.1 riastrad vaddr_t pdir;
105 1.1 riastrad
106 1.1 riastrad /* Area dedicated to kernel modules (amd64 only). */
107 1.1 riastrad vaddr_t smodule;
108 1.1 riastrad vaddr_t emodule;
109 1.1 riastrad };
110 1.1 riastrad
111 1.1 riastrad #endif /* _X86_BOOTSPACE_H_ */
112