20.3 CALL_PAL Dispatch and Vector Calculation

<< Click to Display Table of Contents >>

Navigation:  ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 20 – Boot Sequence, PAL, and SRM Integration >

20.3 CALL_PAL Dispatch and Vector Calculation

20.3.1 CALL_PAL Instruction

 

CALL_PAL is the only architecturally valid entry point into PAL mode (aside from exception/interrupt vectors). It encodes a PAL function selector in bits [25:0], does not behave like a normal subroutine call, and implies full serialization (MemoryBarrierKind::PAL = 0xFFFF). Before PAL code begins: all prior instructions must complete, write buffers must be drained, LL/SC reservations must be cleared, speculative instructions must be discarded, interrupts must be masked (IPL raised to 7), and the pipeline must be flushed.

 


 

20.3.2 Vector Calculation

 

PAL entry vectors are computed differently for exceptions/interrupts (direct vectors from PalVectorTable) and CALL_PAL instructions (calculated offsets from PAL_BASE):

 

Category

Function Range

Vector Formula

Privileged CALL_PAL

0x00–0x3F (kernel only)

PAL_BASE + 0x2000 + ([5:0] << 6)

Unprivileged CALL_PAL

0x80–0xBF (any mode)

PAL_BASE + 0x3000 + ([5:0] << 6)

 

This produces 128 possible entry points spaced 64 bytes apart (enough for a short PAL dispatch stub per function). The computeCallPalEntry() method performs this calculation. Examples: CALL_PAL HALT (0x00) → PAL_BASE + 0x2000, CALL_PAL CSERVE (0x09) → PAL_BASE + 0x2240, CALL_PAL CALLSYS (0x83) → PAL_BASE + 0x30C0.

 


 

20.3.3 EV6 Exception Vectors

 

Exception and interrupt vectors are fixed offsets from PAL_BASE, defined by PalVectorId_EV6 (Alpha 21264 Hardware Reference Manual, Table 5-8):

 

Vector

Offset

RESET

0x0000

MCHK (Machine Check)

0x0080

ARITH (Arithmetic)

0x0100

INTERRUPT (HW/SW/AST)

0x0180

DTB_MISS_SINGLE

0x0200

DTB_MISS_DOUBLE

0x0280

ITB_MISS

0x0300

ITB_ACV

0x0380

DTB_MISS_NATIVE

0x0400

UNALIGN

0x0480

OPCDEC

0x0500

FEN

0x0580

 

For exceptions and interrupts, the entry PC is PAL_BASE + vectorOffset, passed directly to enterPal().

 

See Also: palLib_EV6/PalVectorId_refined.h; palLib_EV6/PalVectorTable_final.h; 8.5 PAL Vector Dispatch; Alpha 21264 Hardware Reference Manual, Table 5-8.