registers 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. Register Usage for Linux/PA-RISC
  2. [ an asterisk is used for planned usage which is currently unimplemented ]
  3. General Registers as specified by ABI
  4. Control Registers
  5. CR 0 (Recovery Counter) used for ptrace
  6. CR 1-CR 7(undefined) unused
  7. CR 8 (Protection ID) per-process value*
  8. CR 9, 12, 13 (PIDS) unused
  9. CR10 (CCR) lazy FPU saving*
  10. CR11 as specified by ABI (SAR)
  11. CR14 (interruption vector) initialized to fault_vector
  12. CR15 (EIEM) initialized to all ones*
  13. CR16 (Interval Timer) read for cycle count/write starts Interval Tmr
  14. CR17-CR22 interruption parameters
  15. CR19 Interrupt Instruction Register
  16. CR20 Interrupt Space Register
  17. CR21 Interrupt Offset Register
  18. CR22 Interrupt PSW
  19. CR23 (EIRR) read for pending interrupts/write clears bits
  20. CR24 (TR 0) Kernel Space Page Directory Pointer
  21. CR25 (TR 1) User Space Page Directory Pointer
  22. CR26 (TR 2) not used
  23. CR27 (TR 3) Thread descriptor pointer
  24. CR28 (TR 4) not used
  25. CR29 (TR 5) not used
  26. CR30 (TR 6) current / 0
  27. CR31 (TR 7) Temporary register, used in various places
  28. Space Registers (kernel mode)
  29. SR0 temporary space register
  30. SR4-SR7 set to 0
  31. SR1 temporary space register
  32. SR2 kernel should not clobber this
  33. SR3 used for userspace accesses (current process)
  34. Space Registers (user mode)
  35. SR0 temporary space register
  36. SR1 temporary space register
  37. SR2 holds space of linux gateway page
  38. SR3 holds user address space value while in kernel
  39. SR4-SR7 Defines short address space for user/kernel
  40. Processor Status Word
  41. W (64-bit addresses) 0
  42. E (Little-endian) 0
  43. S (Secure Interval Timer) 0
  44. T (Taken Branch Trap) 0
  45. H (Higher-privilege trap) 0
  46. L (Lower-privilege trap) 0
  47. N (Nullify next instruction) used by C code
  48. X (Data memory break disable) 0
  49. B (Taken Branch) used by C code
  50. C (code address translation) 1, 0 while executing real-mode code
  51. V (divide step correction) used by C code
  52. M (HPMC mask) 0, 1 while executing HPMC handler*
  53. C/B (carry/borrow bits) used by C code
  54. O (ordered references) 1*
  55. F (performance monitor) 0
  56. R (Recovery Counter trap) 0
  57. Q (collect interruption state) 1 (0 in code directly preceding an rfi)
  58. P (Protection Identifiers) 1*
  59. D (Data address translation) 1, 0 while executing real-mode code
  60. I (external interrupt mask) used by cli()/sti() macros
  61. "Invisible" Registers
  62. PSW default W value 0
  63. PSW default E value 0
  64. Shadow Registers used by interruption handler code
  65. TOC enable bit 1
  66. =========================================================================
  67. The PA-RISC architecture defines 7 registers as "shadow registers".
  68. Those are used in RETURN FROM INTERRUPTION AND RESTORE instruction to reduce
  69. the state save and restore time by eliminating the need for general register
  70. (GR) saves and restores in interruption handlers.
  71. Shadow registers are the GRs 1, 8, 9, 16, 17, 24, and 25.
  72. =========================================================================
  73. Register usage notes, originally from John Marvin, with some additional
  74. notes from Randolph Chung.
  75. For the general registers:
  76. r1,r2,r19-r26,r28,r29 & r31 can be used without saving them first. And of
  77. course, you need to save them if you care about them, before calling
  78. another procedure. Some of the above registers do have special meanings
  79. that you should be aware of:
  80. r1: The addil instruction is hardwired to place its result in r1,
  81. so if you use that instruction be aware of that.
  82. r2: This is the return pointer. In general you don't want to
  83. use this, since you need the pointer to get back to your
  84. caller. However, it is grouped with this set of registers
  85. since the caller can't rely on the value being the same
  86. when you return, i.e. you can copy r2 to another register
  87. and return through that register after trashing r2, and
  88. that should not cause a problem for the calling routine.
  89. r19-r22: these are generally regarded as temporary registers.
  90. Note that in 64 bit they are arg7-arg4.
  91. r23-r26: these are arg3-arg0, i.e. you can use them if you
  92. don't care about the values that were passed in anymore.
  93. r28,r29: are ret0 and ret1. They are what you pass return values
  94. in. r28 is the primary return. When returning small structures
  95. r29 may also be used to pass data back to the caller.
  96. r30: stack pointer
  97. r31: the ble instruction puts the return pointer in here.
  98. r3-r18,r27,r30 need to be saved and restored. r3-r18 are just
  99. general purpose registers. r27 is the data pointer, and is
  100. used to make references to global variables easier. r30 is
  101. the stack pointer.