| commit | 82a14788d6e9a38e90a0f81d09925d729684fd42 | [log] [tgz] |
|---|---|---|
| author | Gaurav Gandhi <gauravgandhi@google.com> | Sat Sep 27 03:17:58 2025 +0000 |
| committer | Gaurav Gandhi <gauravgandhi@google.com> | Sat Sep 27 03:19:59 2025 +0000 |
| tree | efb5fd42b902f1c5e1a6d5b6fc9f8e06053296f0 | |
| parent | 2168ee146144e101f20273011c42b9f9bc4bb8de [diff] |
Fix: Resolve multiple definition linker error Added the `inline` keyword to `uefi::cper::convertToBcd` and `uefi::cper::createCperTimestamp` functions in `cper_encoder.hpp`. This resolves a linker error caused by multiple definitions of these functions when `cper_encoder.hpp` was included in multiple source files. Tested: Fixes build failures in https://gbmc-internal-review.git.corp.google.com/c/deepsea-power-cap/+/244408 Google-Bug-Id: 424199978 Change-Id: I8fd86b8204b4406e6492b61e96c5f8b293d13888 Signed-off-by: Gaurav Gandhi <gauravgandhi@google.com>
This is a header-only library which provides a generic interface for users to write application specific UEFI CPER log encoders.
The UEFI specification for CPER logs allows for many combinations of Record Header and Section Descriptor properties based on the application. However, the underlying data structure does not change from application to application. To make it easier for gBMC applications to log faults in the CPER format the user only needs to specify the type of Record and Section type(s) that the encoder will need to create.
When developing and testing your application specific encoders, you will need to install this library into your development container.
Below is some pseudo code of how a user would setup their application specific CPER encoder which takes in char array types.
class MyCperEncoder : public CperEncoder<char> { RecordHeader createRecordHeader(...) override {...} SectionDescriptor createSectionDescriptor(...) override { if (sectionType == kPlatformMemory) { return createPlatformMemoryDescriptor(); } else if (sectionType == kOemSection) { return createOemDescriptor(); } ... } SectionDescriptor createPlatformMemoryDescriptor() {...} SectionDescriptor createOemDescriptor() {...} }
meson setup -C builddir meson install -C builddir
meson test -C builddir