diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-06-14 20:27:26 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-06-14 20:27:26 +0000 |
commit | aaede9ff9eb1b45344fcba77186a472e11b26aeb (patch) | |
tree | bba74c587ff618799589220db8d80b95be1e99f3 /sys | |
parent | 3bfd640314c1312de501f9772f4c5ce9255a7493 (diff) |
Make sure the pglist is TAILQ_INIT()'ed before invoking uvm_pglistalloc().
ok deraadt@ kettenis@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/pci/vga_post.c | 5 | ||||
-rw-r--r-- | sys/arch/i386/pci/vga_post.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/amd64/pci/vga_post.c b/sys/arch/amd64/pci/vga_post.c index bf2ddb861a2..36c4d82d1dd 100644 --- a/sys/arch/amd64/pci/vga_post.c +++ b/sys/arch/amd64/pci/vga_post.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_post.c,v 1.3 2009/06/06 03:20:57 deraadt Exp $ */ +/* $OpenBSD: vga_post.c,v 1.4 2009/06/14 20:27:24 miod Exp $ */ /* $NetBSD: vga_post.c,v 1.12 2009/03/15 21:32:36 cegger Exp $ */ /*- @@ -140,6 +140,7 @@ vga_post_init(int bus, int device, int function) } sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); + TAILQ_INIT(&sc->ram_backing); err = uvm_pglistalloc(BASE_MEMORY, 0, (paddr_t)-1, 0, 0, &sc->ram_backing, BASE_MEMORY/PAGE_SIZE, UVM_PLA_WAITOK); if (err) { @@ -163,7 +164,7 @@ vga_post_init(int bus, int device, int function) VM_PROT_READ | VM_PROT_WRITE); iter += PAGE_SIZE; } - KASSERT(iter == 65536); + KASSERT(iter == BASE_MEMORY); for (iter = 640 * 1024; iter < 1024 * 1024; iter += PAGE_SIZE) pmap_kenter_pa(sc->sys_image + iter, iter, diff --git a/sys/arch/i386/pci/vga_post.c b/sys/arch/i386/pci/vga_post.c index 0d42900c431..be1b7c1deb9 100644 --- a/sys/arch/i386/pci/vga_post.c +++ b/sys/arch/i386/pci/vga_post.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_post.c,v 1.3 2009/06/06 03:20:58 deraadt Exp $ */ +/* $OpenBSD: vga_post.c,v 1.4 2009/06/14 20:27:25 miod Exp $ */ /* $NetBSD: vga_post.c,v 1.12 2009/03/15 21:32:36 cegger Exp $ */ /*- @@ -140,6 +140,7 @@ vga_post_init(int bus, int device, int function) } sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO); + TAILQ_INIT(&sc->ram_backing); err = uvm_pglistalloc(BASE_MEMORY, 0, (paddr_t)-1, 0, 0, &sc->ram_backing, BASE_MEMORY/PAGE_SIZE, UVM_PLA_WAITOK); if (err) { @@ -163,7 +164,7 @@ vga_post_init(int bus, int device, int function) VM_PROT_READ | VM_PROT_WRITE); iter += PAGE_SIZE; } - KASSERT(iter == 65536); + KASSERT(iter == BASE_MEMORY); for (iter = 640 * 1024; iter < 1024 * 1024; iter += PAGE_SIZE) pmap_kenter_pa(sc->sys_image + iter, iter, |