Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/usermode/usermode Hack to try to help usermode/i386...



details:   https://anonhg.NetBSD.org/src/rev/8306494b6be8
branches:  trunk
changeset: 769037:8306494b6be8
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Tue Aug 30 16:06:20 2011 +0000

description:
Hack to try to help usermode/i386 by setting the EBX register

diffstat:

 sys/arch/usermode/usermode/machdep.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 7cd31ca2558f -r 8306494b6be8 sys/arch/usermode/usermode/machdep.c
--- a/sys/arch/usermode/usermode/machdep.c      Tue Aug 30 14:22:22 2011 +0000
+++ b/sys/arch/usermode/usermode/machdep.c      Tue Aug 30 16:06:20 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.18 2011/08/29 12:46:58 reinoud Exp $ */
+/* $NetBSD: machdep.c,v 1.19 2011/08/30 16:06:20 reinoud Exp $ */
 
 /*-
  * Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2011/08/29 12:46:58 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.19 2011/08/30 16:06:20 reinoud Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -150,6 +150,12 @@
        ucp->uc_stack.ss_size = pack->ep_ssize;
        thunk_makecontext_trapframe2go(ucp, (void *) pack->ep_entry, &pcb->pcb_tf);
 
+#ifdef __i386__
+int *reg;
+reg = (int *) &ucp->uc_mcontext;
+reg[8] = l->l_proc->p_psstrp;  /* _REG_EBX */
+#endif
+
 printf("updated pcb %p\n", pcb);
 printf("\tpcb->pcb_ucp.uc_stack.ss_sp   = %p\n", pcb->pcb_ucp.uc_stack.ss_sp);
 printf("\tpcb->pcb_ucp.uc_stack.ss_size = %d\n", (int) pcb->pcb_ucp.uc_stack.ss_size);



Home | Main Index | Thread Index | Old Index