RETURN();
}
-/* Set reservation */
-PPC_OP(set_reservation)
-{
- regs->reserve = T0 & ~0x03;
- RETURN();
-}
-
/* crf operations */
PPC_OP(getbit_T0)
{
}
/* Instruction cache invalidation helper */
+#define ICACHE_LINE_SIZE 32
+
void do_icbi (void)
{
- // tb_invalidate_page(T0);
+ /* Invalidate one cache line */
+ T0 &= ~(ICACHE_LINE_SIZE - 1);
+ tb_invalidate_page_range(T0, T0 + ICACHE_LINE_SIZE);
}
/* TLB invalidation helpers */
PPC_LDF_OP(fd, ldfq);
PPC_LDF_OP(fs, ldfl);
+/* Load and set reservation */
+PPC_OP(glue(lwarx, MEMSUFFIX))
+{
+ if (T0 & 0x03) {
+ do_queue_exception(EXCP_ALIGN);
+ do_process_exceptions();
+ } else {
+ glue(ldl, MEMSUFFIX)((void *)T0);
+ regs->reserve = T0 & ~0x03;
+ }
+ RETURN();
+}
+
/* Store with reservation */
PPC_OP(glue(stwcx, MEMSUFFIX))
{
/* lwarx */
#if defined(CONFIG_USER_ONLY)
+#define op_lwarx() gen_op_lwarx_raw()
#define op_stwcx() gen_op_stwcx_raw()
#else
+#define op_lwarx() (*gen_op_lwarx[ctx->mem_idx])()
+static GenOpFunc *gen_op_lwarx[] = {
+ &gen_op_lwarx_user,
+ &gen_op_lwarx_kernel,
+};
#define op_stwcx() (*gen_op_stwcx[ctx->mem_idx])()
static GenOpFunc *gen_op_stwcx[] = {
&gen_op_stwcx_user,
gen_op_load_gpr_T1(rB(ctx->opcode));
gen_op_add();
}
- op_ldst(lwz);
+ op_lwarx();
gen_op_store_T1_gpr(rD(ctx->opcode));
- gen_op_set_reservation();
}
/* stwcx. */
while (lj <= j)
gen_opc_instr_start[lj++] = 0;
tb->size = 0;
+#if 0
if (loglevel > 0) {
page_dump(logfile);
}
+#endif
} else {
tb->size = (uint32_t)ctx.nip - pc_start;
}