Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386 explicitely set ds, es, fs and gs to 0 before ...
details: https://anonhg.NetBSD.org/src/rev/76e15e78d2d9
branches: trunk
changeset: 534056:76e15e78d2d9
user: drochner <drochner%NetBSD.org@localhost>
date: Sun Jul 14 14:39:44 2002 +0000
description:
explicitely set ds, es, fs and gs to 0 before calling kvm86;
use the right places in the trap frame (the 4 segment registers which
get loaded on a rti to VM86 mode) to set them for BIOS calls
(we have never set them to anything but 0 before, so it didn't matter)
diffstat:
sys/arch/i386/bios/vesa_raster8.c | 8 ++++----
sys/arch/i386/bios/vesabios.c | 6 +++---
sys/arch/i386/i386/kvm86.c | 9 +++++----
3 files changed, 12 insertions(+), 11 deletions(-)
diffs (107 lines):
diff -r c6114fe19c8f -r 76e15e78d2d9 sys/arch/i386/bios/vesa_raster8.c
--- a/sys/arch/i386/bios/vesa_raster8.c Sun Jul 14 13:56:20 2002 +0000
+++ b/sys/arch/i386/bios/vesa_raster8.c Sun Jul 14 14:39:44 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vesa_raster8.c,v 1.1 2002/07/10 19:15:42 drochner Exp $ */
+/* $NetBSD: vesa_raster8.c,v 1.2 2002/07/14 14:39:44 drochner Exp $ */
#include <sys/param.h>
#include <sys/systm.h>
@@ -66,7 +66,7 @@
memset(&tf, 0, sizeof(struct trapframe));
tf.tf_eax = 0x4f01; /* function code */
tf.tf_ecx = sc->sc_mode;
- tf.tf_es = 0;
+ tf.tf_vm86_es = 0;
tf.tf_edi = 0x2000; /* buf ptr */
res = kvm86_bioscall(0x10, &tf);
@@ -131,7 +131,7 @@
tf.tf_eax = 0x4f04; /* function code */
tf.tf_edx = 0x0001; /* save */
tf.tf_ecx = 0x000f; /* all (but framebuffer) */
- tf.tf_es = 0;
+ tf.tf_vm86_es = 0;
tf.tf_ebx = 0x3000; /* buffer */
res = kvm86_bioscall(0x10, &tf);
@@ -168,7 +168,7 @@
tf.tf_eax = 0x4f04; /* function code */
tf.tf_edx = 0x0002; /* restore */
tf.tf_ecx = 0x000f;
- tf.tf_es = 0;
+ tf.tf_vm86_es = 0;
tf.tf_ebx = 0x3000; /* buffer */
res = kvm86_bioscall(0x10, &tf);
diff -r c6114fe19c8f -r 76e15e78d2d9 sys/arch/i386/bios/vesabios.c
--- a/sys/arch/i386/bios/vesabios.c Sun Jul 14 13:56:20 2002 +0000
+++ b/sys/arch/i386/bios/vesabios.c Sun Jul 14 14:39:44 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vesabios.c,v 1.4 2002/07/14 13:56:20 drochner Exp $ */
+/* $NetBSD: vesabios.c,v 1.5 2002/07/14 14:39:44 drochner Exp $ */
#include <sys/param.h>
#include <sys/systm.h>
@@ -74,7 +74,7 @@
memset(&tf, 0, sizeof(struct trapframe));
tf.tf_eax = 0x4f00; /* function code */
- tf.tf_es = 0;
+ tf.tf_vm86_es = 0;
tf.tf_edi = 0x2000; /* buf ptr */
res = kvm86_bioscall(0x10, &tf);
@@ -205,7 +205,7 @@
memset(&tf, 0, sizeof(struct trapframe));
tf.tf_eax = 0x4f01; /* function code */
tf.tf_ecx = modes[i];
- tf.tf_es = 0;
+ tf.tf_vm86_es = 0;
tf.tf_edi = 0x2000; /* buf ptr */
res = kvm86_bioscall(0x10, &tf);
diff -r c6114fe19c8f -r 76e15e78d2d9 sys/arch/i386/i386/kvm86.c
--- a/sys/arch/i386/i386/kvm86.c Sun Jul 14 13:56:20 2002 +0000
+++ b/sys/arch/i386/i386/kvm86.c Sun Jul 14 14:39:44 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kvm86.c,v 1.2 2002/07/10 19:09:35 drochner Exp $ */
+/* $NetBSD: kvm86.c,v 1.3 2002/07/14 14:39:45 drochner Exp $ */
/*
* Copyright (c) 2002
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kvm86.c,v 1.2 2002/07/10 19:09:35 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kvm86.c,v 1.3 2002/07/14 14:39:45 drochner Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -247,6 +247,7 @@
#ifdef KVM86_IOPL3
tf->tf_eflags |= PSL_IOPL;
#endif
+ tf->tf_ds = tf->tf_es = tf->tf_fs = tf->tf_gs = 0;
kvm86_prepare(bioscallvmd); /* XXX */
return (kvm86_call(tf));
@@ -267,7 +268,7 @@
tf.tf_edx = r->EDX;
tf.tf_esi = r->ESI;
tf.tf_edi = r->EDI;
- tf.tf_es = r->ES;
+ tf.tf_vm86_es = r->ES;
res = kvm86_bioscall(intno, &tf);
@@ -277,7 +278,7 @@
r->EDX = tf.tf_edx;
r->ESI = tf.tf_esi;
r->EDI = tf.tf_edi;
- r->ES = tf.tf_es;
+ r->ES = tf.tf_vm86_es;
r->EFLAGS = tf.tf_eflags;
return (res);
Home |
Main Index |
Thread Index |
Old Index