svn commit: r212580 - head/sys/dev/fb
Jung-uk Kim
jkim at FreeBSD.org
Mon Sep 13 19:58:46 UTC 2010
Author: jkim
Date: Mon Sep 13 19:58:46 2010
New Revision: 212580
URL: http://svn.freebsd.org/changeset/base/212580
Log:
Fix segment:offset calculation of interrupt vector for relocated video BIOS
when the original offset is bigger than size of one page. X86BIOS macros
cannot be used here because it is assumed address is only linear in a page.
Tested by: netchild
Modified:
head/sys/dev/fb/vesa.c
Modified: head/sys/dev/fb/vesa.c
==============================================================================
--- head/sys/dev/fb/vesa.c Mon Sep 13 19:55:40 2010 (r212579)
+++ head/sys/dev/fb/vesa.c Mon Sep 13 19:58:46 2010 (r212580)
@@ -804,18 +804,16 @@ vesa_bios_init(void)
vbios = x86bios_get_orm(vesa_bios_offs);
if (vbios != NULL) {
vesa_bios_size = vbios[2] * 512;
- offs = BIOS_SADDRTOLADDR(vesa_bios_int10);
- if (offs > vesa_bios_offs &&
- offs < vesa_bios_offs + vesa_bios_size) {
+ if (((VESA_BIOS_OFFSET << 12) & 0xffff0000) ==
+ (vesa_bios_int10 & 0xffff0000) &&
+ vesa_bios_size > (vesa_bios_int10 & 0xffff)) {
vesa_bios = x86bios_alloc(&vesa_bios_offs,
vesa_bios_size, M_WAITOK);
memcpy(vesa_bios, vbios, vesa_bios_size);
- offs = offs - VESA_BIOS_OFFSET + vesa_bios_offs;
- offs = (X86BIOS_PHYSTOSEG(offs) << 16) +
- X86BIOS_PHYSTOOFF(offs);
+ offs = ((vesa_bios_offs << 12) & 0xffff0000) +
+ (vesa_bios_int10 & 0xffff);
x86bios_set_intr(0x10, offs);
- } else
- offs = vesa_bios_int10;
+ }
}
if (vesa_bios == NULL)
printf("VESA: failed to shadow video ROM\n");
More information about the svn-src-head
mailing list