aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/parisc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /Documentation/parisc
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'Documentation/parisc')
-rw-r--r--Documentation/parisc/00-INDEX6
-rw-r--r--Documentation/parisc/debugging39
-rw-r--r--Documentation/parisc/registers121
3 files changed, 166 insertions, 0 deletions
diff --git a/Documentation/parisc/00-INDEX b/Documentation/parisc/00-INDEX
new file mode 100644
index 000000000000..cbd060961f43
--- /dev/null
+++ b/Documentation/parisc/00-INDEX
@@ -0,0 +1,6 @@
100-INDEX
2 - this file.
3debugging
4 - some debugging hints for real-mode code
5registers
6 - current/planned usage of registers
diff --git a/Documentation/parisc/debugging b/Documentation/parisc/debugging
new file mode 100644
index 000000000000..d728594058e5
--- /dev/null
+++ b/Documentation/parisc/debugging
@@ -0,0 +1,39 @@
1okay, here are some hints for debugging the lower-level parts of
2linux/parisc.
3
4
51. Absolute addresses
6
7A lot of the assembly code currently runs in real mode, which means
8absolute addresses are used instead of virtual addresses as in the
9rest of the kernel. To translate an absolute address to a virtual
10address you can lookup in System.map, add __PAGE_OFFSET (0x10000000
11currently).
12
13
142. HPMCs
15
16When real-mode code tries to access non-existent memory, you'll get
17an HPMC instead of a kernel oops. To debug an HPMC, try to find
18the System Responder/Requestor addresses. The System Requestor
19address should match (one of the) processor HPAs (high addresses in
20the I/O range); the System Responder address is the address real-mode
21code tried to access.
22
23Typical values for the System Responder address are addresses larger
24than __PAGE_OFFSET (0x10000000) which mean a virtual address didn't
25get translated to a physical address before real-mode code tried to
26access it.
27
28
293. Q bit fun
30
31Certain, very critical code has to clear the Q bit in the PSW. What
32happens when the Q bit is cleared is the CPU does not update the
33registers interruption handlers read to find out where the machine
34was interrupted - so if you get an interruption between the instruction
35that clears the Q bit and the RFI that sets it again you don't know
36where exactly it happened. If you're lucky the IAOQ will point to the
37instrucion that cleared the Q bit, if you're not it points anywhere
38at all. Usually Q bit problems will show themselves in unexplainable
39system hangs or running off the end of physical memory.
diff --git a/Documentation/parisc/registers b/Documentation/parisc/registers
new file mode 100644
index 000000000000..dd3caddd1ad9
--- /dev/null
+++ b/Documentation/parisc/registers
@@ -0,0 +1,121 @@
1Register Usage for Linux/PA-RISC
2
3[ an asterisk is used for planned usage which is currently unimplemented ]
4
5 General Registers as specified by ABI
6
7 Control Registers
8
9CR 0 (Recovery Counter) used for ptrace
10CR 1-CR 7(undefined) unused
11CR 8 (Protection ID) per-process value*
12CR 9, 12, 13 (PIDS) unused
13CR10 (CCR) lazy FPU saving*
14CR11 as specified by ABI (SAR)
15CR14 (interruption vector) initialized to fault_vector
16CR15 (EIEM) initialized to all ones*
17CR16 (Interval Timer) read for cycle count/write starts Interval Tmr
18CR17-CR22 interruption parameters
19CR19 Interrupt Instruction Register
20CR20 Interrupt Space Register
21CR21 Interrupt Offset Register
22CR22 Interrupt PSW
23CR23 (EIRR) read for pending interrupts/write clears bits
24CR24 (TR 0) Kernel Space Page Directory Pointer
25CR25 (TR 1) User Space Page Directory Pointer
26CR26 (TR 2) not used
27CR27 (TR 3) Thread descriptor pointer
28CR28 (TR 4) not used
29CR29 (TR 5) not used
30CR30 (TR 6) current / 0
31CR31 (TR 7) Temporary register, used in various places
32
33 Space Registers (kernel mode)
34
35SR0 temporary space register
36SR4-SR7 set to 0
37SR1 temporary space register
38SR2 kernel should not clobber this
39SR3 used for userspace accesses (current process)
40
41 Space Registers (user mode)
42
43SR0 temporary space register
44SR1 temporary space register
45SR2 holds space of linux gateway page
46SR3 holds user address space value while in kernel
47SR4-SR7 Defines short address space for user/kernel
48
49
50 Processor Status Word
51
52W (64-bit addresses) 0
53E (Little-endian) 0
54S (Secure Interval Timer) 0
55T (Taken Branch Trap) 0
56H (Higher-privilege trap) 0
57L (Lower-privilege trap) 0
58N (Nullify next instruction) used by C code
59X (Data memory break disable) 0
60B (Taken Branch) used by C code
61C (code address translation) 1, 0 while executing real-mode code
62V (divide step correction) used by C code
63M (HPMC mask) 0, 1 while executing HPMC handler*
64C/B (carry/borrow bits) used by C code
65O (ordered references) 1*
66F (performance monitor) 0
67R (Recovery Counter trap) 0
68Q (collect interruption state) 1 (0 in code directly preceding an rfi)
69P (Protection Identifiers) 1*
70D (Data address translation) 1, 0 while executing real-mode code
71I (external interrupt mask) used by cli()/sti() macros
72
73 "Invisible" Registers
74
75PSW default W value 0
76PSW default E value 0
77Shadow Registers used by interruption handler code
78TOC enable bit 1
79
80=========================================================================
81Register usage notes, originally from John Marvin, with some additional
82notes from Randolph Chung.
83
84For the general registers:
85
86r1,r2,r19-r26,r28,r29 & r31 can be used without saving them first. And of
87course, you need to save them if you care about them, before calling
88another procedure. Some of the above registers do have special meanings
89that you should be aware of:
90
91 r1: The addil instruction is hardwired to place its result in r1,
92 so if you use that instruction be aware of that.
93
94 r2: This is the return pointer. In general you don't want to
95 use this, since you need the pointer to get back to your
96 caller. However, it is grouped with this set of registers
97 since the caller can't rely on the value being the same
98 when you return, i.e. you can copy r2 to another register
99 and return through that register after trashing r2, and
100 that should not cause a problem for the calling routine.
101
102 r19-r22: these are generally regarded as temporary registers.
103 Note that in 64 bit they are arg7-arg4.
104
105 r23-r26: these are arg3-arg0, i.e. you can use them if you
106 don't care about the values that were passed in anymore.
107
108 r28,r29: are ret0 and ret1. They are what you pass return values
109 in. r28 is the primary return. When returning small structures
110 r29 may also be used to pass data back to the caller.
111
112 r30: stack pointer
113
114 r31: the ble instruction puts the return pointer in here.
115
116
117r3-r18,r27,r30 need to be saved and restored. r3-r18 are just
118 general purpose registers. r27 is the data pointer, and is
119 used to make references to global variables easier. r30 is
120 the stack pointer.
121