@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.
Files changed (29) hide show
  1. package/CHANGELOG.md +84 -2
  2. package/CMakeLists.txt +68 -52
  3. package/LICENSE +1 -1
  4. package/README.md +34 -25
  5. package/include/micro-os-plus/architecture-riscv/core-functions.h +11 -7
  6. package/include/micro-os-plus/architecture-riscv/csr-functions.h +12 -8
  7. package/include/micro-os-plus/architecture-riscv/declarations.h +7 -8
  8. package/include/micro-os-plus/architecture-riscv/defines.h +10 -11
  9. package/include/micro-os-plus/architecture-riscv/device-functions.h +9 -10
  10. package/include/micro-os-plus/architecture-riscv/{core-functions-inlines.h → inlines/core-functions-inlines.h} +9 -10
  11. package/include/micro-os-plus/architecture-riscv/{csr-functions-inlines.h → inlines/csr-functions-inlines.h} +25 -26
  12. package/include/micro-os-plus/architecture-riscv/{device-functions-inlines.h → inlines/device-functions-inlines.h} +9 -10
  13. package/include/micro-os-plus/architecture-riscv/{instructions-inlines.h → inlines/instructions-inlines.h} +12 -13
  14. package/include/micro-os-plus/architecture-riscv/{platform-functions-inlines.h → inlines/platform-functions-inlines.h} +9 -10
  15. package/include/micro-os-plus/architecture-riscv/inlines/semihosting-inlines.h +46 -0
  16. package/include/micro-os-plus/architecture-riscv/instructions.h +12 -8
  17. package/include/micro-os-plus/architecture-riscv/platform-functions.h +6 -7
  18. package/include/micro-os-plus/architecture-riscv/plic-functions.h +7 -8
  19. package/include/micro-os-plus/architecture-riscv/types.h +6 -7
  20. package/include/micro-os-plus/architecture.h +34 -17
  21. package/linker-scripts/sections-flash.ld +6 -7
  22. package/linker-scripts/sections-ram.ld +6 -7
  23. package/meson.build +81 -22
  24. package/package.json +56 -21
  25. package/src/semihosting.cpp +58 -0
  26. package/xcdl-package.jsonc +32 -0
  27. package/include/micro-os-plus/architecture-riscv/semihosting-inlines.h +0 -79
  28. package/src/.gitkeep +0 -0
  29. package/xpack.json +0 -23
package/CHANGELOG.md CHANGED
@@ -6,9 +6,91 @@ Please check
6
6
  [GitHub](https://github.com/micro-os-plus/architecture-riscv-xpack/issues/)
7
7
  and close existing issues and pull requests.
8
8
 
9
+ ## 2026-08-04
10
+
11
+ * v5.0.0
12
+ * f8176c2 re-generate top commons
13
+
14
+ ## 2026-07-31
15
+
16
+ * a172bb5 CHANGELOG update
17
+ * 0705830 xcdl-package.jsonc update
18
+ * 37a7f6d update guards & includes
19
+
20
+ ## 2026-07-22
21
+
22
+ * 351f4f0 prepare 5.0.0
23
+ * 780394f xcdl export
24
+ * c07d045 re-work includes
25
+ * 98d177f re-generate top commons
26
+ * b79195e re-generate top commons
27
+ * 1a68ac8 extract semihosting.cpp
28
+ * 7f7663c fix copyright notices
29
+
30
+ ## 2026-06-06
31
+
32
+ * 036a3df copyright update 2026
33
+
34
+ ## 2025-11-20
35
+
36
+ * ede63b1 rename npm-pack
37
+
38
+ ## 2025-10-07
39
+
40
+ * 4bcf370 update copyright notices
41
+
42
+ ## 2023-11-28
43
+
44
+ * d1ef44b README updates
45
+ * 8509b6e package.json: cosmetise scripts
46
+
47
+ ## 2023-10-19
48
+
49
+ * 9215ac5 package.json: cosmetise description
50
+ * a7b4471 README updates
51
+
52
+ ## 2023-07-14
53
+
54
+ * 92ed5f2 README updates
55
+ * fa45973 package.json: cosmetise urls
56
+ * 5625c25 package.json: minXpm 0.16.2
57
+
58
+ ## 2023-06-04
59
+
60
+ * b1fc258 update for @scope/name
61
+
62
+ ## 2023-06-03
63
+
64
+ * 39ca32a lower case ci.yml
65
+ * 5a019d3 package.json min 0.16.0
66
+
67
+ ## 2023-05-08
68
+
69
+ * 03d57b0 .npmignore update
70
+ * 99627ed README updates
71
+ * 5e0620b README updates
72
+ * 6c4bd98 READMEs update
73
+ * 1e5a1a6 meson.build cosmetics
74
+
75
+ ## 2022-08-16
76
+
77
+ * a9fb5e2 package.json min 0.14.0 & defaults
78
+
79
+ ## 2022-08-03
80
+
81
+ * d97774b README updates
82
+ * 452f77c .vscode/settings.json: cmake.ignoreCMakeListsMissing
83
+ * 87537f4 .vscode/settings.json: makefile.configureOnOpen
84
+
85
+ ## 2022-08-02
86
+
87
+ * ce9c653 READMEs updates
88
+
9
89
  ## 2022-07-28
10
90
 
11
- * v4.1.0
91
+ * 2bff438 CHANGELOG update
92
+ * e5a9bac 4.1.0
93
+ * 6943ac8 prepare v4.1.0
12
94
  * e19aa16 #5: remove linker script ARM sections
13
95
  * 5f43150 #7: add sections-flash.ld
14
96
  * 963be52 #6: rework semihosting_call_host() to avoid asm() registers
@@ -50,7 +132,7 @@ and close existing issues and pull requests.
50
132
  ## 2021-02-04
51
133
 
52
134
  * v1.1.0
53
- * first restructured release
135
+ * first restructured release; renamed architecture-riscv
54
136
 
55
137
  ## 2020-09-19
56
138
 
package/CMakeLists.txt CHANGED
@@ -1,87 +1,103 @@
1
1
  # -----------------------------------------------------------------------------
2
+ # DO NOT EDIT! Automatically generated from template file: xcdl-package.jsonc
2
3
  #
3
- # This file is part of the µOS++ distribution.
4
- # (https://github.com/micro-os-plus/)
5
- # Copyright (c) 2021 Liviu Ionescu
4
+ # This file is part of the µOS++ project (https://micro-os-plus.github.io/).
5
+ # Copyright (c) 2021-2026 Liviu Ionescu. All rights reserved.
6
6
  #
7
- # Permission to use, copy, modify, and/or distribute this software
8
- # for any purpose is hereby granted, under the terms of the MIT license.
7
+ # Permission to use, copy, modify, and/or distribute this software for any
8
+ # purpose is hereby granted, under the terms of the MIT license.
9
9
  #
10
- # If a copy of the license was not distributed with this file, it can
11
- # be obtained from https://opensource.org/licenses/MIT/.
10
+ # If a copy of the license was not distributed with this file, it can be
11
+ # obtained from https://opensource.org/licenses/mit.
12
12
  #
13
13
  # -----------------------------------------------------------------------------
14
14
 
15
- # This file is intended to be consumed by applications with:
15
+ # This file is intended to be used by applications via:
16
16
  #
17
- # `add_subdirectory("xpacks/micro-os-plus-architecture-riscv")`
17
+ # `add_subdirectory("xpacks/@micro-os-plus/architecture-riscv")`
18
18
  #
19
- # The result is an interface library that can be added to the linker with:
19
+ # This creates libraries that can be linked to a target with:
20
20
  #
21
- # `target_link_libraries(your-target PUBLIC micro-os-plus::architecture-riscv)`
21
+ # ~~~
22
+ # target_link_libraries(your-target PUBLIC micro-os-plus::architectures-riscv)
23
+ # ~~~
22
24
 
23
25
  # -----------------------------------------------------------------------------
24
- ## Preamble ##
25
26
 
26
27
  # https://cmake.org/cmake/help/v3.20/
27
- cmake_minimum_required(VERSION 3.20)
28
-
29
- project(
28
+ cmake_minimum_required (VERSION 3.20)
29
+ project (
30
30
  micro-os-plus-architecture-riscv
31
- DESCRIPTION "µOS++ RISC-V architecture"
31
+ DESCRIPTION "A source code library with the µOS++ RISC-V architecture port"
32
+ LANGUAGES C CXX ASM
32
33
  )
33
34
 
34
- if(COMMAND xpack_get_package_name_and_version)
35
- xpack_get_package_name_and_version("${CMAKE_CURRENT_SOURCE_DIR}/package.json")
36
- message(VERBOSE "Processing xPack ${PACKAGE_JSON_NAME}@${PACKAGE_JSON_VERSION}...")
37
- endif()
38
-
39
- # -----------------------------------------------------------------------------
40
- ## The project library definitions ##
41
-
42
- # https://cmake.org/cmake/help/v3.20/command/add_library.html?highlight=interface#normal-libraries
43
- # PRIVATE: build definitions, used internally
44
- # INTERFACE: usage definitions, passed up to targets linking to it
45
- # PUBLIC: both
35
+ # To access the optional functions, include the
36
+ # `cmake/micro-os-plus-build-helper.cmake` file from the
37
+ # `@micro-os-plus/build-helper` package.
46
38
 
47
- add_library(micro-os-plus-architecture-riscv-interface INTERFACE EXCLUDE_FROM_ALL)
39
+ if (COMMAND xpack_get_package_name_and_version)
40
+ xpack_get_package_name_and_version (
41
+ "${CMAKE_CURRENT_SOURCE_DIR}/package.json"
42
+ )
43
+ message (VERBOSE
44
+ "Processing xPack ${PACKAGE_JSON_NAME}@${PACKAGE_JSON_VERSION}..."
45
+ )
46
+ endif ()
48
47
 
49
48
  # -----------------------------------------------------------------------------
50
- # Target settings.
51
-
52
- target_include_directories(micro-os-plus-architecture-riscv-interface INTERFACE
53
- "include"
54
- )
55
49
 
56
- target_sources(micro-os-plus-architecture-riscv-interface INTERFACE
57
- # None.
50
+ # Interface libraries are the main targets, which consumers (like embedded
51
+ # applications) link against. It defines the public API and properties of the
52
+ # library; sources are propagated to and compiled by each consumer.
53
+
54
+ # They are aliased using namespaced syntax (Project::Target). This is the
55
+ # canonical pattern for consumption via target_link_libraries(), whether the
56
+ # dependency is added via add_subdirectory(), FetchContent, or an installed
57
+ # package via find_package(). Using "::" lets CMake detect an invalid or
58
+ # misspelled target name at configure time, rather than silently passing it
59
+ # through to the linker as a plain string or flag. Note: alias targets are
60
+ # read-only; properties must be set on the underlying target, not on the alias
61
+ # itself.
62
+
63
+ # https://cmake.org/cmake/help/v3.20/command/add_library.html?highlight=interface#interface-libraries
64
+ # Visibility keywords: PRIVATE applies to the target itself; INTERFACE passes
65
+ # properties up to targets that link against it; PUBLIC does both.
66
+ add_library (
67
+ micro-os-plus-architectures-riscv-interface INTERFACE EXCLUDE_FROM_ALL
58
68
  )
59
69
 
60
- target_compile_definitions(micro-os-plus-architecture-riscv-interface INTERFACE
61
- # None.
70
+ target_include_directories (
71
+ micro-os-plus-architectures-riscv-interface INTERFACE "include"
62
72
  )
63
73
 
64
- target_compile_options(micro-os-plus-architecture-riscv-interface INTERFACE
65
- # None.
66
- )
67
-
68
- target_link_libraries(micro-os-plus-architecture-riscv-interface INTERFACE
69
- # Dependencies
70
- # None.
74
+ target_sources (
75
+ micro-os-plus-architectures-riscv-interface INTERFACE "src/semihosting.cpp"
71
76
  )
72
77
 
73
78
  if (COMMAND xpack_display_target_lists)
74
- xpack_display_target_lists(micro-os-plus-architecture-riscv-interface)
75
- endif()
79
+ xpack_display_target_lists (micro-os-plus-architectures-riscv-interface)
80
+ endif ()
76
81
 
77
82
  # -----------------------------------------------------------------------------
78
- # Aliases.
83
+ # Alias.
79
84
 
80
85
  # https://cmake.org/cmake/help/v3.20/command/add_library.html#alias-libraries
81
- add_library(micro-os-plus::architecture-riscv ALIAS micro-os-plus-architecture-riscv-interface)
82
- message(VERBOSE "> micro-os-plus::architecture-riscv -> micro-os-plus-architecture-riscv-interface")
86
+ add_library (
87
+ micro-os-plus::architectures-riscv ALIAS
88
+ micro-os-plus-architectures-riscv-interface
89
+ )
90
+ message (
91
+ VERBOSE
92
+ "> micro-os-plus::architectures-riscv -> micro-os-plus-architectures-riscv-interface"
93
+ )
83
94
 
84
- add_library(micro-os-plus::architecture ALIAS micro-os-plus-architecture-riscv-interface)
85
- message(VERBOSE "> micro-os-plus::architecture -> micro-os-plus-architecture-riscv-interface")
95
+ add_library (
96
+ micro-os-plus::architecture ALIAS micro-os-plus-architectures-riscv-interface
97
+ )
98
+ message (
99
+ VERBOSE
100
+ "> micro-os-plus::architecture -> micro-os-plus-architectures-riscv-interface"
101
+ )
86
102
 
87
103
  # -----------------------------------------------------------------------------
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2017 Liviu Ionescu
3
+ Copyright (c) 2017-2026 Liviu Ionescu
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -1,7 +1,10 @@
1
+ [![GitHub package.json version](https://img.shields.io/github/package-json/v/micro-os-plus/architecture-riscv-xpack)](https://github.com/micro-os-plus/architecture-riscv-xpack/blob/xpack/package.json)
2
+ [![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/micro-os-plus/architecture-riscv-xpack)](https://github.com/micro-os-plus/architecture-riscv-xpack/tags/)
3
+ [![npm (scoped)](https://img.shields.io/npm/v/@micro-os-plus/architecture-riscv.svg?color=blue)](https://www.npmjs.com/package/@micro-os-plus/architecture-riscv/)
1
4
  [![license](https://img.shields.io/github/license/micro-os-plus/architecture-riscv-xpack)](https://github.com/micro-os-plus/architecture-riscv-xpack/blob/xpack/LICENSE)
2
- [![CI on Push](https://github.com/micro-os-plus/architecture-riscv-xpack/actions/workflows/CI.yml/badge.svg)](https://github.com/micro-os-plus/architecture-riscv-xpack/actions/workflows/CI.yml)
5
+ [![CI on Push](https://github.com/micro-os-plus/architecture-riscv-xpack/actions/workflows/ci.yml/badge.svg)](https://github.com/micro-os-plus/architecture-riscv-xpack/actions/workflows/ci.yml)
3
6
 
4
- # A source library xPack with the µOS++ RISC-V architecture definitions
7
+ # A source code library with the µOS++ RISC-V architecture definitions
5
8
 
6
9
  This project provides the **architecture-riscv** source library as an xPack
7
10
  dependency and includes architecture definitions for RISC-V embedded projects.
@@ -27,12 +30,18 @@ As a source library xPack, the easiest way to add it to a project is via
27
30
  A recent [xpm](https://xpack.github.io/xpm/),
28
31
  which is a portable [Node.js](https://nodejs.org/) command line application.
29
32
 
33
+ It is recommended to update to the latest version with:
34
+
35
+ ```sh
36
+ npm install --global xpm@latest
37
+ ```
38
+
30
39
  For details please follow the instructions in the
31
40
  [xPack install](https://xpack.github.io/install/) page.
32
41
 
33
42
  ### xpm
34
43
 
35
- This package is available from npmjs.com as
44
+ This package is available as
36
45
  [`@micro-os-plus/architecture-riscv`](https://www.npmjs.com/package/@micro-os-plus/architecture-riscv)
37
46
  from the `npmjs.com` registry:
38
47
 
@@ -42,7 +51,7 @@ xpm init # Unless a package.json is already present
42
51
 
43
52
  xpm install @micro-os-plus/architecture-riscv@latest
44
53
 
45
- ls -l xpacks/micro-os-plus-architecture-riscv
54
+ ls -l xpacks/@micro-os-plus/architecture-riscv
46
55
  ```
47
56
 
48
57
  ### Git submodule
@@ -56,7 +65,7 @@ git init # Unless already a Git project
56
65
  mkdir -p xpacks
57
66
 
58
67
  git submodule add https://github.com/micro-os-plus/architecture-riscv-xpack.git \
59
- xpacks/micro-os-plus-architecture-riscv
68
+ xpacks/@micro-os-plus/architecture-riscv
60
69
  ```
61
70
 
62
71
  ## Branches
@@ -64,12 +73,12 @@ git submodule add https://github.com/micro-os-plus/architecture-riscv-xpack.git
64
73
  Apart from the unused `master` branch, there are two active branches:
65
74
 
66
75
  - `xpack`, with the latest stable version (default)
67
- - `xpack-develop`, with the current development version
76
+ - `xpack-development`, with the current development version
68
77
 
69
- All development is done in the `xpack-develop` branch, and contributions via
78
+ All development is done in the `xpack-development` branch, and contributions via
70
79
  Pull Requests should be directed to this branch.
71
80
 
72
- When new releases are published, the `xpack-develop` branch is merged
81
+ When new releases are published, the `xpack-development` branch is merged
73
82
  into `xpack`.
74
83
 
75
84
  ## Developer info
@@ -103,7 +112,7 @@ like what GPIO pins are used for various LEDs, buttons, etc.
103
112
  The portable way to include platform specific definitions in an application is:
104
113
 
105
114
  ```c
106
- #include <micro-os-plus/platform.h>
115
+ #include "micro-os-plus/platform.h"
107
116
  ```
108
117
 
109
118
  In µOS++, the platform specific definitions are grouped in the
@@ -117,10 +126,10 @@ SiFive HiFive1 small development board.
117
126
  The RISC-V documentation introduces the term _platform_ as:
118
127
 
119
128
  > A RISC-V hardware _platform_ can contain one or more RISC-V-compatible
120
- processing cores together with other non-RISC-V-compatible cores,
121
- fixed-function accelerators, various physical memory structures,
122
- I/O devices, and an interconnect structure to allow the components
123
- to communicate.
129
+ > processing cores together with other non-RISC-V-compatible cores,
130
+ > fixed-function accelerators, various physical memory structures,
131
+ > I/O devices, and an interconnect structure to allow the components
132
+ > to communicate.
124
133
 
125
134
  In modern implementations, this is generally either a physical chip
126
135
  or a synthesised one.
@@ -144,7 +153,7 @@ In µOS++, the device specific definitions are grouped in the
144
153
  The portable way to include device specific definitions in an application is:
145
154
 
146
155
  ```c
147
- #include <micro-os-plus/device.h>
156
+ #include "micro-os-plus/device.h"
148
157
  ```
149
158
 
150
159
  Example of device packages are **sifive/devices** with the SiFive
@@ -155,9 +164,9 @@ Freedom E310 and E31/E51 Arty devices.
155
164
  The RISC-V documentation introduces the term _core_ as:
156
165
 
157
166
  > A component is termed a core if it contains an independent
158
- instruction fetch unit. A RISC-V-compatible core might support
159
- multiple RISC-V-compatible hardware threads, or harts, through
160
- multi-threading.
167
+ > instruction fetch unit. A RISC-V-compatible core might support
168
+ > multiple RISC-V-compatible hardware threads, or harts, through
169
+ > multi-threading.
161
170
 
162
171
  In µOS++, the core specific definitions are grouped in the
163
172
  `riscv::core` namespace.
@@ -166,7 +175,7 @@ The portable way to include architecture specific definitions
166
175
  in an application is:
167
176
 
168
177
  ```c
169
- #include <micro-os-plus/architecture.h>
178
+ #include "micro-os-plus/architecture.h"
170
179
  ```
171
180
 
172
181
  #### Hart
@@ -210,7 +219,7 @@ The following folders should be passed to the compiler during the build:
210
219
  The header files to be included in user projects are:
211
220
 
212
221
  ```c++
213
- #include <micro-os-plus/architecture.h>
222
+ #include "micro-os-plus/architecture.h"
214
223
  ```
215
224
 
216
225
  #### Source files
@@ -246,7 +255,7 @@ To integrate the architecture-riscv source library into a CMake application,
246
255
  add this folder to the build:
247
256
 
248
257
  ```cmake
249
- add_subdirectory("xpacks/micro-os-plus-architecture-riscv")`
258
+ add_subdirectory("xpacks/@micro-os-plus/architecture-riscv")`
250
259
  ```
251
260
 
252
261
  The result is an interface library that can be added as an application
@@ -265,7 +274,7 @@ To integrate the architecture-riscv source library into a meson application,
265
274
  add this folder to the build:
266
275
 
267
276
  ```meson
268
- subdir('xpacks/micro-os-plus-architecture-riscv')
277
+ subdir('xpacks/@micro-os-plus/architecture-riscv')
269
278
  ```
270
279
 
271
280
  The result is a dependency object that can be added
@@ -300,7 +309,7 @@ TBD
300
309
  According to [semver](https://semver.org) rules:
301
310
 
302
311
  > Major version X (X.y.z | X > 0) MUST be incremented if any
303
- backwards incompatible changes are introduced to the public API.
312
+ > backwards incompatible changes are introduced to the public API.
304
313
 
305
314
  The incompatible changes, in reverse chronological order,
306
315
  are:
@@ -311,7 +320,7 @@ are:
311
320
 
312
321
  ## License
313
322
 
314
- The original content is released under the
315
- [MIT License](https://opensource.org/licenses/MIT/),
323
+ Unless otherwise stated, the content is released under the terms of the
324
+ [MIT License](https://opensource.org/licenses/mit),
316
325
  with all rights reserved to
317
- [Liviu Ionescu](https://github.com/ilg-ul/).
326
+ [Liviu Ionescu](https://github.com/ilg-ul).
@@ -1,13 +1,12 @@
1
1
  /*
2
- * This file is part of the µOS++ distribution.
3
- * (https://github.com/micro-os-plus/)
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
- * for any purpose is hereby granted, under the terms of the MIT license.
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
- * be obtained from https://opensource.org/licenses/MIT/.
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_CORE_FUNCTIONS_H_
@@ -98,6 +97,11 @@ namespace riscv
98
97
 
99
98
  #endif // defined(__cplusplus)
100
99
 
100
+ // ============================================================================
101
+ // Templates, inlines & constexpr implementations.
102
+
103
+ #include "inlines/core-functions-inlines.h"
104
+
101
105
  // ----------------------------------------------------------------------------
102
106
 
103
107
  #endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_CORE_FUNCTIONS_H_
@@ -1,13 +1,12 @@
1
1
  /*
2
- * This file is part of the µOS++ distribution.
3
- * (https://github.com/micro-os-plus/)
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
- * for any purpose is hereby granted, under the terms of the MIT license.
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
- * be obtained from https://opensource.org/licenses/MIT/.
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_CSR_FUNCTIONS_H_
@@ -15,7 +14,7 @@
15
14
 
16
15
  // ----------------------------------------------------------------------------
17
16
 
18
- #include <micro-os-plus/architecture-riscv/types.h>
17
+ #include "micro-os-plus/architecture-riscv/types.h"
19
18
 
20
19
  // ----------------------------------------------------------------------------
21
20
  // RISC-V CSR support functions.
@@ -234,6 +233,11 @@ namespace riscv
234
233
 
235
234
  #endif // defined(__cplusplus)
236
235
 
236
+ // ============================================================================
237
+ // Templates, inlines & constexpr implementations.
238
+
239
+ #include "inlines/csr-functions-inlines.h"
240
+
237
241
  // ----------------------------------------------------------------------------
238
242
 
239
243
  #endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_CSR_FUNCTIONS_H_
@@ -1,13 +1,12 @@
1
1
  /*
2
- * This file is part of the µOS++ distribution.
3
- * (https://github.com/micro-os-plus/)
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
- * for any purpose is hereby granted, under the terms of the MIT license.
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
- * be obtained from https://opensource.org/licenses/MIT/.
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_DECLARATIONS_H_
@@ -15,7 +14,7 @@
15
14
 
16
15
  // ----------------------------------------------------------------------------
17
16
 
18
- #include <micro-os-plus/architecture-riscv/types.h>
17
+ #include "micro-os-plus/architecture-riscv/types.h"
19
18
 
20
19
  #include <stdint.h>
21
20
 
@@ -1,13 +1,12 @@
1
1
  /*
2
- * This file is part of the µOS++ distribution.
3
- * (https://github.com/micro-os-plus/)
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
- * for any purpose is hereby granted, under the terms of the MIT license.
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
- * be obtained from https://opensource.org/licenses/MIT/.
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_DEFINES_H_
@@ -45,9 +44,9 @@
45
44
  #define DCSR_CAUSE_STEP 4
46
45
  #define DCSR_CAUSE_HALT 5
47
46
 
48
- #define MCONTROL_TYPE(xlen) (0xfULL << ((xlen)-4))
49
- #define MCONTROL_DMODE(xlen) (1ULL << ((xlen)-5))
50
- #define MCONTROL_MASKMAX(xlen) (0x3fULL << ((xlen)-11))
47
+ #define MCONTROL_TYPE(xlen) (0xfULL << ((xlen) - 4))
48
+ #define MCONTROL_DMODE(xlen) (1ULL << ((xlen) - 5))
49
+ #define MCONTROL_MASKMAX(xlen) (0x3fULL << ((xlen) - 11))
51
50
 
52
51
  #define MCONTROL_SELECT (1 << 19)
53
52
  #define MCONTROL_TIMING (1 << 18)
@@ -129,7 +128,7 @@
129
128
 
130
129
  // End of SiFive definitions.
131
130
  // ----------------------------------------------------------------------------
132
- #endif
131
+ #endif // 0-1
133
132
 
134
133
  #define RISCV_CSR_MSTATUS_UIE 0x00000001ul
135
134
  #define RISCV_CSR_MSTATUS_SIE 0x00000002ul
@@ -1,13 +1,12 @@
1
1
  /*
2
- * This file is part of the µOS++ distribution.
3
- * (https://github.com/micro-os-plus/)
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
- * for any purpose is hereby granted, under the terms of the MIT license.
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
- * be obtained from https://opensource.org/licenses/MIT/.
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_DEVICE_FUNCTIONS_H_
@@ -15,7 +14,7 @@
15
14
 
16
15
  // ----------------------------------------------------------------------------
17
16
 
18
- #include <micro-os-plus/architecture-riscv/types.h>
17
+ #include "micro-os-plus/architecture-riscv/types.h"
19
18
 
20
19
  // ----------------------------------------------------------------------------
21
20
 
@@ -24,7 +23,7 @@
24
23
  *
25
24
  * The declarations are part of the common design, but each device
26
25
  * must define the actual address and include the file
27
- * <micro-os-plus/architecture-riscv/device-functions-inlines.h>.
26
+ * "micro-os-plus/architecture-riscv/inlines/device-functions-inlines.h".
28
27
  */
29
28
 
30
29
  // ----------------------------------------------------------------------------
@@ -100,7 +99,7 @@ namespace riscv
100
99
  {
101
100
  namespace device
102
101
  {
103
- // ----------------------------------------------------------------------------
102
+ // --------------------------------------------------------------------------
104
103
  // `mtime` functions.
105
104
 
106
105
  /**
@@ -1,17 +1,16 @@
1
1
  /*
2
- * This file is part of the µOS++ distribution.
3
- * (https://github.com/micro-os-plus/)
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
- * for any purpose is hereby granted, under the terms of the MIT license.
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
- * be obtained from https://opensource.org/licenses/MIT/.
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 MICRO_OS_PLUS_ARCHITECTURE_RISCV_CORE_FUNCTIONS_INLINES_H_
14
- #define MICRO_OS_PLUS_ARCHITECTURE_RISCV_CORE_FUNCTIONS_INLINES_H_
12
+ #ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_CORE_FUNCTIONS_INLINES_H_
13
+ #define MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_CORE_FUNCTIONS_INLINES_H_
15
14
 
16
15
  // ----------------------------------------------------------------------------
17
16
 
@@ -81,6 +80,6 @@ namespace riscv
81
80
 
82
81
  // ----------------------------------------------------------------------------
83
82
 
84
- #endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_CORE_FUNCTIONS_INLINES_H_
83
+ #endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_INLINES_CORE_FUNCTIONS_INLINES_H_
85
84
 
86
85
  // ----------------------------------------------------------------------------