Home | History | Annotate | Line # | Download | only in include
armreg.h revision 1.3.2.5
      1  1.3.2.5  pgoyette /* $NetBSD: armreg.h,v 1.3.2.5 2018/07/28 04:37:26 pgoyette Exp $ */
      2      1.1      matt 
      3      1.1      matt /*-
      4      1.1      matt  * Copyright (c) 2014 The NetBSD Foundation, Inc.
      5      1.1      matt  * All rights reserved.
      6      1.1      matt  *
      7      1.1      matt  * This code is derived from software contributed to The NetBSD Foundation
      8      1.1      matt  * by Matt Thomas of 3am Software Foundry.
      9      1.1      matt  *
     10      1.1      matt  * Redistribution and use in source and binary forms, with or without
     11      1.1      matt  * modification, are permitted provided that the following conditions
     12      1.1      matt  * are met:
     13      1.1      matt  * 1. Redistributions of source code must retain the above copyright
     14      1.1      matt  *    notice, this list of conditions and the following disclaimer.
     15      1.1      matt  * 2. Redistributions in binary form must reproduce the above copyright
     16      1.1      matt  *    notice, this list of conditions and the following disclaimer in the
     17      1.1      matt  *    documentation and/or other materials provided with the distribution.
     18      1.1      matt  *
     19      1.1      matt  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20      1.1      matt  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21      1.1      matt  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22      1.1      matt  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23      1.1      matt  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24      1.1      matt  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25      1.1      matt  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26      1.1      matt  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27      1.1      matt  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28      1.1      matt  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29      1.1      matt  * POSSIBILITY OF SUCH DAMAGE.
     30      1.1      matt  */
     31      1.1      matt 
     32      1.1      matt #ifndef _AARCH64_ARMREG_H_
     33      1.1      matt #define _AARCH64_ARMREG_H_
     34      1.1      matt 
     35  1.3.2.2  pgoyette #include <arm/cputypes.h>
     36      1.1      matt #include <sys/types.h>
     37      1.1      matt 
     38  1.3.2.1  pgoyette #define AARCH64REG_READ_INLINE2(regname, regdesc)		\
     39  1.3.2.5  pgoyette static __inline uint64_t					\
     40  1.3.2.1  pgoyette reg_##regname##_read(void)					\
     41  1.3.2.1  pgoyette {								\
     42  1.3.2.1  pgoyette 	uint64_t __rv;						\
     43  1.3.2.1  pgoyette 	__asm __volatile("mrs %0, " #regdesc : "=r"(__rv));	\
     44  1.3.2.1  pgoyette 	return __rv;						\
     45      1.1      matt }
     46      1.1      matt 
     47  1.3.2.1  pgoyette #define AARCH64REG_WRITE_INLINE2(regname, regdesc)		\
     48  1.3.2.5  pgoyette static __inline void						\
     49  1.3.2.1  pgoyette reg_##regname##_write(uint64_t __val)				\
     50  1.3.2.1  pgoyette {								\
     51  1.3.2.1  pgoyette 	__asm __volatile("msr " #regdesc ", %0" :: "r"(__val));	\
     52      1.1      matt }
     53      1.1      matt 
     54  1.3.2.1  pgoyette #define AARCH64REG_WRITEIMM_INLINE2(regname, regdesc)		\
     55  1.3.2.5  pgoyette static __inline void						\
     56  1.3.2.1  pgoyette reg_##regname##_write(uint64_t __val)				\
     57  1.3.2.1  pgoyette {								\
     58  1.3.2.1  pgoyette 	__asm __volatile("msr " #regdesc ", %0" :: "n"(__val));	\
     59      1.1      matt }
     60      1.1      matt 
     61  1.3.2.1  pgoyette #define AARCH64REG_READ_INLINE(regname)				\
     62      1.1      matt 	AARCH64REG_READ_INLINE2(regname, regname)
     63      1.1      matt 
     64  1.3.2.1  pgoyette #define AARCH64REG_WRITE_INLINE(regname)			\
     65      1.1      matt 	AARCH64REG_WRITE_INLINE2(regname, regname)
     66      1.1      matt 
     67  1.3.2.1  pgoyette #define AARCH64REG_WRITEIMM_INLINE(regname)			\
     68      1.1      matt 	AARCH64REG_WRITEIMM_INLINE2(regname, regname)
     69      1.1      matt /*
     70      1.1      matt  * System registers available at EL0 (user)
     71      1.1      matt  */
     72      1.1      matt AARCH64REG_READ_INLINE(ctr_el0)		// Cache Type Register
     73      1.1      matt 
     74  1.3.2.5  pgoyette #define	CTR_EL0_CWG_LINE	__BITS(27,24) // Cacheback Writeback Granule
     75  1.3.2.5  pgoyette #define	CTR_EL0_ERG_LINE	__BITS(23,20) // Exclusives Reservation Granule
     76  1.3.2.5  pgoyette #define	CTR_EL0_DMIN_LINE	__BITS(19,16) // Dcache MIN LINE size (log2 - 2)
     77  1.3.2.5  pgoyette #define	CTR_EL0_L1IP_MASK	__BITS(15,14)
     78  1.3.2.5  pgoyette #define	CTR_EL0_L1IP_AIVIVT	1 // ASID-tagged Virtual Index, Virtual Tag
     79  1.3.2.5  pgoyette #define	CTR_EL0_L1IP_VIPT	2 // Virtual Index, Physical Tag
     80  1.3.2.5  pgoyette #define	CTR_EL0_L1IP_PIPT	3 // Physical Index, Physical Tag
     81  1.3.2.5  pgoyette #define	CTR_EL0_IMIN_LINE	__BITS(3,0) // Icache MIN LINE size (log2 - 2)
     82      1.1      matt 
     83      1.1      matt AARCH64REG_READ_INLINE(dczid_el0)	// Data Cache Zero ID Register
     84      1.1      matt 
     85  1.3.2.5  pgoyette #define	DCZID_DZP __BIT(4)	// Data Zero Prohibited
     86  1.3.2.5  pgoyette #define	DCZID_BS  __BITS(3,0)	// Block Size (log2 - 2)
     87      1.1      matt 
     88      1.1      matt AARCH64REG_READ_INLINE(fpcr)		// Floating Point Control Register
     89      1.1      matt AARCH64REG_WRITE_INLINE(fpcr)
     90      1.1      matt 
     91  1.3.2.5  pgoyette #define	FPCR_AHP    __BIT(26)	// Alternative Half Precision
     92  1.3.2.5  pgoyette #define	FPCR_DN     __BIT(25)	// Default Nan Control
     93  1.3.2.5  pgoyette #define	FPCR_FZ     __BIT(24)	// Flush-To-Zero
     94  1.3.2.5  pgoyette #define	FPCR_RMODE  __BITS(23,22)// Rounding Mode
     95  1.3.2.5  pgoyette #define	 FPCR_RN     0		//  Round Nearest
     96  1.3.2.5  pgoyette #define	 FPCR_RP     1		//  Round towards Plus infinity
     97  1.3.2.5  pgoyette #define	 FPCR_RM     2		//  Round towards Minus infinity
     98  1.3.2.5  pgoyette #define	 FPCR_RZ     3		//  Round towards Zero
     99  1.3.2.5  pgoyette #define	FPCR_STRIDE __BITS(21,20)
    100  1.3.2.5  pgoyette #define	FPCR_LEN    __BITS(18,16)
    101  1.3.2.5  pgoyette #define	FPCR_IDE    __BIT(15)	// Input Denormal Exception enable
    102  1.3.2.5  pgoyette #define	FPCR_IXE    __BIT(12)	// IneXact Exception enable
    103  1.3.2.5  pgoyette #define	FPCR_UFE    __BIT(11)	// UnderFlow Exception enable
    104  1.3.2.5  pgoyette #define	FPCR_OFE    __BIT(10)	// OverFlow Exception enable
    105  1.3.2.5  pgoyette #define	FPCR_DZE    __BIT(9)	// Divide by Zero Exception enable
    106  1.3.2.5  pgoyette #define	FPCR_IOE    __BIT(8)	// Invalid Operation Exception enable
    107  1.3.2.5  pgoyette #define	FPCR_ESUM   0x1F00
    108      1.1      matt 
    109      1.1      matt AARCH64REG_READ_INLINE(fpsr)		// Floating Point Status Register
    110      1.1      matt AARCH64REG_WRITE_INLINE(fpsr)
    111      1.1      matt 
    112  1.3.2.5  pgoyette #define	FPSR_N32  __BIT(31) // AARCH32 Negative
    113  1.3.2.5  pgoyette #define	FPSR_Z32  __BIT(30) // AARCH32 Zero
    114  1.3.2.5  pgoyette #define	FPSR_C32  __BIT(29) // AARCH32 Carry
    115  1.3.2.5  pgoyette #define	FPSR_V32  __BIT(28) // AARCH32 Overflow
    116  1.3.2.5  pgoyette #define	FPSR_QC   __BIT(27) // SIMD Saturation
    117  1.3.2.5  pgoyette #define	FPSR_IDC  __BIT(7) // Input Denormal Cumulative status
    118  1.3.2.5  pgoyette #define	FPSR_IXC  __BIT(4) // IneXact Cumulative status
    119  1.3.2.5  pgoyette #define	FPSR_UFC  __BIT(3) // UnderFlow Cumulative status
    120  1.3.2.5  pgoyette #define	FPSR_OFC  __BIT(2) // OverFlow Cumulative status
    121  1.3.2.5  pgoyette #define	FPSR_DZC  __BIT(1) // Divide by Zero Cumulative status
    122  1.3.2.5  pgoyette #define	FPSR_IOC  __BIT(0) // Invalid Operation Cumulative status
    123  1.3.2.5  pgoyette #define	FPSR_CSUM 0x1F
    124      1.1      matt 
    125      1.1      matt AARCH64REG_READ_INLINE(nzcv)		// condition codes
    126      1.1      matt AARCH64REG_WRITE_INLINE(nzcv)
    127      1.1      matt 
    128  1.3.2.5  pgoyette #define	NZCV_N __BIT(31) // Negative
    129  1.3.2.5  pgoyette #define	NZCV_Z __BIT(30) // Zero
    130  1.3.2.5  pgoyette #define	NZCV_C __BIT(29) // Carry
    131  1.3.2.5  pgoyette #define	NZCV_V __BIT(28) // Overflow
    132      1.1      matt 
    133      1.1      matt AARCH64REG_READ_INLINE(tpidr_el0)	// Thread Pointer ID Register (RW)
    134      1.1      matt AARCH64REG_WRITE_INLINE(tpidr_el0)
    135      1.1      matt 
    136  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(tpidrro_el0)	// Thread Pointer ID Register (RO)
    137  1.3.2.3  pgoyette 
    138      1.3     skrll /*
    139      1.1      matt  * From here on, these can only be accessed at EL1 (kernel)
    140      1.1      matt  */
    141      1.1      matt 
    142      1.1      matt /*
    143      1.1      matt  * These are readonly registers
    144      1.1      matt  */
    145  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(aidr_el1)
    146  1.3.2.3  pgoyette 
    147      1.1      matt AARCH64REG_READ_INLINE2(cbar_el1, s3_1_c15_c3_0)	 // Cortex-A57
    148      1.1      matt 
    149  1.3.2.5  pgoyette #define	CBAR_PA	__BITS(47,18)
    150      1.1      matt 
    151      1.1      matt AARCH64REG_READ_INLINE(ccsidr_el1)
    152  1.3.2.3  pgoyette 
    153  1.3.2.5  pgoyette #define	CCSIDR_WT	 __BIT(31)	// Write-through supported
    154  1.3.2.5  pgoyette #define	CCSIDR_WB	 __BIT(30)	// Write-back supported
    155  1.3.2.5  pgoyette #define	CCSIDR_RA	 __BIT(29)	// Read-allocation supported
    156  1.3.2.5  pgoyette #define	CCSIDR_WA	 __BIT(28)	// Write-allocation supported
    157  1.3.2.5  pgoyette #define	CCSIDR_NUMSET __BITS(27,13)	// (Number of sets in cache) - 1
    158  1.3.2.5  pgoyette #define	CCSIDR_ASSOC __BITS(12,3)	// (Associativity of cache) - 1
    159  1.3.2.5  pgoyette #define	CCSIDR_LINESIZE __BITS(2,0)	// Number of bytes in cache line
    160  1.3.2.3  pgoyette 
    161  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(clidr_el1)
    162  1.3.2.3  pgoyette 
    163  1.3.2.5  pgoyette #define	CLIDR_LOUU   __BITS(29,27)	// Level of Unification Uniprocessor
    164  1.3.2.5  pgoyette #define	CLIDR_LOC    __BITS(26,24)	// Level of Coherency
    165  1.3.2.5  pgoyette #define	CLIDR_LOUIS  __BITS(23,21)	// Level of Unification InnerShareable*/
    166  1.3.2.5  pgoyette #define	CLIDR_CTYPE7 __BITS(20,18)	// Cache Type field for level7
    167  1.3.2.5  pgoyette #define	CLIDR_CTYPE6 __BITS(17,15)	// Cache Type field for level6
    168  1.3.2.5  pgoyette #define	CLIDR_CTYPE5 __BITS(14,12)	// Cache Type field for level5
    169  1.3.2.5  pgoyette #define	CLIDR_CTYPE4 __BITS(11,9)	// Cache Type field for level4
    170  1.3.2.5  pgoyette #define	CLIDR_CTYPE3 __BITS(8,6)		// Cache Type field for level3
    171  1.3.2.5  pgoyette #define	CLIDR_CTYPE2 __BITS(5,3)		// Cache Type field for level2
    172  1.3.2.5  pgoyette #define	CLIDR_CTYPE1 __BITS(2,0)		// Cache Type field for level1
    173  1.3.2.5  pgoyette #define	 CLIDR_TYPE_NOCACHE	 0	// No cache
    174  1.3.2.5  pgoyette #define	 CLIDR_TYPE_ICACHE	 1	// Instruction cache only
    175  1.3.2.5  pgoyette #define	 CLIDR_TYPE_DCACHE	 2	// Data cache only
    176  1.3.2.5  pgoyette #define	 CLIDR_TYPE_IDCACHE	 3	// Separate inst and data caches
    177  1.3.2.5  pgoyette #define	 CLIDR_TYPE_UNIFIEDCACHE 4	// Unified cache
    178  1.3.2.3  pgoyette 
    179  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(currentel)
    180  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_aa64afr0_el1)
    181  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_aa64afr1_el1)
    182  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_aa64dfr0_el1)
    183  1.3.2.3  pgoyette 
    184  1.3.2.5  pgoyette #define	ID_AA64DFR0_EL1_CTX_CMPS __BITS(31,28)
    185  1.3.2.5  pgoyette #define	ID_AA64DFR0_EL1_WRPS __BITS(20,23)
    186  1.3.2.5  pgoyette #define	ID_AA64DFR0_EL1_BRPS __BITS(12,15)
    187  1.3.2.5  pgoyette #define	ID_AA64DFR0_EL1_PMUVER __BITS(8,11)
    188  1.3.2.5  pgoyette #define	 ID_AA64DFR0_EL1_PMUVER_NONE 0
    189  1.3.2.5  pgoyette #define	 ID_AA64DFR0_EL1_PMUVER_V3	 1
    190  1.3.2.5  pgoyette #define	 ID_AA64DFR0_EL1_PMUVER_NOV3 2
    191  1.3.2.5  pgoyette #define	ID_AA64DFR0_EL1_TRACEVER __BITS(4,7)
    192  1.3.2.5  pgoyette #define	 ID_AA64DFR0_EL1_TRACEVER_NONE 0
    193  1.3.2.5  pgoyette #define	 ID_AA64DFR0_EL1_TRACEVER_IMPL 1
    194  1.3.2.5  pgoyette #define	ID_AA64DFR0_EL1_DEBUGVER __BITS(0,3)
    195  1.3.2.5  pgoyette #define	 ID_AA64DFR0_EL1_DEBUGVER_V8A 6
    196  1.3.2.3  pgoyette 
    197  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_aa64dfr1_el1)
    198  1.3.2.3  pgoyette 
    199  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_aa64isar0_el1)
    200  1.3.2.3  pgoyette 
    201  1.3.2.5  pgoyette #define	ID_AA64ISAR0_EL1_CRC32 __BITS(19,16)
    202  1.3.2.5  pgoyette #define	 ID_AA64ISAR0_EL1_CRC32_NONE 0
    203  1.3.2.5  pgoyette #define	 ID_AA64ISAR0_EL1_CRC32_CRC32X 1
    204  1.3.2.5  pgoyette #define	ID_AA64ISAR0_EL1_SHA2 __BITS(15,12)
    205  1.3.2.5  pgoyette #define	 ID_AA64ISAR0_EL1_SHA2_NONE	 0
    206  1.3.2.5  pgoyette #define	 ID_AA64ISAR0_EL1_SHA2_SHA256HSU 1
    207  1.3.2.5  pgoyette #define	ID_AA64ISAR0_EL1_SHA1 __BITS(11,8)
    208  1.3.2.5  pgoyette #define	 ID_AA64ISAR0_EL1_SHA1_NONE	 0
    209  1.3.2.5  pgoyette #define	 ID_AA64ISAR0_EL1_SHA1_SHA1CPMHSU 1
    210  1.3.2.5  pgoyette #define	ID_AA64ISAR0_EL1_AES __BITS(7,4)
    211  1.3.2.5  pgoyette #define	 ID_AA64ISAR0_EL1_AES_NONE	 0
    212  1.3.2.5  pgoyette #define	 ID_AA64ISAR0_EL1_AES_AES	 1
    213  1.3.2.5  pgoyette #define	 ID_AA64ISAR0_EL1_AES_PMUL	 2
    214  1.3.2.3  pgoyette 
    215  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_aa64isar1_el1)
    216  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_aa64mmfr0_el1)
    217  1.3.2.3  pgoyette 
    218  1.3.2.5  pgoyette #define	ID_AA64MMFR0_EL1_TGRAN4 __BITS(31,28)
    219  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_TGRAN4_4KB 0
    220  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_TGRAN4_NONE 15
    221  1.3.2.5  pgoyette #define	ID_AA64MMFR0_EL1_TGRAN64 __BITS(24,27)
    222  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_TGRAN64_64KB 0
    223  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_TGRAN64_NONE 15
    224  1.3.2.5  pgoyette #define	ID_AA64MMFR0_EL1_TGRAN16 __BITS(20,23)
    225  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_TGRAN16_NONE 0
    226  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_TGRAN16_16KB 1
    227  1.3.2.5  pgoyette #define	ID_AA64MMFR0_EL1_BIGENDEL0 __BITS(16,19)
    228  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_BIGENDEL0_NONE 0
    229  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_BIGENDEL0_MIX 1
    230  1.3.2.5  pgoyette #define	ID_AA64MMFR0_EL1_SNSMEM __BITS(12,15)
    231  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_SNSMEM_NONE 0
    232  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_SNSMEM_SNSMEM 1
    233  1.3.2.5  pgoyette #define	ID_AA64MMFR0_EL1_BIGEND __BITS(8,11)
    234  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_BIGEND_NONE 0
    235  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_BIGEND_MIX 1
    236  1.3.2.5  pgoyette #define	ID_AA64MMFR0_EL1_ASIDBITS __BITS(4,7)
    237  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_ASIDBITS_8BIT 0
    238  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_ASIDBITS_16BIT 2
    239  1.3.2.5  pgoyette #define	ID_AA64MMFR0_EL1_PARANGE __BITS(0,3)
    240  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_PARANGE_4G 0
    241  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_PARANGE_64G 1
    242  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_PARANGE_1T 2
    243  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_PARANGE_4T 3
    244  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_PARANGE_16T 4
    245  1.3.2.5  pgoyette #define	 ID_AA64MMFR0_EL1_PARANGE_256T 5
    246  1.3.2.3  pgoyette 
    247  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_aa64mmfr1_el1)
    248  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_aa64pfr0_el1)
    249  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_aa64pfr1_el1)
    250  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(id_pfr1_el1)
    251      1.1      matt AARCH64REG_READ_INLINE(isr_el1)
    252      1.1      matt AARCH64REG_READ_INLINE(midr_el1)
    253      1.1      matt AARCH64REG_READ_INLINE(mpidr_el1)
    254  1.3.2.3  pgoyette 
    255  1.3.2.5  pgoyette #define	MPIDR_AFF3	__BITS(32,39)
    256  1.3.2.5  pgoyette #define	MPIDR_U	 	__BIT(30)		// 1 = Uni-Processor System
    257  1.3.2.5  pgoyette #define	MPIDR_MT	__BIT(24)		// 1 = SMT(AFF0 is logical)
    258  1.3.2.5  pgoyette #define	MPIDR_AFF2	__BITS(16,23)
    259  1.3.2.5  pgoyette #define	MPIDR_AFF1	__BITS(8,15)
    260  1.3.2.5  pgoyette #define	MPIDR_AFF0	__BITS(0,7)
    261  1.3.2.3  pgoyette 
    262      1.1      matt AARCH64REG_READ_INLINE(mvfr0_el1)
    263  1.3.2.3  pgoyette 
    264  1.3.2.5  pgoyette #define	MVFR0_FPROUND __BITS(31,28)
    265  1.3.2.5  pgoyette #define	 MVFR0_FPROUND_NEAREST 0
    266  1.3.2.5  pgoyette #define	 MVFR0_FPROUND_ALL	 1
    267  1.3.2.5  pgoyette #define	MVFR0_FPSHVEC __BITS(27,24)
    268  1.3.2.5  pgoyette #define	 MVFR0_FPSHVEC_NONE	 0
    269  1.3.2.5  pgoyette #define	 MVFR0_FPSHVEC_SHVEC 1
    270  1.3.2.5  pgoyette #define	MVFR0_FPSQRT __BITS(23,20)
    271  1.3.2.5  pgoyette #define	 MVFR0_FPSQRT_NONE	 0
    272  1.3.2.5  pgoyette #define	 MVFR0_FPSQRT_VSQRT	 1
    273  1.3.2.5  pgoyette #define	MVFR0_FPDIVIDE __BITS(19,16)
    274  1.3.2.5  pgoyette #define	 MVFR0_FPDIVIDE_NONE 0
    275  1.3.2.5  pgoyette #define	 MVFR0_FPDIVIDE_VDIV 1
    276  1.3.2.5  pgoyette #define	MVFR0_FPTRAP __BITS(15,12)
    277  1.3.2.5  pgoyette #define	 MVFR0_FPTRAP_NONE	 0
    278  1.3.2.5  pgoyette #define	 MVFR0_FPTRAP_TRAP	 1
    279  1.3.2.5  pgoyette #define	MVFR0_FPDP	 __BITS(11,8)
    280  1.3.2.5  pgoyette #define	 MVFR0_FPDP_NONE	 0
    281  1.3.2.5  pgoyette #define	 MVFR0_FPDP_VFPV2	 1
    282  1.3.2.5  pgoyette #define	 MVFR0_FPDP_VFPV3	 2
    283  1.3.2.5  pgoyette #define	MVFR0_FPSP	 __BITS(7,4)
    284  1.3.2.5  pgoyette #define	 MVFR0_FPSP_NONE	 0
    285  1.3.2.5  pgoyette #define	 MVFR0_FPSP_VFPV2	 1
    286  1.3.2.5  pgoyette #define	 MVFR0_FPSP_VFPV3	 2
    287  1.3.2.5  pgoyette #define	MVFR0_SIMDREG __BITS(3,0)
    288  1.3.2.5  pgoyette #define	 MVFR0_SIMDREG_NONE	 0
    289  1.3.2.5  pgoyette #define	 MVFR0_SIMDREG_16x64 1
    290  1.3.2.5  pgoyette #define	 MVFR0_SIMDREG_32x64 2
    291  1.3.2.3  pgoyette 
    292      1.1      matt AARCH64REG_READ_INLINE(mvfr1_el1)
    293  1.3.2.3  pgoyette 
    294  1.3.2.5  pgoyette #define	MVFR1_SIMDFMAC __BITS(31,28)
    295  1.3.2.5  pgoyette #define	 MVFR1_SIMDFMAC_NONE 0
    296  1.3.2.5  pgoyette #define	 MVFR1_SIMDFMAC_FMAC 1
    297  1.3.2.5  pgoyette #define	MVFR1_FPHP	 __BITS(27,24)
    298  1.3.2.5  pgoyette #define	 MVFR1_FPHP_NONE	 0
    299  1.3.2.5  pgoyette #define	 MVFR1_FPHP_HALF_SINGLE 1
    300  1.3.2.5  pgoyette #define	 MVFR1_FPHP_HALF_DOUBLE 2
    301  1.3.2.5  pgoyette #define	MVFR1_SIMDHP __BITS(23,20)
    302  1.3.2.5  pgoyette #define	 MVFR1_SIMDHP_NONE	 0
    303  1.3.2.5  pgoyette #define	 MVFR1_SIMDHP_HALF	 1
    304  1.3.2.5  pgoyette #define	MVFR1_SIMDSP __BITS(19,16)
    305  1.3.2.5  pgoyette #define	 MVFR1_SIMDSP_NONE	 0
    306  1.3.2.5  pgoyette #define	 MVFR1_SIMDSP_SINGLE 1
    307  1.3.2.5  pgoyette #define	MVFR1_SIMDINT __BITS(15,12)
    308  1.3.2.5  pgoyette #define	 MVFR1_SIMDINT_NONE	 0
    309  1.3.2.5  pgoyette #define	 MVFR1_SIMDINT_INTEGER 1
    310  1.3.2.5  pgoyette #define	MVFR1_SIMDLS __BITS(11,8)
    311  1.3.2.5  pgoyette #define	 MVFR1_SIMDLS_NONE	 0
    312  1.3.2.5  pgoyette #define	 MVFR1_SIMDLS_LOADSTORE 1
    313  1.3.2.5  pgoyette #define	MVFR1_FPDNAN __BITS(7,4)
    314  1.3.2.5  pgoyette #define	 MVFR1_FPDNAN_NONE	 0
    315  1.3.2.5  pgoyette #define	 MVFR1_FPDNAN_NAN	 1
    316  1.3.2.5  pgoyette #define	MVFR1_FPFTZ	 __BITS(3,0)
    317  1.3.2.5  pgoyette #define	 MVFR1_FPFTZ_NONE	 0
    318  1.3.2.5  pgoyette #define	 MVFR1_FPFTZ_DENORMAL 1
    319  1.3.2.3  pgoyette 
    320      1.1      matt AARCH64REG_READ_INLINE(mvfr2_el1)
    321  1.3.2.3  pgoyette 
    322  1.3.2.5  pgoyette #define	MVFR2_FPMISC __BITS(7,4)
    323  1.3.2.5  pgoyette #define	 MVFR2_FPMISC_NONE	 0
    324  1.3.2.5  pgoyette #define	 MVFR2_FPMISC_SEL	 1
    325  1.3.2.5  pgoyette #define	 MVFR2_FPMISC_DROUND 2
    326  1.3.2.5  pgoyette #define	 MVFR2_FPMISC_ROUNDINT 3
    327  1.3.2.5  pgoyette #define	 MVFR2_FPMISC_MAXMIN 4
    328  1.3.2.5  pgoyette #define	MVFR2_SIMDMISC __BITS(3,0)
    329  1.3.2.5  pgoyette #define	 MVFR2_SIMDMISC_NONE 0
    330  1.3.2.5  pgoyette #define	 MVFR2_SIMDMISC_DROUND 1
    331  1.3.2.5  pgoyette #define	 MVFR2_SIMDMISC_ROUNDINT 2
    332  1.3.2.5  pgoyette #define	 MVFR2_SIMDMISC_MAXMIN 3
    333  1.3.2.3  pgoyette 
    334      1.1      matt AARCH64REG_READ_INLINE(revidr_el1)
    335      1.1      matt 
    336      1.1      matt /*
    337      1.1      matt  * These are read/write registers
    338      1.1      matt  */
    339      1.1      matt AARCH64REG_READ_INLINE(cpacr_el1)	// Coprocessor Access Control Regiser
    340      1.1      matt AARCH64REG_WRITE_INLINE(cpacr_el1)
    341      1.1      matt 
    342  1.3.2.5  pgoyette #define	CPACR_TTA	 __BIT(28)	 // System Register Access Traps
    343  1.3.2.5  pgoyette #define	CPACR_FPEN	 __BITS(21,20)
    344  1.3.2.5  pgoyette #define	CPACR_FPEN_NONE __SHIFTIN(0, CPACR_FPEN)
    345  1.3.2.5  pgoyette #define	CPACR_FPEN_EL1 __SHIFTIN(1, CPACR_FPEN)
    346  1.3.2.5  pgoyette #define	CPACR_FPEN_NONE_2 __SHIFTIN(2, CPACR_FPEN)
    347  1.3.2.5  pgoyette #define	CPACR_FPEN_ALL __SHIFTIN(3, CPACR_FPEN)
    348      1.1      matt 
    349  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(csselr_el1)	// Cache Size Selection Register
    350  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(csselr_el1)
    351  1.3.2.3  pgoyette 
    352  1.3.2.5  pgoyette #define	CSSELR_LEVEL	__BITS(3,1)	// Cache level of required cache
    353  1.3.2.5  pgoyette #define	CSSELR_IND	 __BIT(0)	// Instruction not Data bit
    354  1.3.2.3  pgoyette 
    355  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(daif)		// Debug Async Irq Fiq mask register
    356  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(daif)
    357  1.3.2.3  pgoyette AARCH64REG_WRITEIMM_INLINE(daifclr)
    358  1.3.2.3  pgoyette AARCH64REG_WRITEIMM_INLINE(daifset)
    359  1.3.2.3  pgoyette 
    360  1.3.2.5  pgoyette #define	DAIF_D	 __BIT(9)	// Debug Exception Mask
    361  1.3.2.5  pgoyette #define	DAIF_A	 __BIT(8)	// SError Abort Mask
    362  1.3.2.5  pgoyette #define	DAIF_I	 __BIT(7)	// IRQ Mask
    363  1.3.2.5  pgoyette #define	DAIF_F	 __BIT(6)	// FIQ Mask
    364  1.3.2.5  pgoyette #define	DAIF_SETCLR_SHIFT 6		// for daifset/daifclr #imm shift
    365  1.3.2.3  pgoyette 
    366      1.1      matt AARCH64REG_READ_INLINE(elr_el1)		// Exception Link Register
    367      1.1      matt AARCH64REG_WRITE_INLINE(elr_el1)
    368      1.1      matt 
    369      1.1      matt AARCH64REG_READ_INLINE(esr_el1)		// Exception Symdrone Register
    370      1.1      matt AARCH64REG_WRITE_INLINE(esr_el1)
    371      1.1      matt 
    372  1.3.2.5  pgoyette #define	ESR_EC		__BITS(31,26) // Exception Cause
    373  1.3.2.5  pgoyette #define	 ESR_EC_UNKNOWN	 0x00	// AXX: Unknown Reason
    374  1.3.2.5  pgoyette #define	 ESR_EC_WFX		0x01	// AXX: WFI or WFE instruction execution
    375  1.3.2.5  pgoyette #define	 ESR_EC_CP15_RT	 0x03	// A32: MCR/MRC access to CP15 !EC=0
    376  1.3.2.5  pgoyette #define	 ESR_EC_CP15_RRT	0x04	// A32: MCRR/MRRC access to CP15 !EC=0
    377  1.3.2.5  pgoyette #define	 ESR_EC_CP14_RT	 0x05	// A32: MCR/MRC access to CP14
    378  1.3.2.5  pgoyette #define	 ESR_EC_CP14_DT	 0x06	// A32: LDC/STC access to CP14
    379  1.3.2.5  pgoyette #define	 ESR_EC_FP_ACCESS	0x07	// AXX: Access to SIMD/FP Registers
    380  1.3.2.5  pgoyette #define	 ESR_EC_FPID	 0x08	// A32: MCR/MRC access to CP10 !EC=7
    381  1.3.2.5  pgoyette #define	 ESR_EC_CP14_RRT	0x0c	// A32: MRRC access to CP14
    382  1.3.2.5  pgoyette #define	 ESR_EC_ILL_STATE	0x0e	// AXX: Illegal Execution State
    383  1.3.2.5  pgoyette #define	 ESR_EC_SVC_A32	 0x11	// A32: SVC Instruction Execution
    384  1.3.2.5  pgoyette #define	 ESR_EC_HVC_A32	 0x12	// A32: HVC Instruction Execution
    385  1.3.2.5  pgoyette #define	 ESR_EC_SMC_A32	 0x13	// A32: SMC Instruction Execution
    386  1.3.2.5  pgoyette #define	 ESR_EC_SVC_A64	 0x15	// A64: SVC Instruction Execution
    387  1.3.2.5  pgoyette #define	 ESR_EC_HVC_A64	 0x16	// A64: HVC Instruction Execution
    388  1.3.2.5  pgoyette #define	 ESR_EC_SMC_A64	 0x17	// A64: SMC Instruction Execution
    389  1.3.2.5  pgoyette #define	 ESR_EC_SYS_REG	 0x18	// A64: MSR/MRS/SYS instruction (!EC0/1/7)
    390  1.3.2.5  pgoyette #define	 ESR_EC_INSN_ABT_EL0	0x20 // AXX: Instruction Abort (EL0)
    391  1.3.2.5  pgoyette #define	 ESR_EC_INSN_ABT_EL1	0x21 // AXX: Instruction Abort (EL1)
    392  1.3.2.5  pgoyette #define	 ESR_EC_PC_ALIGNMENT	0x22 // AXX: Misaligned PC
    393  1.3.2.5  pgoyette #define	 ESR_EC_DATA_ABT_EL0	0x24 // AXX: Data Abort (EL0)
    394  1.3.2.5  pgoyette #define	 ESR_EC_DATA_ABT_EL1	0x25 // AXX: Data Abort (EL1)
    395  1.3.2.5  pgoyette #define	 ESR_EC_SP_ALIGNMENT 	0x26 // AXX: Misaligned SP
    396  1.3.2.5  pgoyette #define	 ESR_EC_FP_TRAP_A32	0x28	// A32: FP Exception
    397  1.3.2.5  pgoyette #define	 ESR_EC_FP_TRAP_A64	0x2c	// A64: FP Exception
    398  1.3.2.5  pgoyette #define	 ESR_EC_SERROR	 	0x2f	// AXX: SError Interrupt
    399  1.3.2.5  pgoyette #define	 ESR_EC_BRKPNT_EL0	0x30	// AXX: Breakpoint Exception (EL0)
    400  1.3.2.5  pgoyette #define	 ESR_EC_BRKPNT_EL1	0x31	// AXX: Breakpoint Exception (EL1)
    401  1.3.2.5  pgoyette #define	 ESR_EC_SW_STEP_EL0	0x32	// AXX: Software Step (EL0)
    402  1.3.2.5  pgoyette #define	 ESR_EC_SW_STEP_EL1	0x33	// AXX: Software Step (EL1)
    403  1.3.2.5  pgoyette #define	 ESR_EC_WTCHPNT_EL0	0x34	// AXX: Watchpoint (EL0)
    404  1.3.2.5  pgoyette #define	 ESR_EC_WTCHPNT_EL1	0x35	// AXX: Watchpoint (EL1)
    405  1.3.2.5  pgoyette #define	 ESR_EC_BKPT_INSN_A32	0x38	// A32: BKPT Instruction Execution
    406  1.3.2.5  pgoyette #define	 ESR_EC_VECTOR_CATCH	0x3a	// A32: Vector Catch Exception
    407  1.3.2.5  pgoyette #define	 ESR_EC_BKPT_INSN_A64	0x3c	// A64: BKPT Instruction Execution
    408  1.3.2.5  pgoyette #define	ESR_IL			__BIT(25) // Instruction Length (1=32-bit)
    409  1.3.2.5  pgoyette #define	ESR_ISS			__BITS(24,0) // Instruction Specific Syndrome
    410  1.3.2.5  pgoyette #define	ESR_ISS_CV		__BIT(24)	// common
    411  1.3.2.5  pgoyette #define	ESR_ISS_COND		__BITS(23,20)	// common
    412  1.3.2.5  pgoyette #define	ESR_ISS_WFX_TRAP_INSN	__BIT(0)	// for ESR_EC_WFX
    413  1.3.2.5  pgoyette #define	ESR_ISS_MRC_OPC2	__BITS(19,17)	// for ESR_EC_CP15_RT
    414  1.3.2.5  pgoyette #define	ESR_ISS_MRC_OPC1	__BITS(16,14)	// for ESR_EC_CP15_RT
    415  1.3.2.5  pgoyette #define	ESR_ISS_MRC_CRN		__BITS(13,10)	// for ESR_EC_CP15_RT
    416  1.3.2.5  pgoyette #define	ESR_ISS_MRC_RT		__BITS(9,5)	// for ESR_EC_CP15_RT
    417  1.3.2.5  pgoyette #define	ESR_ISS_MRC_CRM		__BITS(4,1)	// for ESR_EC_CP15_RT
    418  1.3.2.5  pgoyette #define	ESR_ISS_MRC_DIRECTION	__BIT(0)	// for ESR_EC_CP15_RT
    419  1.3.2.5  pgoyette #define	ESR_ISS_MCRR_OPC1	__BITS(19,16)	// for ESR_EC_CP15_RRT
    420  1.3.2.5  pgoyette #define	ESR_ISS_MCRR_RT2	__BITS(14,10)	// for ESR_EC_CP15_RRT
    421  1.3.2.5  pgoyette #define	ESR_ISS_MCRR_RT		__BITS(9,5)	// for ESR_EC_CP15_RRT
    422  1.3.2.5  pgoyette #define	ESR_ISS_MCRR_CRM	__BITS(4,1)	// for ESR_EC_CP15_RRT
    423  1.3.2.5  pgoyette #define	ESR_ISS_MCRR_DIRECTION	__BIT(0)	// for ESR_EC_CP15_RRT
    424  1.3.2.5  pgoyette #define	ESR_ISS_HVC_IMM16	__BITS(15,0)	// for ESR_EC_{SVC,HVC}
    425  1.3.2.5  pgoyette // ...
    426  1.3.2.5  pgoyette #define	ESR_ISS_INSNABORT_EA	__BIT(9)	// for ESC_RC_INSN_ABT_EL[01]
    427  1.3.2.5  pgoyette #define	ESR_ISS_INSNABORT_S1PTW	__BIT(7)	// for ESC_RC_INSN_ABT_EL[01]
    428  1.3.2.5  pgoyette #define	ESR_ISS_INSNABORT_IFSC	__BITS(0,5)	// for ESC_RC_INSN_ABT_EL[01]
    429  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_ISV	__BIT(24)	// for ESC_RC_DATA_ABT_EL[01]
    430  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_SAS	__BITS(23,22)	// for ESC_RC_DATA_ABT_EL[01]
    431  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_SSE	__BIT(21)	// for ESC_RC_DATA_ABT_EL[01]
    432  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_SRT	__BITS(19,16)	// for ESC_RC_DATA_ABT_EL[01]
    433  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_SF	__BIT(15)	// for ESC_RC_DATA_ABT_EL[01]
    434  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_AR	__BIT(14)	// for ESC_RC_DATA_ABT_EL[01]
    435  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_EA	__BIT(9)	// for ESC_RC_DATA_ABT_EL[01]
    436  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_CM	__BIT(8)	// for ESC_RC_DATA_ABT_EL[01]
    437  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_S1PTW	__BIT(7)	// for ESC_RC_DATA_ABT_EL[01]
    438  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_WnR	__BIT(6)	// for ESC_RC_DATA_ABT_EL[01]
    439  1.3.2.5  pgoyette #define	ESR_ISS_DATAABORT_DFSC	__BITS(0,5)	// for ESC_RC_DATA_ABT_EL[01]
    440  1.3.2.5  pgoyette 
    441  1.3.2.5  pgoyette #define	ESR_ISS_FSC_ADDRESS_SIZE_FAULT_0	 0x00
    442  1.3.2.5  pgoyette #define	ESR_ISS_FSC_ADDRESS_SIZE_FAULT_1	 0x01
    443  1.3.2.5  pgoyette #define	ESR_ISS_FSC_ADDRESS_SIZE_FAULT_2	 0x02
    444  1.3.2.5  pgoyette #define	ESR_ISS_FSC_ADDRESS_SIZE_FAULT_3	 0x03
    445  1.3.2.5  pgoyette #define	ESR_ISS_FSC_TRANSLATION_FAULT_0	 0x04
    446  1.3.2.5  pgoyette #define	ESR_ISS_FSC_TRANSLATION_FAULT_1	 0x05
    447  1.3.2.5  pgoyette #define	ESR_ISS_FSC_TRANSLATION_FAULT_2	 0x06
    448  1.3.2.5  pgoyette #define	ESR_ISS_FSC_TRANSLATION_FAULT_3	 0x07
    449  1.3.2.5  pgoyette #define	ESR_ISS_FSC_ACCESS_FAULT_0		 0x08
    450  1.3.2.5  pgoyette #define	ESR_ISS_FSC_ACCESS_FAULT_1		 0x09
    451  1.3.2.5  pgoyette #define	ESR_ISS_FSC_ACCESS_FAULT_2		 0x0a
    452  1.3.2.5  pgoyette #define	ESR_ISS_FSC_ACCESS_FAULT_3		 0x0b
    453  1.3.2.5  pgoyette #define	ESR_ISS_FSC_PERM_FAULT_0		 0x0c
    454  1.3.2.5  pgoyette #define	ESR_ISS_FSC_PERM_FAULT_1		 0x0d
    455  1.3.2.5  pgoyette #define	ESR_ISS_FSC_PERM_FAULT_2		 0x0e
    456  1.3.2.5  pgoyette #define	ESR_ISS_FSC_PERM_FAULT_3		 0x0f
    457  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SYNC_EXTERNAL_ABORT	 0x10
    458  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_0 0x14
    459  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_1 0x15
    460  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_2 0x16
    461  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SYNC_EXTERNAL_ABORT_TTWALK_3 0x17
    462  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SYNC_PARITY_ERROR	 0x18
    463  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_0 0x1c
    464  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_1 0x1d
    465  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_2 0x1e
    466  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SYNC_PARITY_ERROR_ON_TTWALK_3 0x1f
    467  1.3.2.5  pgoyette #define	ESR_ISS_FSC_ALIGNMENT_FAULT		 0x21
    468  1.3.2.5  pgoyette #define	ESR_ISS_FSC_TLB_CONFLICT_FAULT	 0x30
    469  1.3.2.5  pgoyette #define	ESR_ISS_FSC_LOCKDOWN_ABORT		 0x34
    470  1.3.2.5  pgoyette #define	ESR_ISS_FSC_UNSUPPORTED_EXCLUSIVE	 0x35
    471  1.3.2.5  pgoyette #define	ESR_ISS_FSC_FIRST_LEVEL_DOMAIN_FAULT 0x3d
    472  1.3.2.5  pgoyette #define	ESR_ISS_FSC_SECOND_LEVEL_DOMAIN_FAULT 0x3e
    473      1.1      matt 
    474      1.1      matt 
    475      1.1      matt AARCH64REG_READ_INLINE(far_el1)		// Fault Address Register
    476      1.1      matt AARCH64REG_WRITE_INLINE(far_el1)
    477      1.1      matt 
    478  1.3.2.3  pgoyette AARCH64REG_READ_INLINE2(l2ctlr_el1, s3_1_c11_c0_2)  // Cortex-A53,57,72,73
    479  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE2(l2ctlr_el1, s3_1_c11_c0_2) // Cortex-A53,57,72,73
    480  1.3.2.3  pgoyette 
    481  1.3.2.5  pgoyette #define	L2CTLR_NUMOFCORE	__BITS(25,24)	// Number of cores
    482  1.3.2.5  pgoyette #define	L2CTLR_CPUCACHEPROT	__BIT(22)	// CPU Cache Protection
    483  1.3.2.5  pgoyette #define	L2CTLR_SCUL2CACHEPROT	__BIT(21)	// SCU-L2 Cache Protection
    484  1.3.2.5  pgoyette #define	L2CTLR_L2_INPUT_LATENCY	__BIT(5)	// L2 Data RAM input latency
    485  1.3.2.5  pgoyette #define	L2CTLR_L2_OUTPUT_LATENCY __BIT(0)	// L2 Data RAM output latency
    486  1.3.2.3  pgoyette 
    487  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(mair_el1) // Memory Attribute Indirection Register
    488      1.1      matt AARCH64REG_WRITE_INLINE(mair_el1)
    489      1.1      matt 
    490  1.3.2.5  pgoyette #define	MAIR_ATTR0	 __BITS(7,0)
    491  1.3.2.5  pgoyette #define	MAIR_ATTR1	 __BITS(15,8)
    492  1.3.2.5  pgoyette #define	MAIR_ATTR2	 __BITS(23,16)
    493  1.3.2.5  pgoyette #define	MAIR_ATTR3	 __BITS(31,24)
    494  1.3.2.5  pgoyette #define	MAIR_ATTR4	 __BITS(39,32)
    495  1.3.2.5  pgoyette #define	MAIR_ATTR5	 __BITS(47,40)
    496  1.3.2.5  pgoyette #define	MAIR_ATTR6	 __BITS(55,48)
    497  1.3.2.5  pgoyette #define	MAIR_ATTR7	 __BITS(63,56)
    498  1.3.2.5  pgoyette #define	MAIR_DEVICE_nGnRnE 0x00	// NoGathering,NoReordering,NoEarlyWriteAck.
    499  1.3.2.5  pgoyette #define	MAIR_NORMAL_NC 0x44
    500  1.3.2.5  pgoyette #define	MAIR_NORMAL_WT 0xbb
    501  1.3.2.5  pgoyette #define	MAIR_NORMAL_WB 0xff
    502  1.3.2.3  pgoyette 
    503      1.1      matt AARCH64REG_READ_INLINE(par_el1)		// Physical Address Register
    504      1.1      matt AARCH64REG_WRITE_INLINE(par_el1)
    505      1.1      matt 
    506  1.3.2.5  pgoyette #define	PAR_ATTR	__BITS(63,56)	// F=0 memory attributes
    507  1.3.2.5  pgoyette #define	PAR_PA		__BITS(47,12)	// F=0 physical address
    508  1.3.2.5  pgoyette #define	PAR_NS		__BIT(9)	// F=0 non-secure
    509  1.3.2.5  pgoyette #define	PAR_S		__BIT(9)	// F=1 failure stage
    510  1.3.2.5  pgoyette #define	PAR_SHA		__BITS(8,7)	// F=0 shareability attribute
    511  1.3.2.5  pgoyette #define	 PAR_SHA_NONE	0
    512  1.3.2.5  pgoyette #define	 PAR_SHA_OUTER	2
    513  1.3.2.5  pgoyette #define	 PAR_SHA_INNER	3
    514  1.3.2.5  pgoyette #define	PAR_PTW		__BIT(8)	// F=1 partial table walk
    515  1.3.2.5  pgoyette #define	PAR_FST		__BITS(6,1)	// F=1 fault status code
    516  1.3.2.5  pgoyette #define	PAR_F		__BIT(0)	// translation failed
    517      1.1      matt 
    518      1.1      matt AARCH64REG_READ_INLINE(rmr_el1)		// Reset Management Register
    519      1.1      matt AARCH64REG_WRITE_INLINE(rmr_el1)
    520      1.1      matt 
    521      1.1      matt AARCH64REG_READ_INLINE(rvbar_el1)	// Reset Vector Base Address Register
    522      1.1      matt AARCH64REG_WRITE_INLINE(rvbar_el1)
    523      1.1      matt 
    524      1.2     skrll AARCH64REG_READ_INLINE(sctlr_el1)	// System Control Register
    525      1.2     skrll AARCH64REG_WRITE_INLINE(sctlr_el1)
    526      1.1      matt 
    527  1.3.2.5  pgoyette #define	SCTLR_RES0	0xc8222400	// Reserved ARMv8.0, write 0
    528  1.3.2.5  pgoyette #define	SCTLR_RES1	0x30d00800	// Reserved ARMv8.0, write 1
    529  1.3.2.5  pgoyette #define	SCTLR_M		__BIT(0)
    530  1.3.2.5  pgoyette #define	SCTLR_A		__BIT(1)
    531  1.3.2.5  pgoyette #define	SCTLR_C		__BIT(2)
    532  1.3.2.5  pgoyette #define	SCTLR_SA	__BIT(3)
    533  1.3.2.5  pgoyette #define	SCTLR_SA0	__BIT(4)
    534  1.3.2.5  pgoyette #define	SCTLR_CP15BEN	__BIT(5)
    535  1.3.2.5  pgoyette #define	SCTLR_THEE	__BIT(6)
    536  1.3.2.5  pgoyette #define	SCTLR_ITD	__BIT(7)
    537  1.3.2.5  pgoyette #define	SCTLR_SED	__BIT(8)
    538  1.3.2.5  pgoyette #define	SCTLR_UMA	__BIT(9)
    539  1.3.2.5  pgoyette #define	SCTLR_I		__BIT(12)
    540  1.3.2.5  pgoyette #define	SCTLR_DZE	__BIT(14)
    541  1.3.2.5  pgoyette #define	SCTLR_UCT	__BIT(15)
    542  1.3.2.5  pgoyette #define	SCTLR_nTWI	__BIT(16)
    543  1.3.2.5  pgoyette #define	SCTLR_nTWE	__BIT(18)
    544  1.3.2.5  pgoyette #define	SCTLR_WXN	__BIT(19)
    545  1.3.2.5  pgoyette #define	SCTLR_IESB	__BIT(21)
    546  1.3.2.5  pgoyette #define	SCTLR_SPAN	__BIT(23)
    547  1.3.2.5  pgoyette #define	SCTLR_EOE	__BIT(24)
    548  1.3.2.5  pgoyette #define	SCTLR_EE	__BIT(25)
    549  1.3.2.5  pgoyette #define	SCTLR_UCI	__BIT(26)
    550  1.3.2.5  pgoyette #define	SCTLR_nTLSMD	__BIT(28)
    551  1.3.2.5  pgoyette #define	SCTLR_LSMAOE	__BIT(29)
    552  1.3.2.3  pgoyette 
    553  1.3.2.3  pgoyette // current EL stack pointer
    554  1.3.2.5  pgoyette static __inline uint64_t
    555  1.3.2.3  pgoyette reg_sp_read(void)
    556  1.3.2.3  pgoyette {
    557  1.3.2.3  pgoyette 	uint64_t __rv;
    558  1.3.2.3  pgoyette 	__asm __volatile ("mov %0, sp" : "=r"(__rv));
    559  1.3.2.3  pgoyette 	return __rv;
    560  1.3.2.3  pgoyette }
    561  1.3.2.3  pgoyette 
    562  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(sp_el0)		// EL0 Stack Pointer
    563      1.1      matt AARCH64REG_WRITE_INLINE(sp_el0)
    564      1.1      matt 
    565  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(spsel)		// Stack Pointer Select
    566  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(spsel)
    567      1.1      matt 
    568  1.3.2.5  pgoyette #define	SPSEL_SP	 __BIT(0);	// use SP_EL0 at all exception levels
    569      1.1      matt 
    570      1.1      matt AARCH64REG_READ_INLINE(spsr_el1)	// Saved Program Status Register
    571      1.1      matt AARCH64REG_WRITE_INLINE(spsr_el1)
    572      1.1      matt 
    573  1.3.2.5  pgoyette #define	SPSR_NZCV 	__BITS(31,28)	// mask of N Z C V
    574  1.3.2.5  pgoyette #define	 SPSR_N	 	__BIT(31)		// Negative
    575  1.3.2.5  pgoyette #define	 SPSR_Z	 	__BIT(30)		// Zero
    576  1.3.2.5  pgoyette #define	 SPSR_C	 	__BIT(29)		// Carry
    577  1.3.2.5  pgoyette #define	 SPSR_V	 	__BIT(28)		// oVerflow
    578  1.3.2.5  pgoyette #define	SPSR_A32_Q 	__BIT(27)		// A32: Overflow
    579  1.3.2.5  pgoyette #define	SPSR_A32_J 	__BIT(24)		// A32: Jazelle Mode
    580  1.3.2.5  pgoyette #define	SPSR_A32_IT1 	__BIT(23)		// A32: IT[1]
    581  1.3.2.5  pgoyette #define	SPSR_A32_IT0 	__BIT(22)		// A32: IT[0]
    582  1.3.2.5  pgoyette #define	SPSR_SS	 	__BIT(21)		// Software Step
    583  1.3.2.5  pgoyette #define	SPSR_IL	 	__BIT(20)		// Instruction Length
    584  1.3.2.5  pgoyette #define	SPSR_GE	 	__BITS(19,16)	// A32: SIMD GE
    585  1.3.2.5  pgoyette #define	SPSR_IT7 	__BIT(15)		// A32: IT[7]
    586  1.3.2.5  pgoyette #define	SPSR_IT6 	__BIT(14)		// A32: IT[6]
    587  1.3.2.5  pgoyette #define	SPSR_IT5 	__BIT(13)		// A32: IT[5]
    588  1.3.2.5  pgoyette #define	SPSR_IT4 	__BIT(12)		// A32: IT[4]
    589  1.3.2.5  pgoyette #define	SPSR_IT3 	__BIT(11)		// A32: IT[3]
    590  1.3.2.5  pgoyette #define	SPSR_IT2 	__BIT(10)		// A32: IT[2]
    591  1.3.2.5  pgoyette #define	SPSR_A64_D 	__BIT(9)		// A64: Debug Exception Mask
    592  1.3.2.5  pgoyette #define	SPSR_A32_E 	__BIT(9)		// A32: BE Endian Mode
    593  1.3.2.5  pgoyette #define	SPSR_A	 	__BIT(8)		// Async abort (SError) Mask
    594  1.3.2.5  pgoyette #define	SPSR_I	 	__BIT(7)		// IRQ Mask
    595  1.3.2.5  pgoyette #define	SPSR_F	 	__BIT(6)		// FIQ Mask
    596  1.3.2.5  pgoyette #define	SPSR_A32_T 	__BIT(5)		// A32 Thumb Mode
    597  1.3.2.5  pgoyette #define	SPSR_M	 	__BITS(4,0)	// Execution State
    598  1.3.2.5  pgoyette #define	 SPSR_M_EL3H 	0x0d
    599  1.3.2.5  pgoyette #define	 SPSR_M_EL3T 	0x0c
    600  1.3.2.5  pgoyette #define	 SPSR_M_EL2H 	0x09
    601  1.3.2.5  pgoyette #define	 SPSR_M_EL2T 	0x08
    602  1.3.2.5  pgoyette #define	 SPSR_M_EL1H 	0x05
    603  1.3.2.5  pgoyette #define	 SPSR_M_EL1T 	0x04
    604  1.3.2.5  pgoyette #define	 SPSR_M_EL0T 	0x00
    605  1.3.2.5  pgoyette #define	 SPSR_M_SYS32	0x1f
    606  1.3.2.5  pgoyette #define	 SPSR_M_UND32	0x1b
    607  1.3.2.5  pgoyette #define	 SPSR_M_ABT32	0x17
    608  1.3.2.5  pgoyette #define	 SPSR_M_SVC32	0x13
    609  1.3.2.5  pgoyette #define	 SPSR_M_IRQ32	0x12
    610  1.3.2.5  pgoyette #define	 SPSR_M_FIQ32	0x11
    611  1.3.2.5  pgoyette #define	 SPSR_M_USR32	0x10
    612      1.1      matt 
    613      1.1      matt AARCH64REG_READ_INLINE(tcr_el1)		// Translation Control Register
    614      1.1      matt AARCH64REG_WRITE_INLINE(tcr_el1)
    615      1.1      matt 
    616  1.3.2.3  pgoyette #define TCR_PAGE_SIZE1(tcr)	(1L << ((1L << __SHIFTOUT(tcr, TCR_TG1)) + 8))
    617      1.1      matt 
    618      1.1      matt AARCH64REG_READ_INLINE(tpidr_el1)	// Thread ID Register (EL1)
    619      1.1      matt AARCH64REG_WRITE_INLINE(tpidr_el1)
    620      1.1      matt 
    621      1.1      matt AARCH64REG_WRITE_INLINE(tpidrro_el0)	// Thread ID Register (RO for EL0)
    622      1.1      matt 
    623  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(ttbr0_el1) // Translation Table Base Register 0 EL1
    624      1.1      matt AARCH64REG_WRITE_INLINE(ttbr0_el1)
    625      1.1      matt 
    626  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(ttbr1_el1) // Translation Table Base Register 1 EL1
    627      1.1      matt AARCH64REG_WRITE_INLINE(ttbr1_el1)
    628      1.1      matt 
    629      1.1      matt AARCH64REG_READ_INLINE(vbar_el1)	// Vector Base Address Register
    630      1.1      matt AARCH64REG_WRITE_INLINE(vbar_el1)
    631      1.1      matt 
    632  1.3.2.3  pgoyette /*
    633  1.3.2.3  pgoyette  * From here on, these are DEBUG registers
    634  1.3.2.3  pgoyette  */
    635  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr0_el1) // Debug Breakpoint Control Register 0
    636  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr0_el1)
    637  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr1_el1) // Debug Breakpoint Control Register 1
    638  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr1_el1)
    639  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr2_el1) // Debug Breakpoint Control Register 2
    640  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr2_el1)
    641  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr3_el1) // Debug Breakpoint Control Register 3
    642  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr3_el1)
    643  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr4_el1) // Debug Breakpoint Control Register 4
    644  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr4_el1)
    645  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr5_el1) // Debug Breakpoint Control Register 5
    646  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr5_el1)
    647  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr6_el1) // Debug Breakpoint Control Register 6
    648  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr6_el1)
    649  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr7_el1) // Debug Breakpoint Control Register 7
    650  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr7_el1)
    651  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr8_el1) // Debug Breakpoint Control Register 8
    652  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr8_el1)
    653  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr9_el1) // Debug Breakpoint Control Register 9
    654  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr9_el1)
    655  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr10_el1) // Debug Breakpoint Control Register 10
    656  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr10_el1)
    657  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr11_el1) // Debug Breakpoint Control Register 11
    658  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr11_el1)
    659  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr12_el1) // Debug Breakpoint Control Register 12
    660  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr12_el1)
    661  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr13_el1) // Debug Breakpoint Control Register 13
    662  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr13_el1)
    663  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr14_el1) // Debug Breakpoint Control Register 14
    664  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr14_el1)
    665  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbcr15_el1) // Debug Breakpoint Control Register 15
    666  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbcr15_el1)
    667  1.3.2.3  pgoyette 
    668  1.3.2.5  pgoyette #define	DBGBCR_BT	 __BITS(23,20)
    669  1.3.2.5  pgoyette #define	DBGBCR_LBN	 __BITS(19,16)
    670  1.3.2.5  pgoyette #define	DBGBCR_SSC	 __BITS(15,14)
    671  1.3.2.5  pgoyette #define	DBGBCR_HMC	 __BIT(13)
    672  1.3.2.5  pgoyette #define	DBGBCR_BAS	 __BITS(8,5)
    673  1.3.2.5  pgoyette #define	DBGBCR_PMC	 __BITS(2,1)
    674  1.3.2.5  pgoyette #define	DBGBCR_E	 __BIT(0)
    675  1.3.2.3  pgoyette 
    676  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr0_el1) // Debug Breakpoint Value Register 0
    677  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr0_el1)
    678  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr1_el1) // Debug Breakpoint Value Register 1
    679  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr1_el1)
    680  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr2_el1) // Debug Breakpoint Value Register 2
    681  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr2_el1)
    682  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr3_el1) // Debug Breakpoint Value Register 3
    683  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr3_el1)
    684  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr4_el1) // Debug Breakpoint Value Register 4
    685  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr4_el1)
    686  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr5_el1) // Debug Breakpoint Value Register 5
    687  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr5_el1)
    688  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr6_el1) // Debug Breakpoint Value Register 6
    689  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr6_el1)
    690  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr7_el1) // Debug Breakpoint Value Register 7
    691  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr7_el1)
    692  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr8_el1) // Debug Breakpoint Value Register 8
    693  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr8_el1)
    694  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr9_el1) // Debug Breakpoint Value Register 9
    695  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr9_el1)
    696  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr10_el1) // Debug Breakpoint Value Register 10
    697  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr10_el1)
    698  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr11_el1) // Debug Breakpoint Value Register 11
    699  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr11_el1)
    700  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr12_el1) // Debug Breakpoint Value Register 12
    701  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr12_el1)
    702  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr13_el1) // Debug Breakpoint Value Register 13
    703  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr13_el1)
    704  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr14_el1) // Debug Breakpoint Value Register 14
    705  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr14_el1)
    706  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgbvr15_el1) // Debug Breakpoint Value Register 15
    707  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgbvr15_el1)
    708  1.3.2.3  pgoyette 
    709  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr0_el1) // Debug Watchpoint Control Register 0
    710  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr0_el1)
    711  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr1_el1) // Debug Watchpoint Control Register 1
    712  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr1_el1)
    713  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr2_el1) // Debug Watchpoint Control Register 2
    714  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr2_el1)
    715  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr3_el1) // Debug Watchpoint Control Register 3
    716  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr3_el1)
    717  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr4_el1) // Debug Watchpoint Control Register 4
    718  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr4_el1)
    719  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr5_el1) // Debug Watchpoint Control Register 5
    720  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr5_el1)
    721  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr6_el1) // Debug Watchpoint Control Register 6
    722  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr6_el1)
    723  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr7_el1) // Debug Watchpoint Control Register 7
    724  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr7_el1)
    725  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr8_el1) // Debug Watchpoint Control Register 8
    726  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr8_el1)
    727  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr9_el1) // Debug Watchpoint Control Register 9
    728  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr9_el1)
    729  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr10_el1) // Debug Watchpoint Control Register 10
    730  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr10_el1)
    731  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr11_el1) // Debug Watchpoint Control Register 11
    732  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr11_el1)
    733  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr12_el1) // Debug Watchpoint Control Register 12
    734  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr12_el1)
    735  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr13_el1) // Debug Watchpoint Control Register 13
    736  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr13_el1)
    737  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr14_el1) // Debug Watchpoint Control Register 14
    738  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr14_el1)
    739  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwcr15_el1) // Debug Watchpoint Control Register 15
    740  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwcr15_el1)
    741  1.3.2.3  pgoyette 
    742  1.3.2.5  pgoyette #define	DBGWCR_MASK	 __BITS(28,24)
    743  1.3.2.5  pgoyette #define	DBGWCR_WT	 __BIT(20)
    744  1.3.2.5  pgoyette #define	DBGWCR_LBN	 __BITS(19,16)
    745  1.3.2.5  pgoyette #define	DBGWCR_SSC	 __BITS(15,14)
    746  1.3.2.5  pgoyette #define	DBGWCR_HMC	 __BIT(13)
    747  1.3.2.5  pgoyette #define	DBGWCR_BAS	 __BITS(12,5)
    748  1.3.2.5  pgoyette #define	DBGWCR_LSC	 __BITS(4,3)
    749  1.3.2.5  pgoyette #define	DBGWCR_PAC	 __BITS(2,1)
    750  1.3.2.5  pgoyette #define	DBGWCR_E	 __BIT(0)
    751  1.3.2.3  pgoyette 
    752  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr0_el1) // Debug Watchpoint Value Register 0
    753  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr0_el1)
    754  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr1_el1) // Debug Watchpoint Value Register 1
    755  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr1_el1)
    756  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr2_el1) // Debug Watchpoint Value Register 2
    757  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr2_el1)
    758  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr3_el1) // Debug Watchpoint Value Register 3
    759  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr3_el1)
    760  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr4_el1) // Debug Watchpoint Value Register 4
    761  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr4_el1)
    762  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr5_el1) // Debug Watchpoint Value Register 5
    763  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr5_el1)
    764  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr6_el1) // Debug Watchpoint Value Register 6
    765  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr6_el1)
    766  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr7_el1) // Debug Watchpoint Value Register 7
    767  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr7_el1)
    768  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr8_el1) // Debug Watchpoint Value Register 8
    769  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr8_el1)
    770  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr9_el1) // Debug Watchpoint Value Register 9
    771  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr9_el1)
    772  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr10_el1) // Debug Watchpoint Value Register 10
    773  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr10_el1)
    774  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr11_el1) // Debug Watchpoint Value Register 11
    775  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr11_el1)
    776  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr12_el1) // Debug Watchpoint Value Register 12
    777  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr12_el1)
    778  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr13_el1) // Debug Watchpoint Value Register 13
    779  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr13_el1)
    780  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr14_el1) // Debug Watchpoint Value Register 14
    781  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr14_el1)
    782  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(dbgwvr15_el1) // Debug Watchpoint Value Register 15
    783  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(dbgwvr15_el1)
    784  1.3.2.3  pgoyette 
    785  1.3.2.5  pgoyette #define	DBGWVR_MASK	 __BITS(64,3)
    786  1.3.2.3  pgoyette 
    787  1.3.2.3  pgoyette 
    788  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(mdscr_el1) // Monitor Debug System Control Register
    789  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(mdscr_el1)
    790  1.3.2.3  pgoyette 
    791  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(oslar_el1)	// OS Lock Access Register
    792  1.3.2.3  pgoyette 
    793  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(oslsr_el1)	// OS Lock Status Register
    794  1.3.2.3  pgoyette 
    795  1.3.2.3  pgoyette /*
    796  1.3.2.3  pgoyette  * From here on, these are PMC registers
    797  1.3.2.3  pgoyette  */
    798  1.3.2.3  pgoyette 
    799      1.1      matt AARCH64REG_READ_INLINE(pmccfiltr_el0)
    800      1.1      matt AARCH64REG_WRITE_INLINE(pmccfiltr_el0)
    801      1.1      matt 
    802  1.3.2.5  pgoyette #define	PMCCFILTR_P	__BIT(31)	 // Don't count cycles in EL1
    803  1.3.2.5  pgoyette #define	PMCCFILTR_U	__BIT(30)	 // Don't count cycles in EL0
    804  1.3.2.5  pgoyette #define	PMCCFILTR_NSK	__BIT(29)	 // Don't count cycles in NS EL1
    805  1.3.2.5  pgoyette #define	PMCCFILTR_NSU 	__BIT(28)	 // Don't count cycles in NS EL0
    806  1.3.2.5  pgoyette #define	PMCCFILTR_NSH 	__BIT(27)	 // Don't count cycles in NS EL2
    807  1.3.2.5  pgoyette #define	PMCCFILTR_M	__BIT(26)	 // Don't count cycles in EL3
    808      1.1      matt 
    809      1.1      matt AARCH64REG_READ_INLINE(pmccntr_el0)
    810      1.1      matt 
    811  1.3.2.5  pgoyette AARCH64REG_READ_INLINE(pmceid0_el0)
    812  1.3.2.5  pgoyette AARCH64REG_READ_INLINE(pmceid1_el0)
    813  1.3.2.5  pgoyette 
    814  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmcntenclr_el0)
    815  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmcntenset_el0)
    816  1.3.2.5  pgoyette 
    817  1.3.2.5  pgoyette AARCH64REG_READ_INLINE(pmcr_el0)
    818  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmcr_el0)
    819  1.3.2.5  pgoyette 
    820  1.3.2.5  pgoyette #define	PMCR_IMP      __BITS(31,24)	// Implementor code
    821  1.3.2.5  pgoyette #define	PMCR_IDCODE   __BITS(23,16)	// Identification code
    822  1.3.2.5  pgoyette #define	PMCR_N        __BITS(15,11)	// Number of event counters
    823  1.3.2.5  pgoyette #define	PMCR_LC       __BIT(6)		// Long cycle counter enable
    824  1.3.2.5  pgoyette #define	PMCR_DP       __BIT(5)		// Disable cycle counter when event
    825  1.3.2.5  pgoyette 					// counting is prohibited
    826  1.3.2.5  pgoyette #define	PMCR_X        __BIT(4)		// Enable export of events
    827  1.3.2.5  pgoyette #define	PMCR_D        __BIT(3)		// Clock divider
    828  1.3.2.5  pgoyette #define	PMCR_C        __BIT(2)		// Cycle counter reset
    829  1.3.2.5  pgoyette #define	PMCR_P        __BIT(1)		// Event counter reset
    830  1.3.2.5  pgoyette #define	PMCR_E        __BIT(0)		// Enable
    831  1.3.2.5  pgoyette 
    832  1.3.2.5  pgoyette 
    833  1.3.2.5  pgoyette AARCH64REG_READ_INLINE(pmevcntr1_el0)
    834  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmevcntr1_el0)
    835  1.3.2.5  pgoyette 
    836  1.3.2.5  pgoyette AARCH64REG_READ_INLINE(pmevtyper1_el0)
    837  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmevtyper1_el0)
    838  1.3.2.5  pgoyette 
    839  1.3.2.5  pgoyette #define	PMEVTYPER_P   __BIT(31)		// Don't count events in EL1
    840  1.3.2.5  pgoyette #define	PMEVTYPER_U   __BIT(30)		// Don't count events in EL0
    841  1.3.2.5  pgoyette #define	PMEVTYPER_NSK __BIT(29)		// Don't count events in NS EL1
    842  1.3.2.5  pgoyette #define	PMEVTYPER_NSU __BIT(28)		// Don't count events in NS EL0
    843  1.3.2.5  pgoyette #define	PMEVTYPER_NSH __BIT(27)		// Count events in NS EL2
    844  1.3.2.5  pgoyette #define	PMEVTYPER_M   __BIT(26)		// Don't count events in EL3
    845  1.3.2.5  pgoyette #define	PMEVTYPER_MT  __BIT(25)		// Count events on all CPUs with same
    846  1.3.2.5  pgoyette 					// aff1 level
    847  1.3.2.5  pgoyette #define	PMEVTYPER_EVTCOUNT __BITS(15,0)	// Event to count
    848  1.3.2.5  pgoyette 
    849  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmintenclr_el1)
    850  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmintenset_el1)
    851  1.3.2.5  pgoyette 
    852  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmovsclr_el0)
    853  1.3.2.5  pgoyette AARCH64REG_READ_INLINE(pmovsset_el0)
    854  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmovsset_el0)
    855  1.3.2.5  pgoyette 
    856  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmselr_el0)
    857  1.3.2.5  pgoyette 
    858  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmswinc_el0)
    859  1.3.2.5  pgoyette 
    860  1.3.2.5  pgoyette AARCH64REG_READ_INLINE(pmuserenr_el0)
    861  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmuserenr_el0)
    862  1.3.2.5  pgoyette 
    863  1.3.2.5  pgoyette AARCH64REG_READ_INLINE(pmxevcntr_el0)
    864  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmxevcntr_el0)
    865  1.3.2.5  pgoyette 
    866  1.3.2.5  pgoyette AARCH64REG_READ_INLINE(pmxevtyper_el0)
    867  1.3.2.5  pgoyette AARCH64REG_WRITE_INLINE(pmxevtyper_el0)
    868  1.3.2.5  pgoyette 
    869  1.3.2.5  pgoyette /*
    870  1.3.2.5  pgoyette  * Generic timer registers
    871  1.3.2.5  pgoyette  */
    872  1.3.2.5  pgoyette 
    873      1.1      matt AARCH64REG_READ_INLINE(cntfrq_el0)
    874      1.1      matt 
    875  1.3.2.3  pgoyette AARCH64REG_READ_INLINE(cnthctl_el2)
    876  1.3.2.3  pgoyette AARCH64REG_WRITE_INLINE(cnthctl_el2)
    877  1.3.2.3  pgoyette 
    878  1.3.2.5  pgoyette #define	CNTHCTL_EVNTDIR __BIT(3)
    879  1.3.2.5  pgoyette #define	CNTHCTL_EVNTEN __BIT(2)
    880  1.3.2.5  pgoyette #define	CNTHCTL_EL1PCEN __BIT(1)
    881  1.3.2.5  pgoyette #define	CNTHCTL_EL1PCTEN __BIT(0)
    882  1.3.2.3  pgoyette 
    883      1.1      matt AARCH64REG_READ_INLINE(cntkctl_el1)
    884      1.1      matt AARCH64REG_WRITE_INLINE(cntkctl_el1)
    885      1.1      matt 
    886  1.3.2.5  pgoyette #define	CNTKCTL_EL0PTEN	__BIT(9)	// EL0 access for CNTP CVAL/TVAL/CTL
    887  1.3.2.5  pgoyette #define	CNTKCTL_PL0PTEN	CNTKCTL_EL0PTEN
    888  1.3.2.5  pgoyette #define	CNTKCTL_EL0VTEN	__BIT(8)	// EL0 access for CNTV CVAL/TVAL/CTL
    889  1.3.2.5  pgoyette #define	CNTKCTL_PL0VTEN	CNTKCTL_EL0VTEN
    890  1.3.2.5  pgoyette #define	CNTKCTL_ELNTI	__BITS(7,4)
    891  1.3.2.5  pgoyette #define	CNTKCTL_EVNTDIR	__BIT(3)
    892  1.3.2.5  pgoyette #define	CNTKCTL_EVNTEN	__BIT(2)
    893  1.3.2.5  pgoyette #define	CNTKCTL_EL0VCTEN __BIT(1)	// EL0 access for CNTVCT and CNTFRQ
    894  1.3.2.5  pgoyette #define	CNTKCTL_PL0VCTEN CNTKCTL_EL0VCTEN
    895  1.3.2.5  pgoyette #define	CNTKCTL_EL0PCTEN __BIT(0)	// EL0 access for CNTPCT and CNTFRQ
    896  1.3.2.5  pgoyette #define	CNTKCTL_PL0PCTEN CNTKCTL_EL0PCTEN
    897      1.1      matt 
    898      1.1      matt AARCH64REG_READ_INLINE(cntp_ctl_el0)
    899      1.1      matt AARCH64REG_WRITE_INLINE(cntp_ctl_el0)
    900      1.1      matt AARCH64REG_READ_INLINE(cntp_cval_el0)
    901      1.1      matt AARCH64REG_WRITE_INLINE(cntp_cval_el0)
    902      1.1      matt AARCH64REG_READ_INLINE(cntp_tval_el0)
    903      1.1      matt AARCH64REG_WRITE_INLINE(cntp_tval_el0)
    904      1.1      matt AARCH64REG_READ_INLINE(cntpct_el0)
    905      1.1      matt AARCH64REG_WRITE_INLINE(cntpct_el0)
    906      1.1      matt 
    907      1.1      matt AARCH64REG_READ_INLINE(cntps_ctl_el1)
    908      1.1      matt AARCH64REG_WRITE_INLINE(cntps_ctl_el1)
    909      1.1      matt AARCH64REG_READ_INLINE(cntps_cval_el1)
    910      1.1      matt AARCH64REG_WRITE_INLINE(cntps_cval_el1)
    911      1.1      matt AARCH64REG_READ_INLINE(cntps_tval_el1)
    912      1.1      matt AARCH64REG_WRITE_INLINE(cntps_tval_el1)
    913      1.1      matt 
    914      1.1      matt AARCH64REG_READ_INLINE(cntv_ctl_el0)
    915      1.1      matt AARCH64REG_WRITE_INLINE(cntv_ctl_el0)
    916      1.1      matt AARCH64REG_READ_INLINE(cntv_cval_el0)
    917      1.1      matt AARCH64REG_WRITE_INLINE(cntv_cval_el0)
    918      1.1      matt AARCH64REG_READ_INLINE(cntv_tval_el0)
    919      1.1      matt AARCH64REG_WRITE_INLINE(cntv_tval_el0)
    920      1.1      matt AARCH64REG_READ_INLINE(cntvct_el0)
    921      1.1      matt AARCH64REG_WRITE_INLINE(cntvct_el0)
    922      1.1      matt 
    923  1.3.2.5  pgoyette #define	CNTCTL_ISTATUS  __BIT(2)	// Interrupt Asserted
    924  1.3.2.5  pgoyette #define	CNTCTL_IMASK    __BIT(1)	// Timer Interrupt is Masked
    925  1.3.2.5  pgoyette #define	CNTCTL_ENABLE   __BIT(0)	// Timer Enabled
    926      1.1      matt 
    927      1.1      matt 
    928  1.3.2.3  pgoyette // ID_AA64PFR0_EL1: AArch64 Processor Feature Register 0
    929  1.3.2.5  pgoyette #define	ID_AA64PFR0_EL1_GIC		__BITS(24,27) // GIC CPU IF
    930  1.3.2.5  pgoyette #define	ID_AA64PFR0_EL1_GIC_SHIFT	24
    931  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_GIC_CPUIF_EN	1
    932  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_GIC_CPUIF_NONE	0
    933  1.3.2.5  pgoyette #define	ID_AA64PFR0_EL1_ADVSIMD		__BITS(23,20) // SIMD
    934  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_ADV_SIMD_IMPL	0x0
    935  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_ADV_SIMD_NONE	0xf
    936  1.3.2.5  pgoyette #define	ID_AA64PFR0_EL1_FP		__BITS(19,16) // FP
    937  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_FP_IMPL	0x0
    938  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_FP_NONE	0xf
    939  1.3.2.5  pgoyette #define	ID_AA64PFR0_EL1_EL3		__BITS(15,12) // EL3 handling
    940  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_EL3_NONE	0
    941  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_EL3_64		1
    942  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_EL3_64_32	2
    943  1.3.2.5  pgoyette #define	ID_AA64PFR0_EL1_EL2		__BITS(11,8) // EL2 handling
    944  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_EL2_NONE	0
    945  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_EL2_64	 	1
    946  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_EL2_64_32	2
    947  1.3.2.5  pgoyette #define	ID_AA64PFR0_EL1_EL1		__BITS(7,4) // EL1 handling
    948  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_EL1_64	 	1
    949  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_EL1_64_32	2
    950  1.3.2.5  pgoyette #define	ID_AA64PFR0_EL1_EL0		__BITS(3,0) // EL0 handling
    951  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_EL0_64	 	1
    952  1.3.2.5  pgoyette #define	 ID_AA64PFR0_EL1_EL0_64_32	2
    953  1.3.2.3  pgoyette 
    954  1.3.2.3  pgoyette // ICC_SRE_EL1: Interrupt Controller System Register Enable register
    955  1.3.2.5  pgoyette #define	ICC_SRE_EL1_SRE		 __BIT(0)
    956  1.3.2.5  pgoyette #define	ICC_SRE_EL1_DFB		 __BIT(1)
    957  1.3.2.5  pgoyette #define	ICC_SRE_EL1_DIB		 __BIT(2)
    958  1.3.2.3  pgoyette 
    959  1.3.2.3  pgoyette // ICC_SRE_EL2: Interrupt Controller System Register Enable register
    960  1.3.2.5  pgoyette #define	ICC_SRE_EL2_SRE		 __BIT(0)
    961  1.3.2.5  pgoyette #define	ICC_SRE_EL2_DFB		 __BIT(1)
    962  1.3.2.5  pgoyette #define	ICC_SRE_EL2_DIB		 __BIT(2)
    963  1.3.2.5  pgoyette #define	ICC_SRE_EL2_EN		 __BIT(3)
    964  1.3.2.3  pgoyette 
    965  1.3.2.3  pgoyette 
    966  1.3.2.3  pgoyette /*
    967  1.3.2.3  pgoyette  * GENERIC TIMER REGISTER ACCESS
    968  1.3.2.3  pgoyette  */
    969  1.3.2.5  pgoyette static __inline uint32_t
    970  1.3.2.3  pgoyette gtmr_cntfrq_read(void)
    971  1.3.2.3  pgoyette {
    972  1.3.2.3  pgoyette 
    973  1.3.2.3  pgoyette 	return reg_cntfrq_el0_read();
    974  1.3.2.3  pgoyette }
    975  1.3.2.3  pgoyette 
    976  1.3.2.5  pgoyette static __inline uint32_t
    977  1.3.2.3  pgoyette gtmr_cntk_ctl_read(void)
    978  1.3.2.3  pgoyette {
    979      1.1      matt 
    980  1.3.2.3  pgoyette 	return reg_cntkctl_el1_read();
    981  1.3.2.3  pgoyette }
    982  1.3.2.3  pgoyette 
    983  1.3.2.5  pgoyette static __inline void
    984  1.3.2.3  pgoyette gtmr_cntk_ctl_write(uint32_t val)
    985  1.3.2.3  pgoyette {
    986  1.3.2.3  pgoyette 
    987  1.3.2.3  pgoyette 	reg_cntkctl_el1_write(val);
    988  1.3.2.3  pgoyette }
    989  1.3.2.3  pgoyette 
    990  1.3.2.3  pgoyette /*
    991  1.3.2.3  pgoyette  * Counter-timer Virtual Count timer
    992  1.3.2.3  pgoyette  */
    993  1.3.2.5  pgoyette static __inline uint64_t
    994  1.3.2.3  pgoyette gtmr_cntpct_read(void)
    995  1.3.2.3  pgoyette {
    996  1.3.2.3  pgoyette 
    997  1.3.2.3  pgoyette 	return reg_cntpct_el0_read();
    998  1.3.2.3  pgoyette }
    999  1.3.2.3  pgoyette 
   1000  1.3.2.5  pgoyette static __inline uint64_t
   1001  1.3.2.3  pgoyette gtmr_cntvct_read(void)
   1002  1.3.2.3  pgoyette {
   1003  1.3.2.3  pgoyette 
   1004  1.3.2.3  pgoyette 	return reg_cntvct_el0_read();
   1005  1.3.2.3  pgoyette }
   1006  1.3.2.3  pgoyette 
   1007  1.3.2.3  pgoyette /*
   1008  1.3.2.3  pgoyette  * Counter-timer Virtual Timer Control register
   1009  1.3.2.3  pgoyette  */
   1010  1.3.2.5  pgoyette static __inline uint32_t
   1011  1.3.2.3  pgoyette gtmr_cntv_ctl_read(void)
   1012  1.3.2.3  pgoyette {
   1013  1.3.2.3  pgoyette 
   1014  1.3.2.3  pgoyette 	return reg_cntv_ctl_el0_read();
   1015  1.3.2.3  pgoyette }
   1016  1.3.2.3  pgoyette 
   1017  1.3.2.5  pgoyette static __inline void
   1018  1.3.2.3  pgoyette gtmr_cntv_ctl_write(uint32_t val)
   1019  1.3.2.3  pgoyette {
   1020  1.3.2.3  pgoyette 
   1021  1.3.2.3  pgoyette 	reg_cntv_ctl_el0_write(val);
   1022  1.3.2.3  pgoyette }
   1023  1.3.2.3  pgoyette 
   1024  1.3.2.5  pgoyette static __inline void
   1025  1.3.2.3  pgoyette gtmr_cntp_ctl_write(uint32_t val)
   1026  1.3.2.3  pgoyette {
   1027  1.3.2.3  pgoyette 
   1028  1.3.2.3  pgoyette 
   1029  1.3.2.3  pgoyette 	reg_cntp_ctl_el0_write(val);
   1030  1.3.2.3  pgoyette }
   1031  1.3.2.3  pgoyette 
   1032  1.3.2.3  pgoyette /*
   1033  1.3.2.3  pgoyette  * Counter-timer Virtual Timer TimerValue register
   1034  1.3.2.3  pgoyette  */
   1035  1.3.2.5  pgoyette static __inline uint32_t
   1036  1.3.2.4  pgoyette gtmr_cntv_tval_read(void)
   1037  1.3.2.4  pgoyette {
   1038  1.3.2.4  pgoyette 
   1039  1.3.2.4  pgoyette 	return reg_cntv_tval_el0_read();
   1040  1.3.2.4  pgoyette }
   1041  1.3.2.4  pgoyette 
   1042  1.3.2.5  pgoyette static __inline void
   1043  1.3.2.3  pgoyette gtmr_cntv_tval_write(uint32_t val)
   1044  1.3.2.3  pgoyette {
   1045  1.3.2.3  pgoyette 
   1046  1.3.2.3  pgoyette 	reg_cntv_tval_el0_write(val);
   1047  1.3.2.3  pgoyette }
   1048  1.3.2.3  pgoyette 
   1049  1.3.2.3  pgoyette 
   1050  1.3.2.3  pgoyette /*
   1051  1.3.2.3  pgoyette  * Counter-timer Virtual Timer CompareValue register
   1052  1.3.2.3  pgoyette  */
   1053  1.3.2.5  pgoyette static __inline uint64_t
   1054  1.3.2.3  pgoyette gtmr_cntv_cval_read(void)
   1055  1.3.2.3  pgoyette {
   1056  1.3.2.3  pgoyette 
   1057  1.3.2.3  pgoyette 	return reg_cntv_cval_el0_read();
   1058  1.3.2.3  pgoyette }
   1059      1.1      matt 
   1060      1.1      matt #endif /* _AARCH64_ARMREG_H_ */
   1061