Exemple #1
0
void
ARMul_STC (ARMul_State * state, ARMword instr, ARMword address)
{
    unsigned cpab;
    ARMword data;

    UNDEF_LSCPCBaseWb;

    if (! CP_ACCESS_ALLOWED (state, CPNum))
    {
        ARMul_UndefInstr (state, instr);
        return;
    }

    if (ADDREXCEPT (address) || VECTORACCESS (address))
        INTERNALABORT (address);

    cpab = (state->STC[CPNum]) (state, ARMul_FIRST, instr, &data);
    while (cpab == ARMul_BUSY)
    {
        ARMul_Icycles (state, 1, 0);
        if (IntPending (state))
        {
            cpab = (state->STC[CPNum]) (state, ARMul_INTERRUPT, instr, 0);
            return;
        }
        else
            cpab = (state->STC[CPNum]) (state, ARMul_BUSY, instr, &data);
    }

    if (cpab == ARMul_CANT)
    {
        CPTAKEABORT;
        return;
    }
#ifndef MODE32
    if (ADDREXCEPT (address) || VECTORACCESS (address))
        INTERNALABORT (address);
#endif
    BUSUSEDINCPCN;
    if (BIT (21))
        LSBase = state->Base;
    cpab = (state->STC[CPNum]) (state, ARMul_DATA, instr, &data);
    ARMul_StoreWordN (state, address, data);

    while (cpab == ARMul_INC)
    {
        address += 4;
        cpab = (state->STC[CPNum]) (state, ARMul_DATA, instr, &data);
        ARMul_StoreWordN (state, address, data);
    }

    if (state->abortSig || state->Aborted)
        TAKEABORT;
}
Exemple #2
0
void ARMul_LDC(ARMul_State *state,ARMword instr,ARMword address)
{unsigned cpab ;
 ARMword data ;

 UNDEF_LSCPCBaseWb ;
 if (ADDREXCEPT(address)) {
    INTERNALABORT(address) ;
    }
 cpab = (state->LDC[CPNum])(state,ARMul_FIRST,instr,0) ;
 while (cpab == ARMul_BUSY) {
    ARMul_Icycles(state,1,0) ;
    if (IntPending(state)) {
       cpab = (state->LDC[CPNum])(state,ARMul_INTERRUPT,instr,0) ;
       return ;
       }
    else
       cpab = (state->LDC[CPNum])(state,ARMul_BUSY,instr,0) ;
    }
 if (cpab == ARMul_CANT) {
    CPTAKEABORT ;
    return ;
    }
 cpab = (state->LDC[CPNum])(state,ARMul_TRANSFER,instr,0) ;
 data = ARMul_LoadWordN(state,address) ;
 BUSUSEDINCPCN ;
 if (BIT(21))
    LSBase = state->Base ;
 cpab = (state->LDC[CPNum])(state,ARMul_DATA,instr,data) ;
 while (cpab == ARMul_INC) {
    address += 4 ;
    data = ARMul_LoadWordN(state,address) ;
    cpab = (state->LDC[CPNum])(state,ARMul_DATA,instr,data) ;
    }
 if (state->abortSig || state->Aborted) {
    TAKEABORT ;
    }
 }
Exemple #3
0
void
ARMul_STC (ARMul_State * state, ARMword instr, ARMword address)
{
	unsigned cpab;
	ARMword data;

	UNDEF_LSCPCBaseWb;

	//printf("SKYEYE ARMul_STC, CPnum is %x, instr %x, addr %x\n",CPNum, instr, address);
	/*chy 2004-05-23 should update this function in the future,should concern dataabort */
//  skyeye_instr_debug=0;printf("SKYEYE  debug end!!!!\n");
// chy 2004-05-25 , fix it now,so needn't printf 
//  printf("SKYEYE ARMul_STC, should update this function!!!!!\n");

	//exit(-1);
	if (!CP_ACCESS_ALLOWED (state, CPNum)) {
		/* 
		   printf
		   ("SKYEYE ARMul_STC,NOT ALLOW, undefinstr,  CPnum is %x, instr %x, addr %x\n",
		   CPNum, instr, address);
		 */
		ARMul_UndefInstr (state, instr);
		return;
	}

	if (ADDREXCEPT (address) || VECTORACCESS (address))
		INTERNALABORT (address);

	cpab = (state->STC[CPNum]) (state, ARMul_FIRST, instr, &data);
	while (cpab == ARMul_BUSY) {
		ARMul_Icycles (state, 1, 0);
		if (IntPending (state)) {
			cpab = (state->STC[CPNum]) (state, ARMul_INTERRUPT,
						    instr, 0);
			return;
		}
		else
			cpab = (state->STC[CPNum]) (state, ARMul_BUSY, instr,
						    &data);
	}

	if (cpab == ARMul_CANT) {
		/* 
		   printf
		   ("SKYEYE ARMul_STC,CANT, undefinstr,  CPnum is %x, instr %x, addr %x\n",
		   CPNum, instr, address);
		 */
		CPTAKEABORT;
		return;
	}
#ifndef MODE32
	if (ADDREXCEPT (address) || VECTORACCESS (address))
		INTERNALABORT (address);
#endif
	BUSUSEDINCPCN;
//chy 2004-05-25
/*
  if (BIT (21))
    LSBase = state->Base;
*/
	cpab = (state->STC[CPNum]) (state, ARMul_DATA, instr, &data);
	ARMul_StoreWordN (state, address, data);
	//chy 2004-05-25      
	if (state->abortSig || state->Aborted)
		goto L_stc_takeabort;

	while (cpab == ARMul_INC) {
		address += 4;
		cpab = (state->STC[CPNum]) (state, ARMul_DATA, instr, &data);
		ARMul_StoreWordN (state, address, data);
		//chy 2004-05-25  
		if (state->abortSig || state->Aborted)
			goto L_stc_takeabort;
	}
//chy 2004-05-25
      L_stc_takeabort:
	if (BIT (21)) {
		if (!
		    ((state->abortSig || state->Aborted)
		     && state->lateabtSig == LOW))
			LSBase = state->Base;
	}

	if (state->abortSig || state->Aborted)
		TAKEABORT;
}