1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     reg_common.h
4 
5   Copyright (C)2009 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 12449 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_HW_ARM_REG_COMMON_H_
17 #define NN_HW_ARM_REG_COMMON_H_
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 
24 //----------------------------------------------------------------------
25 //                  Program Status Register
26 //----------------------------------------------------------------------
27 
28 #define HW_PSR_CPU_MODE_MASK       0x1f // CPU mode
29 
30 #define HW_PSR_USR_MODE            0x10 // User mode
31 #define HW_PSR_FIQ_MODE            0x11 // FIQ mode
32 #define HW_PSR_IRQ_MODE            0x12 // IRQ mode
33 #define HW_PSR_SVC_MODE            0x13 // Supervisor mode
34 #define HW_PSR_ABORT_MODE          0x17 // Abort mode (prefetch/Data)
35 #define HW_PSR_UNDEF_MODE          0x1b // Undefined instruction mode
36 #define HW_PSR_SYS_MODE            0x1f // System mode
37 
38 #define HW_PSR_ARM_STATE           0x0  // ARM state
39 #define HW_PSR_THUMB_STATE         0x20 // Thumb state
40 
41 #define HW_PSR_FIQ_DISABLE         0x40 // FIQ Disable
42 #define HW_PSR_IRQ_DISABLE         0x80 // IRQ Disable
43 #define HW_PSR_IRQ_FIQ_DISABLE     0xc0 // IRQ & FIQ Disable
44 
45 #define HW_PSR_IRQ_DISABLE_SHIFT   7   // HW_PSR_IRQ_DISABLE == (1 << PSR_IRQ_DISABLE_SHIFT)
46 
47 #if defined(SDK_ARM11) || defined(NN_PROCESSOR_ARM_V6)
48 
49 #define HW_PSR_IMPR_ABORT_DISABLE  0x00000100   // Imprecise Abort Disable
50 #define HW_PSR_DATA_LITTLE_ENDIAN  0x00000000   // Data Little Endian
51 #define HW_PSR_DATA_BIG_ENDIAN     0x00000200   // Data Big Endian
52 
53 #define HW_PSR_SIMD_GE0            0x00010000   // SIMD greater-than-or-equal
54 #define HW_PSR_SIMD_GE1            0x00020000
55 #define HW_PSR_SIMD_GE2            0x00040000
56 #define HW_PSR_SIMD_GE3            0x00080000
57 
58 #define HW_PSR_JAVA_STATE          0x01000000   // JAVA state
59 
60 #endif // SDK_ARM11
61 
62 #define HW_PSR_Q_FLAG              0x08000000   // Sticky Overflow (Q) flag
63 #define HW_PSR_V_FLAG              0x10000000   // Overflow flag
64 #define HW_PSR_C_FLAG              0x20000000   // Carry/Borrow/Extend flag
65 #define HW_PSR_Z_FLAG              0x40000000   // Zero flag
66 #define HW_PSR_N_FLAG              0x80000000   // Negative/Less than flag
67 
68 
69 #ifdef __cplusplus
70 } // extern "C"
71 #endif
72 
73 // NN_HW_ARM_REG_COMMON_H_
74 #endif
75