Revision 210b580b
b/hw/nvram/spapr_nvram.c | ||
---|---|---|
44 | 44 |
#define DEFAULT_NVRAM_SIZE 65536 |
45 | 45 |
#define MAX_NVRAM_SIZE (UINT16_MAX * 16) |
46 | 46 |
|
47 |
static void rtas_nvram_fetch(sPAPREnvironment *spapr, |
|
47 |
static void rtas_nvram_fetch(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
48 | 48 |
uint32_t token, uint32_t nargs, |
49 | 49 |
target_ulong args, |
50 | 50 |
uint32_t nret, target_ulong rets) |
... | ... | |
91 | 91 |
rtas_st(rets, 1, (alen < 0) ? 0 : alen); |
92 | 92 |
} |
93 | 93 |
|
94 |
static void rtas_nvram_store(sPAPREnvironment *spapr, |
|
94 |
static void rtas_nvram_store(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
95 | 95 |
uint32_t token, uint32_t nargs, |
96 | 96 |
target_ulong args, |
97 | 97 |
uint32_t nret, target_ulong rets) |
b/hw/ppc/spapr_events.c | ||
---|---|---|
277 | 277 |
qemu_irq_pulse(xics_get_qirq(spapr->icp, spapr->epow_irq)); |
278 | 278 |
} |
279 | 279 |
|
280 |
static void check_exception(sPAPREnvironment *spapr, |
|
280 |
static void check_exception(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
281 | 281 |
uint32_t token, uint32_t nargs, |
282 | 282 |
target_ulong args, |
283 | 283 |
uint32_t nret, target_ulong rets) |
b/hw/ppc/spapr_hcall.c | ||
---|---|---|
525 | 525 |
uint32_t nargs = ldl_be_phys(rtas_r3 + 4); |
526 | 526 |
uint32_t nret = ldl_be_phys(rtas_r3 + 8); |
527 | 527 |
|
528 |
return spapr_rtas_call(spapr, token, nargs, rtas_r3 + 12, |
|
528 |
return spapr_rtas_call(cpu, spapr, token, nargs, rtas_r3 + 12,
|
|
529 | 529 |
nret, rtas_r3 + 12 + 4*nargs); |
530 | 530 |
} |
531 | 531 |
|
b/hw/ppc/spapr_pci.c | ||
---|---|---|
119 | 119 |
rtas_st(rets, 1, val); |
120 | 120 |
} |
121 | 121 |
|
122 |
static void rtas_ibm_read_pci_config(sPAPREnvironment *spapr, |
|
122 |
static void rtas_ibm_read_pci_config(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
123 | 123 |
uint32_t token, uint32_t nargs, |
124 | 124 |
target_ulong args, |
125 | 125 |
uint32_t nret, target_ulong rets) |
... | ... | |
139 | 139 |
finish_read_pci_config(spapr, buid, addr, size, rets); |
140 | 140 |
} |
141 | 141 |
|
142 |
static void rtas_read_pci_config(sPAPREnvironment *spapr, |
|
142 |
static void rtas_read_pci_config(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
143 | 143 |
uint32_t token, uint32_t nargs, |
144 | 144 |
target_ulong args, |
145 | 145 |
uint32_t nret, target_ulong rets) |
... | ... | |
185 | 185 |
rtas_st(rets, 0, 0); |
186 | 186 |
} |
187 | 187 |
|
188 |
static void rtas_ibm_write_pci_config(sPAPREnvironment *spapr, |
|
188 |
static void rtas_ibm_write_pci_config(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
189 | 189 |
uint32_t token, uint32_t nargs, |
190 | 190 |
target_ulong args, |
191 | 191 |
uint32_t nret, target_ulong rets) |
... | ... | |
206 | 206 |
finish_write_pci_config(spapr, buid, addr, size, val, rets); |
207 | 207 |
} |
208 | 208 |
|
209 |
static void rtas_write_pci_config(sPAPREnvironment *spapr, |
|
209 |
static void rtas_write_pci_config(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
210 | 210 |
uint32_t token, uint32_t nargs, |
211 | 211 |
target_ulong args, |
212 | 212 |
uint32_t nret, target_ulong rets) |
... | ... | |
277 | 277 |
} |
278 | 278 |
} |
279 | 279 |
|
280 |
static void rtas_ibm_change_msi(sPAPREnvironment *spapr, |
|
280 |
static void rtas_ibm_change_msi(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
281 | 281 |
uint32_t token, uint32_t nargs, |
282 | 282 |
target_ulong args, uint32_t nret, |
283 | 283 |
target_ulong rets) |
... | ... | |
374 | 374 |
trace_spapr_pci_rtas_ibm_change_msi(func, req_num); |
375 | 375 |
} |
376 | 376 |
|
377 |
static void rtas_ibm_query_interrupt_source_number(sPAPREnvironment *spapr, |
|
377 |
static void rtas_ibm_query_interrupt_source_number(PowerPCCPU *cpu, |
|
378 |
sPAPREnvironment *spapr, |
|
378 | 379 |
uint32_t token, |
379 | 380 |
uint32_t nargs, |
380 | 381 |
target_ulong args, |
b/hw/ppc/spapr_rtas.c | ||
---|---|---|
38 | 38 |
#define TOKEN_BASE 0x2000 |
39 | 39 |
#define TOKEN_MAX 0x100 |
40 | 40 |
|
41 |
static void rtas_display_character(sPAPREnvironment *spapr, |
|
41 |
static void rtas_display_character(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
42 | 42 |
uint32_t token, uint32_t nargs, |
43 | 43 |
target_ulong args, |
44 | 44 |
uint32_t nret, target_ulong rets) |
... | ... | |
54 | 54 |
} |
55 | 55 |
} |
56 | 56 |
|
57 |
static void rtas_get_time_of_day(sPAPREnvironment *spapr, |
|
57 |
static void rtas_get_time_of_day(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
58 | 58 |
uint32_t token, uint32_t nargs, |
59 | 59 |
target_ulong args, |
60 | 60 |
uint32_t nret, target_ulong rets) |
... | ... | |
78 | 78 |
rtas_st(rets, 7, 0); /* we don't do nanoseconds */ |
79 | 79 |
} |
80 | 80 |
|
81 |
static void rtas_set_time_of_day(sPAPREnvironment *spapr, |
|
81 |
static void rtas_set_time_of_day(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
82 | 82 |
uint32_t token, uint32_t nargs, |
83 | 83 |
target_ulong args, |
84 | 84 |
uint32_t nret, target_ulong rets) |
... | ... | |
99 | 99 |
rtas_st(rets, 0, 0); /* Success */ |
100 | 100 |
} |
101 | 101 |
|
102 |
static void rtas_power_off(sPAPREnvironment *spapr, |
|
102 |
static void rtas_power_off(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
103 | 103 |
uint32_t token, uint32_t nargs, target_ulong args, |
104 | 104 |
uint32_t nret, target_ulong rets) |
105 | 105 |
{ |
... | ... | |
111 | 111 |
rtas_st(rets, 0, 0); |
112 | 112 |
} |
113 | 113 |
|
114 |
static void rtas_system_reboot(sPAPREnvironment *spapr, |
|
114 |
static void rtas_system_reboot(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
115 | 115 |
uint32_t token, uint32_t nargs, |
116 | 116 |
target_ulong args, |
117 | 117 |
uint32_t nret, target_ulong rets) |
... | ... | |
124 | 124 |
rtas_st(rets, 0, 0); |
125 | 125 |
} |
126 | 126 |
|
127 |
static void rtas_query_cpu_stopped_state(sPAPREnvironment *spapr, |
|
127 |
static void rtas_query_cpu_stopped_state(PowerPCCPU *cpu_, |
|
128 |
sPAPREnvironment *spapr, |
|
128 | 129 |
uint32_t token, uint32_t nargs, |
129 | 130 |
target_ulong args, |
130 | 131 |
uint32_t nret, target_ulong rets) |
... | ... | |
154 | 155 |
rtas_st(rets, 0, -3); |
155 | 156 |
} |
156 | 157 |
|
157 |
static void rtas_start_cpu(sPAPREnvironment *spapr, |
|
158 |
static void rtas_start_cpu(PowerPCCPU *cpu_, sPAPREnvironment *spapr,
|
|
158 | 159 |
uint32_t token, uint32_t nargs, |
159 | 160 |
target_ulong args, |
160 | 161 |
uint32_t nret, target_ulong rets) |
... | ... | |
208 | 209 |
|
209 | 210 |
struct rtas_call *rtas_next = rtas_table; |
210 | 211 |
|
211 |
target_ulong spapr_rtas_call(sPAPREnvironment *spapr, |
|
212 |
target_ulong spapr_rtas_call(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
212 | 213 |
uint32_t token, uint32_t nargs, target_ulong args, |
213 | 214 |
uint32_t nret, target_ulong rets) |
214 | 215 |
{ |
... | ... | |
217 | 218 |
struct rtas_call *call = rtas_table + (token - TOKEN_BASE); |
218 | 219 |
|
219 | 220 |
if (call->fn) { |
220 |
call->fn(spapr, token, nargs, args, nret, rets); |
|
221 |
call->fn(cpu, spapr, token, nargs, args, nret, rets);
|
|
221 | 222 |
return H_SUCCESS; |
222 | 223 |
} |
223 | 224 |
} |
... | ... | |
227 | 228 |
* machines) without looking it up in the device tree. This |
228 | 229 |
* special case makes this work */ |
229 | 230 |
if (token == 0xa) { |
230 |
rtas_display_character(spapr, 0xa, nargs, args, nret, rets); |
|
231 |
rtas_display_character(cpu, spapr, 0xa, nargs, args, nret, rets);
|
|
231 | 232 |
return H_SUCCESS; |
232 | 233 |
} |
233 | 234 |
|
b/hw/ppc/spapr_vio.c | ||
---|---|---|
321 | 321 |
free_crq(dev); |
322 | 322 |
} |
323 | 323 |
|
324 |
static void rtas_set_tce_bypass(sPAPREnvironment *spapr, uint32_t token, |
|
324 |
static void rtas_set_tce_bypass(PowerPCCPU *cpu, sPAPREnvironment *spapr, |
|
325 |
uint32_t token, |
|
325 | 326 |
uint32_t nargs, target_ulong args, |
326 | 327 |
uint32_t nret, target_ulong rets) |
327 | 328 |
{ |
... | ... | |
351 | 352 |
rtas_st(rets, 0, 0); |
352 | 353 |
} |
353 | 354 |
|
354 |
static void rtas_quiesce(sPAPREnvironment *spapr, uint32_t token, |
|
355 |
static void rtas_quiesce(PowerPCCPU *cpu, sPAPREnvironment *spapr, |
|
356 |
uint32_t token, |
|
355 | 357 |
uint32_t nargs, target_ulong args, |
356 | 358 |
uint32_t nret, target_ulong rets) |
357 | 359 |
{ |
b/hw/ppc/xics.c | ||
---|---|---|
400 | 400 |
return H_SUCCESS; |
401 | 401 |
} |
402 | 402 |
|
403 |
static void rtas_set_xive(sPAPREnvironment *spapr, uint32_t token, |
|
403 |
static void rtas_set_xive(PowerPCCPU *cpu, sPAPREnvironment *spapr, |
|
404 |
uint32_t token, |
|
404 | 405 |
uint32_t nargs, target_ulong args, |
405 | 406 |
uint32_t nret, target_ulong rets) |
406 | 407 |
{ |
... | ... | |
427 | 428 |
rtas_st(rets, 0, 0); /* Success */ |
428 | 429 |
} |
429 | 430 |
|
430 |
static void rtas_get_xive(sPAPREnvironment *spapr, uint32_t token, |
|
431 |
static void rtas_get_xive(PowerPCCPU *cpu, sPAPREnvironment *spapr, |
|
432 |
uint32_t token, |
|
431 | 433 |
uint32_t nargs, target_ulong args, |
432 | 434 |
uint32_t nret, target_ulong rets) |
433 | 435 |
{ |
... | ... | |
451 | 453 |
rtas_st(rets, 2, ics->irqs[nr - ics->offset].priority); |
452 | 454 |
} |
453 | 455 |
|
454 |
static void rtas_int_off(sPAPREnvironment *spapr, uint32_t token, |
|
456 |
static void rtas_int_off(PowerPCCPU *cpu, sPAPREnvironment *spapr, |
|
457 |
uint32_t token, |
|
455 | 458 |
uint32_t nargs, target_ulong args, |
456 | 459 |
uint32_t nret, target_ulong rets) |
457 | 460 |
{ |
... | ... | |
476 | 479 |
rtas_st(rets, 0, 0); /* Success */ |
477 | 480 |
} |
478 | 481 |
|
479 |
static void rtas_int_on(sPAPREnvironment *spapr, uint32_t token, |
|
482 |
static void rtas_int_on(PowerPCCPU *cpu, sPAPREnvironment *spapr, |
|
483 |
uint32_t token, |
|
480 | 484 |
uint32_t nargs, target_ulong args, |
481 | 485 |
uint32_t nret, target_ulong rets) |
482 | 486 |
{ |
b/include/hw/ppc/spapr.h | ||
---|---|---|
319 | 319 |
stl_be_phys(phys + 4*n, val); |
320 | 320 |
} |
321 | 321 |
|
322 |
typedef void (*spapr_rtas_fn)(sPAPREnvironment *spapr, uint32_t token, |
|
322 |
typedef void (*spapr_rtas_fn)(PowerPCCPU *cpu, sPAPREnvironment *spapr, |
|
323 |
uint32_t token, |
|
323 | 324 |
uint32_t nargs, target_ulong args, |
324 | 325 |
uint32_t nret, target_ulong rets); |
325 | 326 |
int spapr_rtas_register(const char *name, spapr_rtas_fn fn); |
326 |
target_ulong spapr_rtas_call(sPAPREnvironment *spapr, |
|
327 |
target_ulong spapr_rtas_call(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
327 | 328 |
uint32_t token, uint32_t nargs, target_ulong args, |
328 | 329 |
uint32_t nret, target_ulong rets); |
329 | 330 |
int spapr_rtas_device_tree_setup(void *fdt, hwaddr rtas_addr, |
Also available in: Unified diff