- return (cpu_single_env->msr[MSR_POW] << MSR_POW) |
- (cpu_single_env->msr[MSR_ILE] << MSR_ILE) |
- (cpu_single_env->msr[MSR_EE] << MSR_EE) |
- (cpu_single_env->msr[MSR_PR] << MSR_PR) |
- (cpu_single_env->msr[MSR_FP] << MSR_FP) |
- (cpu_single_env->msr[MSR_ME] << MSR_ME) |
- (cpu_single_env->msr[MSR_FE0] << MSR_FE0) |
- (cpu_single_env->msr[MSR_SE] << MSR_SE) |
- (cpu_single_env->msr[MSR_BE] << MSR_BE) |
- (cpu_single_env->msr[MSR_FE1] << MSR_FE1) |
- (cpu_single_env->msr[MSR_IP] << MSR_IP) |
- (cpu_single_env->msr[MSR_IR] << MSR_IR) |
- (cpu_single_env->msr[MSR_DR] << MSR_DR) |
- (cpu_single_env->msr[MSR_RI] << MSR_RI) |
- (cpu_single_env->msr[MSR_LE] << MSR_LE);
+ CPUState *env = mon_get_cpu();
+ if (!env)
+ return 0;
+ return (env->msr[MSR_POW] << MSR_POW) |
+ (env->msr[MSR_ILE] << MSR_ILE) |
+ (env->msr[MSR_EE] << MSR_EE) |
+ (env->msr[MSR_PR] << MSR_PR) |
+ (env->msr[MSR_FP] << MSR_FP) |
+ (env->msr[MSR_ME] << MSR_ME) |
+ (env->msr[MSR_FE0] << MSR_FE0) |
+ (env->msr[MSR_SE] << MSR_SE) |
+ (env->msr[MSR_BE] << MSR_BE) |
+ (env->msr[MSR_FE1] << MSR_FE1) |
+ (env->msr[MSR_IP] << MSR_IP) |
+ (env->msr[MSR_IR] << MSR_IR) |
+ (env->msr[MSR_DR] << MSR_DR) |
+ (env->msr[MSR_RI] << MSR_RI) |
+ (env->msr[MSR_LE] << MSR_LE);