File: /usr/src/linux/include/asm-ia64/sn/kldir.h
1 /* $Id$
2 *
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Derived from IRIX <sys/SN/kldir.h>, revision 1.21.
8 *
9 * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
10 * Copyright (C) 1999 by Ralf Baechle
11 */
12 #ifndef _ASM_SN_KLDIR_H
13 #define _ASM_SN_KLDIR_H
14
15 #include <linux/config.h>
16 #include <asm/sn/sgi.h>
17
18 /*
19 * The kldir memory area resides at a fixed place in each node's memory and
20 * provides pointers to most other IP27 memory areas. This allows us to
21 * resize and/or relocate memory areas at a later time without breaking all
22 * firmware and kernels that use them. Indices in the array are
23 * permanently dedicated to areas listed below. Some memory areas (marked
24 * below) reside at a permanently fixed location, but are included in the
25 * directory for completeness.
26 */
27
28 #define KLDIR_MAGIC 0x434d5f53505f5357
29
30 /*
31 * The upper portion of the memory map applies during boot
32 * only and is overwritten by IRIX/SYMMON.
33 *
34 * MEMORY MAP PER NODE
35 *
36 * 0x2000000 (32M) +-----------------------------------------+
37 * | IO6 BUFFERS FOR FLASH ENET IOC3 |
38 * 0x1F80000 (31.5M) +-----------------------------------------+
39 * | IO6 TEXT/DATA/BSS/stack |
40 * 0x1C00000 (30M) +-----------------------------------------+
41 * | IO6 PROM DEBUG TEXT/DATA/BSS/stack |
42 * 0x0800000 (28M) +-----------------------------------------+
43 * | IP27 PROM TEXT/DATA/BSS/stack |
44 * 0x1B00000 (27M) +-----------------------------------------+
45 * | IP27 CFG |
46 * 0x1A00000 (26M) +-----------------------------------------+
47 * | Graphics PROM |
48 * 0x1800000 (24M) +-----------------------------------------+
49 * | 3rd Party PROM drivers |
50 * 0x1600000 (22M) +-----------------------------------------+
51 * | |
52 * | Free |
53 * | |
54 * +-----------------------------------------+
55 * | UNIX DEBUG Version |
56 * 0x190000 (2M--) +-----------------------------------------+
57 * | SYMMON |
58 * | (For UNIX Debug only) |
59 * 0x34000 (208K) +-----------------------------------------+
60 * | SYMMON STACK [NUM_CPU_PER_NODE] |
61 * | (For UNIX Debug only) |
62 * 0x25000 (148K) +-----------------------------------------+
63 * | KLCONFIG - II (temp) |
64 * | |
65 * | ---------------------------- |
66 * | |
67 * | UNIX NON-DEBUG Version |
68 * 0x19000 (100K) +-----------------------------------------+
69 *
70 *
71 * The lower portion of the memory map contains information that is
72 * permanent and is used by the IP27PROM, IO6PROM and IRIX.
73 *
74 * 0x19000 (100K) +-----------------------------------------+
75 * | |
76 * | PI Error Spools (32K) |
77 * | |
78 * 0x12000 (72K) +-----------------------------------------+
79 * | Unused |
80 * 0x11c00 (71K) +-----------------------------------------+
81 * | CPU 1 NMI Eframe area |
82 * 0x11a00 (70.5K) +-----------------------------------------+
83 * | CPU 0 NMI Eframe area |
84 * 0x11800 (70K) +-----------------------------------------+
85 * | CPU 1 NMI Register save area |
86 * 0x11600 (69.5K) +-----------------------------------------+
87 * | CPU 0 NMI Register save area |
88 * 0x11400 (69K) +-----------------------------------------+
89 * | GDA (1k) |
90 * 0x11000 (68K) +-----------------------------------------+
91 * | Early cache Exception stack |
92 * | and/or |
93 * | kernel/io6prom nmi registers |
94 * 0x10800 (66k) +-----------------------------------------+
95 * | cache error eframe |
96 * 0x10400 (65K) +-----------------------------------------+
97 * | Exception Handlers (UALIAS copy) |
98 * 0x10000 (64K) +-----------------------------------------+
99 * | |
100 * | |
101 * | KLCONFIG - I (permanent) (48K) |
102 * | |
103 * | |
104 * | |
105 * 0x4000 (16K) +-----------------------------------------+
106 * | NMI Handler (Protected Page) |
107 * 0x3000 (12K) +-----------------------------------------+
108 * | ARCS PVECTORS (master node only) |
109 * 0x2c00 (11K) +-----------------------------------------+
110 * | ARCS TVECTORS (master node only) |
111 * 0x2800 (10K) +-----------------------------------------+
112 * | LAUNCH [NUM_CPU] |
113 * 0x2400 (9K) +-----------------------------------------+
114 * | Low memory directory (KLDIR) |
115 * 0x2000 (8K) +-----------------------------------------+
116 * | ARCS SPB (1K) |
117 * 0x1000 (4K) +-----------------------------------------+
118 * | Early cache Exception stack |
119 * | and/or |
120 * | kernel/io6prom nmi registers |
121 * 0x800 (2k) +-----------------------------------------+
122 * | cache error eframe |
123 * 0x400 (1K) +-----------------------------------------+
124 * | Exception Handlers |
125 * 0x0 (0K) +-----------------------------------------+
126 */
127
128 #ifdef LANGUAGE_ASSEMBLY
129 #define KLDIR_OFF_MAGIC 0x00
130 #define KLDIR_OFF_OFFSET 0x08
131 #define KLDIR_OFF_POINTER 0x10
132 #define KLDIR_OFF_SIZE 0x18
133 #define KLDIR_OFF_COUNT 0x20
134 #define KLDIR_OFF_STRIDE 0x28
135 #endif /* LANGUAGE_ASSEMBLY */
136
137 #ifdef _LANGUAGE_C
138 typedef struct kldir_ent_s {
139 u64 magic; /* Indicates validity of entry */
140 off_t offset; /* Offset from start of node space */
141 __psunsigned_t pointer; /* Pointer to area in some cases */
142 size_t size; /* Size in bytes */
143 u64 count; /* Repeat count if array, 1 if not */
144 size_t stride; /* Stride if array, 0 if not */
145 char rsvd[16]; /* Pad entry to 0x40 bytes */
146 /* NOTE: These 16 bytes are used in the Partition KLDIR
147 entry to store partition info. Refer to klpart.h for this. */
148 } kldir_ent_t;
149 #endif /* _LANGUAGE_C */
150
151
152 #define KLDIR_ENT_SIZE 0x40
153 #define KLDIR_MAX_ENTRIES (0x400 / 0x40)
154
155 /*
156 * The actual offsets of each memory area are machine-dependent
157 */
158 #if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC)
159 #include <asm/sn/sn1/kldir.h>
160 #else
161 #error "kldir.h is currently defined for IP27 and IP35 platforms only"
162 #endif
163
164 #endif /* _ASM_SN_KLDIR_H */
165