Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * c 2001 PPC 64 Team, IBM Corp | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or | |
5 | * modify it under the terms of the GNU General Public License | |
6 | * as published by the Free Software Foundation; either version | |
7 | * 2 of the License, or (at your option) any later version. | |
8 | */ | |
9 | ||
10 | #include <linux/config.h> | |
11 | #include <linux/types.h> | |
12 | #include <linux/threads.h> | |
13 | #include <linux/module.h> | |
14 | ||
15 | #include <asm/processor.h> | |
16 | #include <asm/ptrace.h> | |
17 | #include <asm/page.h> | |
18 | ||
19 | #include <asm/lppaca.h> | |
20 | #include <asm/iSeries/ItLpQueue.h> | |
21 | #include <asm/paca.h> | |
22 | ||
23 | static union { | |
24 | struct systemcfg data; | |
25 | u8 page[PAGE_SIZE]; | |
26 | } systemcfg_store __page_aligned; | |
27 | struct systemcfg *systemcfg = &systemcfg_store.data; | |
28 | EXPORT_SYMBOL(systemcfg); | |
29 | ||
30 | ||
31 | /* This symbol is provided by the linker - let it fill in the paca | |
32 | * field correctly */ | |
33 | extern unsigned long __toc_start; | |
34 | ||
35 | /* The Paca is an array with one entry per processor. Each contains an | |
36 | * lppaca, which contains the information shared between the | |
37 | * hypervisor and Linux. Each also contains an ItLpRegSave area which | |
38 | * is used by the hypervisor to save registers. | |
39 | * On systems with hardware multi-threading, there are two threads | |
40 | * per processor. The Paca array must contain an entry for each thread. | |
41 | * The VPD Areas will give a max logical processors = 2 * max physical | |
42 | * processors. The processor VPD array needs one entry per physical | |
43 | * processor (not thread). | |
44 | */ | |
45 | #ifdef CONFIG_PPC_ISERIES | |
46 | #define EXTRA_INITS(number, lpq) \ | |
47 | .lppaca_ptr = &paca[number].lppaca, \ | |
1da177e4 LT |
48 | .reg_save_ptr = &paca[number].reg_save, \ |
49 | .reg_save = { \ | |
50 | .xDesc = 0xd397d9e2, /* "LpRS" */ \ | |
51 | .xSize = sizeof(struct ItLpRegSave) \ | |
52 | }, | |
53 | #else | |
54 | #define EXTRA_INITS(number, lpq) | |
55 | #endif | |
56 | ||
57 | #define PACAINITDATA(number,start,lpq,asrr,asrv) \ | |
58 | { \ | |
59 | .lock_token = 0x8000, \ | |
60 | .paca_index = (number), /* Paca Index */ \ | |
61 | .default_decr = 0x00ff0000, /* Initial Decr */ \ | |
62 | .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \ | |
63 | .stab_real = (asrr), /* Real pointer to segment table */ \ | |
64 | .stab_addr = (asrv), /* Virt pointer to segment table */ \ | |
65 | .cpu_start = (start), /* Processor start */ \ | |
66 | .hw_cpu_id = 0xffff, \ | |
67 | .lppaca = { \ | |
68 | .desc = 0xd397d781, /* "LpPa" */ \ | |
69 | .size = sizeof(struct lppaca), \ | |
70 | .dyn_proc_status = 2, \ | |
71 | .decr_val = 0x00ff0000, \ | |
72 | .fpregs_in_use = 1, \ | |
73 | .end_of_quantum = 0xfffffffffffffffful, \ | |
74 | .slb_count = 64, \ | |
75 | }, \ | |
76 | EXTRA_INITS((number), (lpq)) \ | |
77 | } | |
78 | ||
79 | struct paca_struct paca[] = { | |
80 | #ifdef CONFIG_PPC_ISERIES | |
81 | PACAINITDATA( 0, 1, &xItLpQueue, 0, STAB0_VIRT_ADDR), | |
82 | #else | |
83 | PACAINITDATA( 0, 1, NULL, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR), | |
84 | #endif | |
85 | #if NR_CPUS > 1 | |
86 | PACAINITDATA( 1, 0, NULL, 0, 0), | |
87 | PACAINITDATA( 2, 0, NULL, 0, 0), | |
88 | PACAINITDATA( 3, 0, NULL, 0, 0), | |
89 | #if NR_CPUS > 4 | |
90 | PACAINITDATA( 4, 0, NULL, 0, 0), | |
91 | PACAINITDATA( 5, 0, NULL, 0, 0), | |
92 | PACAINITDATA( 6, 0, NULL, 0, 0), | |
93 | PACAINITDATA( 7, 0, NULL, 0, 0), | |
94 | #if NR_CPUS > 8 | |
95 | PACAINITDATA( 8, 0, NULL, 0, 0), | |
96 | PACAINITDATA( 9, 0, NULL, 0, 0), | |
97 | PACAINITDATA(10, 0, NULL, 0, 0), | |
98 | PACAINITDATA(11, 0, NULL, 0, 0), | |
99 | PACAINITDATA(12, 0, NULL, 0, 0), | |
100 | PACAINITDATA(13, 0, NULL, 0, 0), | |
101 | PACAINITDATA(14, 0, NULL, 0, 0), | |
102 | PACAINITDATA(15, 0, NULL, 0, 0), | |
103 | PACAINITDATA(16, 0, NULL, 0, 0), | |
104 | PACAINITDATA(17, 0, NULL, 0, 0), | |
105 | PACAINITDATA(18, 0, NULL, 0, 0), | |
106 | PACAINITDATA(19, 0, NULL, 0, 0), | |
107 | PACAINITDATA(20, 0, NULL, 0, 0), | |
108 | PACAINITDATA(21, 0, NULL, 0, 0), | |
109 | PACAINITDATA(22, 0, NULL, 0, 0), | |
110 | PACAINITDATA(23, 0, NULL, 0, 0), | |
111 | PACAINITDATA(24, 0, NULL, 0, 0), | |
112 | PACAINITDATA(25, 0, NULL, 0, 0), | |
113 | PACAINITDATA(26, 0, NULL, 0, 0), | |
114 | PACAINITDATA(27, 0, NULL, 0, 0), | |
115 | PACAINITDATA(28, 0, NULL, 0, 0), | |
116 | PACAINITDATA(29, 0, NULL, 0, 0), | |
117 | PACAINITDATA(30, 0, NULL, 0, 0), | |
118 | PACAINITDATA(31, 0, NULL, 0, 0), | |
119 | #if NR_CPUS > 32 | |
120 | PACAINITDATA(32, 0, NULL, 0, 0), | |
121 | PACAINITDATA(33, 0, NULL, 0, 0), | |
122 | PACAINITDATA(34, 0, NULL, 0, 0), | |
123 | PACAINITDATA(35, 0, NULL, 0, 0), | |
124 | PACAINITDATA(36, 0, NULL, 0, 0), | |
125 | PACAINITDATA(37, 0, NULL, 0, 0), | |
126 | PACAINITDATA(38, 0, NULL, 0, 0), | |
127 | PACAINITDATA(39, 0, NULL, 0, 0), | |
128 | PACAINITDATA(40, 0, NULL, 0, 0), | |
129 | PACAINITDATA(41, 0, NULL, 0, 0), | |
130 | PACAINITDATA(42, 0, NULL, 0, 0), | |
131 | PACAINITDATA(43, 0, NULL, 0, 0), | |
132 | PACAINITDATA(44, 0, NULL, 0, 0), | |
133 | PACAINITDATA(45, 0, NULL, 0, 0), | |
134 | PACAINITDATA(46, 0, NULL, 0, 0), | |
135 | PACAINITDATA(47, 0, NULL, 0, 0), | |
136 | PACAINITDATA(48, 0, NULL, 0, 0), | |
137 | PACAINITDATA(49, 0, NULL, 0, 0), | |
138 | PACAINITDATA(50, 0, NULL, 0, 0), | |
139 | PACAINITDATA(51, 0, NULL, 0, 0), | |
140 | PACAINITDATA(52, 0, NULL, 0, 0), | |
141 | PACAINITDATA(53, 0, NULL, 0, 0), | |
142 | PACAINITDATA(54, 0, NULL, 0, 0), | |
143 | PACAINITDATA(55, 0, NULL, 0, 0), | |
144 | PACAINITDATA(56, 0, NULL, 0, 0), | |
145 | PACAINITDATA(57, 0, NULL, 0, 0), | |
146 | PACAINITDATA(58, 0, NULL, 0, 0), | |
147 | PACAINITDATA(59, 0, NULL, 0, 0), | |
148 | PACAINITDATA(60, 0, NULL, 0, 0), | |
149 | PACAINITDATA(61, 0, NULL, 0, 0), | |
150 | PACAINITDATA(62, 0, NULL, 0, 0), | |
151 | PACAINITDATA(63, 0, NULL, 0, 0), | |
152 | #if NR_CPUS > 64 | |
153 | PACAINITDATA(64, 0, NULL, 0, 0), | |
154 | PACAINITDATA(65, 0, NULL, 0, 0), | |
155 | PACAINITDATA(66, 0, NULL, 0, 0), | |
156 | PACAINITDATA(67, 0, NULL, 0, 0), | |
157 | PACAINITDATA(68, 0, NULL, 0, 0), | |
158 | PACAINITDATA(69, 0, NULL, 0, 0), | |
159 | PACAINITDATA(70, 0, NULL, 0, 0), | |
160 | PACAINITDATA(71, 0, NULL, 0, 0), | |
161 | PACAINITDATA(72, 0, NULL, 0, 0), | |
162 | PACAINITDATA(73, 0, NULL, 0, 0), | |
163 | PACAINITDATA(74, 0, NULL, 0, 0), | |
164 | PACAINITDATA(75, 0, NULL, 0, 0), | |
165 | PACAINITDATA(76, 0, NULL, 0, 0), | |
166 | PACAINITDATA(77, 0, NULL, 0, 0), | |
167 | PACAINITDATA(78, 0, NULL, 0, 0), | |
168 | PACAINITDATA(79, 0, NULL, 0, 0), | |
169 | PACAINITDATA(80, 0, NULL, 0, 0), | |
170 | PACAINITDATA(81, 0, NULL, 0, 0), | |
171 | PACAINITDATA(82, 0, NULL, 0, 0), | |
172 | PACAINITDATA(83, 0, NULL, 0, 0), | |
173 | PACAINITDATA(84, 0, NULL, 0, 0), | |
174 | PACAINITDATA(85, 0, NULL, 0, 0), | |
175 | PACAINITDATA(86, 0, NULL, 0, 0), | |
176 | PACAINITDATA(87, 0, NULL, 0, 0), | |
177 | PACAINITDATA(88, 0, NULL, 0, 0), | |
178 | PACAINITDATA(89, 0, NULL, 0, 0), | |
179 | PACAINITDATA(90, 0, NULL, 0, 0), | |
180 | PACAINITDATA(91, 0, NULL, 0, 0), | |
181 | PACAINITDATA(92, 0, NULL, 0, 0), | |
182 | PACAINITDATA(93, 0, NULL, 0, 0), | |
183 | PACAINITDATA(94, 0, NULL, 0, 0), | |
184 | PACAINITDATA(95, 0, NULL, 0, 0), | |
185 | PACAINITDATA(96, 0, NULL, 0, 0), | |
186 | PACAINITDATA(97, 0, NULL, 0, 0), | |
187 | PACAINITDATA(98, 0, NULL, 0, 0), | |
188 | PACAINITDATA(99, 0, NULL, 0, 0), | |
189 | PACAINITDATA(100, 0, NULL, 0, 0), | |
190 | PACAINITDATA(101, 0, NULL, 0, 0), | |
191 | PACAINITDATA(102, 0, NULL, 0, 0), | |
192 | PACAINITDATA(103, 0, NULL, 0, 0), | |
193 | PACAINITDATA(104, 0, NULL, 0, 0), | |
194 | PACAINITDATA(105, 0, NULL, 0, 0), | |
195 | PACAINITDATA(106, 0, NULL, 0, 0), | |
196 | PACAINITDATA(107, 0, NULL, 0, 0), | |
197 | PACAINITDATA(108, 0, NULL, 0, 0), | |
198 | PACAINITDATA(109, 0, NULL, 0, 0), | |
199 | PACAINITDATA(110, 0, NULL, 0, 0), | |
200 | PACAINITDATA(111, 0, NULL, 0, 0), | |
201 | PACAINITDATA(112, 0, NULL, 0, 0), | |
202 | PACAINITDATA(113, 0, NULL, 0, 0), | |
203 | PACAINITDATA(114, 0, NULL, 0, 0), | |
204 | PACAINITDATA(115, 0, NULL, 0, 0), | |
205 | PACAINITDATA(116, 0, NULL, 0, 0), | |
206 | PACAINITDATA(117, 0, NULL, 0, 0), | |
207 | PACAINITDATA(118, 0, NULL, 0, 0), | |
208 | PACAINITDATA(119, 0, NULL, 0, 0), | |
209 | PACAINITDATA(120, 0, NULL, 0, 0), | |
210 | PACAINITDATA(121, 0, NULL, 0, 0), | |
211 | PACAINITDATA(122, 0, NULL, 0, 0), | |
212 | PACAINITDATA(123, 0, NULL, 0, 0), | |
213 | PACAINITDATA(124, 0, NULL, 0, 0), | |
214 | PACAINITDATA(125, 0, NULL, 0, 0), | |
215 | PACAINITDATA(126, 0, NULL, 0, 0), | |
216 | PACAINITDATA(127, 0, NULL, 0, 0), | |
217 | #endif | |
218 | #endif | |
219 | #endif | |
220 | #endif | |
221 | #endif | |
222 | }; | |
223 | EXPORT_SYMBOL(paca); |