Revision 39ac8455 hw/spapr.h
b/hw/spapr.h | ||
---|---|---|
237 | 237 |
#define H_GET_MPP 0x2D4 |
238 | 238 |
#define MAX_HCALL_OPCODE H_GET_MPP |
239 | 239 |
|
240 |
/* The hcalls above are standardized in PAPR and implemented by pHyp |
|
241 |
* as well. |
|
242 |
* |
|
243 |
* We also need some hcalls which are specific to qemu / KVM-on-POWER. |
|
244 |
* So far we just need one for H_RTAS, but in future we'll need more |
|
245 |
* for extensions like virtio. We put those into the 0xf000-0xfffc |
|
246 |
* range which is reserved by PAPR for "platform-specific" hcalls. |
|
247 |
*/ |
|
248 |
#define KVMPPC_HCALL_BASE 0xf000 |
|
249 |
#define KVMPPC_H_RTAS (KVMPPC_HCALL_BASE + 0x0) |
|
250 |
#define KVMPPC_HCALL_MAX KVMPPC_H_RTAS |
|
251 |
|
|
240 | 252 |
extern sPAPREnvironment *spapr; |
241 | 253 |
|
242 | 254 |
/*#define DEBUG_SPAPR_HCALLS*/ |
... | ... | |
257 | 269 |
target_ulong spapr_hypercall(CPUState *env, target_ulong opcode, |
258 | 270 |
target_ulong *args); |
259 | 271 |
|
272 |
static inline uint32_t rtas_ld(target_ulong phys, int n) |
|
273 |
{ |
|
274 |
return ldl_phys(phys + 4*n); |
|
275 |
} |
|
276 |
|
|
277 |
static inline void rtas_st(target_ulong phys, int n, uint32_t val) |
|
278 |
{ |
|
279 |
stl_phys(phys + 4*n, val); |
|
280 |
} |
|
281 |
|
|
282 |
typedef void (*spapr_rtas_fn)(sPAPREnvironment *spapr, uint32_t token, |
|
283 |
uint32_t nargs, target_ulong args, |
|
284 |
uint32_t nret, target_ulong rets); |
|
285 |
void spapr_rtas_register(const char *name, spapr_rtas_fn fn); |
|
286 |
target_ulong spapr_rtas_call(sPAPREnvironment *spapr, |
|
287 |
uint32_t token, uint32_t nargs, target_ulong args, |
|
288 |
uint32_t nret, target_ulong rets); |
|
289 |
int spapr_rtas_device_tree_setup(void *fdt, target_phys_addr_t rtas_addr, |
|
290 |
target_phys_addr_t rtas_size); |
|
291 |
|
|
260 | 292 |
#endif /* !defined (__HW_SPAPR_H__) */ |
Also available in: Unified diff