summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-01-15 00:56:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-01-15 00:56:28 +0000
commitc9112320e5a5701da64ec2a3386fbc37743ec8cf (patch)
tree218aeb948a26d748294c57507abd7f4daaea07a9 /sys
parenta4000ead815155e831a895fbfcf6f5a58b0d4ff0 (diff)
from netbsd; Make a small attempt to deal better with VM86 mode in GDB
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/i386/process_machdep.c64
1 files changed, 37 insertions, 27 deletions
diff --git a/sys/arch/i386/i386/process_machdep.c b/sys/arch/i386/i386/process_machdep.c
index caad7bae0fe..56eda5950ac 100644
--- a/sys/arch/i386/i386/process_machdep.c
+++ b/sys/arch/i386/i386/process_machdep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: process_machdep.c,v 1.19 1995/10/11 04:19:47 mycroft Exp $ */
+/* $NetBSD: process_machdep.c,v 1.20 1996/01/13 06:14:44 mycroft Exp $ */
/*
* Copyright (c) 1995 Charles M. Hannum. All rights reserved.
@@ -76,6 +76,10 @@
#include <machine/reg.h>
#include <machine/segments.h>
+#ifdef VM86
+#include <machine/vm86.h>
+#endif
+
static inline struct trapframe *
process_frame(p)
struct proc *p;
@@ -106,6 +110,9 @@ process_read_regs(p, regs)
regs->r_fs = tf->tf_vm86_fs;
regs->r_es = tf->tf_vm86_es;
regs->r_ds = tf->tf_vm86_ds;
+ regs->r_eflags = tf->tf_eflags;
+ SETFLAGS(regs->r_eflags, VM86_EFLAGS(p),
+ VM86_FLAGMASK(p)|PSL_VIF);
} else
#endif
{
@@ -113,19 +120,19 @@ process_read_regs(p, regs)
regs->r_fs = pcb->pcb_fs;
regs->r_es = tf->tf_es;
regs->r_ds = tf->tf_ds;
+ regs->r_eflags = tf->tf_eflags;
}
- regs->r_edi = tf->tf_edi;
- regs->r_esi = tf->tf_esi;
- regs->r_ebp = tf->tf_ebp;
- regs->r_ebx = tf->tf_ebx;
- regs->r_edx = tf->tf_edx;
- regs->r_ecx = tf->tf_ecx;
- regs->r_eax = tf->tf_eax;
- regs->r_eip = tf->tf_eip;
- regs->r_cs = tf->tf_cs;
- regs->r_eflags = tf->tf_eflags;
- regs->r_esp = tf->tf_esp;
- regs->r_ss = tf->tf_ss;
+ regs->r_edi = tf->tf_edi;
+ regs->r_esi = tf->tf_esi;
+ regs->r_ebp = tf->tf_ebp;
+ regs->r_ebx = tf->tf_ebx;
+ regs->r_edx = tf->tf_edx;
+ regs->r_ecx = tf->tf_ecx;
+ regs->r_eax = tf->tf_eax;
+ regs->r_eip = tf->tf_eip;
+ regs->r_cs = tf->tf_cs;
+ regs->r_esp = tf->tf_esp;
+ regs->r_ss = tf->tf_ss;
return (0);
}
@@ -172,6 +179,9 @@ process_write_regs(p, regs)
tf->tf_vm86_fs = regs->r_fs;
tf->tf_vm86_es = regs->r_es;
tf->tf_vm86_ds = regs->r_ds;
+ tf->tf_eflags = regs->r_eflags;
+ SETFLAGS(VM86_EFLAGS(p), regs->r_eflags,
+ VM86_FLAGMASK(p)|PSL_VIF);
} else
#endif
{
@@ -199,21 +209,21 @@ process_write_regs(p, regs)
pcb->pcb_gs = regs->r_gs;
pcb->pcb_fs = regs->r_fs;
- tf->tf_es = regs->r_es;
- tf->tf_ds = regs->r_ds;
+ tf->tf_es = regs->r_es;
+ tf->tf_ds = regs->r_ds;
+ tf->tf_eflags = regs->r_eflags;
}
- tf->tf_edi = regs->r_edi;
- tf->tf_esi = regs->r_esi;
- tf->tf_ebp = regs->r_ebp;
- tf->tf_ebx = regs->r_ebx;
- tf->tf_edx = regs->r_edx;
- tf->tf_ecx = regs->r_ecx;
- tf->tf_eax = regs->r_eax;
- tf->tf_eip = regs->r_eip;
- tf->tf_cs = regs->r_cs;
- tf->tf_eflags = regs->r_eflags;
- tf->tf_esp = regs->r_esp;
- tf->tf_ss = regs->r_ss;
+ tf->tf_edi = regs->r_edi;
+ tf->tf_esi = regs->r_esi;
+ tf->tf_ebp = regs->r_ebp;
+ tf->tf_ebx = regs->r_ebx;
+ tf->tf_edx = regs->r_edx;
+ tf->tf_ecx = regs->r_ecx;
+ tf->tf_eax = regs->r_eax;
+ tf->tf_eip = regs->r_eip;
+ tf->tf_cs = regs->r_cs;
+ tf->tf_esp = regs->r_esp;
+ tf->tf_ss = regs->r_ss;
return (0);
}