Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode/dev Link syscall to userland so on exit is...
details: https://anonhg.NetBSD.org/src/rev/1ce2d3075d7b
branches: trunk
changeset: 769398:1ce2d3075d7b
user: reinoud <reinoud%NetBSD.org@localhost>
date: Thu Sep 08 14:47:17 2011 +0000
description:
Link syscall to userland so on exit is automatically goes to userland.
diffstat:
sys/arch/usermode/dev/cpu.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (47 lines):
diff -r 574f784a488f -r 1ce2d3075d7b sys/arch/usermode/dev/cpu.c
--- a/sys/arch/usermode/dev/cpu.c Thu Sep 08 12:37:28 2011 +0000
+++ b/sys/arch/usermode/dev/cpu.c Thu Sep 08 14:47:17 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.38 2011/09/08 12:37:28 reinoud Exp $ */
+/* $NetBSD: cpu.c,v 1.39 2011/09/08 14:47:17 reinoud Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -30,7 +30,7 @@
#include "opt_hz.h"
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.38 2011/09/08 12:37:28 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.39 2011/09/08 14:47:17 reinoud Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@@ -291,13 +291,13 @@
pcb = lwp_getpcb(curlwp);
/* switch to userland */
-printf("switching to userland\n");
+printf("return of trampoline func, switching to userland\n");
thunk_setcontext(&pcb->pcb_userland_ucp);
panic("%s: shouldn't return", __func__);
}
-extern int syscall(lwp_t *l);
+extern void syscall(void);
void
cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
void (*func)(void *), void *arg)
@@ -336,10 +336,10 @@
/* set up the ucontext for the syscall */
pcb2->pcb_syscall_ucp.uc_flags = _UC_CPU;
- pcb2->pcb_syscall_ucp.uc_link = NULL;
+ pcb2->pcb_syscall_ucp.uc_link = &pcb2->pcb_userland_ucp;
pcb2->pcb_syscall_ucp.uc_stack.ss_size = 0; /* no stack move */
thunk_makecontext_1(&pcb2->pcb_syscall_ucp, (void (*)(void)) syscall,
- l2);
+ NULL);
}
void
Home |
Main Index |
Thread Index |
Old Index