[edk2-devel] [PATCH edk2-platforms v1 05/12] Platform/ARM/VExpressPkg: Helper macro to map reference token
Sami Mujawar
sami.mujawar at arm.com
Fri Feb 12 10:23:34 UTC 2021
Introduce helper macro REFERENCE_TOKEN() to map reference tokens.
Signed-off-by: Sami Mujawar <sami.mujawar at arm.com>
---
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c | 3 +--
Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h | 6 ++++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
index 3298f9f9f79a2b23f181d3e961298f1c366976ee..49aa16184a2da587471239a7c90ed864f963896c 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.c
@@ -150,8 +150,7 @@ EDKII_PLATFORM_REPOSITORY_INFO VExpressPlatRepositoryInfo = {
// The number of timer frames implemented in the GT Block
FVP_TIMER_FRAMES_COUNT,
// Reference token for the GT Block timer frame list
- (CM_OBJECT_TOKEN)((UINT8*)&VExpressPlatRepositoryInfo +
- OFFSET_OF (EDKII_PLATFORM_REPOSITORY_INFO, GTBlock0TimerInfo))
+ REFERENCE_TOKEN (GTBlock0TimerInfo)
}
},
diff --git a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
index c25ba9fac52fe049236948185dfc052c44a71e4b..c21f160dd082bddb9e8e1ab666143887d67869cd 100644
--- a/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
+++ b/Platform/ARM/VExpressPkg/ConfigurationManager/ConfigurationManagerDxe/ConfigurationManager.h
@@ -71,6 +71,12 @@ typedef EFI_STATUS (*CM_OBJECT_HANDLER_PROC) (
IN OUT CM_OBJ_DESCRIPTOR * CONST CmObject
);
+/** A helper macro for mapping a reference token.
+*/
+#define REFERENCE_TOKEN(Field) \
+ (CM_OBJECT_TOKEN)((UINT8*)&VExpressPlatRepositoryInfo + \
+ OFFSET_OF (EDKII_PLATFORM_REPOSITORY_INFO, Field))
+
/** The number of CPUs
*/
#define PLAT_CPU_COUNT 8
--
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#71631): https://edk2.groups.io/g/devel/message/71631
Mute This Topic: https://groups.io/mt/80580207/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list