diff options
author | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-11-05 03:08:17 +0000 |
---|---|---|
committer | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-11-05 03:08:17 +0000 |
commit | 740ee2ea4048b4a85345024a90c39887304c28f3 (patch) | |
tree | fc8188503124420902d6eb5f3999f7856a40c86f /MdePkg | |
parent | c5e0de8794346f0e11ae63f1e7705e784dcd5f81 (diff) | |
download | edk2-740ee2ea4048b4a85345024a90c39887304c28f3.zip edk2-740ee2ea4048b4a85345024a90c39887304c28f3.tar.gz edk2-740ee2ea4048b4a85345024a90c39887304c28f3.tar.bz2 |
Add comment about usage on EFI_SIZE_TO_PAGES() and EFI_PAGES_TO_SIZE macros.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11004 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r-- | MdePkg/Include/Uefi/UefiBaseType.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/MdePkg/Include/Uefi/UefiBaseType.h b/MdePkg/Include/Uefi/UefiBaseType.h index 6e52280..5b8a762 100644 --- a/MdePkg/Include/Uefi/UefiBaseType.h +++ b/MdePkg/Include/Uefi/UefiBaseType.h @@ -188,8 +188,12 @@ typedef union { #define EFI_PAGE_MASK 0xFFF
#define EFI_PAGE_SHIFT 12
+//
+// It is expected that a parameter for the following two macros is of type UINTN.
+// Be careful to pass a UINT64 parameter because 32-bit build break may happen
+// if << or >> shift operations are performed on a 64-bit integer with 32-bit C compiler.
+//
#define EFI_SIZE_TO_PAGES(a) (((a) >> EFI_PAGE_SHIFT) + (((a) & EFI_PAGE_MASK) ? 1 : 0))
-
#define EFI_PAGES_TO_SIZE(a) ( (a) << EFI_PAGE_SHIFT)
///
|