Deleted Added
full compact
subr_syscall.c (31544) subr_syscall.c (31564)
1/*-
2 * Copyright (C) 1994, David Greenman
3 * Copyright (c) 1990, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the University of Utah, and William Jolitz.
8 *

--- 21 unchanged lines hidden (view full) ---

30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)trap.c 7.4 (Berkeley) 5/13/91
1/*-
2 * Copyright (C) 1994, David Greenman
3 * Copyright (c) 1990, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the University of Utah, and William Jolitz.
8 *

--- 21 unchanged lines hidden (view full) ---

30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)trap.c 7.4 (Berkeley) 5/13/91
38 * $Id: trap.c,v 1.117 1997/12/04 14:35:40 jkh Exp $
38 * $Id: trap.c,v 1.118 1997/12/04 21:21:26 jmg Exp $
39 */
40
41/*
42 * 386 Trap and System call handling
43 */
44
45#include "opt_cpu.h"
46#include "opt_ddb.h"
47#include "opt_ktrace.h"
48#include "opt_vm86.h"
49
50#include <sys/param.h>
51#include <sys/systm.h>
52#include <sys/proc.h>
39 */
40
41/*
42 * 386 Trap and System call handling
43 */
44
45#include "opt_cpu.h"
46#include "opt_ddb.h"
47#include "opt_ktrace.h"
48#include "opt_vm86.h"
49
50#include <sys/param.h>
51#include <sys/systm.h>
52#include <sys/proc.h>
53#include <sys/pioctl.h>
53#include <sys/kernel.h>
54#include <sys/resourcevar.h>
55#include <sys/signalvar.h>
56#include <sys/syscall.h>
57#include <sys/sysent.h>
58#include <sys/vmmeter.h>
59#ifdef KTRACE
60#include <sys/ktrace.h>

--- 921 unchanged lines hidden (view full) ---

982 }
983#ifdef KTRACE
984 if (KTRPOINT(p, KTR_SYSCALL))
985 ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
986#endif
987 p->p_retval[0] = 0;
988 p->p_retval[1] = frame.tf_edx;
989
54#include <sys/kernel.h>
55#include <sys/resourcevar.h>
56#include <sys/signalvar.h>
57#include <sys/syscall.h>
58#include <sys/sysent.h>
59#include <sys/vmmeter.h>
60#ifdef KTRACE
61#include <sys/ktrace.h>

--- 921 unchanged lines hidden (view full) ---

983 }
984#ifdef KTRACE
985 if (KTRPOINT(p, KTR_SYSCALL))
986 ktrsyscall(p->p_tracep, code, callp->sy_narg, args);
987#endif
988 p->p_retval[0] = 0;
989 p->p_retval[1] = frame.tf_edx;
990
991 STOPEVENT(p, S_SCE, callp->sy_narg);
992
990 error = (*callp->sy_call)(p, args);
991
992 switch (error) {
993
994 case 0:
995 /*
996 * Reinitialize proc pointer `p' as it may be different
997 * if this is a child returning from fork syscall.

--- 34 unchanged lines hidden (view full) ---

1032 }
1033
1034 userret(p, &frame, sticks);
1035
1036#ifdef KTRACE
1037 if (KTRPOINT(p, KTR_SYSRET))
1038 ktrsysret(p->p_tracep, code, error, p->p_retval[0]);
1039#endif
993 error = (*callp->sy_call)(p, args);
994
995 switch (error) {
996
997 case 0:
998 /*
999 * Reinitialize proc pointer `p' as it may be different
1000 * if this is a child returning from fork syscall.

--- 34 unchanged lines hidden (view full) ---

1035 }
1036
1037 userret(p, &frame, sticks);
1038
1039#ifdef KTRACE
1040 if (KTRPOINT(p, KTR_SYSRET))
1041 ktrsysret(p->p_tracep, code, error, p->p_retval[0]);
1042#endif
1043
1044 /*
1045 * This works because errno is findable through the
1046 * register set. If we ever support an emulation where this
1047 * is not the case, this code will need to be revisited.
1048 */
1049 STOPEVENT(p, S_SCX, code);
1050
1040}
1041
1042/*
1043 * Simplified back end of syscall(), used when returning from fork()
1044 * directly into user mode.
1045 */
1046void
1047fork_return(p, frame)

--- 13 unchanged lines hidden ---
1051}
1052
1053/*
1054 * Simplified back end of syscall(), used when returning from fork()
1055 * directly into user mode.
1056 */
1057void
1058fork_return(p, frame)

--- 13 unchanged lines hidden ---