Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Add missing pmap_update() in vga_post_init(...



details:   https://anonhg.NetBSD.org/src/rev/713d494ac91f
branches:  trunk
changeset: 755908:713d494ac91f
user:      rmind <rmind%NetBSD.org@localhost>
date:      Mon Jun 28 00:39:47 2010 +0000

description:
Add missing pmap_update() in vga_post_init(), remove wrong pmap_kremove()
in error path, and fix pmap_update() in vga_post_set_vbe().

diffstat:

 sys/arch/x86/x86/vga_post.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (51 lines):

diff -r 586d798e1ac8 -r 713d494ac91f sys/arch/x86/x86/vga_post.c
--- a/sys/arch/x86/x86/vga_post.c       Sun Jun 27 20:36:42 2010 +0000
+++ b/sys/arch/x86/x86/vga_post.c       Mon Jun 28 00:39:47 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vga_post.c,v 1.14 2009/11/07 07:27:49 cegger Exp $ */
+/* $NetBSD: vga_post.c,v 1.15 2010/06/28 00:39:47 rmind Exp $ */
 
 /*-
  * Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vga_post.c,v 1.14 2009/11/07 07:27:49 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vga_post.c,v 1.15 2010/06/28 00:39:47 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -160,7 +160,6 @@
        if (err) {
                uvm_km_free(kernel_map, sc->sys_image, 1024 * 1024,
                                UVM_KMF_VAONLY);
-               pmap_kremove(sc->sys_image, 1024 * 1024);
                kmem_free(sc, sizeof(*sc));
                return NULL;
        }
@@ -170,8 +169,11 @@
 
        pmap_kenter_pa(sys_bios_data, 0, VM_PROT_READ, 0);
        pmap_update(pmap_kernel());
+
        memcpy((void *)sc->bios_data, (void *)sys_bios_data, PAGE_SIZE);
+
        pmap_kremove(sys_bios_data, PAGE_SIZE);
+       pmap_update(pmap_kernel());
        uvm_km_free(kernel_map, sys_bios_data, PAGE_SIZE, UVM_KMF_VAONLY);
 
        iter = 0;
@@ -237,10 +239,11 @@
 void
 vga_post_free(struct vga_post *sc)
 {
+
        uvm_pglistfree(&sc->ram_backing);
        pmap_kremove(sc->sys_image, 1024 * 1024);
+       pmap_update(pmap_kernel());
        uvm_km_free(kernel_map, sc->sys_image, 1024 * 1024, UVM_KMF_VAONLY);
-       pmap_update(pmap_kernel());
        kmem_free(sc, sizeof(*sc));
 }
 



Home | Main Index | Thread Index | Old Index