@micro-os-plus/architecture-riscv 4.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +84 -2
- package/CMakeLists.txt +68 -52
- package/LICENSE +1 -1
- package/README.md +34 -25
- package/include/micro-os-plus/architecture-riscv/core-functions.h +11 -7
- package/include/micro-os-plus/architecture-riscv/csr-functions.h +12 -8
- package/include/micro-os-plus/architecture-riscv/declarations.h +7 -8
- package/include/micro-os-plus/architecture-riscv/defines.h +10 -11
- package/include/micro-os-plus/architecture-riscv/device-functions.h +9 -10
- package/include/micro-os-plus/architecture-riscv/{core-functions-inlines.h → inlines/core-functions-inlines.h} +9 -10
- package/include/micro-os-plus/architecture-riscv/{csr-functions-inlines.h → inlines/csr-functions-inlines.h} +25 -26
- package/include/micro-os-plus/architecture-riscv/{device-functions-inlines.h → inlines/device-functions-inlines.h} +9 -10
- package/include/micro-os-plus/architecture-riscv/{instructions-inlines.h → inlines/instructions-inlines.h} +12 -13
- package/include/micro-os-plus/architecture-riscv/{platform-functions-inlines.h → inlines/platform-functions-inlines.h} +9 -10
- package/include/micro-os-plus/architecture-riscv/inlines/semihosting-inlines.h +46 -0
- package/include/micro-os-plus/architecture-riscv/instructions.h +12 -8
- package/include/micro-os-plus/architecture-riscv/platform-functions.h +6 -7
- package/include/micro-os-plus/architecture-riscv/plic-functions.h +7 -8
- package/include/micro-os-plus/architecture-riscv/types.h +6 -7
- package/include/micro-os-plus/architecture.h +34 -17
- package/linker-scripts/sections-flash.ld +6 -7
- package/linker-scripts/sections-ram.ld +6 -7
- package/meson.build +81 -22
- package/package.json +56 -21
- package/src/semihosting.cpp +58 -0
- package/xcdl-package.jsonc +32 -0
- package/include/micro-os-plus/architecture-riscv/semihosting-inlines.h +0 -79
- package/src/.gitkeep +0 -0
- package/xpack.json +0 -23
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2017 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2017-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
|
-
#ifndef
|
|
14
|
-
#define
|
|
12
|
+
#ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_CSR_FUNCTIONS_INLINES_H_
|
|
13
|
+
#define MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_CSR_FUNCTIONS_INLINES_H_
|
|
15
14
|
|
|
16
15
|
// ----------------------------------------------------------------------------
|
|
17
16
|
|
|
@@ -56,7 +55,7 @@ extern "C"
|
|
|
56
55
|
{
|
|
57
56
|
riscv_architecture_register_t tmp;
|
|
58
57
|
|
|
59
|
-
__asm__ volatile(
|
|
58
|
+
__asm__ volatile (
|
|
60
59
|
|
|
61
60
|
"csrr %[r],mstatus"
|
|
62
61
|
|
|
@@ -71,7 +70,7 @@ extern "C"
|
|
|
71
70
|
static inline __attribute__ ((always_inline)) void
|
|
72
71
|
riscv_csr_write_mstatus (riscv_architecture_register_t value)
|
|
73
72
|
{
|
|
74
|
-
__asm__ volatile(
|
|
73
|
+
__asm__ volatile (
|
|
75
74
|
|
|
76
75
|
"csrw mstatus,%[v]"
|
|
77
76
|
|
|
@@ -86,7 +85,7 @@ extern "C"
|
|
|
86
85
|
{
|
|
87
86
|
riscv_architecture_register_t tmp;
|
|
88
87
|
|
|
89
|
-
__asm__ volatile(
|
|
88
|
+
__asm__ volatile (
|
|
90
89
|
|
|
91
90
|
"csrrc %[r],mstatus,%[v]"
|
|
92
91
|
|
|
@@ -103,7 +102,7 @@ extern "C"
|
|
|
103
102
|
{
|
|
104
103
|
riscv_architecture_register_t tmp;
|
|
105
104
|
|
|
106
|
-
__asm__ volatile(
|
|
105
|
+
__asm__ volatile (
|
|
107
106
|
|
|
108
107
|
"csrrs %[r],mstatus,%[v]"
|
|
109
108
|
|
|
@@ -125,7 +124,7 @@ extern "C"
|
|
|
125
124
|
{
|
|
126
125
|
riscv_architecture_register_t tmp;
|
|
127
126
|
|
|
128
|
-
__asm__ volatile(
|
|
127
|
+
__asm__ volatile (
|
|
129
128
|
|
|
130
129
|
"csrr %[r],mtvec"
|
|
131
130
|
|
|
@@ -143,7 +142,7 @@ extern "C"
|
|
|
143
142
|
static inline __attribute__ ((always_inline)) void
|
|
144
143
|
riscv_csr_write_mtvec (riscv_architecture_register_t value)
|
|
145
144
|
{
|
|
146
|
-
__asm__ volatile(
|
|
145
|
+
__asm__ volatile (
|
|
147
146
|
|
|
148
147
|
"csrw mtvec,%[v]"
|
|
149
148
|
|
|
@@ -160,7 +159,7 @@ extern "C"
|
|
|
160
159
|
{
|
|
161
160
|
riscv_architecture_register_t tmp;
|
|
162
161
|
|
|
163
|
-
__asm__ volatile(
|
|
162
|
+
__asm__ volatile (
|
|
164
163
|
|
|
165
164
|
"csrr %[r],mcause"
|
|
166
165
|
|
|
@@ -179,7 +178,7 @@ extern "C"
|
|
|
179
178
|
{
|
|
180
179
|
riscv_architecture_register_t tmp;
|
|
181
180
|
|
|
182
|
-
__asm__ volatile(
|
|
181
|
+
__asm__ volatile (
|
|
183
182
|
|
|
184
183
|
"csrr %[r],mie"
|
|
185
184
|
|
|
@@ -194,7 +193,7 @@ extern "C"
|
|
|
194
193
|
static inline __attribute__ ((always_inline)) void
|
|
195
194
|
riscv_csr_write_mie (riscv_architecture_register_t value)
|
|
196
195
|
{
|
|
197
|
-
__asm__ volatile(
|
|
196
|
+
__asm__ volatile (
|
|
198
197
|
|
|
199
198
|
"csrw mie,%[v]"
|
|
200
199
|
|
|
@@ -209,7 +208,7 @@ extern "C"
|
|
|
209
208
|
{
|
|
210
209
|
riscv_architecture_register_t tmp;
|
|
211
210
|
|
|
212
|
-
__asm__ volatile(
|
|
211
|
+
__asm__ volatile (
|
|
213
212
|
|
|
214
213
|
"csrrc %[r],mie,%[v]"
|
|
215
214
|
|
|
@@ -226,7 +225,7 @@ extern "C"
|
|
|
226
225
|
{
|
|
227
226
|
riscv_architecture_register_t tmp;
|
|
228
227
|
|
|
229
|
-
__asm__ volatile(
|
|
228
|
+
__asm__ volatile (
|
|
230
229
|
|
|
231
230
|
"csrrs %[r],mie,%[v]"
|
|
232
231
|
|
|
@@ -250,7 +249,7 @@ extern "C"
|
|
|
250
249
|
{
|
|
251
250
|
riscv_architecture_register_t tmp;
|
|
252
251
|
|
|
253
|
-
__asm__ volatile(
|
|
252
|
+
__asm__ volatile (
|
|
254
253
|
|
|
255
254
|
"csrr %[r],mcycle"
|
|
256
255
|
|
|
@@ -270,7 +269,7 @@ extern "C"
|
|
|
270
269
|
|
|
271
270
|
uint32_t tmp;
|
|
272
271
|
|
|
273
|
-
__asm__ volatile(
|
|
272
|
+
__asm__ volatile (
|
|
274
273
|
|
|
275
274
|
"csrr %[r],mcycle"
|
|
276
275
|
|
|
@@ -294,7 +293,7 @@ extern "C"
|
|
|
294
293
|
|
|
295
294
|
uint32_t tmp;
|
|
296
295
|
|
|
297
|
-
__asm__ volatile(
|
|
296
|
+
__asm__ volatile (
|
|
298
297
|
|
|
299
298
|
"csrr %[r],mcycleh"
|
|
300
299
|
|
|
@@ -306,7 +305,7 @@ extern "C"
|
|
|
306
305
|
|
|
307
306
|
#elif __riscv_xlen == 64
|
|
308
307
|
|
|
309
|
-
return (uint32_t)
|
|
308
|
+
return (uint32_t)(riscv_csr_read_mcycle () >> 32);
|
|
310
309
|
|
|
311
310
|
#endif // __riscv_xlen
|
|
312
311
|
}
|
|
@@ -318,7 +317,7 @@ extern "C"
|
|
|
318
317
|
{
|
|
319
318
|
riscv_architecture_register_t tmp;
|
|
320
319
|
|
|
321
|
-
__asm__ volatile(
|
|
320
|
+
__asm__ volatile (
|
|
322
321
|
|
|
323
322
|
"csrr %[r],mhartid"
|
|
324
323
|
|
|
@@ -461,6 +460,6 @@ namespace riscv
|
|
|
461
460
|
|
|
462
461
|
// ----------------------------------------------------------------------------
|
|
463
462
|
|
|
464
|
-
#endif //
|
|
463
|
+
#endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_CSR_FUNCTIONS_INLINES_H_
|
|
465
464
|
|
|
466
465
|
// ----------------------------------------------------------------------------
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2017 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2017-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
|
-
#ifndef
|
|
14
|
-
#define
|
|
12
|
+
#ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_DEVICE_FUNCTIONS_INLINES_H_
|
|
13
|
+
#define MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_DEVICE_FUNCTIONS_INLINES_H_
|
|
15
14
|
|
|
16
15
|
// ----------------------------------------------------------------------------
|
|
17
16
|
|
|
@@ -230,6 +229,6 @@ namespace riscv
|
|
|
230
229
|
|
|
231
230
|
// ----------------------------------------------------------------------------
|
|
232
231
|
|
|
233
|
-
#endif //
|
|
232
|
+
#endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_DEVICE_FUNCTIONS_INLINES_H_
|
|
234
233
|
|
|
235
234
|
// ----------------------------------------------------------------------------
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2017 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2017-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
|
-
#ifndef
|
|
14
|
-
#define
|
|
12
|
+
#ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_INSTRUCTIONS_INLINES_H_
|
|
13
|
+
#define MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_INSTRUCTIONS_INLINES_H_
|
|
15
14
|
|
|
16
15
|
// ----------------------------------------------------------------------------
|
|
17
16
|
|
|
@@ -31,7 +30,7 @@ extern "C"
|
|
|
31
30
|
static inline __attribute__ ((always_inline)) void
|
|
32
31
|
riscv_architecture_nop (void)
|
|
33
32
|
{
|
|
34
|
-
__asm__ volatile(
|
|
33
|
+
__asm__ volatile (
|
|
35
34
|
|
|
36
35
|
" nop "
|
|
37
36
|
|
|
@@ -44,7 +43,7 @@ extern "C"
|
|
|
44
43
|
static inline __attribute__ ((always_inline)) void
|
|
45
44
|
riscv_architecture_ebreak (void)
|
|
46
45
|
{
|
|
47
|
-
__asm__ volatile(
|
|
46
|
+
__asm__ volatile (
|
|
48
47
|
|
|
49
48
|
" ebreak "
|
|
50
49
|
|
|
@@ -57,7 +56,7 @@ extern "C"
|
|
|
57
56
|
static inline __attribute__ ((always_inline)) void
|
|
58
57
|
riscv_architecture_wfi (void)
|
|
59
58
|
{
|
|
60
|
-
__asm__ volatile(
|
|
59
|
+
__asm__ volatile (
|
|
61
60
|
|
|
62
61
|
" wfi "
|
|
63
62
|
|
|
@@ -167,6 +166,6 @@ namespace micro_os_plus
|
|
|
167
166
|
|
|
168
167
|
// ----------------------------------------------------------------------------
|
|
169
168
|
|
|
170
|
-
#endif //
|
|
169
|
+
#endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_INSTRUCTIONS_INLINES_H_
|
|
171
170
|
|
|
172
171
|
// ----------------------------------------------------------------------------
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2017 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2017-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
|
-
#ifndef
|
|
14
|
-
#define
|
|
12
|
+
#ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_PLATFORM_FUNCTIONS_INLINES_H_
|
|
13
|
+
#define MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_PLATFORM_FUNCTIONS_INLINES_H_
|
|
15
14
|
|
|
16
15
|
// ----------------------------------------------------------------------------
|
|
17
16
|
|
|
@@ -76,6 +75,6 @@ namespace riscv
|
|
|
76
75
|
|
|
77
76
|
// ----------------------------------------------------------------------------
|
|
78
77
|
|
|
79
|
-
#endif //
|
|
78
|
+
#endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_PLATFORM_FUNCTIONS_INLINES_H_
|
|
80
79
|
|
|
81
80
|
// ----------------------------------------------------------------------------
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2015-2026 Liviu Ionescu. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
7
|
+
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_SEMIHOSTING_INLINES_H_
|
|
13
|
+
#define MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_SEMIHOSTING_INLINES_H_
|
|
14
|
+
|
|
15
|
+
// ----------------------------------------------------------------------------
|
|
16
|
+
|
|
17
|
+
#if defined(__cplusplus)
|
|
18
|
+
extern "C"
|
|
19
|
+
{
|
|
20
|
+
#endif // defined(__cplusplus)
|
|
21
|
+
|
|
22
|
+
// --------------------------------------------------------------------------
|
|
23
|
+
|
|
24
|
+
// The hint that differentiates the semihosting call.
|
|
25
|
+
#define RISCV_SEMIHOSTING_CALL_NUMBER 7
|
|
26
|
+
|
|
27
|
+
// --------------------------------------------------------------------------
|
|
28
|
+
|
|
29
|
+
// Type of each entry in a parameter block.
|
|
30
|
+
typedef micro_os_plus_architecture_register_t
|
|
31
|
+
micro_os_plus_semihosting_param_block_t;
|
|
32
|
+
// Type of result.
|
|
33
|
+
typedef micro_os_plus_architecture_signed_register_t
|
|
34
|
+
micro_os_plus_semihosting_response_t;
|
|
35
|
+
|
|
36
|
+
// --------------------------------------------------------------------------
|
|
37
|
+
|
|
38
|
+
#if defined(__cplusplus)
|
|
39
|
+
}
|
|
40
|
+
#endif // defined(__cplusplus)
|
|
41
|
+
|
|
42
|
+
// ----------------------------------------------------------------------------
|
|
43
|
+
|
|
44
|
+
#endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_SEMIHOSTING_INLINES_H_
|
|
45
|
+
|
|
46
|
+
// ----------------------------------------------------------------------------
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2017 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2017-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
#ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_ARCH_INSTRUCTIONS_H_
|
|
@@ -15,7 +14,7 @@
|
|
|
15
14
|
|
|
16
15
|
// ----------------------------------------------------------------------------
|
|
17
16
|
|
|
18
|
-
#include
|
|
17
|
+
#include "micro-os-plus/architecture-riscv/defines.h"
|
|
19
18
|
|
|
20
19
|
#include <stdint.h>
|
|
21
20
|
|
|
@@ -146,6 +145,11 @@ namespace micro_os_plus
|
|
|
146
145
|
|
|
147
146
|
#endif // defined(__cplusplus)
|
|
148
147
|
|
|
148
|
+
// ============================================================================
|
|
149
|
+
// Templates, inlines & constexpr implementations.
|
|
150
|
+
|
|
151
|
+
#include "inlines/instructions-inlines.h"
|
|
152
|
+
|
|
149
153
|
// ----------------------------------------------------------------------------
|
|
150
154
|
|
|
151
155
|
#endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_ARCH_INSTRUCTIONS_H_
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2017 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2017-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
#ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_PLATFORM_FUNCTIONS_H_
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2017 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2017-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
#ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_PLIC_FUNCTIONS_H_
|
|
@@ -15,7 +14,7 @@
|
|
|
15
14
|
|
|
16
15
|
// ----------------------------------------------------------------------------
|
|
17
16
|
|
|
18
|
-
#include
|
|
17
|
+
#include "micro-os-plus/architecture-riscv/types.h"
|
|
19
18
|
|
|
20
19
|
#include <stdbool.h>
|
|
21
20
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2017 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2017-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
#ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_ARCH_TYPES_H_
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2017 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2017-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
#ifndef MICRO_OS_PLUS_ARCHITECTURE_H_
|
|
@@ -15,21 +14,39 @@
|
|
|
15
14
|
|
|
16
15
|
// ----------------------------------------------------------------------------
|
|
17
16
|
|
|
18
|
-
#
|
|
17
|
+
#if defined(__cplusplus)
|
|
18
|
+
#if !(__cplusplus >= 202002L || (defined(_MSVC_LANG) && _MSVC_LANG >= 202002L))
|
|
19
|
+
#error "C++20 or higher is required"
|
|
20
|
+
#endif
|
|
21
|
+
#endif // defined(__cplusplus)
|
|
19
22
|
|
|
20
|
-
#
|
|
21
|
-
#include
|
|
23
|
+
#if __has_include("micro-os-plus/project-config.h")
|
|
24
|
+
#include "micro-os-plus/project-config.h"
|
|
25
|
+
#endif // __has_include("micro-os-plus/project-config.h")
|
|
22
26
|
|
|
23
|
-
#
|
|
24
|
-
#include
|
|
27
|
+
#if __has_include("micro-os-plus/architecture-defines.h")
|
|
28
|
+
#include "micro-os-plus/architecture-defines.h"
|
|
29
|
+
#endif // __has_include("micro-os-plus/architecture-defines.h")
|
|
25
30
|
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
// ----------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
// No guard is needed; there can be only one architecture in a build.
|
|
34
|
+
// #if defined(MICRO_OS_PLUS_INCLUDE_ARCHITECTURES_RISCV_ENABLED)
|
|
35
|
+
|
|
36
|
+
// ----------------------------------------------------------------------------
|
|
28
37
|
|
|
29
|
-
#include
|
|
30
|
-
#include
|
|
38
|
+
#include "micro-os-plus/architecture-riscv/defines.h"
|
|
39
|
+
#include "micro-os-plus/architecture-riscv/types.h"
|
|
40
|
+
#include "micro-os-plus/architecture-riscv/declarations.h"
|
|
41
|
+
#include "micro-os-plus/architecture-riscv/instructions.h"
|
|
42
|
+
#include "micro-os-plus/architecture-riscv/csr-functions.h"
|
|
43
|
+
#include "micro-os-plus/architecture-riscv/core-functions.h"
|
|
44
|
+
|
|
45
|
+
#include "micro-os-plus/architecture-riscv/inlines/semihosting-inlines.h"
|
|
46
|
+
|
|
47
|
+
// ----------------------------------------------------------------------------
|
|
31
48
|
|
|
32
|
-
#
|
|
49
|
+
// #endif // defined(MICRO_OS_PLUS_INCLUDE_ARCHITECTURES_RISCV_ENABLED)
|
|
33
50
|
|
|
34
51
|
// ----------------------------------------------------------------------------
|
|
35
52
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2022 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2022-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
/*
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* This file is part of the µOS++
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2022 Liviu Ionescu.
|
|
2
|
+
* This file is part of the µOS++ project (https://micro-os-plus.github.io/).
|
|
3
|
+
* Copyright (c) 2022-2026 Liviu Ionescu. All rights reserved.
|
|
5
4
|
*
|
|
6
|
-
* Permission to use, copy, modify, and/or distribute this software
|
|
7
|
-
*
|
|
5
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
* purpose is hereby granted, under the terms of the MIT license.
|
|
8
7
|
*
|
|
9
|
-
* If a copy of the license was not distributed with this file, it can
|
|
10
|
-
*
|
|
8
|
+
* If a copy of the license was not distributed with this file, it can be
|
|
9
|
+
* obtained from https://opensource.org/licenses/mit.
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
/*
|