-
Notifications
You must be signed in to change notification settings - Fork 8.2k
mgmt: mcumgr: lib: cmd: dev: Add device information handler #44124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
17a565d
mgmt: mcumgr: lib: cmd: os: Add device information handler
nordicjm 1227f8e
doc: mgmt: smp group 0: Add OS info details
nordicjm 1e57b66
doc: release: 3.3: Add os_mgmt info command
nordicjm f2ccd71
tests: mgmt: mcumgr: os_mgmt_info: Add tests
nordicjm 8f4730b
mgmt: mcumgr: transport: dummy: Fix issue with large packets
nordicjm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
137 changes: 137 additions & 0 deletions
137
subsys/mgmt/mcumgr/grp/os_mgmt/include/os_mgmt_processor.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| /* | ||
| * Copyright (c) 2022 Zephyr authors | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #ifndef H_OS_MGMT_PROCESSOR_ | ||
| #define H_OS_MGMT_PROCESSOR_ | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| /** | ||
| * Processor name (used in uname output command) | ||
| * Will be unknown if processor type is not listed | ||
| * (List extracted from /cmake/gcc-m-cpu.cmake) | ||
| */ | ||
| #if defined(CONFIG_ARM) | ||
| #if defined(CONFIG_CPU_CORTEX_M0) | ||
| #define PROCESSOR_NAME "cortex-m0" | ||
| #elif defined(CONFIG_CPU_CORTEX_M0PLUS) | ||
| #define PROCESSOR_NAME "cortex-m0plus" | ||
| #elif defined(CONFIG_CPU_CORTEX_M1) | ||
| #define PROCESSOR_NAME "cortex-m1" | ||
| #elif defined(CONFIG_CPU_CORTEX_M3) | ||
| #define PROCESSOR_NAME "cortex-m3" | ||
| #elif defined(CONFIG_CPU_CORTEX_M4) | ||
| #define PROCESSOR_NAME "cortex-m4" | ||
| #elif defined(CONFIG_CPU_CORTEX_M7) | ||
| #define PROCESSOR_NAME "cortex-m7" | ||
| #elif defined(CONFIG_CPU_CORTEX_M23) | ||
| #define PROCESSOR_NAME "cortex-m23" | ||
| #elif defined(CONFIG_CPU_CORTEX_M33) | ||
| #if defined(CONFIG_ARMV8_M_DSP) | ||
| #define PROCESSOR_NAME "cortex-m33" | ||
| #else | ||
| #define PROCESSOR_NAME "cortex-m33+nodsp" | ||
| #endif | ||
| #elif defined(CONFIG_CPU_CORTEX_M55) | ||
| #if defined(CONFIG_ARMV8_1_M_MVEF) | ||
| #define PROCESSOR_NAME "cortex-m55" | ||
| #elif defined(CONFIG_ARMV8_1_M_MVEI) | ||
| #define PROCESSOR_NAME "cortex-m55+nomve.fp" | ||
| #elif defined(CONFIG_ARMV8_M_DSP) | ||
| #define PROCESSOR_NAME "cortex-m55+nomve" | ||
| #else | ||
| #define PROCESSOR_NAME "cortex-m55+nodsp" | ||
| #endif | ||
| #elif defined(CONFIG_CPU_CORTEX_R4) | ||
| #if defined(CONFIG_FPU) && defined(CONFIG_CPU_HAS_VFP) | ||
| #define PROCESSOR_NAME "cortex-r4f" | ||
| #else | ||
| #define PROCESSOR_NAME "cortex-r4" | ||
| #endif | ||
| #elif defined(CONFIG_CPU_CORTEX_R5) | ||
| #if defined(CONFIG_FPU) && defined(CONFIG_CPU_HAS_VFP) | ||
| #if !defined(CONFIG_VFP_FEATURE_DOUBLE_PRECISION) | ||
| #define PROCESSOR_NAME "cortex-r5+nofp.dp" | ||
| #else | ||
| #define PROCESSOR_NAME "cortex-r5" | ||
| #endif | ||
| #else | ||
| #define PROCESSOR_NAME "cortex-r5+nofp" | ||
| #endif | ||
| #elif defined(CONFIG_CPU_CORTEX_R7) | ||
| #if defined(CONFIG_FPU) && defined(CONFIG_CPU_HAS_VFP) | ||
| #if !defined(CONFIG_VFP_FEATURE_DOUBLE_PRECISION) | ||
| #define PROCESSOR_NAME "cortex-r7+nofp.dp" | ||
| #else | ||
| #define PROCESSOR_NAME "cortex-r7" | ||
| #endif | ||
| #else | ||
| #define PROCESSOR_NAME "cortex-r7+nofp" | ||
| #endif | ||
| #elif defined(CONFIG_CPU_CORTEX_R52) | ||
| #if defined(CONFIG_FPU) && defined(CONFIG_CPU_HAS_VFP) | ||
| #if !defined(CONFIG_VFP_FEATURE_DOUBLE_PRECISION) | ||
| #define PROCESSOR_NAME "cortex-r52+nofp.dp" | ||
| #else | ||
| #define PROCESSOR_NAME "cortex-r52" | ||
| #endif | ||
| #else | ||
| #define PROCESSOR_NAME "cortex-r52" | ||
| #endif | ||
| #elif defined(CONFIG_CPU_CORTEX_A9) | ||
| #define PROCESSOR_NAME "cortex-a9" | ||
| #endif | ||
| #elif defined(CONFIG_ARM64) | ||
| #if defined(CONFIG_CPU_CORTEX_A53) | ||
| #define PROCESSOR_NAME "cortex-a53" | ||
| #if defined(CONFIG_CPU_CORTEX_A55) | ||
| #define PROCESSOR_NAME "cortex-a55" | ||
| #elif defined(CONFIG_CPU_CORTEX_A72) | ||
| #define PROCESSOR_NAME "cortex-a72" | ||
| #elif defined(CONFIG_CPU_CORTEX_R82) | ||
| #define PROCESSOR_NAME "armv8.4-a+nolse" | ||
| #endif | ||
| #endif | ||
| #elif defined(CONFIG_ARC) | ||
| #if defined(CONFIG_CPU_EM4_FPUS) | ||
| #define PROCESSOR_NAME "em4_fpus" | ||
| #elif defined(CONFIG_CPU_EM4_DMIPS) | ||
| #define PROCESSOR_NAME "em4_dmips" | ||
| #elif defined(CONFIG_CPU_EM4_FPUDA) | ||
| #define PROCESSOR_NAME "em4_fpuda" | ||
| #elif defined(CONFIG_CPU_HS3X) | ||
| #define PROCESSOR_NAME "archs" | ||
| #elif defined(CONFIG_CPU_HS5X) | ||
| #define PROCESSOR_NAME "hs5x" | ||
| #elif defined(CONFIG_CPU_HS6X) | ||
| #define PROCESSOR_NAME "hs6x" | ||
| #elif defined(CONFIG_CPU_EM4) | ||
| #define PROCESSOR_NAME "arcem" | ||
| #elif defined(CONFIG_CPU_EM6) | ||
| #define PROCESSOR_NAME "arcem" | ||
| #endif | ||
| #elif defined(CONFIG_X86) | ||
| #if defined(CONFIG_X86_64) | ||
| #define PROCESSOR_NAME "x86_64" | ||
| #else | ||
| #define PROCESSOR_NAME "x86" | ||
| #endif | ||
| #elif defined(CONFIG_RISCV) | ||
| #define PROCESSOR_NAME "riscv" | ||
| #endif | ||
|
|
||
| #ifndef PROCESSOR_NAME | ||
| #warning "Processor type could not be determined" | ||
| #define PROCESSOR_NAME "unknown" | ||
| #endif | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif /* H_OS_MGMT_PROCESSOR_ */ | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow this is really hard to follow, maybe worth indenting the defines in a followup patch? Not normally a fan of that either but editing this seems like a nightmare.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed it is horrible to look at and update, indentation would probably be a good idea, I'll give it a try and see if CI throws an error about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if it's even worth reporting it in such details, maybe you could just report whatever is in
cpu@0compatible.