@micro-os-plus/architecture-riscv 4.1.0 → 5.1.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 (31) hide show
  1. package/CHANGELOG.md +104 -2
  2. package/CMakeLists.txt +70 -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 +13 -14
  9. package/include/micro-os-plus/architecture-riscv/device-functions.h +9 -10
  10. package/include/micro-os-plus/architecture-riscv/functions.h +35 -0
  11. package/include/micro-os-plus/architecture-riscv/{core-functions-inlines.h → inlines/core-functions-inlines.h} +9 -10
  12. package/include/micro-os-plus/architecture-riscv/{csr-functions-inlines.h → inlines/csr-functions-inlines.h} +25 -26
  13. package/include/micro-os-plus/architecture-riscv/{device-functions-inlines.h → inlines/device-functions-inlines.h} +9 -10
  14. package/include/micro-os-plus/architecture-riscv/{instructions-inlines.h → inlines/instructions-inlines.h} +12 -13
  15. package/include/micro-os-plus/architecture-riscv/{platform-functions-inlines.h → inlines/platform-functions-inlines.h} +9 -10
  16. package/include/micro-os-plus/architecture-riscv/inlines/semihosting-inlines.h +51 -0
  17. package/include/micro-os-plus/architecture-riscv/instructions.h +15 -11
  18. package/include/micro-os-plus/architecture-riscv/platform-functions.h +6 -7
  19. package/include/micro-os-plus/architecture-riscv/plic-functions.h +7 -8
  20. package/include/micro-os-plus/architecture-riscv/types.h +6 -7
  21. package/include/micro-os-plus/architecture.h +40 -17
  22. package/linker-scripts/sections-flash.ld +6 -7
  23. package/linker-scripts/sections-ram.ld +6 -7
  24. package/meson.build +83 -23
  25. package/package.json +56 -21
  26. package/src/semihosting.cpp +58 -0
  27. package/src/show-cpuid.cpp +28 -0
  28. package/xcdl-package.jsonc +33 -0
  29. package/include/micro-os-plus/architecture-riscv/semihosting-inlines.h +0 -79
  30. package/src/.gitkeep +0 -0
  31. package/xpack.json +0 -23
package/CHANGELOG.md CHANGED
@@ -6,9 +6,111 @@ 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-09-09
10
+
11
+ * v5.1.0
12
+ * b3d5140 re-format
13
+
14
+ ## 2026-09-08
15
+
16
+ * 0150285 architecture.h __ASSEMBLY__
17
+ * cadd9d4 add micro_os_plus_semihosting_register_t
18
+
19
+ ## 2026-09-07
20
+
21
+ * bf22010 cosmetics xpm packages
22
+ * 7b75d63 add show-cpuid
23
+
24
+ ## 2026-08-05
25
+
26
+ * 19ddea8 readme cosmetics
27
+
28
+ ## 2026-08-04
29
+
30
+ * 8052bbb 5.0.0
31
+ * c3a6757 prepare v5.0.0
32
+ * f8176c2 re-generate top commons
33
+
34
+ ## 2026-07-31
35
+
36
+ * a172bb5 CHANGELOG update
37
+ * 0705830 xcdl-package.jsonc update
38
+ * 37a7f6d update guards & includes
39
+
40
+ ## 2026-07-22
41
+
42
+ * 351f4f0 prepare 5.0.0
43
+ * 780394f xcdl export
44
+ * c07d045 re-work includes
45
+ * 98d177f re-generate top commons
46
+ * b79195e re-generate top commons
47
+ * 1a68ac8 extract semihosting.cpp
48
+ * 7f7663c fix copyright notices
49
+
50
+ ## 2026-06-06
51
+
52
+ * 036a3df copyright update 2026
53
+
54
+ ## 2025-11-20
55
+
56
+ * ede63b1 rename npm-pack
57
+
58
+ ## 2025-10-07
59
+
60
+ * 4bcf370 update copyright notices
61
+
62
+ ## 2023-11-28
63
+
64
+ * d1ef44b README updates
65
+ * 8509b6e package.json: cosmetise scripts
66
+
67
+ ## 2023-10-19
68
+
69
+ * 9215ac5 package.json: cosmetise description
70
+ * a7b4471 README updates
71
+
72
+ ## 2023-07-14
73
+
74
+ * 92ed5f2 README updates
75
+ * fa45973 package.json: cosmetise urls
76
+ * 5625c25 package.json: minXpm 0.16.2
77
+
78
+ ## 2023-06-04
79
+
80
+ * b1fc258 update for @scope/name
81
+
82
+ ## 2023-06-03
83
+
84
+ * 39ca32a lower case ci.yml
85
+ * 5a019d3 package.json min 0.16.0
86
+
87
+ ## 2023-05-08
88
+
89
+ * 03d57b0 .npmignore update
90
+ * 99627ed README updates
91
+ * 5e0620b README updates
92
+ * 6c4bd98 READMEs update
93
+ * 1e5a1a6 meson.build cosmetics
94
+
95
+ ## 2022-08-16
96
+
97
+ * a9fb5e2 package.json min 0.14.0 & defaults
98
+
99
+ ## 2022-08-03
100
+
101
+ * d97774b README updates
102
+ * 452f77c .vscode/settings.json: cmake.ignoreCMakeListsMissing
103
+ * 87537f4 .vscode/settings.json: makefile.configureOnOpen
104
+
105
+ ## 2022-08-02
106
+
107
+ * ce9c653 READMEs updates
108
+
9
109
  ## 2022-07-28
10
110
 
11
- * v4.1.0
111
+ * 2bff438 CHANGELOG update
112
+ * e5a9bac 4.1.0
113
+ * 6943ac8 prepare v4.1.0
12
114
  * e19aa16 #5: remove linker script ARM sections
13
115
  * 5f43150 #7: add sections-flash.ld
14
116
  * 963be52 #6: rework semihosting_call_host() to avoid asm() registers
@@ -50,7 +152,7 @@ and close existing issues and pull requests.
50
152
  ## 2021-02-04
51
153
 
52
154
  * v1.1.0
53
- * first restructured release
155
+ * first restructured release; renamed architecture-riscv
54
156
 
55
157
  ## 2020-09-19
56
158
 
package/CMakeLists.txt CHANGED
@@ -1,87 +1,105 @@
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 (
44
+ VERBOSE
45
+ "Processing xpm package ${PACKAGE_JSON_NAME}@${PACKAGE_JSON_VERSION}..."
46
+ )
47
+ endif ()
48
48
 
49
49
  # -----------------------------------------------------------------------------
50
- # Target settings.
51
-
52
- target_include_directories(micro-os-plus-architecture-riscv-interface INTERFACE
53
- "include"
54
- )
55
50
 
56
- target_sources(micro-os-plus-architecture-riscv-interface INTERFACE
57
- # None.
51
+ # Interface libraries are the main targets, which consumers (like embedded
52
+ # applications) link against. It defines the public API and properties of the
53
+ # library; sources are propagated to and compiled by each consumer.
54
+
55
+ # They are aliased using namespaced syntax (Project::Target). This is the
56
+ # canonical pattern for consumption via target_link_libraries(), whether the
57
+ # dependency is added via add_subdirectory(), FetchContent, or an installed
58
+ # package via find_package(). Using "::" lets CMake detect an invalid or
59
+ # misspelled target name at configure time, rather than silently passing it
60
+ # through to the linker as a plain string or flag. Note: alias targets are
61
+ # read-only; properties must be set on the underlying target, not on the alias
62
+ # itself.
63
+
64
+ # https://cmake.org/cmake/help/v3.20/command/add_library.html?highlight=interface#interface-libraries
65
+ # Visibility keywords: PRIVATE applies to the target itself; INTERFACE passes
66
+ # properties up to targets that link against it; PUBLIC does both.
67
+ add_library (
68
+ micro-os-plus-architectures-riscv-interface INTERFACE EXCLUDE_FROM_ALL
58
69
  )
59
70
 
60
- target_compile_definitions(micro-os-plus-architecture-riscv-interface INTERFACE
61
- # None.
71
+ target_include_directories (
72
+ micro-os-plus-architectures-riscv-interface INTERFACE "include"
62
73
  )
63
74
 
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.
75
+ target_sources (
76
+ micro-os-plus-architectures-riscv-interface INTERFACE "src/semihosting.cpp"
77
+ "src/show-cpuid.cpp"
71
78
  )
72
79
 
73
80
  if (COMMAND xpack_display_target_lists)
74
- xpack_display_target_lists(micro-os-plus-architecture-riscv-interface)
75
- endif()
81
+ xpack_display_target_lists (micro-os-plus-architectures-riscv-interface)
82
+ endif ()
76
83
 
77
84
  # -----------------------------------------------------------------------------
78
- # Aliases.
85
+ # Alias.
79
86
 
80
87
  # 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")
88
+ add_library (
89
+ micro-os-plus::architectures-riscv ALIAS
90
+ micro-os-plus-architectures-riscv-interface
91
+ )
92
+ message (
93
+ VERBOSE
94
+ "> micro-os-plus::architectures-riscv -> micro-os-plus-architectures-riscv-interface"
95
+ )
83
96
 
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")
97
+ add_library (
98
+ micro-os-plus::architecture ALIAS micro-os-plus-architectures-riscv-interface
99
+ )
100
+ message (
101
+ VERBOSE
102
+ "> micro-os-plus::architecture -> micro-os-plus-architectures-riscv-interface"
103
+ )
86
104
 
87
105
  # -----------------------------------------------------------------------------
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,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_ARCH_DEFINES_H_
14
- #define MICRO_OS_PLUS_ARCHITECTURE_RISCV_ARCH_DEFINES_H_
12
+ #ifndef MICRO_OS_PLUS_ARCHITECTURE_RISCV_DEFINES_H_
13
+ #define MICRO_OS_PLUS_ARCHITECTURE_RISCV_DEFINES_H_
15
14
 
16
15
  // ----------------------------------------------------------------------------
17
16
 
@@ -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
@@ -180,6 +179,6 @@
180
179
 
181
180
  // ----------------------------------------------------------------------------
182
181
 
183
- #endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_ARCH_DEFINES_H_
182
+ #endif // MICRO_OS_PLUS_ARCHITECTURE_RISCV_DEFINES_H_
184
183
 
185
184
  // ----------------------------------------------------------------------------
@@ -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
  /**