diff options
author | Kechao Liu <kechao.liu@intel.com> | 2008-12-29 11:23:22 +0800 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2008-12-31 11:34:14 +0200 |
commit | 369bfdabe8cae67768ee1fb34c3b22d52a7b86ce (patch) | |
tree | 006493c3a852506b4dfca3b36691e8231f45452c /bios | |
parent | e8255f5f34294524e4fc15f0f723989f1e58a01f (diff) |
kvm: bios: pass devfn to pci card bios
Signed-off-by: Kechao Liu <kechao.liu@intel.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'bios')
-rw-r--r-- | bios/rombios.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/bios/rombios.c b/bios/rombios.c index 54c94bfb..c4f6ccd5 100644 --- a/bios/rombios.c +++ b/bios/rombios.c @@ -10254,18 +10254,30 @@ rom_scan_loop: add al, #0x04 block_count_rounded: - xor bx, bx ;; Restore DS back to 0000: - mov ds, bx push ax ;; Save AX push di ;; Save DI ;; Push addr of ROM entry point push cx ;; Push seg push #0x0003 ;; Push offset + ;; Get the BDF into ax before invoking the option ROM + mov bl, [2] + mov al, bl + shr al, #7 + cmp al, #1 + jne fetch_bdf + mov ax, ds ;; Increment the DS since rom size larger than an segment + add ax, #0x1000 + mov ds, ax +fetch_bdf: + shl bx, #9 + xor ax, ax + mov al, [bx] + ;; Point ES:DI at "$PnP", which tells the ROM that we are a PnP BIOS. ;; That should stop it grabbing INT 19h; we will use its BEV instead. - mov ax, #0xf000 - mov es, ax + mov bx, #0xf000 + mov es, bx lea di, pnp_string mov bp, sp ;; Call ROM init routine using seg:off on stack |