mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-27 15:44:04 +02:00
ArmPkg/ArmMmuLib: Use function pointer type
mReplaceLiveEntryFunc is a function pointer but assigned as a VOID* pointer: mReplaceLiveEntryFunc = *(VOID **)GET_GUID_HOB_DATA (Hob); This leads to the Visual Studio warning: nonstandard extension, function/data pointer conversion in expression This change updates the assignment to avoid using a data pointer and defines a type for the function pointer to succinctly and accurately refer to the type when it is used in the library code. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
0e9ce9146a
commit
d451bba399
@ -20,16 +20,9 @@
|
|||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/HobLib.h>
|
#include <Library/HobLib.h>
|
||||||
|
#include "ArmMmuLibInternal.h"
|
||||||
|
|
||||||
STATIC
|
STATIC ARM_REPLACE_LIVE_TRANSLATION_ENTRY mReplaceLiveEntryFunc = ArmReplaceLiveTranslationEntry;
|
||||||
VOID (
|
|
||||||
EFIAPI *mReplaceLiveEntryFunc
|
|
||||||
)(
|
|
||||||
IN UINT64 *Entry,
|
|
||||||
IN UINT64 Value,
|
|
||||||
IN UINT64 RegionStart,
|
|
||||||
IN BOOLEAN DisableMmu
|
|
||||||
) = ArmReplaceLiveTranslationEntry;
|
|
||||||
|
|
||||||
STATIC
|
STATIC
|
||||||
UINT64
|
UINT64
|
||||||
@ -742,7 +735,7 @@ ArmMmuBaseLibConstructor (
|
|||||||
|
|
||||||
Hob = GetFirstGuidHob (&gArmMmuReplaceLiveTranslationEntryFuncGuid);
|
Hob = GetFirstGuidHob (&gArmMmuReplaceLiveTranslationEntryFuncGuid);
|
||||||
if (Hob != NULL) {
|
if (Hob != NULL) {
|
||||||
mReplaceLiveEntryFunc = *(VOID **)GET_GUID_HOB_DATA (Hob);
|
mReplaceLiveEntryFunc = *(ARM_REPLACE_LIVE_TRANSLATION_ENTRY *)GET_GUID_HOB_DATA (Hob);
|
||||||
} else {
|
} else {
|
||||||
//
|
//
|
||||||
// The ArmReplaceLiveTranslationEntry () helper function may be invoked
|
// The ArmReplaceLiveTranslationEntry () helper function may be invoked
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#include <Library/CacheMaintenanceLib.h>
|
#include <Library/CacheMaintenanceLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/HobLib.h>
|
#include <Library/HobLib.h>
|
||||||
|
#include "ArmMmuLibInternal.h"
|
||||||
|
|
||||||
EFI_STATUS
|
EFI_STATUS
|
||||||
EFIAPI
|
EFIAPI
|
||||||
@ -22,7 +23,7 @@ ArmMmuPeiLibConstructor (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
extern UINT32 ArmReplaceLiveTranslationEntrySize;
|
extern UINT32 ArmReplaceLiveTranslationEntrySize;
|
||||||
VOID *ArmReplaceLiveTranslationEntryFunc;
|
ARM_REPLACE_LIVE_TRANSLATION_ENTRY ArmReplaceLiveTranslationEntryFunc;
|
||||||
VOID *Hob;
|
VOID *Hob;
|
||||||
|
|
||||||
EFI_FV_FILE_INFO FileInfo;
|
EFI_FV_FILE_INFO FileInfo;
|
||||||
|
@ -19,10 +19,12 @@
|
|||||||
CONSTRUCTOR = ArmMmuBaseLibConstructor
|
CONSTRUCTOR = ArmMmuBaseLibConstructor
|
||||||
|
|
||||||
[Sources.AARCH64]
|
[Sources.AARCH64]
|
||||||
|
ArmMmuLibInternal.h
|
||||||
AArch64/ArmMmuLibCore.c
|
AArch64/ArmMmuLibCore.c
|
||||||
AArch64/ArmMmuLibReplaceEntry.S
|
AArch64/ArmMmuLibReplaceEntry.S
|
||||||
|
|
||||||
[Sources.ARM]
|
[Sources.ARM]
|
||||||
|
ArmMmuLibInternal.h
|
||||||
Arm/ArmMmuLibConvert.c
|
Arm/ArmMmuLibConvert.c
|
||||||
Arm/ArmMmuLibCore.c
|
Arm/ArmMmuLibCore.c
|
||||||
Arm/ArmMmuLibUpdate.c
|
Arm/ArmMmuLibUpdate.c
|
||||||
|
23
ArmPkg/Library/ArmMmuLib/ArmMmuLibInternal.h
Normal file
23
ArmPkg/Library/ArmMmuLib/ArmMmuLibInternal.h
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/** @file
|
||||||
|
Arm MMU library instance internal header file.
|
||||||
|
|
||||||
|
Copyright (C) Microsoft Corporation. All rights reserved.
|
||||||
|
|
||||||
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
|
**/
|
||||||
|
|
||||||
|
#ifndef ARM_MMU_LIB_INTERNAL_H_
|
||||||
|
#define ARM_MMU_LIB_INTERNAL_H_
|
||||||
|
|
||||||
|
typedef
|
||||||
|
VOID(
|
||||||
|
EFIAPI *ARM_REPLACE_LIVE_TRANSLATION_ENTRY
|
||||||
|
)(
|
||||||
|
IN UINT64 *Entry,
|
||||||
|
IN UINT64 Value,
|
||||||
|
IN UINT64 RegionStart,
|
||||||
|
IN BOOLEAN DisableMmu
|
||||||
|
);
|
||||||
|
|
||||||
|
#endif
|
@ -17,6 +17,7 @@
|
|||||||
CONSTRUCTOR = ArmMmuPeiLibConstructor
|
CONSTRUCTOR = ArmMmuPeiLibConstructor
|
||||||
|
|
||||||
[Sources.AARCH64]
|
[Sources.AARCH64]
|
||||||
|
ArmMmuLibInternal.h
|
||||||
AArch64/ArmMmuLibCore.c
|
AArch64/ArmMmuLibCore.c
|
||||||
AArch64/ArmMmuPeiLibConstructor.c
|
AArch64/ArmMmuPeiLibConstructor.c
|
||||||
AArch64/ArmMmuLibReplaceEntry.S
|
AArch64/ArmMmuLibReplaceEntry.S
|
||||||
|
Loading…
x
Reference in New Issue
Block a user