Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arm/include/arm32 Only do the SA110 user register s...
details: https://anonhg.NetBSD.org/src/rev/37565c83f216
branches: trunk
changeset: 780615:37565c83f216
user: matt <matt%NetBSD.org@localhost>
date: Tue Jul 31 08:01:30 2012 +0000
description:
Only do the SA110 user register save workaround on kernel using SA110s.
diffstat:
sys/arch/arm/include/arm32/frame.h | 24 ++++++++++++++++--------
1 files changed, 16 insertions(+), 8 deletions(-)
diffs (59 lines):
diff -r 90b1be5d0dc4 -r 37565c83f216 sys/arch/arm/include/arm32/frame.h
--- a/sys/arch/arm/include/arm32/frame.h Tue Jul 31 07:49:45 2012 +0000
+++ b/sys/arch/arm/include/arm32/frame.h Tue Jul 31 08:01:30 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: frame.h,v 1.25 2012/07/31 07:23:16 matt Exp $ */
+/* $NetBSD: frame.h,v 1.26 2012/07/31 08:01:30 matt Exp $ */
/*
* Copyright (c) 1994-1997 Mark Brinicombe.
@@ -117,6 +117,7 @@
#include "opt_multiprocessor.h"
#include "opt_cpuoptions.h"
#include "opt_arm_debug.h"
+#include "opt_cputypes.h"
#include <machine/cpu.h>
@@ -305,17 +306,26 @@
/*
* PUSHFRAME - macro to push a trap frame on the stack in the current mode
* Since the current mode is used, the SVC lr field is not defined.
- *
+ */
+
+#ifdef CPU_SA110
+/*
* NOTE: r13 and r14 are stored separately as a work around for the
* SA110 rev 2 STM^ bug
*/
+#define PUSHUSERREGS \
+ stmia sp, {r0-r12}; /* Push the user mode registers */ \
+ add r0, sp, #(4*13); /* Adjust the stack pointer */ \
+ stmia r0, {r13-r14}^ /* Push the user mode registers */
+#else
+#define PUSHUSERREGS \
+ stmia sp, {r0-r14}^ /* Push the user mode registers */
+#endif
#define PUSHFRAME \
str lr, [sp, #-4]!; /* Push the return address */ \
sub sp, sp, #(4*18); /* Adjust the stack pointer */ \
- stmia sp, {r0-r12}; /* Push the user mode registers */ \
- add r0, sp, #(4*13); /* Adjust the stack pointer */ \
- stmia r0, {r13-r14}^; /* Push the user mode registers */ \
+ PUSHUSERREGS; /* Push the user mode registers */ \
mov r0, r0; /* NOP for previous instruction */ \
mrs r0, spsr_all; /* Get the SPSR */ \
str r0, [sp, #-4]! /* Push the SPSR on the stack */
@@ -369,9 +379,7 @@
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 */ \
- stmia sp, {r0-r12}; /* Push the user mode registers */ \
- add r0, sp, #(4*13); /* Adjust the stack pointer */ \
- stmia r0, {r13-r14}^; /* Push the user mode registers */ \
+ PUSHUSERREGS; /* Push the user mode registers */ \
mov r0, r0; /* NOP for previous instruction */ \
mrs r0, spsr_all; /* Get the SPSR */ \
str r0, [sp, #-4]! /* Push the SPSR onto the stack */
Home |
Main Index |
Thread Index |
Old Index