Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/include Pull out constant definitions insid...



details:   https://anonhg.NetBSD.org/src/rev/978dd6941ea1
branches:  trunk
changeset: 959173:978dd6941ea1
user:      rin <rin%NetBSD.org@localhost>
date:      Wed Feb 03 10:37:05 2021 +0000

description:
Pull out constant definitions inside struct declaration.

Enable CTASSERT(9) for CPUSAVE_SIZE.

diffstat:

 sys/arch/powerpc/include/cpu.h |  50 ++++++++++++++++++++++-------------------
 1 files changed, 27 insertions(+), 23 deletions(-)

diffs (71 lines):

diff -r d500120a6265 -r 978dd6941ea1 sys/arch/powerpc/include/cpu.h
--- a/sys/arch/powerpc/include/cpu.h    Wed Feb 03 10:31:10 2021 +0000
+++ b/sys/arch/powerpc/include/cpu.h    Wed Feb 03 10:37:05 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.115 2020/07/15 08:58:51 rin Exp $    */
+/*     $NetBSD: cpu.h,v 1.116 2021/02/03 10:37:05 rin Exp $    */
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -60,6 +60,31 @@
 
 #include <sys/cpu_data.h>
 
+#ifdef _KERNEL
+#define        CI_SAVETEMP     (0*CPUSAVE_LEN)
+#define        CI_SAVEDDB      (1*CPUSAVE_LEN)
+#define        CI_SAVEIPKDB    (2*CPUSAVE_LEN) /* obsolete */
+#define        CI_SAVEMMU      (3*CPUSAVE_LEN)
+#define        CI_SAVEMAX      (4*CPUSAVE_LEN)
+#define        CPUSAVE_LEN     8
+#if defined(PPC_BOOKE) && !defined(MODULAR) && !defined(_MODULE)
+#define        CPUSAVE_SIZE    128
+#else
+#define        CPUSAVE_SIZE    (CI_SAVEMAX*CPUSAVE_LEN)
+CTASSERT(CPUSAVE_SIZE >= 128);
+#endif
+#define        CPUSAVE_R28     0               /* where r28 gets saved */
+#define        CPUSAVE_R29     1               /* where r29 gets saved */
+#define        CPUSAVE_R30     2               /* where r30 gets saved */
+#define        CPUSAVE_R31     3               /* where r31 gets saved */
+#define        CPUSAVE_DEAR    4               /* where IBM4XX SPR_DEAR gets saved */
+#define        CPUSAVE_DAR     4               /* where OEA SPR_DAR gets saved */
+#define        CPUSAVE_ESR     5               /* where IBM4XX SPR_ESR gets saved */
+#define        CPUSAVE_DSISR   5               /* where OEA SPR_DSISR gets saved */
+#define        CPUSAVE_SRR0    6               /* where SRR0 gets saved */
+#define        CPUSAVE_SRR1    7               /* where SRR1 gets saved */
+#endif /* _KERNEL */
+
 struct cpu_info {
        struct cpu_data ci_data;        /* MI per-cpu data */
 #ifdef _KERNEL
@@ -92,28 +117,7 @@
 #if defined(PPC_IBM4XX) || defined(MODULAR) || defined(_MODULE)
        char *ci_intstk;
 #endif
-#define        CI_SAVETEMP     (0*CPUSAVE_LEN)
-#define        CI_SAVEDDB      (1*CPUSAVE_LEN)
-#define        CI_SAVEIPKDB    (2*CPUSAVE_LEN) /* obsolete */
-#define        CI_SAVEMMU      (3*CPUSAVE_LEN)
-#define        CI_SAVEMAX      (4*CPUSAVE_LEN)
-#define        CPUSAVE_LEN     8
-#if defined(PPC_BOOKE) && !defined(MODULAR) && !defined(_MODULE)
-#define        CPUSAVE_SIZE    128
-#else
-#define        CPUSAVE_SIZE    (CI_SAVEMAX*CPUSAVE_LEN)
-// XXX CTASSERT(CPUSAVE_SIZE >= 128);
-#endif
-#define        CPUSAVE_R28     0               /* where r28 gets saved */
-#define        CPUSAVE_R29     1               /* where r29 gets saved */
-#define        CPUSAVE_R30     2               /* where r30 gets saved */
-#define        CPUSAVE_R31     3               /* where r31 gets saved */
-#define        CPUSAVE_DEAR    4               /* where IBM4XX SPR_DEAR gets saved */
-#define        CPUSAVE_DAR     4               /* where OEA SPR_DAR gets saved */
-#define        CPUSAVE_ESR     5               /* where IBM4XX SPR_ESR gets saved */
-#define        CPUSAVE_DSISR   5               /* where OEA SPR_DSISR gets saved */
-#define        CPUSAVE_SRR0    6               /* where SRR0 gets saved */
-#define        CPUSAVE_SRR1    7               /* where SRR1 gets saved */
+
        register_t ci_savearea[CPUSAVE_SIZE];
 #if defined(PPC_BOOKE) || defined(MODULAR) || defined(_MODULE)
        uint32_t ci_pmap_asid_cur;



Home | Main Index | Thread Index | Old Index