Ejemplo n.º 1
0
//Rebuild sorted interrupt id table (priorities were updated)
void SIIDRebuild(void)
{
	u32 cnt=0;
	u32 vpend=interrupt_vpend;
	u32 vmask=interrupt_vmask;
	interrupt_vpend=0;
	interrupt_vmask=0x00000000;
	//rebuild interrupt table
	for (u32 ilevel=0;ilevel<16;ilevel++)
	{
		for (u32 isrc=0;isrc<28;isrc++)
      {
         if (GET_PRIO_LEVEL(InterruptSourceList[isrc]) != ilevel)
            continue;

         InterruptEnvId[cnt]=InterruptSourceList[isrc].IntEvnCode;
         u32 p=InterruptBit[isrc]&vpend;
         u32 m=InterruptBit[isrc]&vmask;
         InterruptBit[isrc]=1<<cnt;
         if (p)
            interrupt_vpend|=InterruptBit[isrc];
         if (m)
            interrupt_vmask|=InterruptBit[isrc];
         cnt++;
      }

		InterruptLevelBit[ilevel]=(1<<cnt)-1;
	}

	SRdecode();
}
Ejemplo n.º 2
0
//called when sr is changed and we must check for reg banks ect.. , returns true if interrupts got 
bool UpdateSR()
{
	if (sr.MD)
	{
		if (old_sr.RB !=sr.RB)
			ChangeGPR();//bank change
	}
	else
	{
		if (sr.RB)
		{
			log("UpdateSR MD=0;RB=1 , this must not happen\n");
			sr.RB =0;//error - must allways be 0
			if (old_sr.RB)
				ChangeGPR();//switch
		}
		else
		{
			if (old_sr.RB)
				ChangeGPR();//switch
		}
	}
/*
	if ((old_sr.IMASK!=0xF) && (sr.IMASK==0xF))
	{
		//log("Interrupts disabled  , pc=0x%X\n",pc);
	}

	if ((old_sr.IMASK==0xF) && (sr.IMASK!=0xF))
	{
		//log("Interrupts enabled  , pc=0x%X\n",pc);
	}
	
	bool rv=old_sr.IMASK > sr.IMASK;
	rv|=old_sr.BL==1 && sr.BL==0; 
	if (sr.IMASK==0xF)
		rv=false;
*/
	old_sr.m_full=sr.m_full;
	
	return SRdecode();
}