Source-Changes-HG archive

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

[src/trunk]: src/sys/arch Change all archs that did:



details:   https://anonhg.NetBSD.org/src/rev/653f2dd8cde2
branches:  trunk
changeset: 583555:653f2dd8cde2
user:      cube <cube%NetBSD.org@localhost>
date:      Thu Aug 11 20:32:55 2005 +0000

description:
Change all archs that did:

#define clockframe somethingelse

to:

struct clockframe {
        struct somethingelse cf_se;
};

and change access macros accordingly.

That means that, at least for that very issue, things will not go
ka-boomy if you don't have the actual definition of struct clockframe
before including systm.h.

diffstat:

 sys/arch/acorn26/include/frame.h   |   6 ++++--
 sys/arch/amd64/include/cpu.h       |  10 ++++++----
 sys/arch/arm/include/arm32/frame.h |   6 ++++--
 sys/arch/arm/include/cpu.h         |  12 ++++++------
 sys/arch/i386/include/cpu.h        |  10 ++++++----
 sys/arch/pc532/include/cpu.h       |  12 +++++++-----
 sys/arch/xen/include/cpu.h         |  10 ++++++----
 sys/arch/xen/xen/clock.c           |   6 +++---
 8 files changed, 42 insertions(+), 30 deletions(-)

diffs (214 lines):

diff -r 14f5d502d3a4 -r 653f2dd8cde2 sys/arch/acorn26/include/frame.h
--- a/sys/arch/acorn26/include/frame.h  Thu Aug 11 17:22:35 2005 +0000
+++ b/sys/arch/acorn26/include/frame.h  Thu Aug 11 20:32:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frame.h,v 1.1 2002/03/24 15:46:58 bjh21 Exp $  */
+/*     $NetBSD: frame.h,v 1.2 2005/08/11 20:32:55 cube Exp $   */
 
 /*
  * Copyright (c) 1999 Ben Harris.
@@ -78,7 +78,9 @@
        register_t if_r15; /* Must be fixed so we know which branch to use */
 } irqframe_t;
 
-#define clockframe irqframe
+struct clockframe {
+       struct irqframe cf_if;
+};
 
 /*
  * Switch frame
diff -r 14f5d502d3a4 -r 653f2dd8cde2 sys/arch/amd64/include/cpu.h
--- a/sys/arch/amd64/include/cpu.h      Thu Aug 11 17:22:35 2005 +0000
+++ b/sys/arch/amd64/include/cpu.h      Thu Aug 11 20:32:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.6 2004/09/25 11:08:47 yamt Exp $     */
+/*     $NetBSD: cpu.h,v 1.7 2005/08/11 20:32:55 cube Exp $     */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -203,11 +203,13 @@
  * encapsulate the previous machine state in an opaque
  * clockframe; for now, use generic intrframe.
  */
-#define clockframe intrframe
+struct clockframe {
+       struct intrframe cf_if;
+};
 
-#define        CLKF_USERMODE(frame)    USERMODE((frame)->if_cs, (frame)->if_rflags)
+#define        CLKF_USERMODE(frame)    USERMODE((frame)->cf_if.if_cs, (frame)->cf_if.if_rflags)
 #define CLKF_BASEPRI(frame)    (0)
-#define CLKF_PC(frame)         ((frame)->if_rip)
+#define CLKF_PC(frame)         ((frame)->cf_if.if_rip)
 #define CLKF_INTR(frame)       (curcpu()->ci_idepth > 1)
 
 /*
diff -r 14f5d502d3a4 -r 653f2dd8cde2 sys/arch/arm/include/arm32/frame.h
--- a/sys/arch/arm/include/arm32/frame.h        Thu Aug 11 17:22:35 2005 +0000
+++ b/sys/arch/arm/include/arm32/frame.h        Thu Aug 11 20:32:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: frame.h,v 1.11 2004/04/27 07:13:16 scw Exp $   */
+/*     $NetBSD: frame.h,v 1.12 2005/08/11 20:32:55 cube Exp $  */
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -76,7 +76,9 @@
        unsigned int if_pc;
 } irqframe_t;
 
-#define clockframe irqframe
+struct clockframe {
+       struct irqframe cf_if;
+};
 
 /*
  * Switch frame
diff -r 14f5d502d3a4 -r 653f2dd8cde2 sys/arch/arm/include/cpu.h
--- a/sys/arch/arm/include/cpu.h        Thu Aug 11 17:22:35 2005 +0000
+++ b/sys/arch/arm/include/cpu.h        Thu Aug 11 20:32:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.36 2004/09/22 11:32:02 yamt Exp $    */
+/*     $NetBSD: cpu.h,v 1.37 2005/08/11 20:32:55 cube Exp $    */
 
 /*
  * Copyright (c) 1994-1996 Mark Brinicombe.
@@ -127,9 +127,9 @@
  * frame came from USR mode or not.
  */
 #ifdef __PROG32
-#define CLKF_USERMODE(frame)   ((frame->if_spsr & PSR_MODE) == PSR_USR32_MODE)
+#define CLKF_USERMODE(frame)   ((frame->cf_if.if_spsr & PSR_MODE) == PSR_USR32_MODE)
 #else
-#define CLKF_USERMODE(frame)   ((frame->if_r15 & R15_MODE) == R15_MODE_USR)
+#define CLKF_USERMODE(frame)   ((frame->cf_if.if_r15 & R15_MODE) == R15_MODE_USR)
 #endif
 
 /*
@@ -150,7 +150,7 @@
 /* Hack to treat FPE time as interrupt time so we can measure it */
 #define CLKF_INTR(frame)                                               \
        ((current_intr_depth > 1) ||                                    \
-           (frame->if_spsr & PSR_MODE) == PSR_UND32_MODE)
+           (frame->cf_if.if_spsr & PSR_MODE) == PSR_UND32_MODE)
 #else
 #define CLKF_INTR(frame)       (current_intr_depth > 1) 
 #endif
@@ -159,9 +159,9 @@
  * CLKF_PC: Extract the program counter from a clockframe
  */
 #ifdef __PROG32
-#define CLKF_PC(frame)         (frame->if_pc)
+#define CLKF_PC(frame)         (frame->cf_if.if_pc)
 #else
-#define CLKF_PC(frame)         (frame->if_r15 & R15_PC)
+#define CLKF_PC(frame)         (frame->cf_if.if_r15 & R15_PC)
 #endif
 
 /*
diff -r 14f5d502d3a4 -r 653f2dd8cde2 sys/arch/i386/include/cpu.h
--- a/sys/arch/i386/include/cpu.h       Thu Aug 11 17:22:35 2005 +0000
+++ b/sys/arch/i386/include/cpu.h       Thu Aug 11 20:32:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.117 2005/02/21 15:10:51 he Exp $     */
+/*     $NetBSD: cpu.h,v 1.118 2005/08/11 20:32:55 cube Exp $   */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -263,11 +263,13 @@
  * running (hardclock) interrupt, CLKF_BASEPRI() *must* always be 0; otherwise
  * we could stall hardclock ticks if another interrupt takes too long.
  */
-#define clockframe intrframe
+struct clockframe {
+       struct intrframe cf_if;
+};
 
-#define        CLKF_USERMODE(frame)    USERMODE((frame)->if_cs, (frame)->if_eflags)
+#define        CLKF_USERMODE(frame)    USERMODE((frame)->cf_if.if_cs, (frame)->cf_if.if_eflags)
 #define        CLKF_BASEPRI(frame)     (0)
-#define        CLKF_PC(frame)          ((frame)->if_eip)
+#define        CLKF_PC(frame)          ((frame)->cf_if.if_eip)
 #define        CLKF_INTR(frame)        (curcpu()->ci_idepth > 1)
 
 /*
diff -r 14f5d502d3a4 -r 653f2dd8cde2 sys/arch/pc532/include/cpu.h
--- a/sys/arch/pc532/include/cpu.h      Thu Aug 11 17:22:35 2005 +0000
+++ b/sys/arch/pc532/include/cpu.h      Thu Aug 11 20:32:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.42 2004/09/22 11:32:03 yamt Exp $    */
+/*     $NetBSD: cpu.h,v 1.43 2005/08/11 20:32:55 cube Exp $    */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -74,11 +74,13 @@
  * clockframe; for now, use generic intrframe.
  */
 
-#define        clockframe intrframe
+struct clockframe {
+       struct intrframe cf_if;
+};
 
-#define        CLKF_USERMODE(framep)   USERMODE((framep)->if_regs.r_psr)
-#define        CLKF_BASEPRI(framep)    ((framep)->if_pl == imask[IPL_ZERO])
-#define        CLKF_PC(framep)         ((framep)->if_regs.r_pc)
+#define        CLKF_USERMODE(framep)   USERMODE((framep)->cf_if.if_regs.r_psr)
+#define        CLKF_BASEPRI(framep)    ((framep)->cf_if.if_pl == imask[IPL_ZERO])
+#define        CLKF_PC(framep)         ((framep)->cf_if.if_regs.r_pc)
 #define        CLKF_INTR(frame)        (0)     /* XXX should have an interrupt stack */
 
 /*
diff -r 14f5d502d3a4 -r 653f2dd8cde2 sys/arch/xen/include/cpu.h
--- a/sys/arch/xen/include/cpu.h        Thu Aug 11 17:22:35 2005 +0000
+++ b/sys/arch/xen/include/cpu.h        Thu Aug 11 20:32:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.8 2005/04/16 22:49:37 bouyer Exp $   */
+/*     $NetBSD: cpu.h,v 1.9 2005/08/11 20:32:55 cube Exp $     */
 /*     NetBSD: cpu.h,v 1.113 2004/02/20 17:35:01 yamt Exp      */
 
 /*-
@@ -264,11 +264,13 @@
  * running (hardclock) interrupt, CLKF_BASEPRI() *must* always be 0; otherwise
  * we could stall hardclock ticks if another interrupt takes too long.
  */
-#define clockframe intrframe
+struct clockframe {
+       struct intrframe cf_if;
+};
 
-#define        CLKF_USERMODE(frame)    USERMODE((frame)->if_cs, (frame)->if_eflags)
+#define        CLKF_USERMODE(frame)    USERMODE((frame)->cf_if.if_cs, (frame)->cf_if.if_eflags)
 #define        CLKF_BASEPRI(frame)     (0)
-#define        CLKF_PC(frame)          ((frame)->if_eip)
+#define        CLKF_PC(frame)          ((frame)->cf_if.if_eip)
 #define        CLKF_INTR(frame)        (curcpu()->ci_idepth > 1)
 
 /*
diff -r 14f5d502d3a4 -r 653f2dd8cde2 sys/arch/xen/xen/clock.c
--- a/sys/arch/xen/xen/clock.c  Thu Aug 11 17:22:35 2005 +0000
+++ b/sys/arch/xen/xen/clock.c  Thu Aug 11 20:32:55 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clock.c,v 1.13 2005/06/25 18:44:59 bouyer Exp $        */
+/*     $NetBSD: clock.c,v 1.14 2005/08/11 20:32:56 cube Exp $  */
 
 /*
  *
@@ -34,7 +34,7 @@
 #include "opt_xen.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.13 2005/06/25 18:44:59 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clock.c,v 1.14 2005/08/11 20:32:56 cube Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -271,7 +271,7 @@
                                cc_microset(ci);
                        }
                }
-               hardclock(regs);
+               hardclock((struct clockframe *)regs);
                delta -= NS_PER_TICK;
                processed_system_time += NS_PER_TICK;
        }



Home | Main Index | Thread Index | Old Index