/* **********************************************************
* Copyright 2006 VMware, Inc.
*
* This file is part of the VMI option ROM.
*
* The VMI option ROM is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation.
*
* The VMI option ROM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the VMI option ROM; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA
* **********************************************************/
#define VMI_API_REV_MINOR 0x00
#define VMI_API_REV_MAJOR 0x03
#define PCI_VENDOR_ID_VMWARE 0x15ad
#define PCI_DEVICE_ID_VMWARE_VMI 0x801
#define PCI_OPDS_REVISION 0
#define PCI_DEVICE_VMI_CLASS 0x5
#define PCI_DEVICE_VMI_INTERFACE 0
#define PCI_DEVICE_VMI_SUBCLASS 0x80
#define PCI_OPDS_CODETYPE_X86 0
#define PCI_OPDS_INDICATOR_EOL 0x80
#define ROM_REV_MAJOR 0
#define ROM_REV_MINOR 3
#define PCI_OPDS_INDICATOR_IPLDEV 0x4
.global start
.section .text
start:
.byte 0x55,0xAA // ROM signature
.byte _romChunks // size in 512b chunks
.byte 0x90, 0x90, 0x90, 0x90 // entry point
.byte 0
.ascii "cVmi" // VMI signature
.byte VMI_API_REV_MINOR // minor version
.byte VMI_API_REV_MAJOR // major version
.byte 2
.byte 0
.long 0
.word 0
.word (license - start)
.word (romPciHeader - start)
.word (romPnpHeader - start)
.long 0
.fill 96
jmp vmiInit
.align 8
jmp vmiGetRelocationInfo
.align 8
license: .ascii "GPL\0"
.align 4
romPciHeader:
.ascii "PCIR"
.word PCI_VENDOR_ID_VMWARE
.word PCI_DEVICE_ID_VMWARE_VMI
.word 0
.word romPciHeaderEnd - romPciHeader
.byte PCI_OPDS_REVISION // structure rev
.long PCI_DEVICE_VMI_CLASS // device class
.byte PCI_DEVICE_VMI_SUBCLASS // device subclass
.byte PCI_DEVICE_VMI_INTERFACE // device interface
.word _romChunks // image length
.byte ROM_REV_MINOR // minor revision
.byte ROM_REV_MAJOR // major revision
.byte PCI_OPDS_CODETYPE_X86 // x86 binary
.byte PCI_OPDS_INDICATOR_EOL // last ROM
.word 0 // reserved
romPciHeaderEnd:
romMsg:
.ascii "VMI option ROM revision "
.ascii "\r\nHypervisor API version "
.ascii "\r\nCopyright (c) 2005, VMware, Inc.\r\n"
romMsgEnd:
romStrap:
lret
.align 16
romPnpHeader:
.ascii "$PnP" // signature
.byte 1 // revision
.byte (romPnpHeaderEnd-romPnpHeader)/16 // size
.word 0 // next header
.byte 0 // reserved
.byte 0 // checksum
.long PCI_DEVICE_ID_VMWARE_VMI // device ID
.word (romManufacturer - start) // mfr string
.word (romProduct - start) // product string
.byte 0,0,0 // device type
.byte PCI_OPDS_INDICATOR_IPLDEV // IPL flags
.word 0 // BCV
.word 0 // DV
.word (romStrap - start) // BEV
.word 0 // reserved
.word 0 // SRV
.align 16
romPnpHeaderEnd:
romManufacturer:
.ascii "Anthony Liguori"
.byte 0
romProduct:
.ascii "QEMU VMI ROM"
.byte 0
vmiInit: xorl %eax, %eax
ret
vmiGetRelocationInfo:
xorl %eax, %eax
xorl %edx, %edx
ret
end: