2 * c 2001 PPC 64 Team, IBM Corp
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.
10 #include <linux/config.h>
11 #include <linux/types.h>
12 #include <linux/threads.h>
13 #include <linux/module.h>
15 #include <asm/processor.h>
16 #include <asm/ptrace.h>
19 #include <asm/lppaca.h>
20 #include <asm/iSeries/ItLpQueue.h>
24 struct systemcfg data;
26 } systemcfg_store __page_aligned;
27 struct systemcfg *systemcfg = &systemcfg_store.data;
28 EXPORT_SYMBOL(systemcfg);
31 /* This symbol is provided by the linker - let it fill in the paca
33 extern unsigned long __toc_start;
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).
45 #ifdef CONFIG_PPC_ISERIES
46 #define EXTRA_INITS(number, lpq) \
47 .lppaca_ptr = &paca[number].lppaca, \
48 .lpqueue_ptr = (lpq), /* &xItLpQueue, */ \
49 .reg_save_ptr = &paca[number].reg_save, \
51 .xDesc = 0xd397d9e2, /* "LpRS" */ \
52 .xSize = sizeof(struct ItLpRegSave) \
55 #define EXTRA_INITS(number, lpq)
58 #define PACAINITDATA(number,start,lpq,asrr,asrv) \
60 .lock_token = 0x8000, \
61 .paca_index = (number), /* Paca Index */ \
62 .default_decr = 0x00ff0000, /* Initial Decr */ \
63 .kernel_toc = (unsigned long)(&__toc_start) + 0x8000UL, \
64 .stab_real = (asrr), /* Real pointer to segment table */ \
65 .stab_addr = (asrv), /* Virt pointer to segment table */ \
66 .cpu_start = (start), /* Processor start */ \
67 .hw_cpu_id = 0xffff, \
69 .desc = 0xd397d781, /* "LpPa" */ \
70 .size = sizeof(struct lppaca), \
71 .dyn_proc_status = 2, \
72 .decr_val = 0x00ff0000, \
74 .end_of_quantum = 0xfffffffffffffffful, \
77 EXTRA_INITS((number), (lpq)) \
80 struct paca_struct paca[] = {
81 #ifdef CONFIG_PPC_ISERIES
82 PACAINITDATA( 0, 1, &xItLpQueue, 0, STAB0_VIRT_ADDR),
84 PACAINITDATA( 0, 1, NULL, STAB0_PHYS_ADDR, STAB0_VIRT_ADDR),
87 PACAINITDATA( 1, 0, NULL, 0, 0),
88 PACAINITDATA( 2, 0, NULL, 0, 0),
89 PACAINITDATA( 3, 0, NULL, 0, 0),
91 PACAINITDATA( 4, 0, NULL, 0, 0),
92 PACAINITDATA( 5, 0, NULL, 0, 0),
93 PACAINITDATA( 6, 0, NULL, 0, 0),
94 PACAINITDATA( 7, 0, NULL, 0, 0),
96 PACAINITDATA( 8, 0, NULL, 0, 0),
97 PACAINITDATA( 9, 0, NULL, 0, 0),
98 PACAINITDATA(10, 0, NULL, 0, 0),
99 PACAINITDATA(11, 0, NULL, 0, 0),
100 PACAINITDATA(12, 0, NULL, 0, 0),
101 PACAINITDATA(13, 0, NULL, 0, 0),
102 PACAINITDATA(14, 0, NULL, 0, 0),
103 PACAINITDATA(15, 0, NULL, 0, 0),
104 PACAINITDATA(16, 0, NULL, 0, 0),
105 PACAINITDATA(17, 0, NULL, 0, 0),
106 PACAINITDATA(18, 0, NULL, 0, 0),
107 PACAINITDATA(19, 0, NULL, 0, 0),
108 PACAINITDATA(20, 0, NULL, 0, 0),
109 PACAINITDATA(21, 0, NULL, 0, 0),
110 PACAINITDATA(22, 0, NULL, 0, 0),
111 PACAINITDATA(23, 0, NULL, 0, 0),
112 PACAINITDATA(24, 0, NULL, 0, 0),
113 PACAINITDATA(25, 0, NULL, 0, 0),
114 PACAINITDATA(26, 0, NULL, 0, 0),
115 PACAINITDATA(27, 0, NULL, 0, 0),
116 PACAINITDATA(28, 0, NULL, 0, 0),
117 PACAINITDATA(29, 0, NULL, 0, 0),
118 PACAINITDATA(30, 0, NULL, 0, 0),
119 PACAINITDATA(31, 0, NULL, 0, 0),
121 PACAINITDATA(32, 0, NULL, 0, 0),
122 PACAINITDATA(33, 0, NULL, 0, 0),
123 PACAINITDATA(34, 0, NULL, 0, 0),
124 PACAINITDATA(35, 0, NULL, 0, 0),
125 PACAINITDATA(36, 0, NULL, 0, 0),
126 PACAINITDATA(37, 0, NULL, 0, 0),
127 PACAINITDATA(38, 0, NULL, 0, 0),
128 PACAINITDATA(39, 0, NULL, 0, 0),
129 PACAINITDATA(40, 0, NULL, 0, 0),
130 PACAINITDATA(41, 0, NULL, 0, 0),
131 PACAINITDATA(42, 0, NULL, 0, 0),
132 PACAINITDATA(43, 0, NULL, 0, 0),
133 PACAINITDATA(44, 0, NULL, 0, 0),
134 PACAINITDATA(45, 0, NULL, 0, 0),
135 PACAINITDATA(46, 0, NULL, 0, 0),
136 PACAINITDATA(47, 0, NULL, 0, 0),
137 PACAINITDATA(48, 0, NULL, 0, 0),
138 PACAINITDATA(49, 0, NULL, 0, 0),
139 PACAINITDATA(50, 0, NULL, 0, 0),
140 PACAINITDATA(51, 0, NULL, 0, 0),
141 PACAINITDATA(52, 0, NULL, 0, 0),
142 PACAINITDATA(53, 0, NULL, 0, 0),
143 PACAINITDATA(54, 0, NULL, 0, 0),
144 PACAINITDATA(55, 0, NULL, 0, 0),
145 PACAINITDATA(56, 0, NULL, 0, 0),
146 PACAINITDATA(57, 0, NULL, 0, 0),
147 PACAINITDATA(58, 0, NULL, 0, 0),
148 PACAINITDATA(59, 0, NULL, 0, 0),
149 PACAINITDATA(60, 0, NULL, 0, 0),
150 PACAINITDATA(61, 0, NULL, 0, 0),
151 PACAINITDATA(62, 0, NULL, 0, 0),
152 PACAINITDATA(63, 0, NULL, 0, 0),
154 PACAINITDATA(64, 0, NULL, 0, 0),
155 PACAINITDATA(65, 0, NULL, 0, 0),
156 PACAINITDATA(66, 0, NULL, 0, 0),
157 PACAINITDATA(67, 0, NULL, 0, 0),
158 PACAINITDATA(68, 0, NULL, 0, 0),
159 PACAINITDATA(69, 0, NULL, 0, 0),
160 PACAINITDATA(70, 0, NULL, 0, 0),
161 PACAINITDATA(71, 0, NULL, 0, 0),
162 PACAINITDATA(72, 0, NULL, 0, 0),
163 PACAINITDATA(73, 0, NULL, 0, 0),
164 PACAINITDATA(74, 0, NULL, 0, 0),
165 PACAINITDATA(75, 0, NULL, 0, 0),
166 PACAINITDATA(76, 0, NULL, 0, 0),
167 PACAINITDATA(77, 0, NULL, 0, 0),
168 PACAINITDATA(78, 0, NULL, 0, 0),
169 PACAINITDATA(79, 0, NULL, 0, 0),
170 PACAINITDATA(80, 0, NULL, 0, 0),
171 PACAINITDATA(81, 0, NULL, 0, 0),
172 PACAINITDATA(82, 0, NULL, 0, 0),
173 PACAINITDATA(83, 0, NULL, 0, 0),
174 PACAINITDATA(84, 0, NULL, 0, 0),
175 PACAINITDATA(85, 0, NULL, 0, 0),
176 PACAINITDATA(86, 0, NULL, 0, 0),
177 PACAINITDATA(87, 0, NULL, 0, 0),
178 PACAINITDATA(88, 0, NULL, 0, 0),
179 PACAINITDATA(89, 0, NULL, 0, 0),
180 PACAINITDATA(90, 0, NULL, 0, 0),
181 PACAINITDATA(91, 0, NULL, 0, 0),
182 PACAINITDATA(92, 0, NULL, 0, 0),
183 PACAINITDATA(93, 0, NULL, 0, 0),
184 PACAINITDATA(94, 0, NULL, 0, 0),
185 PACAINITDATA(95, 0, NULL, 0, 0),
186 PACAINITDATA(96, 0, NULL, 0, 0),
187 PACAINITDATA(97, 0, NULL, 0, 0),
188 PACAINITDATA(98, 0, NULL, 0, 0),
189 PACAINITDATA(99, 0, NULL, 0, 0),
190 PACAINITDATA(100, 0, NULL, 0, 0),
191 PACAINITDATA(101, 0, NULL, 0, 0),
192 PACAINITDATA(102, 0, NULL, 0, 0),
193 PACAINITDATA(103, 0, NULL, 0, 0),
194 PACAINITDATA(104, 0, NULL, 0, 0),
195 PACAINITDATA(105, 0, NULL, 0, 0),
196 PACAINITDATA(106, 0, NULL, 0, 0),
197 PACAINITDATA(107, 0, NULL, 0, 0),
198 PACAINITDATA(108, 0, NULL, 0, 0),
199 PACAINITDATA(109, 0, NULL, 0, 0),
200 PACAINITDATA(110, 0, NULL, 0, 0),
201 PACAINITDATA(111, 0, NULL, 0, 0),
202 PACAINITDATA(112, 0, NULL, 0, 0),
203 PACAINITDATA(113, 0, NULL, 0, 0),
204 PACAINITDATA(114, 0, NULL, 0, 0),
205 PACAINITDATA(115, 0, NULL, 0, 0),
206 PACAINITDATA(116, 0, NULL, 0, 0),
207 PACAINITDATA(117, 0, NULL, 0, 0),
208 PACAINITDATA(118, 0, NULL, 0, 0),
209 PACAINITDATA(119, 0, NULL, 0, 0),
210 PACAINITDATA(120, 0, NULL, 0, 0),
211 PACAINITDATA(121, 0, NULL, 0, 0),
212 PACAINITDATA(122, 0, NULL, 0, 0),
213 PACAINITDATA(123, 0, NULL, 0, 0),
214 PACAINITDATA(124, 0, NULL, 0, 0),
215 PACAINITDATA(125, 0, NULL, 0, 0),
216 PACAINITDATA(126, 0, NULL, 0, 0),
217 PACAINITDATA(127, 0, NULL, 0, 0),