Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/include Remove mostly duplicate MIPS spec CP0 ...



details:   https://anonhg.NetBSD.org/src/rev/e369d0d18dd9
branches:  trunk
changeset: 936353:e369d0d18dd9
user:      simonb <simonb%NetBSD.org@localhost>
date:      Sun Jul 26 07:46:21 2020 +0000

description:
Remove mostly duplicate MIPS spec CP0 regs from octeon_corereg.h, move
the Cavium specific CP0 regs to <mips/cpuregs.h> as done for other core
specific regs.

diffstat:

 sys/arch/mips/cavium/dev/octeon_corereg.h |  374 +-----------------------------
 sys/arch/mips/include/cpuregs.h           |   52 +++-
 2 files changed, 44 insertions(+), 382 deletions(-)

diffs (truncated from 539 to 300 lines):

diff -r 2c177657644e -r e369d0d18dd9 sys/arch/mips/cavium/dev/octeon_corereg.h
--- a/sys/arch/mips/cavium/dev/octeon_corereg.h Sun Jul 26 07:26:52 2020 +0000
+++ b/sys/arch/mips/cavium/dev/octeon_corereg.h Sun Jul 26 07:46:21 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: octeon_corereg.h,v 1.3 2020/06/22 03:05:07 simonb Exp $        */
+/*     $NetBSD: octeon_corereg.h,v 1.4 2020/07/26 07:46:21 simonb Exp $        */
 
 /*
  * Copyright (c) 2007 Internet Initiative Japan, Inc.
@@ -29,345 +29,10 @@
 #ifndef _OCTEON_COREREG_H_
 #define _OCTEON_COREREG_H_
 
-/*
- * Core Coprocessor 0 Privileged Registers.
- */
-
-#ifdef _LOCORE
-#define        CP0_INDEX               $0      /* Index Register */
-#define        CP0_RANDOM              $1      /* Random Register */
-#define        CP0_ENTRYLO0            $2      /* EntryLo0 Registers */
-#define        CP0_ENTRYLO1            $3      /* EntryLo1 Registers */
-#define        CP0_CONTEXT             $4      /* Context Register */
-#define        CP0_PAGEMASK            $5      /* PageMask Register */
-#define        CP0_PAGEGRAIN           $5, 1   /* PageGrain Register */
-#define        CP0_WIRED               $6      /* Wired Register */
-#define        CP0_HWRENA              $7      /* HWREna Register */
-#define        CP0_BADVADDR            $8      /* BadVAddr Register */
-#define        CP0_COUNT               $9      /* Count Register */
-#define        CP0_ENTRYHI             $10     /* EntryHi Register */
-#define        CP0_COMPARE             $11     /* Compare Register */
-#define        CP0_STATUS              $12     /* Status Register */
-#define        CP0_INTCTL              $12, 1  /* IntCtl Register */
-#define        CP0_SRSCTL              $12, 2  /* SRSCtl Register */
-#define        CP0_CAUSE               $13     /* Cause Register */
-#define        CP0_EPC                 $14     /* Exception Program Counter */
-#define        CP0_PRID                $15     /* PRId Register */
-#define        CP0_EBASE               $15, 1  /* EBase Register */
-#define        CP0_CONFIG              $16     /* Config Register */
-#define        CP0_CONFIG1             $16, 1  /* Config1 Register */
-#define        CP0_CONFIG2             $16, 2  /* Config2 Register */
-#define        CP0_CONFIG3             $16, 3  /* Config3 Register */
-#define        CP0_WATCHLO             $18     /* WatchLo Register */
-#define        CP0_WATCHLO1            $18, 1  
-#define        CP0_WATCHHI             $19     /* WatchHi Register */
-#define        CP0_WATCHHI1            $19, 1  
-#define        CP0_XCONTEXT            $20     /* XContext Register */
-#define        CP0_DEBUG               $23     /* Debug Register */
-#define        CP0_DPC                 $24     /* Debug Exception Program Counter Register */
-#define        CP0_PCCTL               $25     /* Performance Counter Control Register */
-#define        CP0_PCCTL1              $25, 2  
-#define        CP0_PCCNT               $25, 1  /* Performance Counter Counter Register */
-#define        CP0_PCCNT1              $25, 3  
-#define        CP0_ERROREPC            $30     /* ErrorEPC */
-#define        CP0_DESAVE              $31     /* DESAVE Register */
-#define        CP0_CACHEERRI           $27     /* CacheErr (Icache) */
-#define        CP0_CACHEERRD           $27, 1  /* CacheErr (Dcache) */
-#define        CP0_TAGLOI              $28     /* TagLo Register (Icache) */
-#define        CP0_TAGLOD              $28, 2  /* TagLo Register (Dcache) */
-#define        CP0_DATALOI             $28, 1  /* DataLo Register (Icache) */
-#define        CP0_DATALOD             $28, 3  /* DataLo Register (Dcache) */
-#define        CP0_TAGHI               $29, 2  /* TagHi Register */
-#define        CP0_DATAHII             $29, 1  /* DataHi Register (Icache) */
-#define        CP0_DATAHID             $29, 3  /* DataHi Register (Dcache) */
-#define        CP0_CVMCTL              $9, 7   /* CvmCtl Register */
-#define        CP0_CVMMEMCTL           $11, 7  /* CvmMemCtl Register */
-#define        CP0_CVMCNT              $9, 6   /* CvmCount Register */
-#define        CP0_MCD                 $22     /* Multi-Core Debug Register */
-#endif
-
 /* ---- register bits */
 
-/* Index Register */
-
-#define        CP0_INDEX_P                             UINT32_C(0x80000000)
-#define        CP0_INDEX_XXX_30_5                      0x7fffffe0
-#define        CP0_INDEX_INDEX                         0x0000001f
-
-/* Random Register */
-
-#define        CP0_RANDOM_XXX_31_5                     0xffffffe0
-#define        CP0_RANDOM_RANDOM                       0x0000001f
-
-/* EntryLo0, EntryLo1 Registers */
-
-#define        CP0_ENTRYLON_FILL                       UINT64_C(0xfffff80000000000)
-#define        CP0_ENTRYLON_PFNX                       UINT64_C(0x000007ffc0000000)
-#define        CP0_ENTRYLON_PFN                        UINT64_C(0x000000003fffffc0)
-#define        CP0_ENTRYLON_C                          UINT64_C(0x0000000000000038)
-#define        CP0_ENTRYLON_D                          UINT64_C(0x0000000000000004)
-#define        CP0_ENTRYLON_V                          UINT64_C(0x0000000000000002)
-#define        CP0_ENTRYLON_G                          UINT64_C(0x0000000000000001)
-
-/* Context Register */
-
-#define        CP0_CONTEXT_PTEBASE                     UINT64_C(0xffffffffff800000)
-#define        CP0_CONTEXT_BADVPN2                     UINT64_C(0x00000000007ffff0)
-#define        CP0_CONTEXT_XXX_3_0                     UINT64_C(0x000000000000000f)
-
-/* PageMask Register */
-
-#define        CP0_PAGEMASK_XXX_31_29                  UINT64_C(0xe000000000000000)
-#define        CP0_PAGEMASK_MASK                       UINT64_C(0x1fffffffffffe000)
-#define        CP0_PAGEMASK_MASKX                      UINT64_C(0x0000000000001800)
-#define        CP0_PAGEMASK_XXX_10_0                   UINT64_C(0x0000000000000fff)
-
-/* PageGrain Register */
-
-#define        CP0_PAGEGRAIN_ASE                       0xc0000000
-#define        CP0_PAGEGRAIN_ELPA                      UINT32_C(0x20000000)
-#define        CP0_PAGEGRAIN_ESP                       UINT32_C(0x10000000)
-#define        CP0_PAGEGRAIN_XXX_27_13                 0x0fffe000
-#define        CP0_PAGEGRAIN_XXX_7_0                   0x000000ff
-
-/* Wired Register */
-
-#define        CP0_WIRED_XXX_31_5                      UINT64_C(0xffffffffffffffe0)
-#define        CP0_WIRED_WIRED                         UINT64_C(0x000000000000001f)
-
-/* HWREna Register */
-
-#define        CP0_HWRENA_MASKX                        0xc0000000
-#define        CP0_HWRENA_XXX_29_4                     0x3ffffff0
-#define        CP0_HWRENA_MASK                         0x0000000f
-
-/* BadVAddr Register */
-
-/* Count Register */
-
-/* EntryHi Register */
-
-#define        CP0_ENTRYHI_R                           UINT64_C(0xc000000000000000)
-#define        CP0_ENTRYHI_FILL                        UINT64_C(0x3ffe000000000000)
-#define        CP0_ENTRYHI_VPN2                        UINT64_C(0x0001ffffffffe000)
-#define        CP0_ENTRYHI_VPN2X                       UINT64_C(0x0000000000001800)
-#define        CP0_ENTRYHI_XXX_10_8                    UINT64_C(0x0000000000000700)
-#define        CP0_ENTRYHI_ASID                        UINT64_C(0x00000000000000ff)
-
-/* Compare Register */
-
-/* Status Register */
-
-#define        CP0_STATUS_CU3                          UINT32_C(0x80000000)
-#define        CP0_STATUS_CU2                          UINT32_C(0x40000000)
-#define        CP0_STATUS_CU1                          UINT32_C(0x20000000)
-#define        CP0_STATUS_CU0                          UINT32_C(0x10000000)
-#define        CP0_STATUS_RP                           UINT32_C(0x08000000)
-#define        CP0_STATUS_FR                           UINT32_C(0x04000000)
-#define        CP0_STATUS_RE                           UINT32_C(0x02000000)
-#define        CP0_STATUS_MX                           UINT32_C(0x01000000)
-#define        CP0_STATUS_PX                           UINT32_C(0x00800000)
-#define        CP0_STATUS_BEV                          UINT32_C(0x00400000)
-#define        CP0_STATUS_TS                           UINT32_C(0x00200000)
-#define        CP0_STATUS_SR                           UINT32_C(0x00100000)
-#define        CP0_STATUS_NMI                          UINT32_C(0x00080000)
-#define        CP0_STATUS_XXX_18_16                    0x00070000
-#define        CP0_STATUS_IM_7_4                       0x0000fc00
-#define        CP0_STATUS_IM_1_0                       0x00000300
-#define        CP0_STATUS_KX                           UINT32_C(0x00000080)
-#define        CP0_STATUS_SX                           UINT32_C(0x00000040)
-#define        CP0_STATUS_UX                           UINT32_C(0x00000020)
-#define        CP0_STATUS_KSU                          0x00000018
-#define        CP0_STATUS_ERL                          UINT32_C(0x00000004)
-#define        CP0_STATUS_EXL                          UINT32_C(0x00000002)
-#define        CP0_STATUS_IE                           UINT32_C(0x00000001)
-
-/* IntCtl Register */
-
-#define        CP0_INTCTL_IPTI                         0xe0000000
-#define        CP0_INTCTL_IPPCI                        0x1c000000
-#define        CP0_INTCTL_XXX_25_10                    0x03fffc00
-#define        CP0_INTCTL_VS                           0x000003e0
-#define        CP0_INTCTL_XXX_4_0                      0x0000001f
-
-/* SRSCtl Register */
-
-#define        CP0_SRSCTL_XXX_31_30                    0xc0000000
-#define        CP0_SRSCTL_HSS                          0x3c000000
-#define        CP0_SRSCTL_XXX_25_22                    0x03c00000
-#define        CP0_SRSCTL_EICSS                        0x003c0000
-#define        CP0_SRSCTL_XXX_17_16                    0x00030000
-#define        CP0_SRSCTL_ESS                          0x0000f000
-#define        CP0_SRSCTL_XXX_11_10                    0x00000c00
-#define        CP0_SRSCTL_EXL                          0x000003c0
-#define        CP0_SRSCTL_XXX_5_4                      0x00000030
-#define        CP0_SRSCTL_CSS                          0x0000000f
-
-/* Cause Register */
-
-#define        CP0_CAUSE_BD                            UINT32_C(0x80000000)
-#define        CP0_CAUSE_TI                            UINT32_C(0x40000000)
-#define        CP0_CAUSE_CE                            0x30000000
-#define        CP0_CAUSE_DC                            UINT32_C(0x08000000)
-#define        CP0_CAUSE_PCI                           UINT32_C(0x04000000)
-#define        CP0_CAUSE_XXX_25_24                     0x03000000
-#define        CP0_CAUSE_IV                            UINT32_C(0x00800000)
-#define        CP0_CAUSE_WP                            UINT32_C(0x00400000)
-#define        CP0_CAUSE_XXX_21_16                     0x003f0000
-#define        CP0_CAUSE_IP_7_4                        0x0000f000
-#define        CP0_CAUSE_IP_3_2                        0x00000c00
-#define        CP0_CAUSE_IP_1_0                        0x00000300
-#define        CP0_CAUSE_XXX_7                         UINT32_C(0x00000080)
-#define        CP0_CAUSE_EXCCODE                       0x0000007c
-#define        CP0_CAUSE_XXX_1_0                       0x00000003
-
-/* Exception Program Counter */
-
-/* PRId Register */
-
-#define        CP0_PRID_COMPANY_OPTIONS                0xff000000
-#define        CP0_PRID_COMPANY_ID                     0x00ff0000
-#define        CP0_PRID_PROCESSOR_ID                   0x0000ff00
-#define        CP0_PRID_REVISION                       0x000000ff
-
-/* EBase Register */
-
-#define        CP0_EBASE_ALWAYS                        UINT32_C(0x80000000)
-#define        CP0_EBASE_XXX_30                        UINT32_C(0x40000000)
-#define        CP0_EBASE_EXCEPTION_BASE                0x3ffff000
-#define        CP0_EBASE_XXX_11_10                     0x00000c00
-#define        CP0_EBASE_CPU_NUM                       0x000003ff
-
-/* Config Register */
-
-#define        CP0_CONFIG_M                            UINT32_C(0x80000000)
-#define        CP0_CONFIG_IMPL                         0x7fff0000
-#define        CP0_CONFIG_BE                           UINT32_C(0x00008000)
-#define        CP0_CONFIG_AT                           0x00006000
-#define        CP0_CONFIG_AR                           0x00001c00
-#define        CP0_CONFIG_MT                           0x00000380
-#define        CP0_CONFIG_XXX_6_4                      0x00000070
-#define        CP0_CONFIG_VI                           UINT32_C(0x00000008)
-#define        CP0_CONFIG_KO                           0x00000007
-
-/* Config1 Register */
-
-#define        CP0_CONFIG1_M                           UINT32_C(0x10000000)
-#define        CP0_CONFIG1_MMUSIZE_1                   0x7e000000
-#define        CP0_CONFIG1_IS                          0x01c00000
-#define        CP0_CONFIG1_IL                          0x00380000
-#define        CP0_CONFIG1_IA                          0x00070000
-#define        CP0_CONFIG1_DS                          0x0000e000
-#define        CP0_CONFIG1_DL                          0x00001c00
-#define        CP0_CONFIG1_DA                          0x00000380
-#define        CP0_CONFIG1_C2                          UINT32_C(0x00000040)
-#define        CP0_CONFIG1_MD                          UINT32_C(0x00000020)
-#define        CP0_CONFIG1_PC                          UINT32_C(0x00000010)
-#define        CP0_CONFIG1_WR                          UINT32_C(0x00000008)
-#define        CP0_CONFIG1_CA                          UINT32_C(0x00000004)
-#define        CP0_CONFIG1_EP                          UINT32_C(0x00000002)
-#define        CP0_CONFIG1_FP                          UINT32_C(0x00000001)
-
-/* Config2 Register */
-
-#define        CP0_CONFIG2_M                           UINT32_C(0x80000000)
-#define        CP0_CONFIG2_TU                          0x70000000
-#define        CP0_CONFIG2_TS                          0x0f000000
-#define        CP0_CONFIG2_TL                          0x00f00000
-#define        CP0_CONFIG2_TA                          0x000f0000
-#define        CP0_CONFIG2_SU                          0x0000f000
-#define        CP0_CONFIG2_SS                          0x00000f00
-#define        CP0_CONFIG2_SL                          0x000000f0
-#define        CP0_CONFIG2_SA                          0x0000000f
-
-/* Config3 Register */
-
-#define        CP0_CONFIG3_M                           UINT32_C(0x80000000)
-#define        CP0_CONFIG3_XXX_30_8                    0x7fffff00
-#define        CP0_CONFIG3_LPA                         UINT32_C(0x00000080)
-#define        CP0_CONFIG3_VEIC                        UINT32_C(0x00000040)
-#define        CP0_CONFIG3_VINT                        UINT32_C(0x00000020)
-#define        CP0_CONFIG3_SP                          UINT32_C(0x00000010)
-#define        CP0_CONFIG3_XXX_3_2                     0x0000000c
-#define        CP0_CONFIG3_SM                          UINT32_C(0x00000002)
-#define        CP0_CONFIG3_TL                          UINT32_C(0x00000001)
-
-/* WatchLo Register */
-
-#define        CP0_WATCHLO_VADDR                       UINT64_C(0xfffffffffffffff8)
-#define        CP0_WATCHLO_I                           UINT64_C(0x0000000000000004)
-#define        CP0_WATCHLO_R                           UINT64_C(0x0000000000000002)
-#define        CP0_WATCHLO_W                           UINT64_C(0x0000000000000001)
-
-/* WatchHi Register */
-
-#define        CP0_WATCHHI_M                           UINT32_C(0x80000000)
-#define        CP0_WATCHHI_G                           UINT32_C(0x40000000)
-#define        CP0_WATCHHI_XXX_29_24                   0x3f000000
-#define        CP0_WATCHHI_ASID                        0x00ff0000
-#define        CP0_WATCHHI_XXX_15_12                   0x0000f000
-#define        CP0_WATCHHI_MASK                        0x00000ff8
-#define        CP0_WATCHHI_I                           UINT32_C(0x00000004)
-#define        CP0_WATCHHI_R                           UINT32_C(0x00000002)
-#define        CP0_WATCHHI_W                           UINT32_C(0x00000001)
-
-/* XContext Register */
-
-#define        CP0_XCONTEXT_PTEBASE                    UINT64_C(0xfffffc0000000000)
-#define        CP0_XCONTEXT_R                          UINT64_C(0x0000030000000000)
-#define        CP0_XCONTEXT_BADVPN2                    UINT64_C(0x000000fffffffff0)



Home | Main Index | Thread Index | Old Index