Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Allow platforms to use an extra level of indirectio...



details:   https://anonhg.NetBSD.org/src/rev/e468e8e8871a
branches:  trunk
changeset: 521784:e468e8e8871a
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Feb 05 18:26:07 2002 +0000

description:
Allow platforms to use an extra level of indirection for FIQs,
enabled by definining __ARM_FIQ_INDIRECT in <machine/types.h>.
This is needed for OpenFirmware systems (like the Shark), where
the OFW vector page is used, and kernel entries merely patched
into it.

diffstat:

 sys/arch/arm/arm/fiq.c         |  13 ++++++++++---
 sys/arch/arm/arm/vectors.S     |  19 ++++++++++++++++++-
 sys/arch/arm/arm32/genassym.cf |   5 ++++-
 sys/arch/arm32/include/types.h |   5 ++++-
 sys/arch/dnard/include/types.h |   5 ++++-
 5 files changed, 40 insertions(+), 7 deletions(-)

diffs (143 lines):

diff -r 764f25e4ab91 -r e468e8e8871a sys/arch/arm/arm/fiq.c
--- a/sys/arch/arm/arm/fiq.c    Tue Feb 05 15:28:03 2002 +0000
+++ b/sys/arch/arm/arm/fiq.c    Tue Feb 05 18:26:07 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fiq.c,v 1.3 2002/01/25 19:19:24 thorpej Exp $  */
+/*     $NetBSD: fiq.c,v 1.4 2002/02/05 18:26:07 thorpej Exp $  */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fiq.c,v 1.3 2002/01/25 19:19:24 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fiq.c,v 1.4 2002/02/05 18:26:07 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -62,11 +62,16 @@
  * fiq_installhandler:
  *
  *     Actually install the FIQ handler down at the FIQ vector.
+ *
+ *     Note: If the FIQ is invoked via an extra layer of
+ *     indirection, the actual FIQ code store lives in the
+ *     data segment, so there is no need to manipulate
+ *     the vector page's protection.
  */
 static void
 fiq_installhandler(void *func, size_t size)
 {
-#ifdef __PROG32
+#if defined(__PROG32) && !defined(__ARM_FIQ_INDIRECT)
        extern void zero_page_readwrite(void);  /* XXX */
        extern void zero_page_readonly(void);   /* XXX */
 
@@ -76,7 +81,9 @@
        memcpy(fiqvector, func, size);
 
 #ifdef __PROG32
+#if !defined(__ARM_FIQ_INDIRECT)
        zero_page_readonly();
+#endif
        cpu_icache_sync_range((vaddr_t) fiqvector, size);
 #endif
 }
diff -r 764f25e4ab91 -r e468e8e8871a sys/arch/arm/arm/vectors.S
--- a/sys/arch/arm/arm/vectors.S        Tue Feb 05 15:28:03 2002 +0000
+++ b/sys/arch/arm/arm/vectors.S        Tue Feb 05 18:26:07 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vectors.S,v 1.1 2001/12/20 01:20:22 thorpej Exp $      */
+/*     $NetBSD: vectors.S,v 1.2 2002/02/05 18:26:07 thorpej Exp $      */
 
 /*
  * Copyright (C) 1994-1997 Mark Brinicombe
@@ -55,10 +55,14 @@
        ldr     pc, Ldata_abort_target
        ldr     pc, Laddress_exception_target
        ldr     pc, Lirq_target
+#ifdef __ARM_FIQ_INDIRECT
+       ldr     pc, Lfiq_target
+#else
 Lfiqvector:
        .set    _C_LABEL(fiqvector), . - _C_LABEL(page0)
        subs    pc, lr, #4
        .org    Lfiqvector + 0x100
+#endif
 
 Lreset_target:
        .word   reset_entry
@@ -80,4 +84,17 @@
 
 Lirq_target:
        .word   irq_entry
+
+#ifdef __ARM_FIQ_INDIRECT
+Lfiq_target:
+       .word   _C_LABEL(fiqvector)
+#endif
 _C_LABEL(page0_end):
+
+#ifdef __ARM_FIQ_INDIRECT
+       .data
+       .align  0
+_C_LABEL(fiqvector):
+       subs    pc, lr, #4
+       .org    _C_LABEL(fiqvector) + 0x100
+#endif
diff -r 764f25e4ab91 -r e468e8e8871a sys/arch/arm/arm32/genassym.cf
--- a/sys/arch/arm/arm32/genassym.cf    Tue Feb 05 15:28:03 2002 +0000
+++ b/sys/arch/arm/arm32/genassym.cf    Tue Feb 05 18:26:07 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: genassym.cf,v 1.9 2002/01/25 19:19:25 thorpej Exp $
+#      $NetBSD: genassym.cf,v 1.10 2002/02/05 18:26:08 thorpej Exp $
 
 # Copyright (c) 1982, 1990 The Regents of the University of California.
 # All rights reserved.
@@ -51,6 +51,9 @@
 include <machine/vmparam.h>
 
 define __PROG32                1
+ifdef __ARM_FIQ_INDIRECT
+define __ARM_FIQ_INDIRECT      1
+endif
 
 define VM_MIN_ADDRESS          VM_MIN_ADDRESS
 define VM_MAXUSER_ADDRESS      VM_MAXUSER_ADDRESS
diff -r 764f25e4ab91 -r e468e8e8871a sys/arch/arm32/include/types.h
--- a/sys/arch/arm32/include/types.h    Tue Feb 05 15:28:03 2002 +0000
+++ b/sys/arch/arm32/include/types.h    Tue Feb 05 18:26:07 2002 +0000
@@ -1,10 +1,13 @@
-/* $NetBSD: types.h,v 1.16 2001/11/22 18:00:01 thorpej Exp $ */
+/* $NetBSD: types.h,v 1.17 2002/02/05 18:26:08 thorpej Exp $ */
 
 #ifndef _ARM32_TYPES_H_
 #define _ARM32_TYPES_H_
 
 #include <arm/arm32/types.h>
 
+/* We need to invoke FIQs indirectly. */
+#define        __ARM_FIQ_INDIRECT
+
 #define __HAVE_DEVICE_REGISTER
 #define __HAVE_NWSCONS
 
diff -r 764f25e4ab91 -r e468e8e8871a sys/arch/dnard/include/types.h
--- a/sys/arch/dnard/include/types.h    Tue Feb 05 15:28:03 2002 +0000
+++ b/sys/arch/dnard/include/types.h    Tue Feb 05 18:26:07 2002 +0000
@@ -1,10 +1,13 @@
-/* $NetBSD: types.h,v 1.2 2001/11/22 18:00:01 thorpej Exp $ */
+/* $NetBSD: types.h,v 1.3 2002/02/05 18:26:08 thorpej Exp $ */
 
 #ifndef _ARM32_TYPES_H_
 #define _ARM32_TYPES_H_
 
 #include <arm/arm32/types.h>
 
+/* We need to invoke FIQs indirectly. */ 
+#define        __ARM_FIQ_INDIRECT
+
 #define __HAVE_DEVICE_REGISTER
 #define __HAVE_NWSCONS
 



Home | Main Index | Thread Index | Old Index