static void msm_iommu_reset(void __iomem *base, int ncb) { int ctx; SET_RPUE(base, 0); SET_RPUEIE(base, 0); SET_ESRRESTORE(base, 0); SET_TBE(base, 0); SET_CR(base, 0); SET_SPDMBE(base, 0); SET_TESTBUSCR(base, 0); SET_TLBRSW(base, 0); SET_GLOBAL_TLBIALL(base, 0); SET_RPU_ACR(base, 0); SET_TLBLKCRWE(base, 1); for (ctx = 0; ctx < ncb; ctx++) { SET_BPRCOSH(base, ctx, 0); SET_BPRCISH(base, ctx, 0); SET_BPRCNSH(base, ctx, 0); SET_BPSHCFG(base, ctx, 0); SET_BPMTCFG(base, ctx, 0); SET_ACTLR(base, ctx, 0); SET_SCTLR(base, ctx, 0); SET_FSRRESTORE(base, ctx, 0); SET_TTBR0(base, ctx, 0); SET_TTBR1(base, ctx, 0); SET_TTBCR(base, ctx, 0); SET_BFBCR(base, ctx, 0); SET_PAR(base, ctx, 0); SET_FAR(base, ctx, 0); SET_TLBFLPTER(base, ctx, 0); SET_TLBSLPTER(base, ctx, 0); SET_TLBLKCR(base, ctx, 0); SET_CTX_TLBIALL(base, ctx, 0); SET_TLBIVA(base, ctx, 0); SET_PRRR(base, ctx, 0); SET_NMRR(base, ctx, 0); SET_CONTEXTIDR(base, ctx, 0); } mb(); }
void isr_external() { //PUSHALL; extern int __tk_IntFlagCntr; __uint32_t stack_ptr; __uint32_t cr; __tk_IntFlagCntr++; //__uint32_t *sipend = &SIPEND; idx = *(__int8_t *) (&SIVEC); //idx = (idx/4)-1; idx = (idx / 4); GET_GPR(1, stack_ptr); n_isr++; if (n_isr > 1) possible_starvation(); if (stack_ptr & 0x00000003) alignement_issue(); else isr_table[idx] (); #ifndef DONT_FECKUP_ON_PURPOSE //feck up un purpose to check that context is fully saved and resored SET_SPR(_CTR, 0xFFFF); SET_SPR(_XER, 0xFFFF); GET_CR(cr); SET_CR(0xFFFFFFFF); #endif if (SIPEND & 0x5555) //If internal interrupt (i.e. lvl_Intrnl_0 to lvl_Intrnl_7) SET_SPR(_EIE, 0xFF); //permit nested interrupts n_isr--; __tk_IntFlagCntr--; //POPALL; }
void foo (void) { SET_CR (2, 7); SET_CR (3, 8); SET_CR (4, 9); }