hujun260 opened a new pull request, #21784:
URL: https://github.com/apache/nuttx/pull/21784
# NuttX PR Description
## Title
arm_a_r: merge cp15.h to arm_a_r
## Description
This PR consolidates the ARMv7-A, ARMv7-R, and ARMv8-R CP15 definitions into
the shared `arm_a_r` include directory.
## Changes
- Move the shared CP15 header from:
```text
arch/arm/include/armv7-a/cp15.h
```
to:
```text
arch/arm/include/arm_a_r/cp15.h
```
- Remove the duplicated ARMv7-R and ARMv8-R copies.
- Update the ARMv7-A, ARMv7-R, and ARMv8-R IRQ headers to include the shared
CP15 definitions.
- Update ARMv7-A, ARMv7-R, and ARMv8-R timer headers to use the new shared
include path.
- Preserve architecture-specific behavior while reducing duplicated register
and CP15 definitions.
## Motivation
The ARMv7-A, ARMv7-R, and ARMv8-R profiles share common CP15 definitions.
Moving the header into `arm_a_r` avoids maintaining multiple copies and
prepares
the ARM architecture source tree for further common-code consolidation.
## Runtime and Build Testing
The ARMv7-A QEMU `nsh` configuration was built with the GNU Arm Embedded
toolchain and executed under QEMU.
### Build log
```text
-- Board: qemu-armv7a
-- Config: nsh
-- The C compiler identification is GNU 13.2.1
-- Found assembler: arm-none-eabi-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: build
[1328/1328] Linking CXX executable final_nuttx
Memory region Used Size Region Size %age Used
ROM: 373960 B 1 MB 35.66%
RAM: 28 KB 16 MB 0.17%
```
### ARMv7-A QEMU startup
```text
qemu-system-arm -cpu cortex-a7 -semihosting \
-M virt,virtualization=off,gic-version=2 -m 1024 -nographic \
-kernel ./build/nuttx
nsh>
```
### `ostest`
```text
nsh> ostest
stdio_test: Standard I/O Check: printf
ostest_main: Started user_main at PID=6
user_main: vfork() test
vfork_test: Child 7 ran and exited before the parent resumed
user_main: FPU test
FPU#1: Succeeded
FPU#2: Succeeded
user_main: wqueue test
wqueue_test: backend = flat
wqueue_test: HPWORK done
wqueue_test: custom queue, threads = 1 done
wqueue_test: custom queue, threads = 2 done
wqueue_test: multiple custom queues done
wqueue_test: teardown done
user_main: mutex test
mutex_test: PASSED
user_main: signal handler test
sighand_test: SUCCESS
user_main: nested signal handler test
signest_test: done
user_main: priority inheritance test
priority_inheritance: PASSED Priority were correctly restored.
priority_inheritance: Finished
user_main: scheduler lock test
sched_lock: PASSED No pre-emption occurred while scheduler was locked.
sched_lock: Finished
Final memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena ff3ffc ff3ffc
ordblks 2 7
mxordblk fec130 fd5460
uordblks 7d94 7ed4
fordblks fec268 fec128
user_main: Exiting
ostest_main: Exiting with status 0
nsh>
```
## Testing Status
- [x] Built with the ARMv7-A QEMU `nsh` configuration.
- [x] Booted the resulting image under QEMU.
- [x] `ostest_main: Exiting with status 0`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]