Revision: 16968
http://sourceforge.net/p/edk2/code/16968
Author: lersek
Date: 2015-02-28 20:32:16 +0000 (Sat, 28 Feb 2015)
Log Message:
-----------
Ovmf/Xen: fix pointer to int cast in XenBusDxe
On ARM, xen_pfn_t is 64 bits but the size of a pointer is only
32 bits, so casting between them needs to go via (UINTN). Also
move the xen_pfn_t cast outside the shift so that we can avoid
shifting 64-bit quantities on 32-bit architectures, which may
require runtime library support.
Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Stefano Stabellini <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Anthony PERARD <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Laszlo Ersek <[email protected]>
Modified Paths:
--------------
trunk/edk2/OvmfPkg/XenBusDxe/GrantTable.c
Modified: trunk/edk2/OvmfPkg/XenBusDxe/GrantTable.c
===================================================================
--- trunk/edk2/OvmfPkg/XenBusDxe/GrantTable.c 2015-02-28 20:32:06 UTC (rev
16967)
+++ trunk/edk2/OvmfPkg/XenBusDxe/GrantTable.c 2015-02-28 20:32:16 UTC (rev
16968)
@@ -160,7 +160,7 @@
Parameters.domid = DOMID_SELF;
Parameters.idx = Index;
Parameters.space = XENMAPSPACE_grant_table;
- Parameters.gpfn = (((xen_pfn_t) GrantTable) >> EFI_PAGE_SHIFT) + Index;
+ Parameters.gpfn = (xen_pfn_t) ((UINTN) GrantTable >> EFI_PAGE_SHIFT) +
Index;
ReturnCode = XenHypercallMemoryOp (Dev, XENMEM_add_to_physmap,
&Parameters);
if (ReturnCode != 0) {
DEBUG ((EFI_D_ERROR, "Xen GrantTable, add_to_physmap hypercall error:
%d\n", ReturnCode));
@@ -182,7 +182,7 @@
for (Index = NR_GRANT_FRAMES - 1; Index >= 0; Index--) {
Parameters.domid = DOMID_SELF;
- Parameters.gpfn = (((xen_pfn_t) GrantTable) >> EFI_PAGE_SHIFT) + Index;
+ Parameters.gpfn = (xen_pfn_t) ((UINTN) GrantTable >> EFI_PAGE_SHIFT) +
Index;
DEBUG ((EFI_D_INFO, "Xen GrantTable, removing %X\n", Parameters.gpfn));
ReturnCode = XenHypercallMemoryOp (Dev, XENMEM_remove_from_physmap,
&Parameters);
if (ReturnCode != 0) {
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits