RTEMS 6.1-rc2
Loading...
Searching...
No Matches
v850.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
14/*
15 * COPYRIGHT (c) 1989-2012.
16 * On-Line Applications Research Corporation (OAR).
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40#ifndef _RTEMS_SCORE_V850_H
41#define _RTEMS_SCORE_V850_H
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/*
48 * This file contains the information required to build
49 * RTEMS for a particular member of the NO CPU family.
50 * It does this by setting variables to indicate which
51 * implementation dependent features are present in a particular
52 * member of the family.
53 *
54 * This is a good place to list all the known CPU models
55 * that this port supports and which RTEMS CPU model they correspond
56 * to.
57 */
58
59#if defined(rtems_multilib)
60/*
61 * Figure out all CPU Model Feature Flags based upon compiler
62 * predefines.
63 */
64#define CPU_MODEL_NAME "rtems_multilib"
65#define V850_HAS_FPU 0
66#define V850_HAS_BYTE_SWAP_INSTRUCTION 0
67
68#elif defined(__v850e2v3__)
69#define CPU_MODEL_NAME "v850e2v3"
70#define V850_HAS_FPU 1
71#define V850_HAS_BYTE_SWAP_INSTRUCTION 1
72
73#elif defined(__v850e2__)
74#define CPU_MODEL_NAME "v850e2"
75#define V850_HAS_FPU 0
76#define V850_HAS_BYTE_SWAP_INSTRUCTION 1
77
78#elif defined(__v850es__)
79#define CPU_MODEL_NAME "v850es"
80#define V850_HAS_FPU 0
81#define V850_HAS_BYTE_SWAP_INSTRUCTION 1
82
83#elif defined(__v850e1__)
84#define CPU_MODEL_NAME "v850e1"
85#define V850_HAS_FPU 0
86#define V850_HAS_BYTE_SWAP_INSTRUCTION 1
87
88#elif defined(__v850e__)
89#define CPU_MODEL_NAME "v850e"
90#define V850_HAS_FPU 0
91#define V850_HAS_BYTE_SWAP_INSTRUCTION 1
92
93#else
94#define CPU_MODEL_NAME "v850"
95#define V850_HAS_FPU 0
96#define V850_HAS_BYTE_SWAP_INSTRUCTION 0
97
98#endif
99
100/*
101 * Define the name of the CPU family.
102 */
103#define CPU_NAME "v850 CPU"
104
105/*
106 * Method to set the Program Status Word (PSW)
107 */
108#define v850_set_psw( _psw ) \
109 __asm__ __volatile__( "ldsr %0, psw" : : "r" (_psw) )
110
111/*
112 * Method to obtain the Program Status Word (PSW)
113 */
114#define v850_get_psw( _psw ) \
115 __asm__ __volatile__( "stsr psw, %0" : "=&r" (_psw) )
116
117/*
118 * Masks and bits in the Program Status Word (PSW)
119 */
120#define V850_PSW_ZERO_MASK 0x01
121#define V850_PSW_IS_ZERO 0x01
122#define V850_PSW_IS_NOT 0x00
123
124#define V850_PSW_SIGN_MASK 0x02
125#define V850_PSW_SIGN_IS_NEGATIVE 0x02
126#define V850_PSW_SIGN_IS_ZERO_OR_POSITIVE 0x00
127
128#define V850_PSW_OVERFLOW_MASK 0x02
129#define V850_PSW_OVERFLOW_OCCURRED 0x02
130#define V850_PSW_OVERFLOW_DID_NOT_OCCUR 0x00
131
132#define V850_PSW_CARRY_OR_BORROW_MASK 0x04
133#define V850_PSW_CARRY_OR_BORROW_OCCURRED 0x04
134#define V850_PSW_CARRY_OR_BORROW_DID_NOT_OCCUR 0x00
135
136#define V850_PSW_SATURATION_MASK 0x10
137#define V850_PSW_SATURATION_OCCURRED 0x10
138#define V850_PSW_SATURATION_DID_NOT_OCCUR 0x00
139
140#define V850_PSW_INTERRUPT_DISABLE_MASK 0x20
141#define V850_PSW_INTERRUPT_DISABLE 0x20
142#define V850_PSW_INTERRUPT_ENABLE 0x00
143
144#define V850_PSW_EXCEPTION_IN_PROCESS_MASK 0x40
145#define V850_PSW_EXCEPTION_IN_PROCESS 0x40
146#define V850_PSW_EXCEPTION_NOT_IN_PROCESS 0x00
147
148#define V850_PSW_NMI_IN_PROCESS_MASK 0x80
149#define V850_PSW_NMI_IN_PROCESS 0x80
150#define V850_PSW_NMI_NOT_IN_PROCESS 0x00
151
152#ifdef __cplusplus
153}
154#endif
155
156#endif /* _RTEMS_SCORE_V850_H */