diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2007-03-22 02:02:21 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-03-26 01:11:20 -0400 |
commit | e5a2072bd48eb4a35c57a8ec45897ac2db3a3f82 (patch) | |
tree | 8ee71ecb846416925a3e5796a8f66626db0c6513 /arch/powerpc/boot/reg.h | |
parent | fae59c39e885148acf42320fe0d4ebf4cb3e9231 (diff) |
[POWERPC] New reg.h for the zImage
This patch adds a reg.h to the zImage code, with common definitions
for accessing system registers. For now, this includes functions for
retrieving the PVR and the stack pointer. This patch then uses the
new reg.h to let start() display the running stack address without
having to explicitly pass the stack as a parameter from the asm code.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/boot/reg.h')
-rw-r--r-- | arch/powerpc/boot/reg.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/powerpc/boot/reg.h b/arch/powerpc/boot/reg.h new file mode 100644 index 000000000000..d3cd9ee98afb --- /dev/null +++ b/arch/powerpc/boot/reg.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef _PPC_BOOT_REG_H | ||
2 | #define _PPC_BOOT_REG_H | ||
3 | /* | ||
4 | * Copyright 2007 Davud Gibson, IBM Corporation. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | static inline u32 mfpvr(void) | ||
13 | { | ||
14 | u32 pvr; | ||
15 | asm volatile ("mfpvr %0" : "=r"(pvr)); | ||
16 | return pvr; | ||
17 | } | ||
18 | |||
19 | register void *__stack_pointer asm("r1"); | ||
20 | #define get_sp() (__stack_pointer) | ||
21 | |||
22 | #endif /* _PPC_BOOT_REG_H */ | ||