mirror of https://gitee.com/openkylin/qemu.git
CR8 support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1237 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
0523c6b7c5
commit
9230e66e5c
12
hw/apic.c
12
hw/apic.c
|
@ -100,6 +100,18 @@ uint64_t cpu_get_apic_base(CPUState *env)
|
||||||
return s->apicbase;
|
return s->apicbase;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cpu_set_apic_tpr(CPUX86State *env, uint8_t val)
|
||||||
|
{
|
||||||
|
APICState *s = env->apic_state;
|
||||||
|
s->tpr = (val & 0x0f) << 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t cpu_get_apic_tpr(CPUX86State *env)
|
||||||
|
{
|
||||||
|
APICState *s = env->apic_state;
|
||||||
|
return s->tpr >> 4;
|
||||||
|
}
|
||||||
|
|
||||||
/* return -1 if no bit is set */
|
/* return -1 if no bit is set */
|
||||||
static int get_highest_priority_int(uint32_t *tab)
|
static int get_highest_priority_int(uint32_t *tab)
|
||||||
{
|
{
|
||||||
|
|
|
@ -509,15 +509,6 @@ typedef struct CPUX86State {
|
||||||
void *opaque;
|
void *opaque;
|
||||||
} CPUX86State;
|
} CPUX86State;
|
||||||
|
|
||||||
#ifndef IN_OP_I386
|
|
||||||
void cpu_x86_outb(CPUX86State *env, int addr, int val);
|
|
||||||
void cpu_x86_outw(CPUX86State *env, int addr, int val);
|
|
||||||
void cpu_x86_outl(CPUX86State *env, int addr, int val);
|
|
||||||
int cpu_x86_inb(CPUX86State *env, int addr);
|
|
||||||
int cpu_x86_inw(CPUX86State *env, int addr);
|
|
||||||
int cpu_x86_inl(CPUX86State *env, int addr);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CPUX86State *cpu_x86_init(void);
|
CPUX86State *cpu_x86_init(void);
|
||||||
int cpu_x86_exec(CPUX86State *s);
|
int cpu_x86_exec(CPUX86State *s);
|
||||||
void cpu_x86_close(CPUX86State *s);
|
void cpu_x86_close(CPUX86State *s);
|
||||||
|
@ -615,6 +606,10 @@ uint64_t cpu_get_tsc(CPUX86State *env);
|
||||||
|
|
||||||
void cpu_set_apic_base(CPUX86State *env, uint64_t val);
|
void cpu_set_apic_base(CPUX86State *env, uint64_t val);
|
||||||
uint64_t cpu_get_apic_base(CPUX86State *env);
|
uint64_t cpu_get_apic_base(CPUX86State *env);
|
||||||
|
void cpu_set_apic_tpr(CPUX86State *env, uint8_t val);
|
||||||
|
#ifndef NO_CPU_IO_DEFS
|
||||||
|
uint8_t cpu_get_apic_tpr(CPUX86State *env);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* will be suppressed */
|
/* will be suppressed */
|
||||||
void cpu_x86_update_cr0(CPUX86State *env, uint32_t new_cr0);
|
void cpu_x86_update_cr0(CPUX86State *env, uint32_t new_cr0);
|
||||||
|
|
|
@ -5631,17 +5631,20 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
case 4:
|
case 4:
|
||||||
|
case 8:
|
||||||
if (b & 2) {
|
if (b & 2) {
|
||||||
gen_op_mov_TN_reg[ot][0][rm]();
|
gen_op_mov_TN_reg[ot][0][rm]();
|
||||||
gen_op_movl_crN_T0(reg);
|
gen_op_movl_crN_T0(reg);
|
||||||
gen_jmp_im(s->pc - s->cs_base);
|
gen_jmp_im(s->pc - s->cs_base);
|
||||||
gen_eob(s);
|
gen_eob(s);
|
||||||
} else {
|
} else {
|
||||||
gen_op_movtl_T0_env(offsetof(CPUX86State,cr[reg]));
|
if (reg == 8)
|
||||||
|
gen_op_movtl_T0_cr8();
|
||||||
|
else
|
||||||
|
gen_op_movtl_T0_env(offsetof(CPUX86State,cr[reg]));
|
||||||
gen_op_mov_reg_T0[ot][rm]();
|
gen_op_mov_reg_T0[ot][rm]();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/* XXX: add CR8 for x86_64 */
|
|
||||||
default:
|
default:
|
||||||
goto illegal_op;
|
goto illegal_op;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue