hujun260 opened a new pull request, #21997:
URL: https://github.com/apache/nuttx/pull/21997
# arm_m: add common directory and move arm_tcbinfo.c into arm_m
## Summary
Add the shared `arm_m` architecture directory and move the common ARM
Cortex-M TCB register-offset implementation into it.
The `arm_m` directory is shared by ARMv6-M, ARMv7-M, and ARMv8-M profiles.
## Changes
- Add `arch/arm/src/arm_m/Make.defs`.
- Add `arch/arm/src/arm_m/CMakeLists.txt`.
- Move `arch/arm/src/armv6-m/arm_tcbinfo.c` to
`arch/arm/src/arm_m/arm_tcbinfo.c`.
- Remove the duplicate ARMv7-M `arm_tcbinfo.c` implementation.
- Remove the duplicate ARMv8-M `arm_tcbinfo.c` implementation.
- Update `arch/arm/src/Makefile` to select `arm_m` for ARMv6-M, ARMv7-M, and
ARMv8-M.
- Update the CMake toolchain selection to use `ARCH_SUBDIR_ARM=arm_m` for
the ARM M profiles.
- Update the ARMv6-M, ARMv7-M, and ARMv8-M Make/CMake source lists so
`arm_tcbinfo.c` is included exactly once.
## Rationale
`arm_tcbinfo.c` provides common TCB register offset information for the ARM
M architecture family. Keeping separate copies in ARMv6-M, ARMv7-M, and ARMv8-M
creates duplication and makes shared source ownership unclear.
The new layout is:
```text
arch/arm/src/arm_m/arm_tcbinfo.c
arch/arm/src/arm_m/Make.defs
arch/arm/src/arm_m/CMakeLists.txt
```
## Build-system integration
Both Make and CMake select the shared directory:
```text
ARMv6-M -> arm_m
ARMv7-M -> arm_m
ARMv8-M -> arm_m
```
The architecture-specific directories continue to contain profile-specific
sources, while the shared TCB information implementation is built from `arm_m`.
## Testing
A representative ARMv7-M configuration was built locally:
```text
$ tools/configure.sh nucleo-g071rb:nsh
$ make CROSSDEV=arm-none-eabi- -j$(nproc)
```
Build result:
```text
LD: nuttx
Memory region Used Size Region Size %age Used
flash: 71676 B 128 KB 54.68%
sram: 3896 B 36 KB 10.57%
CP: nuttx.hex
CP: nuttx.bin
```
Patch checks:
```text
$ git diff --check
$ tools/checkpatch.sh -g apache/master..HEAD
```
## Commit
```text
53c9a272aee arm_m: add directory and move arm_tcbinfo into arm_m
```
--
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]