Module Name: src Committed By: rin Date: Wed Feb 3 10:37:05 UTC 2021
Modified Files: src/sys/arch/powerpc/include: cpu.h Log Message: Pull out constant definitions inside struct declaration. Enable CTASSERT(9) for CPUSAVE_SIZE. To generate a diff of this commit: cvs rdiff -u -r1.115 -r1.116 src/sys/arch/powerpc/include/cpu.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/powerpc/include/cpu.h diff -u src/sys/arch/powerpc/include/cpu.h:1.115 src/sys/arch/powerpc/include/cpu.h:1.116 --- src/sys/arch/powerpc/include/cpu.h:1.115 Wed Jul 15 08:58:51 2020 +++ src/sys/arch/powerpc/include/cpu.h Wed Feb 3 10:37:05 2021 @@ -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 @@ struct cache_info { #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 @@ struct cpu_info { #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;