WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

[Xen-ia64-devel] [PATCH] GFW: Fix InitializeXenVram()

To: tgingold@xxxxxxx, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-ia64-devel] [PATCH] GFW: Fix InitializeXenVram()
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Thu, 25 Sep 2008 13:31:45 +0900
Cc:
Delivery-date: Wed, 24 Sep 2008 21:31:49 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.6i
Fix InitializeXenVram()

alignemnt logic was wrong. round up is needed instead of round down.
add two debug messages.

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r ceb752058fbb 
edk2-sparse/EdkQemuPkg/Chipset/PcCompatible/VgaInit/Dxe/XenVRam.c
--- a/edk2-sparse/EdkQemuPkg/Chipset/PcCompatible/VgaInit/Dxe/XenVRam.c Wed Sep 
24 18:46:12 2008 +0900
+++ b/edk2-sparse/EdkQemuPkg/Chipset/PcCompatible/VgaInit/Dxe/XenVRam.c Thu Sep 
25 13:34:18 2008 +0900
@@ -96,10 +96,13 @@
   Memory = 0xffffffff; // 32bit
   Status = gBS->AllocatePages (AllocateMaxAddress, EfiRuntimeServicesData, 
Pages, &Memory);
   if (Status != EFI_SUCCESS) {
+    DEBUG ((EFI_D_ERROR,
+           "InitializeXenVRam can't allocate memory for vram size = 0x%lx\n",
+           VGA_RAM_SIZE));
     return;
   }
   AlignedMask = ~(XEN_PAGE_SIZE - 1);
-  VgaRam = (UINTN) Memory & AlignedMask;
+  VgaRam = (Memory + XEN_PAGE_SIZE - 1) & AlignedMask;
   UnalignedPages = EFI_SIZE_TO_PAGES (VgaRam - Memory);
   if (UnalignedPages > 0) {
     gBS->FreePages (Memory, UnalignedPages);
@@ -109,6 +112,8 @@
     gBS->FreePages (VgaRam + VGA_RAM_SIZE, UnalignedPages);
   }
   ZeroMem ((VOID*) VgaRam, VGA_RAM_SIZE);
+  DEBUG ((EFI_D_INFO, "InitializeXenVRam vram 0x%lx - 0x%lx\n",
+         VgaRam, VgaRam + VGA_RAM_SIZE));
 
   Data32 = VgaRam; // discard upper bit
   Bar0 = PciRead32 (


-- 
yamahata

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-ia64-devel] [PATCH] GFW: Fix InitializeXenVram(), Isaku Yamahata <=