Improve gettext support. Stylistic fixes and error handling fixes while

on it.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-02-08 19:26:01 +01:00
parent 215c90cb82
commit 9c4b5c13e6
184 changed files with 1175 additions and 959 deletions

View file

@ -36,6 +36,16 @@ grub_memalign_dma32 (grub_size_t align, grub_size_t size)
align = 64;
size = ALIGN_UP (size, align);
ret = grub_memalign (align, size);
#if GRUB_CPU_SIZEOF_VOID_P == 8
if ((grub_addr_t) ret >> 32)
{
/* Shouldn't happend since the only platform in this case is
x86_64-efi and it skips any regions > 4GiB because
of EFI bugs anyway. */
grub_error (GRUB_ERR_BUG, "allocation outside 32-bit range");
return 0;
}
#endif
if (!ret)
return 0;
grub_arch_sync_dma_caches (ret, size);

View file

@ -294,13 +294,15 @@ grub_ohci_pci_iter (grub_pci_device_t dev,
o->hcca_chunk, o->hcca, o->hcca_addr);
/* Reserve memory for ctrl EDs. */
o->ed_ctrl_chunk = grub_memalign_dma32 (16, sizeof(struct grub_ohci_ed)*GRUB_OHCI_CTRL_EDS);
o->ed_ctrl_chunk = grub_memalign_dma32 (16, sizeof(struct grub_ohci_ed)
* GRUB_OHCI_CTRL_EDS);
if (! o->ed_ctrl_chunk)
goto fail;
o->ed_ctrl = grub_dma_get_virt (o->ed_ctrl_chunk);
o->ed_ctrl_addr = grub_dma_get_phys (o->ed_ctrl_chunk);
/* Preset EDs */
grub_memset ((void*)o->ed_ctrl, 0, sizeof(struct grub_ohci_ed) * GRUB_OHCI_CTRL_EDS);
grub_memset ((void *) o->ed_ctrl, 0, sizeof (struct grub_ohci_ed)
* GRUB_OHCI_CTRL_EDS);
for (j=0; j < GRUB_OHCI_CTRL_EDS; j++)
o->ed_ctrl[j].target = grub_cpu_to_le32 (1 << 14); /* skip */
@ -308,7 +310,8 @@ grub_ohci_pci_iter (grub_pci_device_t dev,
o->ed_ctrl_chunk, o->ed_ctrl, o->ed_ctrl_addr);
/* Reserve memory for bulk EDs. */
o->ed_bulk_chunk = grub_memalign_dma32 (16, sizeof(struct grub_ohci_ed)*GRUB_OHCI_BULK_EDS);
o->ed_bulk_chunk = grub_memalign_dma32 (16, sizeof (struct grub_ohci_ed)
* GRUB_OHCI_BULK_EDS);
if (! o->ed_bulk_chunk)
goto fail;
o->ed_bulk = grub_dma_get_virt (o->ed_bulk_chunk);