Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm Stop using #ifdef arm32, since future NetBS...



details:   https://anonhg.NetBSD.org/src/rev/9b27ab5c8028
branches:  trunk
changeset: 504324:9b27ab5c8028
user:      bjh21 <bjh21%NetBSD.org@localhost>
date:      Tue Feb 27 14:11:30 2001 +0000

description:
Stop using #ifdef arm32, since future NetBSD/arm ports are likely
not to provide it.

For things which are historical oddities of NetBSD/arm26, use #ifndef arm26.
For things which are inherently dependent on the size of program space in use,
use #ifdef PROG32 (and include opt_progmode.h).

diffstat:

 sys/arch/arm/arm/process_machdep.c |  23 ++++++++++++-----------
 sys/arch/arm/arm/sig_machdep.c     |  19 ++++++++++---------
 2 files changed, 22 insertions(+), 20 deletions(-)

diffs (142 lines):

diff -r 1a8c3f2346f3 -r 9b27ab5c8028 sys/arch/arm/arm/process_machdep.c
--- a/sys/arch/arm/arm/process_machdep.c        Tue Feb 27 14:05:53 2001 +0000
+++ b/sys/arch/arm/arm/process_machdep.c        Tue Feb 27 14:11:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.2 2001/02/26 16:35:40 bjh21 Exp $        */
+/*     $NetBSD: process_machdep.c,v 1.3 2001/02/27 14:11:30 bjh21 Exp $        */
 
 /*
  * Copyright (c) 1995 Frank Lancaster.  All rights reserved.
@@ -66,13 +66,14 @@
  *     Set the process's program counter.
  */
 
-#ifdef arm32
+#include "opt_progmode.h"
+#ifndef arm26
 #include "opt_armfpe.h"
 #endif
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.2 2001/02/26 16:35:40 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.3 2001/02/27 14:11:30 bjh21 Exp $");
 
 #include <sys/proc.h>
 #include <sys/ptrace.h>
@@ -83,7 +84,7 @@
 #include <machine/pcb.h>
 #include <machine/reg.h>
 
-#ifndef arm32
+#ifdef arm26
 #include <arm/armreg.h>
 #endif
 
@@ -95,10 +96,10 @@
 process_frame(struct proc *p)
 {
 
-#ifdef arm32
+#ifdef arm26
+       return p->p_addr->u_pcb.pcb_tf;
+#else /* arm32 */
        return (p->p_md.md_regs);
-#else /* arm26 */
-       return p->p_addr->u_pcb.pcb_tf;
 #endif
 }
 
@@ -139,11 +140,11 @@
        bcopy((caddr_t)regs->r, (caddr_t)&tf->tf_r0, sizeof(regs->r));
        tf->tf_usr_sp = regs->r_sp;
        tf->tf_usr_lr = regs->r_lr;
-#ifdef arm32
+#ifdef PROG32
        tf->tf_pc = regs->r_pc;
        tf->tf_spsr &=  ~PSR_FLAGS;
        tf->tf_spsr |= regs->r_cpsr & PSR_FLAGS;
-#else /* arm26 */
+#else /* PROG26 */
        if ((regs->r_pc & (R15_MODE | R15_IRQ_DISABLE | R15_FIQ_DISABLE)) != 0)
                return EPERM;
 
@@ -171,9 +172,9 @@
        struct trapframe *tf = process_frame(p);
 
        KASSERT(tf != NULL);
-#ifdef arm32
+#ifdef PROG32
        tf->tf_pc = (int)addr;
-#else /* arm26 */
+#else /* PROG26 */
        /* Only set the PC, not the PSR */
        if (((register_t)addr & R15_PC) != (register_t)addr)
                return EINVAL;
diff -r 1a8c3f2346f3 -r 9b27ab5c8028 sys/arch/arm/arm/sig_machdep.c
--- a/sys/arch/arm/arm/sig_machdep.c    Tue Feb 27 14:05:53 2001 +0000
+++ b/sys/arch/arm/arm/sig_machdep.c    Tue Feb 27 14:11:30 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sig_machdep.c,v 1.1 2001/02/13 13:19:52 bjh21 Exp $    */
+/*     $NetBSD: sig_machdep.c,v 1.2 2001/02/27 14:11:30 bjh21 Exp $    */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -41,10 +41,11 @@
  */
 
 #include "opt_compat_netbsd.h"
+#include "opt_progmode.h"
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.1 2001/02/13 13:19:52 bjh21 Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.2 2001/02/27 14:11:30 bjh21 Exp $");
 
 #include <sys/mount.h>         /* XXX only needed by syscallargs.h */
 #include <sys/proc.h>
@@ -60,7 +61,7 @@
 #include <machine/cpu.h>
 #include <machine/frame.h>
 #include <machine/pcb.h>
-#ifdef arm32
+#ifndef arm26
 #include <machine/cpufunc.h>
 #endif
 
@@ -68,10 +69,10 @@
 process_frame(struct proc *p)
 {
 
-#ifdef arm32
+#ifdef arm26
+       return p->p_addr->u_pcb.pcb_tf;
+#else /* arm32 */
        return (p->p_md.md_regs);
-#else /* arm26 */
-       return p->p_addr->u_pcb.pcb_tf;
 #endif
 }
 
@@ -167,7 +168,7 @@
        tf->tf_r3 = (int)frame.sf_handler;
        tf->tf_usr_sp = (int)fp;
        tf->tf_pc = (int)p->p_sigctx.ps_sigcode;
-#ifdef arm32
+#ifndef arm26
        cpu_cache_syncI();
 #endif
 
@@ -206,10 +207,10 @@
                return (EFAULT);
 
        /* Make sure the processor mode has not been tampered with. */
-#ifdef arm32
+#ifdef PROG32
        if ((context.sc_spsr & PSR_MODE) != PSR_USR32_MODE)
                return (EINVAL);
-#else /* arm26 */
+#else /* PROG26 */
        if ((context.sc_pc & R15_MODE) != R15_MODE_USR ||
            (context.sc_pc & (R15_IRQ_DISABLE | R15_FIQ_DISABLE)) != 0)
                return EINVAL;



Home | Main Index | Thread Index | Old Index