- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

# arch/avr32/include/arch/sysreg.h

Go to the documentation of this file.

    00001
    00041 #ifndef ARCH_SYSREG_H_INCLUDED
    00042 #define ARCH_SYSREG_H_INCLUDED
    00043
    00044 /*
    00045  * Some registers are CPU-specific, some others have CPU-specific
    00046  * semantics. Get the definitions of those.
    00047  */
    00048 #include <cpu/sysreg.h>
    00049
    00050 #define SYSREG_SR                       0x0000
    00051 # define SYSREG_SR_C_BIT                0
    00052 # define SYSREG_SR_C                    (1 << SYSREG_SR_C_BIT)
    00053 # define SYSREG_SR_Z_BIT                1
    00054 # define SYSREG_SR_Z                    (1 << SYSREG_SR_Z_BIT)
    00055 # define SYSREG_SR_N_BIT                2
    00056 # define SYSREG_SR_N                    (1 << SYSREG_SR_N_BIT)
    00057 # define SYSREG_SR_V_BIT                3
    00058 # define SYSREG_SR_V                    (1 << SYSREG_SR_V_BIT)
    00059 # define SYSREG_SR_Q_BIT                4
    00060 # define SYSREG_SR_Q                    (1 << SYSREG_SR_Q_BIT)
    00061 # define SYSREG_SR_L_BIT                5
    00062 # define SYSREG_SR_L                    (1 << SYSREG_SR_L_BIT)
    00063 # define SYSREG_SR_T_BIT                14
    00064 # define SYSREG_SR_T                    (1 << SYSREG_SR_T_BIT)
    00065 # define SYSREG_SR_R_BIT                15
    00066 # define SYSREG_SR_R                    (1 << SYSREG_SR_R_BIT)
    00067 # define SYSREG_SR_GM_BIT               16
    00068 # define SYSREG_SR_GM                   (1 << SYSREG_SR_GM_BIT)
    00069 # define SYSREG_SR_IM_BIT(n)            (17 + (n))
    00070 # define SYSREG_SR_IM(n)                (1 << SYSREG_SR_IM_BIT(n))
    00071 # define SYSREG_SR_IxM                  (0xf << 17)
    00072 # define SYSREG_SR_EM_BIT               21
    00073 # define SYSREG_SR_EM                   (1 << SYSREG_SR_EM_BIT)
    00074 # define SYSREG_SR_MODE_BIT(x)          ((x) + 22)
    00075 # define SYSREG_SR_MODE(x)              ((x) << SYSREG_SR_MODE_BIT(0))
    00076 # define SYSREG_SR_GET_MODE(reg)        (((reg) >> 22) & 0x07)
    00077 # define SYSREG_SR_D_BIT                26
    00078 # define SYSREG_SR_D                    (1 << SYSREG_SR_D_BIT)
    00079 # define SYSREG_SR_DM_BIT               27
    00080 # define SYSREG_SR_DM                   (1 << SYSREG_SR_DM_BIT)
    00081 # define SYSREG_SR_J_BIT                28
    00082 # define SYSREG_SR_J                    (1 << SYSREG_SR_J_BIT)
    00083 # define SYSREG_SR_H_BIT                29
    00084 # define SYSREG_SR_H                    (1 << SYSREG_SR_H_BIT)
    00085 #define SYSREG_EVBA                     0x0004
    00086 #define SYSREG_ACBA                     0x0008
    00087 #define SYSREG_CPUCR                    0x000c
    00088 #define SYSREG_ECR                      0x0010
    00089 #define SYSREG_RSR_SUP                  0x0014
    00090 #define SYSREG_RSR_INT0                 0x0018
    00091 #define SYSREG_RSR_INT1                 0x001c
    00092 #define SYSREG_RSR_INT2                 0x0020
    00093 #define SYSREG_RSR_INT3                 0x0024
    00094 #define SYSREG_RSR_EX                   0x0028
    00095 #define SYSREG_RSR_NMI                  0x002c
    00096 #define SYSREG_RSR_DBG                  0x0030
    00097 #define SYSREG_RAR_SUP                  0x0034
    00098 #define SYSREG_RAR_INT0                 0x0038
    00099 #define SYSREG_RAR_INT1                 0x003c
    00100 #define SYSREG_RAR_INT2                 0x0040
    00101 #define SYSREG_RAR_INT3                 0x0044
    00102 #define SYSREG_RAR_EX                   0x0048
    00103 #define SYSREG_RAR_NMI                  0x004c
    00104 #define SYSREG_RAR_DBG                  0x0050
    00105 #define SYSREG_JECR                     0x0054
    00106 #define SYSREG_JOSP                     0x0058
    00107 #define SYSREG_JAVA_LV0                 0x005c
    00108 #define SYSREG_JAVA_LV1                 0x0060
    00109 #define SYSREG_JAVA_LV2                 0x0064
    00110 #define SYSREG_JAVA_LV3                 0x0068
    00111 #define SYSREG_JAVA_LV4                 0x006c
    00112 #define SYSREG_JAVA_LV5                 0x0070
    00113 #define SYSREG_JAVA_LV6                 0x0074
    00114 #define SYSREG_JAVA_LV7                 0x0078
    00115 #define SYSREG_JTBA                     0x007c
    00116 #define SYSREG_JBCR                     0x0080
    00117 #define SYSREG_CONFIG0                  0x0100
    00118 # define SYSREG_CONFIG0_R               (1 <<  0)
    00119 # define SYSREG_CONFIG0_D               (1 <<  1)
    00120 # define SYSREG_CONFIG0_S               (1 <<  2)
    00121 # define SYSREG_CONFIG0_O               (1 <<  3)
    00122 # define SYSREG_CONFIG0_P               (1 <<  4)
    00123 # define SYSREG_CONFIG0_J               (1 <<  5)
    00124 # define SYSREG_CONFIG0_F               (1 <<  6)
    00125 # define SYSREG_CONFIG0_GET_MMUT(reg)   (((reg) >> 7) & 7)
    00126 #  define SYSREG_CONFIG0_MMUT_NONE      0
    00127 #  define SYSREG_CONFIG0_MMUT_SEPARATE  1
    00128 #  define SYSREG_CONFIG0_MMUT_SHARED    2
    00129 #  define SYSREG_CONFIG0_MMUT_MPU       3
    00130 # define SYSREG_CONFIG0_GET_AR(reg)     (((reg) >> 10) & 7)
    00131 # define SYSREG_CONFIG0_GET_AT(reg)     (((reg) >> 13) & 7)
    00132 # define SYSREG_CONFIG0_GET_PR(reg)     (((reg) >> 16) & 15)
    00133 # define SYSREG_CONFIG0_GET_PT(reg)     (((reg) >> 24) & 0xff)
    00134 #define SYSREG_CONFIG1                  0x0104
    00135
    00136 # define SYSREG_CONFIG1_GET_DASS(reg)   ((reg) & 7)
    00138 # define SYSREG_CONFIG1_GET_DLSZ(reg)   (((reg) >> 3) & 7)
    00140 # define SYSREG_CONFIG1_GET_DSET(reg)   (((reg) >> 6) & 15)
    00142 # define SYSREG_CONFIG1_GET_IASS(reg)   (((reg) >> 10) & 7)
    00144 # define SYSREG_CONFIG1_GET_ILSZ(reg)   (((reg) >> 13) & 7)
    00146 # define SYSREG_CONFIG1_GET_ISET(reg)   (((reg) >> 16) & 15)
    00148 # define SYSREG_CONFIG1_GET_DMMUSZ(reg) (((reg) >> 20) & 0x3f)
    00150 # define SYSREG_CONFIG1_GET_IMMUSZ(reg) (((reg) >> 26) & 0x3f)
    00151 #define SYSREG_COUNT                    0x0108
    00152 #define SYSREG_COMPARE                  0x010c
    00153 #define SYSREG_TLBEHI                   0x0110
    00154 # define SYSREG_TLBEHI_ASID(x)          (x)
    00155 # define SYSREG_TLBEHI_I                (  1 <<  8)
    00156 # define SYSREG_TLBEHI_V                (  1 <<  9)
    00157 # define SYSREG_VPN(v)                  ((v) << 10)
    00158 #define SYSREG_TLBELO                   0x0114
    00159 # define SYSREG_TLBELO_W                (  1 <<  0)
    00160 # define SYSREG_TLBELO_D                (  1 <<  1)
    00161 # define SYSREG_TLBELO_SZ_1K            (  0 <<  2)
    00162 # define SYSREG_TLBELO_SZ_4K            (  1 <<  2)
    00163 # define SYSREG_TLBELO_SZ_64K           (  2 <<  2)
    00164 # define SYSREG_TLBELO_SZ_1M            (  3 <<  2)
    00165 # define SYSREG_TLBELO_AP_X             (  1 <<  4)
    00166 # define SYSREG_TLBELO_AP_W             (  1 <<  5)
    00167 # define SYSREG_TLBELO_AP_U             (  1 <<  6)
    00168 # define SYSREG_TLBELO_B                (  1 <<  7)
    00169 # define SYSREG_TLBELO_G                (  1 <<  8)
    00170 # define SYSREG_TLBELO_C                (  1 <<  9)
    00171 # define SYSREG_TLBELO_PFN(p)           ((p) << 10)
    00172 #define SYSREG_PTBR                     0x0118
    00173 #define SYSREG_TLBEAR                   0x011c
    00174 #define SYSREG_MMUCR                    0x0120
    00175 # define SYSREG_MMUCR_E                 (  1 <<  0)
    00176 # define SYSREG_MMUCR_M                 (  1 <<  1)
    00177 # define SYSREG_MMUCR_I                 (  1 <<  2)
    00178 # define SYSREG_MMUCR_N                 (  1 <<  3)
    00179 # define SYSREG_MMUCR_S                 (  1 <<  4)
    00180 # define SYSREG_MMUCR_DLA(x)            ((x) <<  8)
    00181 # define SYSREG_MMUCR_DRP(x)            ((x) << 14)
    00182 # define SYSREG_MMUCR_ILA(x)            ((x) << 20)
    00183 # define SYSREG_MMUCR_IRP(x)            ((x) << 26)
    00184 #define SYSREG_TLBARLO                  0x0124
    00185 #define SYSREG_TLBARHI                  0x0128
    00186 #define SYSREG_PCCNT                    0x012c
    00187 #define SYSREG_PCNT0                    0x0130
    00188 #define SYSREG_PCNT1                    0x0134
    00189 #define SYSREG_PCCR                     0x0138
    00190 # define SYSREG_PCCR_E                  (  1 <<  0)
    00191 # define SYSREG_PCCR_R                  (  1 <<  1)
    00192 # define SYSREG_PCCR_C                  (  1 <<  2)
    00193 # define SYSREG_PCCR_S                  (  1 <<  3)
    00194 # define SYSREG_PCCR_IE(mask)           ((mask) <<  4)
    00195 # define SYSREG_PCCR_F(mask)            ((mask) <<  8)
    00196 # define SYSREG_PCCR_CONF0(evt)         ((evt)  << 12)
    00197 # define SYSREG_PCCR_CONF1(evt)         ((evt)  << 18)
    00198 #define SYSREG_BEAR                     0x013c
    00199 #define SYSREG_MPUAR0                   0x0140
    00200 #define SYSREG_MPUAR1                   0x0144
    00201 #define SYSREG_MPUAR2                   0x0148
    00202 #define SYSREG_MPUAR3                   0x014c
    00203 #define SYSREG_MPUAR4                   0x0150
    00204 #define SYSREG_MPUAR5                   0x0154
    00205 #define SYSREG_MPUAR6                   0x0158
    00206 #define SYSREG_MPUAR7                   0x015c
    00207 #define SYSREG_MPUPSR0                  0x0160
    00208 #define SYSREG_MPUPSR1                  0x0164
    00209 #define SYSREG_MPUPSR2                  0x0168
    00210 #define SYSREG_MPUPSR3                  0x016c
    00211 #define SYSREG_MPUPSR4                  0x0170
    00212 #define SYSREG_MPUPSR5                  0x0174
    00213 #define SYSREG_MPUPSR6                  0x0178
    00214 #define SYSREG_MPUPSR7                  0x017c
    00215 #define SYSREG_MPUCRA                   0x0180
    00216 #define SYSREG_MPUCRB                   0x0184
    00217 #define SYSREG_MPUBRA                   0x0188
    00218 #define SYSREG_MPUBRB                   0x018c
    00219 #define SYSREG_MPUAPRA                  0x0190
    00220 #define SYSREG_MPUAPRB                  0x0194
    00221 #define SYSREG_MPUCR                    0x0198
    00222
    00223 /* Register access macros */
    00224 #define sysreg_read(reg)                __builtin_mfsr(SYSREG_##reg)
    00225 #define sysreg_write(reg, value)        __builtin_mtsr(SYSREG_##reg, value)
    00226
    00227 #endif /* SYSREG_H_INCLUDED */