Implement Process Priority Register as defined in the PowerPC 2.04 spec.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3282 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
j_mayer 2007-09-30 01:18:26 +00:00
parent d7e4b87e53
commit c80f84e3c0
4 changed files with 39 additions and 0 deletions

View File

@ -295,6 +295,14 @@ void OPPROTO op_store_xer (void)
RETURN(); RETURN();
} }
#if defined(TARGET_PPC64)
void OPPROTO op_store_pri (void)
{
do_store_pri(PARAM1);
RETURN();
}
#endif
#if !defined(CONFIG_USER_ONLY) #if !defined(CONFIG_USER_ONLY)
/* Segment registers load and store */ /* Segment registers load and store */
void OPPROTO op_load_sr (void) void OPPROTO op_load_sr (void)

View File

@ -112,6 +112,14 @@ void do_store_xer (void)
xer_bc = (T0 >> XER_BC) & 0x7F; xer_bc = (T0 >> XER_BC) & 0x7F;
} }
#if defined(TARGET_PPC64)
void do_store_pri (int prio)
{
env->spr[SPR_PPR] &= ~0x001C000000000000ULL;
env->spr[SPR_PPR] |= ((uint64_t)prio & 0x7) << 50;
}
#endif
void do_load_fpscr (void) void do_load_fpscr (void)
{ {
/* The 32 MSB of the target fpr are undefined. /* The 32 MSB of the target fpr are undefined.

View File

@ -57,6 +57,9 @@ void do_load_cr (void);
void do_store_cr (uint32_t mask); void do_store_cr (uint32_t mask);
void do_load_xer (void); void do_load_xer (void);
void do_store_xer (void); void do_store_xer (void);
#if defined(TARGET_PPC64)
void do_store_pri (int prio);
#endif
void do_load_fpscr (void); void do_load_fpscr (void);
void do_store_fpscr (uint32_t mask); void do_store_fpscr (uint32_t mask);
target_ulong ppc_load_dump_spr (int sprn); target_ulong ppc_load_dump_spr (int sprn);

View File

@ -1124,6 +1124,26 @@ GEN_HANDLER(or, 0x1F, 0x1C, 0x0D, 0x00000000, PPC_INTEGER)
} else if (unlikely(Rc(ctx->opcode) != 0)) { } else if (unlikely(Rc(ctx->opcode) != 0)) {
gen_op_load_gpr_T0(rs); gen_op_load_gpr_T0(rs);
gen_set_Rc0(ctx); gen_set_Rc0(ctx);
#if defined(TARGET_PPC64)
} else {
switch (rs) {
case 1:
/* Set process priority to low */
gen_op_store_pri(2);
break;
case 6:
/* Set process priority to medium-low */
gen_op_store_pri(3);
break;
case 2:
/* Set process priority to normal */
gen_op_store_pri(4);
break;
default:
/* nop */
break;
}
#endif
} }
} }