8.5 PAL Vector Dispatch

<< Click to Display Table of Contents >>

Navigation:  ASA-EMulatR Reference Guide > Introduction > Architecture Overview > Chapter 8 - PAL and Privileged Boundary >

8.5 PAL Vector Dispatch

PAL entry vectors are computed differently for exceptions/interrupts (direct vectors) and CALL_PAL instructions (calculated offsets).

 

8.5.1 EV6 Hardware Exception Vectors

 

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

 

RESET = 0x0000 // Reset/wakeup

MCHK = 0x0080 // Machine check

ARITH = 0x0100 // Arithmetic exception

INTERRUPT = 0x0180 // Interrupts (HW/SW/AST)

DTB_MISS_SINGLE = 0x0200 // Single-level DTB miss

DTB_MISS_DOUBLE = 0x0280 // Double (3-level walk) DTB miss

ITB_MISS = 0x0300 // Instruction TB miss

ITB_ACV = 0x0380 // I-stream access violation

DTB_MISS_NATIVE = 0x0400 // DTB miss (native mode)

UNALIGN = 0x0480 // Unaligned access

OPCDEC = 0x0500 // Illegal/privileged opcode

FEN = 0x0580 // Floating-point disabled

 

For exceptions and interrupts, the entry PC is PAL_BASE + vector offset, passed directly to enterPal() as the vectorOrSelector parameter.

 


 

8.5.2 CALL_PAL Vector Calculation

 

CALL_PAL vectors are calculated, not enumerated. The function selector from the instruction's low bits determines the entry point:

 

Privileged CALL_PAL (functions 0x00–0x3F): entry = PAL_BASE + 0x2000 + ([5:0] << 6)

Unprivileged CALL_PAL (functions 0x80–0xBF): entry = 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 (function 0x00) → PAL_BASE + 0x2000. CALL_PAL CSERVE (function 0x09) → PAL_BASE + 0x2240. CALL_PAL CALLSYS (function 0x83) → PAL_BASE + 0x30C0.

 

See Also: palLib_EV6/PalVectorId_refined.h; Alpha 21264 Hardware Reference Manual, Table 5-8.