From c8ecc840d7fa7111577ec3882623bb4b4f496e55 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 16 May 2011 08:51:55 +0200 Subject: [PATCH] * grub-core/bus/pci.c (grub_memalign_dma32): Always allocate in 64-byte blocks. --- ChangeLog | 5 +++++ grub-core/bus/pci.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fc4d68013..868391294 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-05-16 Vladimir Serbinenko + + * grub-core/bus/pci.c (grub_memalign_dma32): Always allocate in 64-byte + blocks. + 2011-05-16 Vladimir Serbinenko * grub-core/bus/usb/usbhub.c (attach_root_port): Wait 10ms diff --git a/grub-core/bus/pci.c b/grub-core/bus/pci.c index 4212905f0..51006a20e 100644 --- a/grub-core/bus/pci.c +++ b/grub-core/bus/pci.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -30,7 +31,11 @@ GRUB_MOD_LICENSE ("GPLv3+"); struct grub_pci_dma_chunk * grub_memalign_dma32 (grub_size_t align, grub_size_t size) { - void *ret = grub_memalign (align, size); + void *ret; + if (align < 64) + align = 64; + size = ALIGN_UP (size, align); + ret = grub_memalign (align, size); if (!ret) return 0; grub_arch_sync_dma_caches (ret, size);