* Remove redundant /DLL option from MSFT
* Use VERSION_STRING from [Defines] section to set
the PE/COFF optional header image version fields.
The use of the MSFT linker /VERSION option is
removed and replaced with the GenFw --image-version
option to use same method for all tool chains and
provide better error checking.
* Add CLANGPDB tool chain family support that matches
MSFT settings.
* Add GCC family tool chain support that overrides
OBJCOPY_STRIPFLAGS to nothing to prevent symbols
from being stripped from PRM Modules so the
PRM Export Descriptor Structure can be found by
GENFW when the --prm option is used.
* Remove all -Wl, options that are not compatible
across all support tool chains. This also removes
the need to list the PRM Export Descriptor Structure
and PRM Handler APIs in the INF file and instead
depend in GENFW with --prm option to find these
symbols and generate the PE/COFF DLL export section.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Use _MSC_EXTENSIONS instead of _MSC_VER when MSC specific
extensions are required such as __declspec(dllexport).
CLANGPDB builds do not set _MSC_VER but CLANGPDB builds
in Windows and Linux do support use of MSC specific
extensions.
Add PRM_EXPORT_DESCRIPTOR macro that provides attributes
required to make sure the PRM Export Descriptor Structure
is not optimized away by the compiler/linker.
PRM_EXPORT_API can not be used for this because the
attributes for code and data may be different with
different tool chains.
For GCC/CLANGDWARF tool chains, PRM_EXPORT_DESCRIPTOR
sets the 'used' and 'section(.prmexportdescriptor)'
attributes and depends on the GCC linker script
to make sure the `.prmexportdescriptor` section is
preserved.
Fix incorrect location of ; in PRM_MODULE_EXPORT()
macro that was found by CLANG.
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Since PRM modules are DXE_RUNTIME_DRIVER images, this change sets
the linker flags to the expected section alignment values for
runtime code images. This serves as an example for platforms but
also results in PRM sample modules in the package having correct
section alignment.
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Make use the newly introduced ShellPrintHiiDefaultEx() alias and
replace wherever it is possible:
- "ShellPrintHiiEx (-1, -1, NULL,"
with:
- "ShellPrintHiiDefaultEx ("
No functional change is introduced.
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
edk2 is dropping support for the ARM32 architecture. This
removes support from PrmPkg. It also removes irrelevant
VALID_ARCHITECTURES comments from infs that are not
arch specific.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
The debug print incorrectly uses "%016x" to print a UINT64 PhysicalAddress.
This can cause truncation since "%x" expects UINT32.
Update the format specifier to "%016llx" to properly handle UINT64 values
and ensure correct output across all architectures.
Signed-off-by: Aaron Li <aaron.li@intel.com>
Fix memory leaks by adding missing FreePool calls:
cleanup HandleBuffer in GetModuleContextBuffers.
REF: https://uefi.org/sites/default/files/resources/UEFI_Spec_Final_2.11.pdf
Chapter 7.3.15: "Services - Boot Services.LocateHandleBuffer":
It is the caller's responsibility to call the Boot Service.FreePool when
the caller no longer requires the contents of Buffer.
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
In PRM spec 1.0 section 4.2.2 ACPI Parameter Buffer defines
the signature of ACPI Parameter Data Buffer is 'PRMP'.
This commit adds the signature of ACPI Parameter Data Buffer.
Signed-off-by: Aaron Li <aaron.li@intel.com>
Correct the GCC GenFw and ld flag to build PRM run time modules.
These changes are made for X64 GCC compiler, current present for AARCH64 only.
Adds addition _X64_OBJCOPY_STRIPFLAG for X64 to retain required symbol
during objcopy.
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
edk2's PRM Data Buffer Signature is 'PRMD', however
PRM spec 1.0 section 4.2.1 Static Data Buffer indicates
that the signature should be 'PRMS'.
This commit aligns edk2's signature definition with the spec.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This is regarding PRM modules that are describing MMIO ranges.
When PrmConfigDxe is calling GetMemorySpaceDescriptor() with
a memory range that is visible to the boot processor but has
not been added to the memory map GetMemorySpaceDescriptor()
will return EFI_SUCCESS and then return a memory descriptor
indicating that the region is non-existent. This causes
SetRuntimeMemoryRangeAttributes() to believe that the region
has already been added to the memory map and will eventually
cause an ASSERT.
This PR allows for SetRuntimeMemoryRangeAttributes() to treat
a non-existent MMIO range the same as a range that triggered
a EFI_NOT_FOUND error response from GetMemorySpaceDescriptor().
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
Remove IA32 from supported architectures, as the MSVC build actually
fails due to the linker expecting a __stdcall calling convention.
IA32 PRMs are not supported anyway, only 64 bit OSes support PRM,
so simply drop the building of IA32 PrmPkg and clarify the README.
While there, clean up some markdown errors.
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
This PR updates the CI pipelines to use VS2022 instead of VS2019
as that is the latest supported VS toolchain on edk2.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
Links from acpica.org are now redirected to the ACPICA overview page
on intel.com. Update the link so it goes to the 20200517 download page.
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Now that the ResetVectors are USER_DEFINED modules, they will not
be linked against StackCheckLibNull, which were the only modules
causing issues. So, we can now remove the kludge we had before
and the requirement for every DSC to include StackCheckLibNull
for SEC modules and just apply StackCheckLibNull globally.
This also changes every DSC to drop the SEC definition of
StackCheckLibNull.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
As per the emailed RFC in
https://edk2.groups.io/g/devel/topic/rfc_move/107675828,
this patch moves CompilerIntrinsicsLib from ArmPkg to
MdePkg as this library provides compiler intrinsics, which
are industry standard.
This aligns with the goal of integrating ArmPkg into existing
packages: https://bugzilla.tianocore.org/show_bug.cgi?id=4121.
The newly placed CompilerIntrinsicsLib is added to MdeLibs.dsc.inc
as every DSC that builds ARM/AARCH64 needs this library added. The
old location is removed from every DSC in edk2 in this commit also
to not break bisectability with minimal hoop jumping.
Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Passing in access attributes to SetMemorySpaceAttributes() will cause
the existing attributes to be overwritten. The MMIO region should have
the appropriate attributes applied during memory protection
initialization and the attributes of the memory space descriptor are
inaccurate. Don't pass in any CPU arch attributes so
SetMemorySpaceAttributes() doesn't subsequently call
gCpu->SetMemoryAttributes().
Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Adds a PrEval entry to the package's ci.yaml file which is used to
verify if the package uses a particular library instance when that
library instance file (INF) is updated.
When a library instance file (INF) is updated, PrEval will review each
package's DSC as described in the ci.yaml file to determine if the
package uses said library instance. If the package does use the library
instance, it will be built and tested to ensure the package is not
broken from the change.
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Joey Vagedes <joeyvagedes@gmail.com>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among
others support, while __func__ was standardized in C99.
Since it's more standard, replace __FUNCTION__ with __func__ throughout
PrmPkg.
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Update PrmPkg host-based unit test INF files to only list
VALID_ARCHITECTURES of IA32 and X64 to align with all other
host-based unit test INF files. The UnitTestFrameworkPkg only
provides build support of host-based unit tests to OS applications
for IA32 and X64.
Cc: Michael Kubacki <mikuback@linux.microsoft.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Reviewed-by: Michael Kubacki <mikuback@linux.microsoft.com>
Specify how to build the PrmPkg for the AArch64 architecture.
Make the 2 following notes:
- the PrmPkg has only been tested on AArch64 using the GCC5
toolchain.
- All symbols to be listed in the PRMT as well as the
PrmModuleExportDescriptor must be explicitly preserved by resorting to
the --require-defined linker flag.
Signed-off-by: Jose Marinho <jose.marinho@arm.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Add support to build PrmPkg for AArch64 using the GCC compiler.
Add AARCH64 architecture to the list of supported architectures.
Add BaseStackCheck library to allow for Prm module builds on AARCH64.
Also update the CI to add dependency on ArmPkg.
Signed-off-by: Jose Marinho <jose.marinho@arm.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
- Add the --prm flag to the GENFW_FLAGS
- Add the --no-gc-section to the linker flags so that apparently
unreferenced symbols are not prematurely removed from the .dll which
is used to generate the Prm module .efi.
- Force the linker to maintain the PrmModuleExportDescriptor symbol.
- Force the linker to maintain the PRM handler funtion's symbol.
Signed-off-by: Jose Marinho <jose.marinho@arm.com>
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Makes the following changes to enforce stricter types:
1. PrmPkg/PrmConfigDxe
The function PrmConfigEndOfDxeNotification () is used as a notify
function (of type EFI_EVENT_NOTIFY), however it has a return type
of EFI_STATUS whereas the return type should actually be VOID.
2. PrmPkg/PrmLoaderDxe
Updates the following types to be more accurate than were allowed
in the VS compiler:
* 3rd actual argument given to GetModuleContextBuffers () is
explicitly marked as CONST PRM_MODULE_CONTEXT_BUFFERS **
* 3rd actual argument given to GetContextBuffer () is
explicitly marked as CONST PRM_CONTEXT_BUFFER **
* PrmLoaderEndOfDxeNotification () return type is changed to VOID
to align with the EFI_EVENT_NOTIFY type
3. PrmPkg/Application/PrmInfo
Updates the following types to be more accurate than were allowed
in the VS compiler:
* SHELL_STATUS in ParseParameterList () is now EFI_STATUS
* 3rd actual argument given to GetModuleContextBuffers () is
explicitly marked as CONST PRM_MODULE_CONTEXT_BUFFERS **
* 3rd actual argument given to GetContextBuffer () is
explicitly marked as CONST PRM_CONTEXT_BUFFER **
Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
Adds a new UEFI application called "PrmInfo" that allows a user
to display and test Platform Runtime Mechanism (PRM) modules.
Execute the application help command for detailed usage
instructions and examples of how to use the application:
"PrmInfo -?"
This application is intended to be helpful during PRM enabling
by allowing the user to:
1. Confirm that their firmware port of the PRM infrastructure
implemented in this package is functioning correctly.
2. Quickly get information about what PRM modules and handlers
are present on a given system.
3. Quickly test PRM handlers without booting to a fully featured
operating system.
4. Develop and exercise PRM handlers prior to the availability of
an operating system that is PRM aware.
Adds a brief section to Readme.md about the PrmInfo UEFI application
with a link to allow the reader to find more information about the
application if interested.
Cc: Andrew Fish <afish@apple.com>
Cc: Kang Gao <kang.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Benjamin You <benjamin.you@intel.com>
Cc: Liu Yun <yun.y.liu@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Acked-by: Liming Gao <gaoliming@byosoft.com.cn>
Acked-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>