kcore.h revision 1.2 1 /* $NetBSD: kcore.h,v 1.2 1997/04/09 19:25:00 thorpej Exp $ */
2
3 /*-
4 * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Gordon W. Ross, Jason R. Thorpe, and Leo Weppelman.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 * must display the following acknowledgement:
20 * This product includes software developed by the NetBSD
21 * Foundation, Inc. and its contributors.
22 * 4. Neither the name of The NetBSD Foundation nor the names of its
23 * contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 * POSSIBILITY OF SUCH DAMAGE.
37 */
38
39 #ifndef _M68K_KCORE_H_
40 #define _M68K_KCORE_H_
41
42 /*
43 * Unified m68k kcore header descriptions.
44 *
45 * NOTE: We must have all possible m68k kcore types defined in this
46 * file. Otherwise, we require kernel sources for all m68k platforms
47 * to build userland.
48 *
49 * We must provide STE/PTE bits in the kcore header for a couple
50 * of reasons:
51 *
52 * - different platforms may have the MMUs configured for different
53 * page sizes
54 * - we may not have a specific platform's pte.h available to us
55 *
56 * These are on-disk structures; use fixed-sized types!
57 *
58 * The total size of the cpu_kcore_hdr should be <= DEV_BSIZE!
59 */
60
61 /*
62 * kcore information for Utah-derived pmaps
63 */
64 #define M68K_NPHYS_RAM_SEGS 8 /* XXX */
65 struct m68k_kcore_hdr {
66 int32_t mmutype; /* MMU type */
67 u_int32_t sg_v; /* STE bits */
68 u_int32_t sg_frame;
69 u_int32_t sg_ishift;
70 u_int32_t sg_pmask;
71 u_int32_t sg40_shift1;
72 u_int32_t sg40_mask2;
73 u_int32_t sg40_shift2;
74 u_int32_t sg40_mask3;
75 u_int32_t sg40_shift3;
76 u_int32_t sg40_addr1;
77 u_int32_t sg40_addr2;
78 u_int32_t pg_v; /* PTE bits */
79 u_int32_t pg_frame;
80 u_int32_t sysseg_pa; /* PA of Sysseg[] */
81 u_int32_t reloc; /* value added to relocate a symbol
82 before address translation is
83 enabled */
84 u_int32_t relocend; /* if kernbase < va < relocend, we
85 can do simple relocation to get
86 the physical address */
87 phys_ram_seg_t ram_segs[M68K_NPHYS_RAM_SEGS];
88 };
89
90 /*
91 * kcore information for the sun3
92 */
93 #define SUN3_NPHYS_RAM_SEGS 4
94 struct sun3_kcore_hdr {
95 u_int32_t segshift;
96 u_int32_t pg_frame; /* PTE bits */
97 u_int32_t pg_valid;
98 u_int8_t ksegmap[256]; /* kernel segment map */
99 phys_ram_seg_t ram_segs[SUN3_NPHYS_RAM_SEGS];
100 };
101
102 /*
103 * kcore information for the sun3x; Motorola MMU, but a very
104 * different pmap.
105 */
106 #define SUN3X_NPHYS_RAM_SEGS 4
107 struct sun3x_kcore_hdr {
108 u_int32_t pg_frame; /* PTE bits */
109 u_int32_t pg_valid;
110 u_int32_t contig_end;
111 u_int32_t kernCbase; /* VA of kernel level C page table */
112 phys_ram_seg_t ram_segs[SUN3X_NPHYS_RAM_SEGS];
113 };
114
115 /*
116 * Catch-all header. "un" is interpreted based on the contents of "name".
117 */
118 struct cpu_kcore_hdr {
119 char name[16]; /* machine name */
120 u_int32_t page_size; /* hardware page size */
121 u_int32_t kernbase; /* start of KVA space */
122 union {
123 struct m68k_kcore_hdr _m68k;
124 struct sun3_kcore_hdr _sun3;
125 struct sun3x_kcore_hdr _sun3x;
126 } un;
127 };
128
129 typedef struct cpu_kcore_hdr cpu_kcore_hdr_t;
130
131 #endif /* _M68K_KCORE_H_ */
132