Patchwork Ensure PCIR is aligned to 4 bytes

login
register
mail settings
Submitter David Woodhouse
Date Jan. 20, 2013, 6:12 p.m.
Message ID <1358705534.20334.53.camel@shinybook.infradead.org>
Download mbox | patch
Permalink /patch/213973/
State New
Headers show

Comments

David Woodhouse - Jan. 20, 2013, 6:12 p.m.
The PCI Firmware Specification apparently requires that the PCI Data
Structure be DWORD-aligned. The implementation in OVMF also requires
this, so vgabios ROMs don't work there. With this fixed, I can now
initialise the VGA ROM from EFI, and EFI can display using INT 10h
services.
Brad - Sept. 13, 2013, 12:05 a.m.
On 20/01/13 1:12 PM, David Woodhouse wrote:
> The PCI Firmware Specification apparently requires that the PCI Data
> Structure be DWORD-aligned. The implementation in OVMF also requires
> this, so vgabios ROMs don't work there. With this fixed, I can now
> initialise the VGA ROM from EFI, and EFI can display using INT 10h
> services.
>
> --- vgabios-0.6c/vgabios.c.orig	2013-01-20 11:33:36.138548472 -0600
> +++ vgabios-0.6c/vgabios.c	2013-01-20 11:36:26.060270163 -0600
> @@ -204,6 +204,7 @@ vgabios_website:
>   .byte	0x00
>
>   #ifdef PCIBIOS
> +.align 4 // DWORD alignment required by PCI Firmware Specification
>   vgabios_pci_data:
>   .ascii "PCIR"
>   #ifdef CIRRUS

We have had this in the OpenBSD port of QEMU for awhile now. Is it 
possible to have this reviewed and commited?

Patch

--- vgabios-0.6c/vgabios.c.orig	2013-01-20 11:33:36.138548472 -0600
+++ vgabios-0.6c/vgabios.c	2013-01-20 11:36:26.060270163 -0600
@@ -204,6 +204,7 @@  vgabios_website:
 .byte	0x00
 
 #ifdef PCIBIOS
+.align 4 // DWORD alignment required by PCI Firmware Specification
 vgabios_pci_data:
 .ascii "PCIR"
 #ifdef CIRRUS