12.8 PAL Integration

<< Click to Display Table of Contents >>

Navigation:  ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 12 – AlphaCPU Core >

12.8 PAL Integration

AlphaCPU provides two overloads of enterPalMode() — one for simple vector+faultPC entry, one for classified entry with PalEntryReason. Both follow the same core sequence: saveContext(), set EXC_ADDR = faultPC, set PC = entryPC | 0x1, set IPL = 7, set CM = KERNEL, activate shadow registers (for CALL_PAL), flush pipeline.

 

executeREI() handles PAL exit: restoreContext() performs full register-context vector copy, return PC is extracted from restored state, slot.reiTarget and slot.pcModified direct the pipeline redirect, and flushPipeline() restarts execution at the restored PC.

 

commitPalReturnValue(PalResult) writes the PAL return value to the destination register after PAL call completion. contextSwitch(cpuId) breaks the LL/SC reservation for the specified CPU — the minimal action required for a context switch.

 

Both enterPalMode() and executeREI() are AXP_HOT AXP_ALWAYS_INLINE — they are on the critical path for every exception, interrupt, and PAL call.

 

See Also: Chapter 8 - PAL and Privileged Boundary; 8.4 CALL_PAL - Entering the Privileged Boundary (PalBox::enterPal); 8.9 HW_REI - Exiting PAL Mode .