Thread (4 messages) flat view 4 messages, 3 authors, 2003-07-15

Re: ppc405gp and GCC register usage

From: Paul Mackerras <hidden>
Date: 2003-07-15 10:51:18

Juergen Beisert writes:
does someone know, which register I can use in my own assembler routines
without disturbing code generated by gcc (in kernel space)? I did not found
any spec which registers gcc use, yet. Is such a document available?
It's defined in the PowerPC ELF ABI document.  Basically a procedure
can use r0 and r3 - r12 without saving and restoring them.  r1 is the
stack pointer, r2 is used by the kernel to hold the pointer to the
task_struct for the current task.  r13 - r31 have to be preserved so
your procedure has to save and restore them if it wants to use them.
Similarly your procedure has to preserve cr2 - cr4 but can use cr0,
cr1, cr5 - cr7, lr, ctr, xer without saving & restoring them.

Unfortunately the PowerPC ELF ABI specification doesn't really have
anyone looking after it at the moment, so I don't know of a public
site where you can get it.  I could send you the pdf if you are
interested.

Paul.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help