]>
Commit | Line | Data |
---|---|---|
39ac8455 DG |
1 | /* |
2 | * QEMU PowerPC pSeries Logical Partition (aka sPAPR) hardware System Emulator | |
3 | * | |
4 | * Hypercall based emulated RTAS | |
5 | * | |
6 | * Copyright (c) 2010-2011 David Gibson, IBM Corporation. | |
7 | * | |
8 | * Permission is hereby granted, free of charge, to any person obtaining a copy | |
9 | * of this software and associated documentation files (the "Software"), to deal | |
10 | * in the Software without restriction, including without limitation the rights | |
11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
12 | * copies of the Software, and to permit persons to whom the Software is | |
13 | * furnished to do so, subject to the following conditions: | |
14 | * | |
15 | * The above copyright notice and this permission notice shall be included in | |
16 | * all copies or substantial portions of the Software. | |
17 | * | |
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
21 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
24 | * THE SOFTWARE. | |
25 | * | |
26 | */ | |
0d75590d | 27 | #include "qemu/osdep.h" |
39ac8455 | 28 | #include "cpu.h" |
03dd024f | 29 | #include "qemu/log.h" |
ce9863b7 | 30 | #include "qemu/error-report.h" |
9c17d615 | 31 | #include "sysemu/sysemu.h" |
39ac8455 | 32 | #include "hw/qdev.h" |
9c17d615 | 33 | #include "sysemu/device_tree.h" |
db4ef288 | 34 | #include "sysemu/cpus.h" |
cf116ad4 | 35 | #include "sysemu/hw_accel.h" |
39ac8455 | 36 | |
0d09e41a PB |
37 | #include "hw/ppc/spapr.h" |
38 | #include "hw/ppc/spapr_vio.h" | |
eeddd59f | 39 | #include "hw/ppc/spapr_rtas.h" |
84369f63 | 40 | #include "hw/ppc/spapr_cpu_core.h" |
af81cf32 | 41 | #include "hw/ppc/ppc.h" |
e3943228 | 42 | #include "hw/boards.h" |
39ac8455 DG |
43 | |
44 | #include <libfdt.h> | |
8c8639df | 45 | #include "hw/ppc/spapr_drc.h" |
f348b6d1 | 46 | #include "qemu/cutils.h" |
028ec3ce | 47 | #include "trace.h" |
3f5dabce | 48 | #include "hw/ppc/fdt.h" |
cf116ad4 | 49 | #include "target/ppc/mmu-hash64.h" |
8c8639df | 50 | |
28e02042 | 51 | static void rtas_display_character(PowerPCCPU *cpu, sPAPRMachineState *spapr, |
821303f5 DG |
52 | uint32_t token, uint32_t nargs, |
53 | target_ulong args, | |
54 | uint32_t nret, target_ulong rets) | |
55 | { | |
56 | uint8_t c = rtas_ld(args, 0); | |
5f2e2ba2 | 57 | VIOsPAPRDevice *sdev = vty_lookup(spapr, 0); |
821303f5 DG |
58 | |
59 | if (!sdev) { | |
a64d325d | 60 | rtas_st(rets, 0, RTAS_OUT_HW_ERROR); |
821303f5 DG |
61 | } else { |
62 | vty_putchars(sdev, &c, sizeof(c)); | |
a64d325d | 63 | rtas_st(rets, 0, RTAS_OUT_SUCCESS); |
821303f5 DG |
64 | } |
65 | } | |
66 | ||
28e02042 | 67 | static void rtas_power_off(PowerPCCPU *cpu, sPAPRMachineState *spapr, |
821303f5 DG |
68 | uint32_t token, uint32_t nargs, target_ulong args, |
69 | uint32_t nret, target_ulong rets) | |
70 | { | |
71 | if (nargs != 2 || nret != 1) { | |
a64d325d | 72 | rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); |
821303f5 DG |
73 | return; |
74 | } | |
cf83f140 | 75 | qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); |
8a9c1b77 | 76 | cpu_stop_current(); |
a64d325d | 77 | rtas_st(rets, 0, RTAS_OUT_SUCCESS); |
821303f5 DG |
78 | } |
79 | ||
28e02042 | 80 | static void rtas_system_reboot(PowerPCCPU *cpu, sPAPRMachineState *spapr, |
c821a43c DG |
81 | uint32_t token, uint32_t nargs, |
82 | target_ulong args, | |
83 | uint32_t nret, target_ulong rets) | |
84 | { | |
85 | if (nargs != 0 || nret != 1) { | |
a64d325d | 86 | rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); |
c821a43c DG |
87 | return; |
88 | } | |
cf83f140 | 89 | qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); |
a64d325d | 90 | rtas_st(rets, 0, RTAS_OUT_SUCCESS); |
c821a43c DG |
91 | } |
92 | ||
210b580b | 93 | static void rtas_query_cpu_stopped_state(PowerPCCPU *cpu_, |
28e02042 | 94 | sPAPRMachineState *spapr, |
a9f8ad8f DG |
95 | uint32_t token, uint32_t nargs, |
96 | target_ulong args, | |
97 | uint32_t nret, target_ulong rets) | |
98 | { | |
99 | target_ulong id; | |
0f20ba62 | 100 | PowerPCCPU *cpu; |
a9f8ad8f DG |
101 | |
102 | if (nargs != 1 || nret != 2) { | |
a64d325d | 103 | rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); |
a9f8ad8f DG |
104 | return; |
105 | } | |
106 | ||
107 | id = rtas_ld(args, 0); | |
2e886fb3 | 108 | cpu = spapr_find_cpu(id); |
05318a85 | 109 | if (cpu != NULL) { |
0f20ba62 | 110 | if (CPU(cpu)->halted) { |
a9f8ad8f DG |
111 | rtas_st(rets, 1, 0); |
112 | } else { | |
113 | rtas_st(rets, 1, 2); | |
114 | } | |
115 | ||
a64d325d | 116 | rtas_st(rets, 0, RTAS_OUT_SUCCESS); |
a9f8ad8f DG |
117 | return; |
118 | } | |
119 | ||
120 | /* Didn't find a matching cpu */ | |
a64d325d | 121 | rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); |
a9f8ad8f DG |
122 | } |
123 | ||
cf116ad4 | 124 | static void rtas_start_cpu(PowerPCCPU *callcpu, sPAPRMachineState *spapr, |
a9f8ad8f DG |
125 | uint32_t token, uint32_t nargs, |
126 | target_ulong args, | |
127 | uint32_t nret, target_ulong rets) | |
128 | { | |
129 | target_ulong id, start, r3; | |
cf116ad4 DG |
130 | PowerPCCPU *newcpu; |
131 | CPUPPCState *env; | |
132 | PowerPCCPUClass *pcc; | |
98248918 | 133 | target_ulong lpcr; |
a9f8ad8f DG |
134 | |
135 | if (nargs != 3 || nret != 1) { | |
a64d325d | 136 | rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); |
a9f8ad8f DG |
137 | return; |
138 | } | |
139 | ||
140 | id = rtas_ld(args, 0); | |
141 | start = rtas_ld(args, 1); | |
142 | r3 = rtas_ld(args, 2); | |
143 | ||
cf116ad4 DG |
144 | newcpu = spapr_find_cpu(id); |
145 | if (!newcpu) { | |
146 | /* Didn't find a matching cpu */ | |
147 | rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); | |
148 | return; | |
149 | } | |
a9f8ad8f | 150 | |
cf116ad4 DG |
151 | env = &newcpu->env; |
152 | pcc = POWERPC_CPU_GET_CLASS(newcpu); | |
a9f8ad8f | 153 | |
cf116ad4 DG |
154 | if (!CPU(newcpu)->halted) { |
155 | rtas_st(rets, 0, RTAS_OUT_HW_ERROR); | |
156 | return; | |
157 | } | |
048706d9 | 158 | |
cf116ad4 | 159 | cpu_synchronize_state(CPU(newcpu)); |
9a94ee5b | 160 | |
cf116ad4 | 161 | env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME); |
98248918 | 162 | |
cf116ad4 | 163 | /* Enable Power-saving mode Exit Cause exceptions for the new CPU */ |
98248918 DG |
164 | lpcr = env->spr[SPR_LPCR] | pcc->lpcr_pm; |
165 | if (!pcc->interrupts_big_endian(callcpu)) { | |
166 | lpcr |= LPCR_ILE; | |
167 | } | |
168 | ppc_store_lpcr(newcpu, lpcr); | |
169 | ||
170 | /* | |
171 | * Set the timebase offset of the new CPU to that of the invoking | |
172 | * CPU. This helps hotplugged CPU to have the correct timebase | |
173 | * offset. | |
174 | */ | |
175 | newcpu->env.tb_env->tb_offset = callcpu->env.tb_env->tb_offset; | |
9a94ee5b | 176 | |
84369f63 | 177 | spapr_cpu_set_entry_state(newcpu, start, r3); |
a9f8ad8f | 178 | |
cf116ad4 | 179 | qemu_cpu_kick(CPU(newcpu)); |
a9f8ad8f | 180 | |
cf116ad4 | 181 | rtas_st(rets, 0, RTAS_OUT_SUCCESS); |
a9f8ad8f DG |
182 | } |
183 | ||
28e02042 | 184 | static void rtas_stop_self(PowerPCCPU *cpu, sPAPRMachineState *spapr, |
59760f2d AK |
185 | uint32_t token, uint32_t nargs, |
186 | target_ulong args, | |
187 | uint32_t nret, target_ulong rets) | |
188 | { | |
189 | CPUState *cs = CPU(cpu); | |
190 | CPUPPCState *env = &cpu->env; | |
9a94ee5b | 191 | PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu); |
59760f2d | 192 | |
9a94ee5b CLG |
193 | /* Disable Power-saving mode Exit Cause exceptions for the CPU. |
194 | * This could deliver an interrupt on a dying CPU and crash the | |
195 | * guest */ | |
cf116ad4 DG |
196 | ppc_store_lpcr(cpu, env->spr[SPR_LPCR] & ~pcc->lpcr_pm); |
197 | cs->halted = 1; | |
198 | qemu_cpu_kick(cs); | |
59760f2d AK |
199 | } |
200 | ||
c920f7b4 DG |
201 | static inline int sysparm_st(target_ulong addr, target_ulong len, |
202 | const void *val, uint16_t vallen) | |
203 | { | |
204 | hwaddr phys = ppc64_phys_to_real(addr); | |
205 | ||
206 | if (len < 2) { | |
207 | return RTAS_OUT_SYSPARM_PARAM_ERROR; | |
208 | } | |
209 | stw_be_phys(&address_space_memory, phys, vallen); | |
210 | cpu_physical_memory_write(phys + 2, val, MIN(len - 2, vallen)); | |
211 | return RTAS_OUT_SUCCESS; | |
212 | } | |
213 | ||
3ada6b11 | 214 | static void rtas_ibm_get_system_parameter(PowerPCCPU *cpu, |
28e02042 | 215 | sPAPRMachineState *spapr, |
3ada6b11 AK |
216 | uint32_t token, uint32_t nargs, |
217 | target_ulong args, | |
218 | uint32_t nret, target_ulong rets) | |
219 | { | |
220 | target_ulong parameter = rtas_ld(args, 0); | |
221 | target_ulong buffer = rtas_ld(args, 1); | |
222 | target_ulong length = rtas_ld(args, 2); | |
c920f7b4 | 223 | target_ulong ret; |
3ada6b11 AK |
224 | |
225 | switch (parameter) { | |
3b50d897 | 226 | case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS: { |
e3943228 SB |
227 | char *param_val = g_strdup_printf("MaxEntCap=%d," |
228 | "DesMem=%llu," | |
229 | "DesProcs=%d," | |
230 | "MaxPlatProcs=%d", | |
231 | max_cpus, | |
232 | current_machine->ram_size / M_BYTE, | |
233 | smp_cpus, | |
234 | max_cpus); | |
c920f7b4 | 235 | ret = sysparm_st(buffer, length, param_val, strlen(param_val) + 1); |
3b50d897 S |
236 | g_free(param_val); |
237 | break; | |
238 | } | |
3052d951 S |
239 | case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE: { |
240 | uint8_t param_val = DIAGNOSTICS_RUN_MODE_DISABLED; | |
241 | ||
c920f7b4 | 242 | ret = sysparm_st(buffer, length, ¶m_val, sizeof(param_val)); |
3ada6b11 AK |
243 | break; |
244 | } | |
b907d7b0 | 245 | case RTAS_SYSPARM_UUID: |
9c5ce8db FZ |
246 | ret = sysparm_st(buffer, length, (unsigned char *)&qemu_uuid, |
247 | (qemu_uuid_set ? 16 : 0)); | |
b907d7b0 | 248 | break; |
3052d951 S |
249 | default: |
250 | ret = RTAS_OUT_NOT_SUPPORTED; | |
251 | } | |
3ada6b11 AK |
252 | |
253 | rtas_st(rets, 0, ret); | |
254 | } | |
255 | ||
256 | static void rtas_ibm_set_system_parameter(PowerPCCPU *cpu, | |
28e02042 | 257 | sPAPRMachineState *spapr, |
3ada6b11 AK |
258 | uint32_t token, uint32_t nargs, |
259 | target_ulong args, | |
260 | uint32_t nret, target_ulong rets) | |
261 | { | |
262 | target_ulong parameter = rtas_ld(args, 0); | |
263 | target_ulong ret = RTAS_OUT_NOT_SUPPORTED; | |
264 | ||
265 | switch (parameter) { | |
3b50d897 | 266 | case RTAS_SYSPARM_SPLPAR_CHARACTERISTICS: |
3052d951 | 267 | case RTAS_SYSPARM_DIAGNOSTICS_RUN_MODE: |
b907d7b0 | 268 | case RTAS_SYSPARM_UUID: |
3ada6b11 AK |
269 | ret = RTAS_OUT_NOT_AUTHORIZED; |
270 | break; | |
271 | } | |
272 | ||
273 | rtas_st(rets, 0, ret); | |
274 | } | |
275 | ||
2e14072f | 276 | static void rtas_ibm_os_term(PowerPCCPU *cpu, |
28e02042 | 277 | sPAPRMachineState *spapr, |
2e14072f ND |
278 | uint32_t token, uint32_t nargs, |
279 | target_ulong args, | |
280 | uint32_t nret, target_ulong rets) | |
281 | { | |
2c553477 | 282 | qemu_system_guest_panicked(NULL); |
2e14072f | 283 | |
2c553477 | 284 | rtas_st(rets, 0, RTAS_OUT_SUCCESS); |
2e14072f ND |
285 | } |
286 | ||
28e02042 | 287 | static void rtas_set_power_level(PowerPCCPU *cpu, sPAPRMachineState *spapr, |
094d2058 NF |
288 | uint32_t token, uint32_t nargs, |
289 | target_ulong args, uint32_t nret, | |
290 | target_ulong rets) | |
291 | { | |
292 | int32_t power_domain; | |
293 | ||
294 | if (nargs != 2 || nret != 2) { | |
295 | rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); | |
296 | return; | |
297 | } | |
298 | ||
299 | /* we currently only use a single, "live insert" powerdomain for | |
300 | * hotplugged/dlpar'd resources, so the power is always live/full (100) | |
301 | */ | |
302 | power_domain = rtas_ld(args, 0); | |
303 | if (power_domain != -1) { | |
304 | rtas_st(rets, 0, RTAS_OUT_NOT_SUPPORTED); | |
305 | return; | |
306 | } | |
307 | ||
308 | rtas_st(rets, 0, RTAS_OUT_SUCCESS); | |
309 | rtas_st(rets, 1, 100); | |
310 | } | |
311 | ||
28e02042 | 312 | static void rtas_get_power_level(PowerPCCPU *cpu, sPAPRMachineState *spapr, |
094d2058 NF |
313 | uint32_t token, uint32_t nargs, |
314 | target_ulong args, uint32_t nret, | |
315 | target_ulong rets) | |
316 | { | |
317 | int32_t power_domain; | |
318 | ||
319 | if (nargs != 1 || nret != 2) { | |
320 | rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); | |
321 | return; | |
322 | } | |
323 | ||
324 | /* we currently only use a single, "live insert" powerdomain for | |
325 | * hotplugged/dlpar'd resources, so the power is always live/full (100) | |
326 | */ | |
327 | power_domain = rtas_ld(args, 0); | |
328 | if (power_domain != -1) { | |
329 | rtas_st(rets, 0, RTAS_OUT_NOT_SUPPORTED); | |
330 | return; | |
331 | } | |
332 | ||
333 | rtas_st(rets, 0, RTAS_OUT_SUCCESS); | |
334 | rtas_st(rets, 1, 100); | |
335 | } | |
336 | ||
39ac8455 DG |
337 | static struct rtas_call { |
338 | const char *name; | |
339 | spapr_rtas_fn fn; | |
3a3b8502 | 340 | } rtas_table[RTAS_TOKEN_MAX - RTAS_TOKEN_BASE]; |
39ac8455 | 341 | |
28e02042 | 342 | target_ulong spapr_rtas_call(PowerPCCPU *cpu, sPAPRMachineState *spapr, |
39ac8455 DG |
343 | uint32_t token, uint32_t nargs, target_ulong args, |
344 | uint32_t nret, target_ulong rets) | |
345 | { | |
3a3b8502 AK |
346 | if ((token >= RTAS_TOKEN_BASE) && (token < RTAS_TOKEN_MAX)) { |
347 | struct rtas_call *call = rtas_table + (token - RTAS_TOKEN_BASE); | |
39ac8455 DG |
348 | |
349 | if (call->fn) { | |
210b580b | 350 | call->fn(cpu, spapr, token, nargs, args, nret, rets); |
39ac8455 DG |
351 | return H_SUCCESS; |
352 | } | |
353 | } | |
354 | ||
821303f5 DG |
355 | /* HACK: Some Linux early debug code uses RTAS display-character, |
356 | * but assumes the token value is 0xa (which it is on some real | |
357 | * machines) without looking it up in the device tree. This | |
358 | * special case makes this work */ | |
359 | if (token == 0xa) { | |
210b580b | 360 | rtas_display_character(cpu, spapr, 0xa, nargs, args, nret, rets); |
821303f5 DG |
361 | return H_SUCCESS; |
362 | } | |
363 | ||
39ac8455 | 364 | hcall_dprintf("Unknown RTAS token 0x%x\n", token); |
a64d325d | 365 | rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); |
39ac8455 DG |
366 | return H_PARAMETER; |
367 | } | |
368 | ||
eeddd59f LV |
369 | uint64_t qtest_rtas_call(char *cmd, uint32_t nargs, uint64_t args, |
370 | uint32_t nret, uint64_t rets) | |
371 | { | |
372 | int token; | |
373 | ||
374 | for (token = 0; token < RTAS_TOKEN_MAX - RTAS_TOKEN_BASE; token++) { | |
375 | if (strcmp(cmd, rtas_table[token].name) == 0) { | |
376 | sPAPRMachineState *spapr = SPAPR_MACHINE(qdev_get_machine()); | |
377 | PowerPCCPU *cpu = POWERPC_CPU(first_cpu); | |
378 | ||
379 | rtas_table[token].fn(cpu, spapr, token + RTAS_TOKEN_BASE, | |
380 | nargs, args, nret, rets); | |
381 | return H_SUCCESS; | |
382 | } | |
383 | } | |
384 | return H_PARAMETER; | |
385 | } | |
386 | ||
3a3b8502 | 387 | void spapr_rtas_register(int token, const char *name, spapr_rtas_fn fn) |
39ac8455 | 388 | { |
adf9ac50 | 389 | assert((token >= RTAS_TOKEN_BASE) && (token < RTAS_TOKEN_MAX)); |
c89d5299 | 390 | |
3a3b8502 | 391 | token -= RTAS_TOKEN_BASE; |
adf9ac50 DG |
392 | |
393 | assert(!rtas_table[token].name); | |
39ac8455 | 394 | |
3a3b8502 AK |
395 | rtas_table[token].name = name; |
396 | rtas_table[token].fn = fn; | |
39ac8455 DG |
397 | } |
398 | ||
3f5dabce | 399 | void spapr_dt_rtas_tokens(void *fdt, int rtas) |
39ac8455 | 400 | { |
39ac8455 DG |
401 | int i; |
402 | ||
3a3b8502 | 403 | for (i = 0; i < RTAS_TOKEN_MAX - RTAS_TOKEN_BASE; i++) { |
39ac8455 DG |
404 | struct rtas_call *call = &rtas_table[i]; |
405 | ||
d36b66f7 | 406 | if (!call->name) { |
39ac8455 DG |
407 | continue; |
408 | } | |
409 | ||
3f5dabce | 410 | _FDT(fdt_setprop_cell(fdt, rtas, call->name, i + RTAS_TOKEN_BASE)); |
39ac8455 | 411 | } |
39ac8455 | 412 | } |
821303f5 | 413 | |
2cac78c1 DG |
414 | void spapr_load_rtas(sPAPRMachineState *spapr, void *fdt, hwaddr addr) |
415 | { | |
416 | int rtas_node; | |
417 | int ret; | |
418 | ||
419 | /* Copy RTAS blob into guest RAM */ | |
420 | cpu_physical_memory_write(addr, spapr->rtas_blob, spapr->rtas_size); | |
421 | ||
422 | ret = fdt_add_mem_rsv(fdt, addr, spapr->rtas_size); | |
423 | if (ret < 0) { | |
424 | error_report("Couldn't add RTAS reserve entry: %s", | |
425 | fdt_strerror(ret)); | |
426 | exit(1); | |
427 | } | |
428 | ||
429 | /* Update the device tree with the blob's location */ | |
430 | rtas_node = fdt_path_offset(fdt, "/rtas"); | |
431 | assert(rtas_node >= 0); | |
432 | ||
433 | ret = fdt_setprop_cell(fdt, rtas_node, "linux,rtas-base", addr); | |
434 | if (ret < 0) { | |
435 | error_report("Couldn't add linux,rtas-base property: %s", | |
436 | fdt_strerror(ret)); | |
437 | exit(1); | |
438 | } | |
439 | ||
440 | ret = fdt_setprop_cell(fdt, rtas_node, "linux,rtas-entry", addr); | |
441 | if (ret < 0) { | |
442 | error_report("Couldn't add linux,rtas-entry property: %s", | |
443 | fdt_strerror(ret)); | |
444 | exit(1); | |
445 | } | |
446 | ||
447 | ret = fdt_setprop_cell(fdt, rtas_node, "rtas-size", spapr->rtas_size); | |
448 | if (ret < 0) { | |
449 | error_report("Couldn't add rtas-size property: %s", | |
450 | fdt_strerror(ret)); | |
451 | exit(1); | |
452 | } | |
453 | } | |
454 | ||
83f7d43a | 455 | static void core_rtas_register_types(void) |
821303f5 | 456 | { |
3a3b8502 AK |
457 | spapr_rtas_register(RTAS_DISPLAY_CHARACTER, "display-character", |
458 | rtas_display_character); | |
3a3b8502 AK |
459 | spapr_rtas_register(RTAS_POWER_OFF, "power-off", rtas_power_off); |
460 | spapr_rtas_register(RTAS_SYSTEM_REBOOT, "system-reboot", | |
461 | rtas_system_reboot); | |
462 | spapr_rtas_register(RTAS_QUERY_CPU_STOPPED_STATE, "query-cpu-stopped-state", | |
a9f8ad8f | 463 | rtas_query_cpu_stopped_state); |
3a3b8502 AK |
464 | spapr_rtas_register(RTAS_START_CPU, "start-cpu", rtas_start_cpu); |
465 | spapr_rtas_register(RTAS_STOP_SELF, "stop-self", rtas_stop_self); | |
466 | spapr_rtas_register(RTAS_IBM_GET_SYSTEM_PARAMETER, | |
467 | "ibm,get-system-parameter", | |
3ada6b11 | 468 | rtas_ibm_get_system_parameter); |
3a3b8502 AK |
469 | spapr_rtas_register(RTAS_IBM_SET_SYSTEM_PARAMETER, |
470 | "ibm,set-system-parameter", | |
3ada6b11 | 471 | rtas_ibm_set_system_parameter); |
2e14072f ND |
472 | spapr_rtas_register(RTAS_IBM_OS_TERM, "ibm,os-term", |
473 | rtas_ibm_os_term); | |
094d2058 NF |
474 | spapr_rtas_register(RTAS_SET_POWER_LEVEL, "set-power-level", |
475 | rtas_set_power_level); | |
476 | spapr_rtas_register(RTAS_GET_POWER_LEVEL, "get-power-level", | |
477 | rtas_get_power_level); | |
821303f5 | 478 | } |
83f7d43a AF |
479 | |
480 | type_init(core_rtas_register_types) |