[Return to Library] [Contents] [Previous Chapter] [Next Section] [Index] [Help]


D    PALcode Instruction Summaries

This appendix summarizes the Privileged Architecture Library (PALcode) instructions that are required to support an Alpha AXP system.

By including the file pal.h (use #include <alpha/pal.h>) in your assembly language program, you can use the symbolic names for the PALcode instructions.


[Return to Library] [Contents] [Previous Chapter] [Next Section] [Index] [Help]


D.1    Unprivileged PALcode Instructions

Table D-1 describes the unprivileged PALcode instructions.

Table D-1: Unprivileged PALcode Instructions

Symbolic Name Number Operation and Description
PAL_bpt 0x80 Break Point Trap - switches mode to kernel mode, builds a stack frame on the kernel stack, and dispatches to the breakpoint code.
PAL_bugchk 0x81 Bugcheck - switches mode to kernel mode, builds a stack frame on the kernel stack, and dispatches to the breakpoint code.
PAL_callsys 0x83 System call - switches mode to kernel mode, builds a callsys stack frame, and dispatches to the system call code.
PAL_gentrap 0xaa Generate Trap - switches mode to kernel, builds a stack frame on the kernel stack, and dispatches to the gentrap code.
PAL_imb 0x86 I-Stream Memory Barrier - makes the I-cache coherent with main memory.
PAL_rduniq 0x9e Read Unique - returns the contents of the process unique register.
PAL_wruniq 0x9f Write Unique - writes the process unique register.


[Return to Library] [Contents] [Previous Chapter] [Previous Section] [Index] [Help]


D.2    Privileged PALcode Instructions

The privileged PALcode instructions can be called only from kernel mode. They provide an interface to control the privileged state of the machine.

Table D-2 describes the privileged PALcode instructions.

Table D-2: Privileged PALcode Instructions

Symbolic Name Number Operation and Description
PAL_halt 0x00 Halt Processor - stops normal instruction processing. Depending on the halt action setting, the processor can either enter console mode or the restart sequence.
PAL_rdps 0x36 Read Process Status - return the current process status.
PAL_rdusp 0x3a Read User Stack Pointer - reads the user stack pointer while in kernel mode and returns it.
PAL_rdval 0x32 Read System Value - reads a 64-bit per-processor value and returns it.
PAL_rtsys 0x3d Return from System Call - pops the return address, the user stack pointer, and the user global pointer from the kernel stack. It then saves the kernel stack pointer, sets mode to user mode, enables interrupts, and jumps to the address popped off the stack.
PAL_rti 0x3f Return from Trap, Fault, or Interrupt - pops certain registers from the kernel stack. If the new mode is user mode, the kernel stack is saved and the user stack is restored.
PAL_swpctx 0x30 Swap Privileged Context - saves the current process data in the current process control block (PCB). Then it switches to the PCB and loads the new process context.
PAL_swpipl 0x35 Swap IPL - returns the current IPL value and sets the IPL.
PAL_tbi 0x33 TB Invalidate - removes entries from the instruction and data translation buffers when the mapping entries change.
PAL_whami 0x3c Who Am I - returns the process number for the current processor. The processor number is in the range 0 to the number of processors minus one (0..numproc-1) that can be configured into the system.
PAL_wrfen 0x2b Write Floating-Point Enable - writes a bit to the floating-point enable register.
PAL_wrkgp 0x37 Write Kernel Global Pointer - writes the kernel global pointer internal register.
PAL_wrusp 0x38 Write User Stack Pointer - writes a value to the user stack pointer while in kernel mode.
PAL_wrval 0x31 Write System Value - writes a 64-bit per-processor value.
PAL_wrvptptr 0x2d Write Virtual Page Table Pointer - writes a pointer to the virtual page table pointer (vptptr).