]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: pt_regs offsets
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Tue, 26 Apr 2005 14:18:59 +0000 (15:18 +0100)
committerRussell King <rmk@dyn-67.arm.linux.org.uk>
Tue, 26 Apr 2005 14:18:59 +0000 (15:18 +0100)
Generate pt_regs S_xx offsets from the structure itself instead
of #defining them.

Signed-off-by: Russell King <rmk@arm.linux.org.uk>
arch/arm/kernel/asm-offsets.c
arch/arm/kernel/entry-common.S
arch/arm/kernel/entry-header.S

index 99d43259ff8917a4e6cd8c6f7b1a7e7761c5e0e3..c1ff4d1f1bfde619616141830a46d3a3cfe4bdc0 100644 (file)
@@ -64,6 +64,26 @@ int main(void)
   DEFINE(TI_VFPSTATE,          offsetof(struct thread_info, vfpstate));
   DEFINE(TI_IWMMXT_STATE,      (offsetof(struct thread_info, fpstate)+4)&~7);
   BLANK();
+  DEFINE(S_R0,                 offsetof(struct pt_regs, ARM_r0));
+  DEFINE(S_R1,                 offsetof(struct pt_regs, ARM_r1));
+  DEFINE(S_R2,                 offsetof(struct pt_regs, ARM_r2));
+  DEFINE(S_R3,                 offsetof(struct pt_regs, ARM_r3));
+  DEFINE(S_R4,                 offsetof(struct pt_regs, ARM_r4));
+  DEFINE(S_R5,                 offsetof(struct pt_regs, ARM_r5));
+  DEFINE(S_R6,                 offsetof(struct pt_regs, ARM_r6));
+  DEFINE(S_R7,                 offsetof(struct pt_regs, ARM_r7));
+  DEFINE(S_R8,                 offsetof(struct pt_regs, ARM_r8));
+  DEFINE(S_R9,                 offsetof(struct pt_regs, ARM_r9));
+  DEFINE(S_R10,                        offsetof(struct pt_regs, ARM_r10));
+  DEFINE(S_FP,                 offsetof(struct pt_regs, ARM_fp));
+  DEFINE(S_IP,                 offsetof(struct pt_regs, ARM_ip));
+  DEFINE(S_SP,                 offsetof(struct pt_regs, ARM_sp));
+  DEFINE(S_LR,                 offsetof(struct pt_regs, ARM_lr));
+  DEFINE(S_PC,                 offsetof(struct pt_regs, ARM_pc));
+  DEFINE(S_PSR,                        offsetof(struct pt_regs, ARM_cpsr));
+  DEFINE(S_OLD_R0,             offsetof(struct pt_regs, ARM_ORIG_r0));
+  DEFINE(S_FRAME_SIZE,         sizeof(struct pt_regs));
+  BLANK();
 #if __LINUX_ARM_ARCH__ >= 6
   DEFINE(MM_CONTEXT_ID,                offsetof(struct mm_struct, context.id));
   BLANK();
index 0cd9f7bcaad7c09ddacc52f844edfe94d1074bf4..55201db0f144418455189f9f7ee8e7cc1cb17fe7 100644 (file)
 
 #include "entry-header.S"
 
-/* 
- * We rely on the fact that R0 is at the bottom of the stack (due to
- * slow/fast restore user regs).
- */
-#if S_R0 != 0
-#error "Please fix"
-#endif
 
        .align  5
 /*
index 109f4f10d314db798fe1e2089f4515cca87523e4..9d4d286d3808520756aded403e7e973ebda65e78 100644 (file)
 #define ARMSWI_OFFSET  0x000f0000
 
 @
-@ Stack format (ensured by USER_* and SVC_*)
+@ Most of the stack format comes from struct pt_regs, but with
+@ the addition of 8 bytes for storing syscall args 5 and 6.
 @
-#define S_FRAME_SIZE   72
-#define S_OLD_R0       68
-#define S_PSR          64
-
-#define S_PC           60
-#define S_LR           56
-#define S_SP           52
-#define S_IP           48
-#define S_FP           44
-#define S_R10          40
-#define S_R9           36
-#define S_R8           32
-#define S_R7           28
-#define S_R6           24
-#define S_R5           20
-#define S_R4           16
-#define S_R3           12
-#define S_R2           8
-#define S_R1           4
-#define S_R0           0
 #define S_OFF          8
 
+/* 
+ * The SWI code relies on the fact that R0 is at the bottom of the stack
+ * (due to slow/fast restore user regs).
+ */
+#if S_R0 != 0
+#error "Please fix"
+#endif
+
 #if __LINUX_ARM_ARCH__ >= 6
        .macro  disable_irq
        cpsid   i