RTEMS  5.0.0
v850.h
Go to the documentation of this file.
1 
12 /*
13  * COPYRIGHT (c) 1989-2012.
14  * On-Line Applications Research Corporation (OAR).
15  *
16  * The license and distribution terms for this file may be
17  * found in the file LICENSE in this distribution or at
18  * http://www.rtems.org/license/LICENSE.
19  */
20 
21 #ifndef _RTEMS_SCORE_V850_H
22 #define _RTEMS_SCORE_V850_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
28 /*
29  * This file contains the information required to build
30  * RTEMS for a particular member of the NO CPU family.
31  * It does this by setting variables to indicate which
32  * implementation dependent features are present in a particular
33  * member of the family.
34  *
35  * This is a good place to list all the known CPU models
36  * that this port supports and which RTEMS CPU model they correspond
37  * to.
38  */
39 
40 #if defined(rtems_multilib)
41 /*
42  * Figure out all CPU Model Feature Flags based upon compiler
43  * predefines.
44  */
45 #define CPU_MODEL_NAME "rtems_multilib"
46 #define V850_HAS_FPU 0
47 #define V850_HAS_BYTE_SWAP_INSTRUCTION 0
48 
49 #elif defined(__v850e2v3__)
50 #define CPU_MODEL_NAME "v850e2v3"
51 #define V850_HAS_FPU 1
52 #define V850_HAS_BYTE_SWAP_INSTRUCTION 1
53 
54 #elif defined(__v850e2__)
55 #define CPU_MODEL_NAME "v850e2"
56 #define V850_HAS_FPU 0
57 #define V850_HAS_BYTE_SWAP_INSTRUCTION 1
58 
59 #elif defined(__v850es__)
60 #define CPU_MODEL_NAME "v850es"
61 #define V850_HAS_FPU 0
62 #define V850_HAS_BYTE_SWAP_INSTRUCTION 1
63 
64 #elif defined(__v850e1__)
65 #define CPU_MODEL_NAME "v850e1"
66 #define V850_HAS_FPU 0
67 #define V850_HAS_BYTE_SWAP_INSTRUCTION 1
68 
69 #elif defined(__v850e__)
70 #define CPU_MODEL_NAME "v850e"
71 #define V850_HAS_FPU 0
72 #define V850_HAS_BYTE_SWAP_INSTRUCTION 1
73 
74 #else
75 #define CPU_MODEL_NAME "v850"
76 #define V850_HAS_FPU 0
77 #define V850_HAS_BYTE_SWAP_INSTRUCTION 0
78 
79 #endif
80 
81 /*
82  * Define the name of the CPU family.
83  */
84 #define CPU_NAME "v850 CPU"
85 
86 /*
87  * Method to set the Program Status Word (PSW)
88  */
89 #define v850_set_psw( _psw ) \
90  __asm__ __volatile__( "ldsr %0, psw" : : "r" (_psw) )
91 
92 /*
93  * Method to obtain the Program Status Word (PSW)
94  */
95 #define v850_get_psw( _psw ) \
96  __asm__ __volatile__( "stsr psw, %0" : "=&r" (_psw) )
97 
98 /*
99  * Masks and bits in the Program Status Word (PSW)
100  */
101 #define V850_PSW_ZERO_MASK 0x01
102 #define V850_PSW_IS_ZERO 0x01
103 #define V850_PSW_IS_NOT 0x00
104 
105 #define V850_PSW_SIGN_MASK 0x02
106 #define V850_PSW_SIGN_IS_NEGATIVE 0x02
107 #define V850_PSW_SIGN_IS_ZERO_OR_POSITIVE 0x00
108 
109 #define V850_PSW_OVERFLOW_MASK 0x02
110 #define V850_PSW_OVERFLOW_OCCURRED 0x02
111 #define V850_PSW_OVERFLOW_DID_NOT_OCCUR 0x00
112 
113 #define V850_PSW_CARRY_OR_BORROW_MASK 0x04
114 #define V850_PSW_CARRY_OR_BORROW_OCCURRED 0x04
115 #define V850_PSW_CARRY_OR_BORROW_DID_NOT_OCCUR 0x00
116 
117 #define V850_PSW_SATURATION_MASK 0x10
118 #define V850_PSW_SATURATION_OCCURRED 0x10
119 #define V850_PSW_SATURATION_DID_NOT_OCCUR 0x00
120 
121 #define V850_PSW_INTERRUPT_DISABLE_MASK 0x20
122 #define V850_PSW_INTERRUPT_DISABLE 0x20
123 #define V850_PSW_INTERRUPT_ENABLE 0x00
124 
125 #define V850_PSW_EXCEPTION_IN_PROCESS_MASK 0x40
126 #define V850_PSW_EXCEPTION_IN_PROCESS 0x40
127 #define V850_PSW_EXCEPTION_NOT_IN_PROCESS 0x00
128 
129 #define V850_PSW_NMI_IN_PROCESS_MASK 0x80
130 #define V850_PSW_NMI_IN_PROCESS 0x80
131 #define V850_PSW_NMI_NOT_IN_PROCESS 0x00
132 
133 #ifdef __cplusplus
134 }
135 #endif
136 
137 #endif /* _RTEMS_SCORE_V850_H */