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