255bd81a | 06-Sep-2024 |
Karthik Rajagopalan <krajagopalan@nvidia.com> |
Use extern C guards in all headers
The project uses a mix of C and C++ requiring extern "C" guards from C++ code both within the project & from C++ apps that use libcper. That won't be required with
Use extern C guards in all headers
The project uses a mix of C and C++ requiring extern "C" guards from C++ code both within the project & from C++ apps that use libcper. That won't be required with this change.
Change-Id: I835dd05166732ca213c72eae2904815a8769599b Signed-off-by: Karthik Rajagopalan <krajagopalan@nvidia.com>
show more ...
|
21c21549 | 17-Sep-2024 |
Aushim Nagarkatti <anagarkatti@nvidia.com> |
Fix cper-nvidia Json Schema
Fix a field name mismatch on registerNum
Change the type of instanceBase to integer. uint64 is not a correct json schema type.
Change-Id: Ia9f04798bbb1323a0fee4daea8763
Fix cper-nvidia Json Schema
Fix a field name mismatch on registerNum
Change the type of instanceBase to integer. uint64 is not a correct json schema type.
Change-Id: Ia9f04798bbb1323a0fee4daea87630dd0d7e5bc3 Signed-off-by: Aushim Nagarkatti <anagarkatti@nvidia.com>
show more ...
|
379e492a | 28-Aug-2024 |
Patrick Williams <patrick@stwcx.xyz> |
Adjust strncpy sizes
When building under bitbake with the latest openbmc, we get compile warnings such as these:
``` | ../git/sections/cper-section-nvidia.c: In function 'ir_section_nvidia_to_cper'
Adjust strncpy sizes
When building under bitbake with the latest openbmc, we get compile warnings such as these:
``` | ../git/sections/cper-section-nvidia.c: In function 'ir_section_nvidia_to_cper': | ../git/sections/cper-section-nvidia.c:67:9: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation] | 67 | strncpy(section_cper->Signature, ```
Using `strncpy` on its own is unsafe because a string too long will end up in the destination buffer without NUL termination. Adjust the strncpy to be one shorter than the buffer and force the trailing byte to be a NUL.
Repeat this pattern for all `strncpy` calls.
Change-Id: I45c630733f0138d2b089a60f698d75e1c09de9e2 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
5220c9bd | 08-Aug-2024 |
Karthik Rajagopalan <krajagopalan@nvidia.com> |
Add ability to use lib without json-c dependency
Adds 2 wrapper APIs to parse raw CPER & return char* for json cperbuf_to_str_ir - parses a full CPER cperbuf_single_section_to_str_ir - parses a sing
Add ability to use lib without json-c dependency
Adds 2 wrapper APIs to parse raw CPER & return char* for json cperbuf_to_str_ir - parses a full CPER cperbuf_single_section_to_str_ir - parses a single-section CPER
Change-Id: Ief018cc421497a8c366157a21e83ef60641e2646 Signed-off-by: Karthik Rajagopalan <krajagopalan@nvidia.com>
show more ...
|
9fe2cb5f | 08-Aug-2024 |
Karthik Rajagopalan <krajagopalan@nvidia.com> |
Generate pkgconfig dependency for parser library
Had to rename overloaded variables & change tests/meson.build to match
Change-Id: Id92a71e6ff4c7edcdc0b64de90e078936921b4d5 Signed-off-by: Karthik R
Generate pkgconfig dependency for parser library
Had to rename overloaded variables & change tests/meson.build to match
Change-Id: Id92a71e6ff4c7edcdc0b64de90e078936921b4d5 Signed-off-by: Karthik Rajagopalan <krajagopalan@nvidia.com>
show more ...
|
462f9f69 | 06-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
README.md: Fix typos
s/ninji/ninja
Change-Id: I2c92dedb4eeb90761e977d06e5a1789facb12069 Signed-off-by: George Liu <liuxiwei@ieisystem.com> |
18a6b127 | 04-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
README.md: Fix MD040 warnings
The following warnings are generated by using markdownlint analysis: ``` MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
README.md: Fix MD040 warnings
The following warnings are generated by using markdownlint analysis: ``` MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] ``` Refer to markdown-lint [1] to fix MD040 [1]: https://github.com/updownpress/markdown-lint/blob/master/rules/040-fenced-code-language.md
Change-Id: I91e8b62a4947109e28f2b5b5768f32bd52b1e21b Signed-off-by: George Liu <liuxiwei@ieisystem.com>
show more ...
|
ec9fc0db | 04-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
docs/OEMExtensions.md: Fix MD036 warnings
The following warnings are generated by using markdownlint analysis: ``` MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "sections
docs/OEMExtensions.md: Fix MD036 warnings
The following warnings are generated by using markdownlint analysis: ``` MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "sections/cper-section-myvendor..."] MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "sections/cper-section-myvendor..."] MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "sections/cper-section.c"] ``` Refer to markdown-lint [1] to fix MD036 [1]: https://github.com/updownpress/markdown-lint/blob/master/rules/036-no-emphasis-as-header.md
Change-Id: I1df5292213fd6a580525087c37445e2b52524b33 Signed-off-by: George Liu <liuxiwei@ieisystem.com>
show more ...
|
d8ac7110 | 04-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
docs/GeneratorExtensions.md: Fix MD036 warnings
The following warnings are generated by using markdownlint analysis: ``` MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "se
docs/GeneratorExtensions.md: Fix MD036 warnings
The following warnings are generated by using markdownlint analysis: ``` MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "sections/gen-section.h"] MD036/no-emphasis-as-heading Emphasis used instead of a heading [Context: "sections/gen-myvendor.c"] ``` Refer to markdown-lint [1] to fix MD036 [1]: https://github.com/updownpress/markdown-lint/blob/master/rules/036-no-emphasis-as-header.md
Change-Id: Ib39b6fff70283c7db070030614a05c3a47a859ae Signed-off-by: George Liu <liuxiwei@ieisystem.com>
show more ...
|
bf68fa15 | 04-Aug-2024 |
George Liu <liuxiwei@ieisystem.com> |
generator/README.md: Fix MD040 warnings
The following warnings are generated by using markdownlint analysis: ``` MD040/fenced-code-language Fenced code blocks should have a language specified [Conte
generator/README.md: Fix MD040 warnings
The following warnings are generated by using markdownlint analysis: ``` MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"] ``` Refer to markdown-lint [1] to fix MD040 [1]: https://github.com/updownpress/markdown-lint/blob/master/rules/040-fenced-code-language.md
Change-Id: I172710424721f2694c8eb5efb186db1f107279ec Signed-off-by: George Liu <liuxiwei@ieisystem.com>
show more ...
|
bf6ccc85 | 05-Aug-2024 |
Karthik Rajagopalan <krajagopalan@nvidia.com> |
Fix leaked json objects when there is a failure parsing
An example that was flagged from the app that uses libcper: ''' Indirect leak of 96 byte(s) in 2 object(s) allocated from: #0 0x7f93e0ddaf
Fix leaked json objects when there is a failure parsing
An example that was flagged from the app that uses libcper: ''' Indirect leak of 96 byte(s) in 2 object(s) allocated from: #0 0x7f93e0ddafdf in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:69 #1 0x7f93e0b97cde in json_object_new /json-c-json-c-0.17-20230812/json_object.c:321 #2 0x7f93e0b97cde in json_object_new_object /json-c-json-c-0.17-20230812/json_object.c:532 #3 0x7f93e0c8ac81 in cper_to_ir ../subprojects/libcper/cper-parse.c:45 '''
Change-Id: I6c77cf797bb369d6e459545cf021f31c47dbe6a0 Signed-off-by: Karthik Rajagopalan <krajagopalan@nvidia.com>
show more ...
|
74e19197 | 25-Jul-2024 |
Karthik Rajagopalan <krajagopalan@nvidia.com> |
Add Karthik Rajagopalan as reviewer
Change-Id: I31727db53db2096ab9af525b58af7b51aa84d9ac Signed-off-by: Karthik Rajagopalan <krajagopalan@nvidia.com> |
45e7332f | 26-Jul-2024 |
Karthik Rajagopalan <krajagopalan@nvidia.com> |
Fix build error when building an app with libcper as a subproject
Addresses the following error from meson setup: subprojects/libcper/meson.build:15:0: ERROR: Function 'add_global_arguments' cannot
Fix build error when building an app with libcper as a subproject
Addresses the following error from meson setup: subprojects/libcper/meson.build:15:0: ERROR: Function 'add_global_arguments' cannot be used in subprojects because there is no way to make that reliable.
Change-Id: I69f42e19c0c8cbc13e21dbee2848275effc65e45 Signed-off-by: Karthik Rajagopalan <krajagopalan@nvidia.com>
show more ...
|
683e0550 | 07-Mar-2024 |
Karthik Rajagopalan <krajagopalan@nvidia.com> |
Add support for NVIDIA CPERs
Support Nvidia CPER entries.
Change-Id: Iea9bde181ead55ad99cdb2a341501bf48e1d82a8 Signed-off-by: Ed Tanous <etanous@nvidia.com> |
4482c48b | 02-Jul-2024 |
Andrew Adriance <aadriance@nvidia.com> |
Update limits headers for better platform compat
This change enables building libcper based cli tools on mac systems.
Change-Id: If9b0134d3677b84c57603fa83d546b58e8c2d073 Signed-off-by: Andrew Adri
Update limits headers for better platform compat
This change enables building libcper based cli tools on mac systems.
Change-Id: If9b0134d3677b84c57603fa83d546b58e8c2d073 Signed-off-by: Andrew Adriance <aadriance@nvidia.com>
show more ...
|
358c7e16 | 15-Jul-2024 |
Ed Tanous <ed@tanous.net> |
Remove json-schema install
This code just copies the json-schema from the source dir to the compile dir. It doesn't actually accomplish anything.
Move the source dir to a compile flag, and let uni
Remove json-schema install
This code just copies the json-schema from the source dir to the compile dir. It doesn't actually accomplish anything.
Move the source dir to a compile flag, and let unit tests read in the schema directly.
Note: Copy was actually done in two places.
Change-Id: I26aee9edbac5b253ca426d32118b71cc5f905e10 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
a84fc937 | 15-Jul-2024 |
Ed Tanous <ed@tanous.net> |
Fix meson warnings
Clean up some variable naming conventions, remove some unused variables.
Change-Id: I87fc4645853b9ce33968863ece0f73cf4bae71fc Signed-off-by: Ed Tanous <ed@tanous.net> |
a7d2cddd | 15-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
Move to embedded base64
Base64 encode/decode is a relatively simple algorithm, and currently libcper takes a dependency on libb64 for this. libb64 does not have methods for determining the encoded
Move to embedded base64
Base64 encode/decode is a relatively simple algorithm, and currently libcper takes a dependency on libb64 for this. libb64 does not have methods for determining the encoded size or decoded size, and rely on the user to provide the right buffer sizes, which libcper currently approximates as 2X the input size (which is incorrect).
This commit removes the libb64 dependency entirely, and inlines a libcper specific base64 encoder and decoder, using EDK2-allowed types.
The implementation itself is unique to libcper and makes the following design decisions. 1. Malloc is performed within the base64_<> functions. This reduces the number of malloc calls total, and removes the need for separately determining the output size. 2. Arguments are passed in by EDK2-types under the assumption that this will keep compatibility with EDK2 implementations. 3. Incremental parsing is not supported. CPER records are expected to be algorithmically small, and buffered such that the entire value fits in memory. This was already an assumption, but dropping the support for incremental encoding significantly reduces the amount of code to support it. It could be added back in the future if needed.
Change-Id: Idb010db105067ea317dbee05c2663511ab3c6611 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
c833a3ac | 15-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
Reformat test meson.build
Using muon fmt
Change-Id: I01142cb05dd9d3901413e40f2218a7dc72b3f8d7 Signed-off-by: Ed Tanous <etanous@nvidia.com> |
63722348 | 15-Jul-2024 |
Ed Tanous <etanous@nvidia.com> |
Add subprojects to gitignore
Subprojects should be ignored by git.
Change-Id: Ic180925b30e13fab7475d123c0127e3de56e4a42 Signed-off-by: Ed Tanous <etanous@nvidia.com> |
fedd457d | 12-Jul-2024 |
Ed Tanous <ed@tanous.net> |
Remove trailing whitespace
clang-format won't remove trailing whitespace if that's the only change. Fix them all.
Change-Id: Ic6e14af43cdd11905d3b58430d49b9ec1484f812 Signed-off-by: Ed Tanous <ed@t
Remove trailing whitespace
clang-format won't remove trailing whitespace if that's the only change. Fix them all.
Change-Id: Ic6e14af43cdd11905d3b58430d49b9ec1484f812 Signed-off-by: Ed Tanous <ed@tanous.net>
show more ...
|
5030d161 | 02-Jul-2024 |
Andrew Adriance <aadriance@nvidia.com> |
Add Andrew Adriance as reviewer
Change-Id: Iff94629e91922bb5763646d15d530eb5f4aec585 Signed-off-by: Andrew Adriance <aadriance@nvidia.com> |
1a908984 | 02-Jul-2024 |
Andrew Adriance <aadriance@nvidia.com> |
Update meson.build to respect default_library for libb64
Allows building a fully static libcper when default_library=static
Change-Id: I5790a53c38609fe2b92614775f0da100e140dd77 Signed-off-by: Andre
Update meson.build to respect default_library for libb64
Allows building a fully static libcper when default_library=static
Change-Id: I5790a53c38609fe2b92614775f0da100e140dd77 Signed-off-by: Andrew Adriance <aadriance@nvidia.com>
show more ...
|
a5b3d49b | 18-Jun-2024 |
Ed Tanous <etanous@nvidia.com> |
Format meson file with muon
Whitespace only change.
Change-Id: Ic8f5fa88938d0e407a37c34f8654138c03048cd0 Signed-off-by: Ed Tanous <etanous@nvidia.com> |
1e267b64 | 18-Jun-2024 |
Ed Tanous <etanous@nvidia.com> |
Suppress meson warning
Meson warns that this will be required in the future. Add it.
Change-Id: I799d868dda86892eea3de4943b238fc3147c9912 Signed-off-by: Ed Tanous <etanous@nvidia.com> |