mirror of https://github.com/xemu-project/xemu.git
hw/s390x/sclp: Have sclp_service_call[_protected]() take S390CPU*
"hw/s390x/sclp.h" is a header used by target-agnostic objects (such hw/char/sclpconsole[-lm].c), thus can not use target-specific types, such CPUS390XState. Have sclp_service_call[_protected]() take a S390CPU pointer, which is target-agnostic. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20231106114500.5269-3-philmd@linaro.org>
This commit is contained in:
parent
6233759ae1
commit
6d3910c9db
|
@ -269,9 +269,9 @@ static void sclp_execute(SCLPDevice *sclp, SCCB *sccb, uint32_t code)
|
||||||
* service_interrupt call.
|
* service_interrupt call.
|
||||||
*/
|
*/
|
||||||
#define SCLP_PV_DUMMY_ADDR 0x4000
|
#define SCLP_PV_DUMMY_ADDR 0x4000
|
||||||
int sclp_service_call_protected(CPUS390XState *env, uint64_t sccb,
|
int sclp_service_call_protected(S390CPU *cpu, uint64_t sccb, uint32_t code)
|
||||||
uint32_t code)
|
|
||||||
{
|
{
|
||||||
|
CPUS390XState *env = &cpu->env;
|
||||||
SCLPDevice *sclp = get_sclp_device();
|
SCLPDevice *sclp = get_sclp_device();
|
||||||
SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp);
|
SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp);
|
||||||
SCCBHeader header;
|
SCCBHeader header;
|
||||||
|
@ -296,8 +296,9 @@ out_write:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code)
|
int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint32_t code)
|
||||||
{
|
{
|
||||||
|
CPUS390XState *env = &cpu->env;
|
||||||
SCLPDevice *sclp = get_sclp_device();
|
SCLPDevice *sclp = get_sclp_device();
|
||||||
SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp);
|
SCLPDeviceClass *sclp_c = SCLP_GET_CLASS(sclp);
|
||||||
SCCBHeader header;
|
SCCBHeader header;
|
||||||
|
|
|
@ -227,8 +227,7 @@ static inline int sccb_data_len(SCCB *sccb)
|
||||||
void s390_sclp_init(void);
|
void s390_sclp_init(void);
|
||||||
void sclp_service_interrupt(uint32_t sccb);
|
void sclp_service_interrupt(uint32_t sccb);
|
||||||
void raise_irq_cpu_hotplug(void);
|
void raise_irq_cpu_hotplug(void);
|
||||||
int sclp_service_call(CPUS390XState *env, uint64_t sccb, uint32_t code);
|
int sclp_service_call(S390CPU *cpu, uint64_t sccb, uint32_t code);
|
||||||
int sclp_service_call_protected(CPUS390XState *env, uint64_t sccb,
|
int sclp_service_call_protected(S390CPU *cpu, uint64_t sccb, uint32_t code);
|
||||||
uint32_t code);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1174,12 +1174,12 @@ static void kvm_sclp_service_call(S390CPU *cpu, struct kvm_run *run,
|
||||||
break;
|
break;
|
||||||
case ICPT_PV_INSTR:
|
case ICPT_PV_INSTR:
|
||||||
g_assert(s390_is_pv());
|
g_assert(s390_is_pv());
|
||||||
sclp_service_call_protected(env, sccb, code);
|
sclp_service_call_protected(cpu, sccb, code);
|
||||||
/* Setting the CC is done by the Ultravisor. */
|
/* Setting the CC is done by the Ultravisor. */
|
||||||
break;
|
break;
|
||||||
case ICPT_INSTRUCTION:
|
case ICPT_INSTRUCTION:
|
||||||
g_assert(!s390_is_pv());
|
g_assert(!s390_is_pv());
|
||||||
r = sclp_service_call(env, sccb, code);
|
r = sclp_service_call(cpu, sccb, code);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
kvm_s390_program_interrupt(cpu, -r);
|
kvm_s390_program_interrupt(cpu, -r);
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -102,7 +102,7 @@ uint64_t HELPER(stck)(CPUS390XState *env)
|
||||||
uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2)
|
uint32_t HELPER(servc)(CPUS390XState *env, uint64_t r1, uint64_t r2)
|
||||||
{
|
{
|
||||||
qemu_mutex_lock_iothread();
|
qemu_mutex_lock_iothread();
|
||||||
int r = sclp_service_call(env, r1, r2);
|
int r = sclp_service_call(env_archcpu(env), r1, r2);
|
||||||
qemu_mutex_unlock_iothread();
|
qemu_mutex_unlock_iothread();
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
tcg_s390_program_interrupt(env, -r, GETPC());
|
tcg_s390_program_interrupt(env, -r, GETPC());
|
||||||
|
|
Loading…
Reference in New Issue