static void pseq_mmu_reg_handler( void *pseq_obj, void *ptr,
uint64 regindex, uint64 newcontext )
{
#ifdef DEBUG_PSEQ
DEBUG_OUT("pseq_t:mmu_reg_handler BEGIN\n");
#endif
int PSEQ_ID;
pseq_t *pseq = (pseq_t *) pseq_obj;
uint32 context_as_int = (uint32) newcontext;
//We need to get the logical processor number, to pass in to contextSwitch:
uint32 logical_proc_num = SIM_get_current_proc_no() % CONFIG_LOGICAL_PER_PHY_PROC;
PSEQ_ID=SIM_get_current_proc_no()/CONFIG_LOGICAL_PER_PHY_PROC;
ASSERT(logical_proc_num < CONFIG_LOGICAL_PER_PHY_PROC);
// CTXT_SWITCH
if (PSEQ_ID == pseq->getID())
pseq->contextSwitch( context_as_int, logical_proc_num );
#ifdef DEBUG_PSEQ
DEBUG_OUT("pseq_t:mmu_reg_handler END proc[%d] \n", logical_proc_num);
#endif
}