Module Name:    src
Committed By:   matt
Date:           Sun Oct 21 15:46:00 UTC 2012

Modified Files:
        src/sys/arch/arm/arm32: genassym.cf
        src/sys/arch/arm/include/arm32: frame.h

Log Message:
Change to use symbolic constants from assym.h and fix a typo in a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/arm/arm32/genassym.cf
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/arm/include/arm32/frame.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/arm32/genassym.cf
diff -u src/sys/arch/arm/arm32/genassym.cf:1.55 src/sys/arch/arm/arm32/genassym.cf:1.56
--- src/sys/arch/arm/arm32/genassym.cf:1.55	Sun Oct 21 09:25:16 2012
+++ src/sys/arch/arm/arm32/genassym.cf	Sun Oct 21 15:46:00 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.55 2012/10/21 09:25:16 matt Exp $
+#	$NetBSD: genassym.cf,v 1.56 2012/10/21 15:46:00 matt Exp $
 
 # Copyright (c) 1982, 1990 The Regents of the University of California.
 # All rights reserved.
@@ -154,6 +154,8 @@ define	TF_R0			offsetof(struct trapframe
 define	TF_R4			offsetof(struct trapframe, tf_r4)
 define	TF_R6			offsetof(struct trapframe, tf_r6)
 define	TF_R10			offsetof(struct trapframe, tf_r10)
+define	TF_USR_SP		offsetof(struct trapframe, tf_usr_sp)
+define	TF_SVC_SP		offsetof(struct trapframe, tf_svc_sp)
 define	TF_PC			offsetof(struct trapframe, tf_pc)
 
 define	PROCSIZE		sizeof(struct proc)

Index: src/sys/arch/arm/include/arm32/frame.h
diff -u src/sys/arch/arm/include/arm32/frame.h:1.34 src/sys/arch/arm/include/arm32/frame.h:1.35
--- src/sys/arch/arm/include/arm32/frame.h:1.34	Sun Oct 21 09:25:16 2012
+++ src/sys/arch/arm/include/arm32/frame.h	Sun Oct 21 15:46:00 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.34 2012/10/21 09:25:16 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.35 2012/10/21 15:46:00 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -323,7 +323,7 @@ LOCK_CAS_DEBUG_LOCALS
  */
 #define	PUSHUSERREGS							   \
 	stmia	sp, {r0-r12};		/* Push the user mode registers */ \
-	add	r0, sp, #(4*13);	/* Adjust the stack pointer */	   \
+	add	r0, sp, #(TF_USR_SP-TF_R0); /* Adjust the stack pointer */ \
 	stmia	r0, {r13-r14}^		/* Push the user mode registers */
 #else
 #define	PUSHUSERREGS							   \
@@ -332,11 +332,11 @@ LOCK_CAS_DEBUG_LOCALS
 
 #define PUSHFRAME							   \
 	str	lr, [sp, #-4]!;		/* Push the return address */	   \
-	sub	sp, sp, #(4*17);	/* Adjust the stack pointer */	   \
+	sub	sp, sp, #(TF_PC-TF_R0);	/* Adjust the stack pointer */	   \
 	PUSHUSERREGS;			/* Push the user mode registers */ \
 	mov     r0, r0;                 /* NOP for previous instruction */ \
 	mrs	r0, spsr_all;		/* Get the SPSR */		   \
-	str	r0, [sp, #-8]!		/* Push the SPSR on the stack */
+	str	r0, [sp, #-TF_R0]!	/* Push the SPSR on the stack */
 
 /*
  * Push a minimal trapframe so we can dispatch an interrupt from the
@@ -347,7 +347,7 @@ LOCK_CAS_DEBUG_LOCALS
 #define PUSHIDLEFRAME							   \
 	str	lr, [sp, #-4]!;		/* save SVC32 lr */		   \
 	str	r6, [sp, #(TF_R6-TF_PC)]!; /* save callee-saved r6 */	   \
-	str	r4, [sp, #(TF_R4-TF_R6)]!; /* save callee-saved r6 */	   \
+	str	r4, [sp, #(TF_R4-TF_R6)]!; /* save callee-saved r4 */	   \
 	mrs	r0, cpsr_all;		/* Get the CPSR */		   \
 	str	r0, [sp, #(-TF_R4)]!	/* Push the CPSR on the stack */
 
@@ -357,11 +357,11 @@ LOCK_CAS_DEBUG_LOCALS
  */
 
 #define PULLFRAME							   \
-	ldr     r0, [sp], #0x0008;      /* Pop the SPSR from stack */	   \
+	ldr     r0, [sp], #TF_R0;	/* Pop the SPSR from stack */	   \
 	msr     spsr_all, r0;						   \
 	ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
 	mov     r0, r0;                 /* NOP for previous instruction */ \
-	add	sp, sp, #(4*17);	/* Adjust the stack pointer */	   \
+	add	sp, sp, #(TF_PC-TF_R0);	/* Adjust the stack pointer */	   \
  	ldr	lr, [sp], #0x0004	/* Pop the return address */
 
 #define PULLIDLEFRAME							   \
@@ -404,11 +404,11 @@ LOCK_CAS_DEBUG_LOCALS
 	mov	sp, r2;			/* Keep stack aligned */	   \
 	msr     spsr_all, r3;		/* Restore correct spsr */	   \
 	ldmdb	r1, {r0-r3};		/* Restore 4 regs from xxx mode */ \
-	sub	sp, sp, #(4*15);	/* Adjust the stack pointer */	   \
+	sub	sp, sp, #(TF_SVC_SP-TF_R0); /* Adjust the stack pointer */ \
 	PUSHUSERREGS;			/* Push the user mode registers */ \
 	mov     r0, r0;                 /* NOP for previous instruction */ \
 	mrs	r0, spsr_all;		/* Get the SPSR */		   \
-	str	r0, [sp, #-8]!		/* Push the SPSR onto the stack */
+	str	r0, [sp, #-TF_R0]!	/* Push the SPSR onto the stack */
 
 /*
  * PULLFRAMEFROMSVCANDEXIT - macro to pull a trap frame from the stack
@@ -422,7 +422,7 @@ LOCK_CAS_DEBUG_LOCALS
 	msr     spsr_all, r0;		/* restore SPSR */		   \
 	ldmia   sp, {r0-r14}^;		/* Restore registers (usr mode) */ \
 	mov     r0, r0;	  		/* NOP for previous instruction */ \
-	add	sp, sp, #(4*15);	/* Adjust the stack pointer */	   \
+	add	sp, sp, #(TF_SVC_SP-TF_R0); /* Adjust the stack pointer */ \
 	ldmia	sp, {sp, lr, pc}^	/* Restore lr and exit */
 
 #endif /* _LOCORE */

Reply via email to