Revision b13ce26d hw/spapr_hcall.c
b/hw/spapr_hcall.c | ||
---|---|---|
75 | 75 |
return rb; |
76 | 76 |
} |
77 | 77 |
|
78 |
static target_ulong h_enter(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
78 |
static target_ulong h_enter(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
79 | 79 |
target_ulong opcode, target_ulong *args) |
80 | 80 |
{ |
81 |
CPUPPCState *env = &cpu->env; |
|
81 | 82 |
target_ulong flags = args[0]; |
82 | 83 |
target_ulong pte_index = args[1]; |
83 | 84 |
target_ulong pteh = args[2]; |
... | ... | |
192 | 193 |
return REMOVE_SUCCESS; |
193 | 194 |
} |
194 | 195 |
|
195 |
static target_ulong h_remove(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
196 |
static target_ulong h_remove(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
196 | 197 |
target_ulong opcode, target_ulong *args) |
197 | 198 |
{ |
199 |
CPUPPCState *env = &cpu->env; |
|
198 | 200 |
target_ulong flags = args[0]; |
199 | 201 |
target_ulong pte_index = args[1]; |
200 | 202 |
target_ulong avpn = args[2]; |
... | ... | |
238 | 240 |
|
239 | 241 |
#define H_BULK_REMOVE_MAX_BATCH 4 |
240 | 242 |
|
241 |
static target_ulong h_bulk_remove(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
243 |
static target_ulong h_bulk_remove(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
242 | 244 |
target_ulong opcode, target_ulong *args) |
243 | 245 |
{ |
246 |
CPUPPCState *env = &cpu->env; |
|
244 | 247 |
int i; |
245 | 248 |
|
246 | 249 |
for (i = 0; i < H_BULK_REMOVE_MAX_BATCH; i++) { |
... | ... | |
284 | 287 |
return H_SUCCESS; |
285 | 288 |
} |
286 | 289 |
|
287 |
static target_ulong h_protect(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
290 |
static target_ulong h_protect(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
288 | 291 |
target_ulong opcode, target_ulong *args) |
289 | 292 |
{ |
293 |
CPUPPCState *env = &cpu->env; |
|
290 | 294 |
target_ulong flags = args[0]; |
291 | 295 |
target_ulong pte_index = args[1]; |
292 | 296 |
target_ulong avpn = args[2]; |
... | ... | |
321 | 325 |
return H_SUCCESS; |
322 | 326 |
} |
323 | 327 |
|
324 |
static target_ulong h_set_dabr(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
328 |
static target_ulong h_set_dabr(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
325 | 329 |
target_ulong opcode, target_ulong *args) |
326 | 330 |
{ |
327 | 331 |
/* FIXME: actually implement this */ |
... | ... | |
457 | 461 |
return H_SUCCESS; |
458 | 462 |
} |
459 | 463 |
|
460 |
static target_ulong h_register_vpa(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
464 |
static target_ulong h_register_vpa(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
461 | 465 |
target_ulong opcode, target_ulong *args) |
462 | 466 |
{ |
463 | 467 |
target_ulong flags = args[0]; |
... | ... | |
505 | 509 |
return ret; |
506 | 510 |
} |
507 | 511 |
|
508 |
static target_ulong h_cede(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
512 |
static target_ulong h_cede(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
509 | 513 |
target_ulong opcode, target_ulong *args) |
510 | 514 |
{ |
515 |
CPUPPCState *env = &cpu->env; |
|
516 |
|
|
511 | 517 |
env->msr |= (1ULL << MSR_EE); |
512 | 518 |
hreg_compute_hflags(env); |
513 | 519 |
if (!cpu_has_work(env)) { |
... | ... | |
518 | 524 |
return H_SUCCESS; |
519 | 525 |
} |
520 | 526 |
|
521 |
static target_ulong h_rtas(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
527 |
static target_ulong h_rtas(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
522 | 528 |
target_ulong opcode, target_ulong *args) |
523 | 529 |
{ |
524 | 530 |
target_ulong rtas_r3 = args[0]; |
... | ... | |
530 | 536 |
nret, rtas_r3 + 12 + 4*nargs); |
531 | 537 |
} |
532 | 538 |
|
533 |
static target_ulong h_logical_load(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
539 |
static target_ulong h_logical_load(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
534 | 540 |
target_ulong opcode, target_ulong *args) |
535 | 541 |
{ |
536 | 542 |
target_ulong size = args[0]; |
... | ... | |
553 | 559 |
return H_PARAMETER; |
554 | 560 |
} |
555 | 561 |
|
556 |
static target_ulong h_logical_store(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
562 |
static target_ulong h_logical_store(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
557 | 563 |
target_ulong opcode, target_ulong *args) |
558 | 564 |
{ |
559 | 565 |
target_ulong size = args[0]; |
... | ... | |
577 | 583 |
return H_PARAMETER; |
578 | 584 |
} |
579 | 585 |
|
580 |
static target_ulong h_logical_memop(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
586 |
static target_ulong h_logical_memop(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
581 | 587 |
target_ulong opcode, target_ulong *args) |
582 | 588 |
{ |
583 | 589 |
target_ulong dst = args[0]; /* Destination address */ |
... | ... | |
644 | 650 |
return H_SUCCESS; |
645 | 651 |
} |
646 | 652 |
|
647 |
static target_ulong h_logical_icbi(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
653 |
static target_ulong h_logical_icbi(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
648 | 654 |
target_ulong opcode, target_ulong *args) |
649 | 655 |
{ |
650 | 656 |
/* Nothing to do on emulation, KVM will trap this in the kernel */ |
651 | 657 |
return H_SUCCESS; |
652 | 658 |
} |
653 | 659 |
|
654 |
static target_ulong h_logical_dcbf(CPUPPCState *env, sPAPREnvironment *spapr,
|
|
660 |
static target_ulong h_logical_dcbf(PowerPCCPU *cpu, sPAPREnvironment *spapr,
|
|
655 | 661 |
target_ulong opcode, target_ulong *args) |
656 | 662 |
{ |
657 | 663 |
/* Nothing to do on emulation, KVM will trap this in the kernel */ |
... | ... | |
682 | 688 |
target_ulong spapr_hypercall(PowerPCCPU *cpu, target_ulong opcode, |
683 | 689 |
target_ulong *args) |
684 | 690 |
{ |
685 |
CPUPPCState *env = &cpu->env; |
|
686 |
|
|
687 | 691 |
if ((opcode <= MAX_HCALL_OPCODE) |
688 | 692 |
&& ((opcode & 0x3) == 0)) { |
689 | 693 |
spapr_hcall_fn fn = papr_hypercall_table[opcode / 4]; |
690 | 694 |
|
691 | 695 |
if (fn) { |
692 |
return fn(env, spapr, opcode, args);
|
|
696 |
return fn(cpu, spapr, opcode, args);
|
|
693 | 697 |
} |
694 | 698 |
} else if ((opcode >= KVMPPC_HCALL_BASE) && |
695 | 699 |
(opcode <= KVMPPC_HCALL_MAX)) { |
696 | 700 |
spapr_hcall_fn fn = kvmppc_hypercall_table[opcode - KVMPPC_HCALL_BASE]; |
697 | 701 |
|
698 | 702 |
if (fn) { |
699 |
return fn(env, spapr, opcode, args);
|
|
703 |
return fn(cpu, spapr, opcode, args);
|
|
700 | 704 |
} |
701 | 705 |
} |
702 | 706 |
|
Also available in: Unified diff