From bcbb89dc92a410f0cca7562e23ef6ddbb23a6ab4 Mon Sep 17 00:00:00 2001 From: dg Date: Sat, 4 Mar 1995 02:25:36 +0000 Subject: [PATCH] Removed obsolete vtrace() and reorganized a little. --- sys/amd64/amd64/sys_machdep.c | 112 ++++++++-------------------------- sys/i386/i386/sys_machdep.c | 112 ++++++++-------------------------- 2 files changed, 48 insertions(+), 176 deletions(-) diff --git a/sys/amd64/amd64/sys_machdep.c b/sys/amd64/amd64/sys_machdep.c index f9b90c51d651..ca75f45b10be 100644 --- a/sys/amd64/amd64/sys_machdep.c +++ b/sys/amd64/amd64/sys_machdep.c @@ -2,9 +2,6 @@ * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -34,85 +31,54 @@ * SUCH DAMAGE. * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 - * $Id: sys_machdep.c,v 1.5 1994/08/13 03:49:46 wollman Exp $ + * $Id: sys_machdep.c,v 1.6 1994/10/30 20:23:23 bde Exp $ + * */ #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include - -#ifdef USER_LDT #include + #include #include + #include /* for kernel_map */ -#endif -#ifdef TRACE -int nvualarm; +void set_user_ldt __P((struct pcb *pcb)); +int i386_get_ldt __P((struct proc *, char *, int *)); +int i386_set_ldt __P((struct proc *, char *, int *)); -struct vtrace_args { - int request; - int value; +struct sysarch_args { + int op; + char *parms; }; -vtrace(p, uap, retval) +int +sysarch(p, uap, retval) struct proc *p; - register struct vtrace_args *uap; + register struct sysarch_args *uap; int *retval; { - int vdoualarm(); + int error = 0; - switch (uap->request) { - - case VTR_DISABLE: /* disable a trace point */ - case VTR_ENABLE: /* enable a trace point */ - if (uap->value < 0 || uap->value >= TR_NFLAGS) - return (EINVAL); - *retval = traceflags[uap->value]; - traceflags[uap->value] = uap->request; + switch(uap->op) { +#ifdef USER_LDT + case I386_GET_LDT: + error = i386_get_ldt(p, uap->parms, retval); break; - case VTR_VALUE: /* return a trace point setting */ - if (uap->value < 0 || uap->value >= TR_NFLAGS) - return (EINVAL); - *retval = traceflags[uap->value]; + case I386_SET_LDT: + error = i386_set_ldt(p, uap->parms, retval); break; - - case VTR_UALARM: /* set a real-time ualarm, less than 1 min */ - if (uap->value <= 0 || uap->value > 60 * hz || nvualarm > 5) - return (EINVAL); - nvualarm++; - timeout(vdoualarm, (caddr_t)p->p_pid, uap->value); - break; - - case VTR_STAMP: - trace(TR_STAMP, uap->value, p->p_pid); +#endif + default: + error = EINVAL; break; } - return (0); + return(error); } -vdoualarm(arg) - int arg; -{ - register struct proc *p; - - p = pfind(arg); - if (p) - psignal(p, 16); - nvualarm--; -} -#endif - #ifdef USER_LDT void set_user_ldt(struct pcb *pcb) @@ -296,33 +262,3 @@ i386_set_ldt(p, args, retval) return(error); } #endif /* USER_LDT */ - -struct sysarch_args { - int op; - char *parms; -}; - -int -sysarch(p, uap, retval) - struct proc *p; - register struct sysarch_args *uap; - int *retval; -{ - int error = 0; - - switch(uap->op) { -#ifdef USER_LDT - case I386_GET_LDT: - error = i386_get_ldt(p, uap->parms, retval); - break; - - case I386_SET_LDT: - error = i386_set_ldt(p, uap->parms, retval); - break; -#endif - default: - error = EINVAL; - break; - } - return(error); -} diff --git a/sys/i386/i386/sys_machdep.c b/sys/i386/i386/sys_machdep.c index f9b90c51d651..ca75f45b10be 100644 --- a/sys/i386/i386/sys_machdep.c +++ b/sys/i386/i386/sys_machdep.c @@ -2,9 +2,6 @@ * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. * - * This code is derived from software contributed to Berkeley by - * William Jolitz. - * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -34,85 +31,54 @@ * SUCH DAMAGE. * * from: @(#)sys_machdep.c 5.5 (Berkeley) 1/19/91 - * $Id: sys_machdep.c,v 1.5 1994/08/13 03:49:46 wollman Exp $ + * $Id: sys_machdep.c,v 1.6 1994/10/30 20:23:23 bde Exp $ + * */ #include #include -#include -#include -#include #include -#include -#include -#include -#include -#include - -#ifdef USER_LDT #include + #include #include + #include /* for kernel_map */ -#endif -#ifdef TRACE -int nvualarm; +void set_user_ldt __P((struct pcb *pcb)); +int i386_get_ldt __P((struct proc *, char *, int *)); +int i386_set_ldt __P((struct proc *, char *, int *)); -struct vtrace_args { - int request; - int value; +struct sysarch_args { + int op; + char *parms; }; -vtrace(p, uap, retval) +int +sysarch(p, uap, retval) struct proc *p; - register struct vtrace_args *uap; + register struct sysarch_args *uap; int *retval; { - int vdoualarm(); + int error = 0; - switch (uap->request) { - - case VTR_DISABLE: /* disable a trace point */ - case VTR_ENABLE: /* enable a trace point */ - if (uap->value < 0 || uap->value >= TR_NFLAGS) - return (EINVAL); - *retval = traceflags[uap->value]; - traceflags[uap->value] = uap->request; + switch(uap->op) { +#ifdef USER_LDT + case I386_GET_LDT: + error = i386_get_ldt(p, uap->parms, retval); break; - case VTR_VALUE: /* return a trace point setting */ - if (uap->value < 0 || uap->value >= TR_NFLAGS) - return (EINVAL); - *retval = traceflags[uap->value]; + case I386_SET_LDT: + error = i386_set_ldt(p, uap->parms, retval); break; - - case VTR_UALARM: /* set a real-time ualarm, less than 1 min */ - if (uap->value <= 0 || uap->value > 60 * hz || nvualarm > 5) - return (EINVAL); - nvualarm++; - timeout(vdoualarm, (caddr_t)p->p_pid, uap->value); - break; - - case VTR_STAMP: - trace(TR_STAMP, uap->value, p->p_pid); +#endif + default: + error = EINVAL; break; } - return (0); + return(error); } -vdoualarm(arg) - int arg; -{ - register struct proc *p; - - p = pfind(arg); - if (p) - psignal(p, 16); - nvualarm--; -} -#endif - #ifdef USER_LDT void set_user_ldt(struct pcb *pcb) @@ -296,33 +262,3 @@ i386_set_ldt(p, args, retval) return(error); } #endif /* USER_LDT */ - -struct sysarch_args { - int op; - char *parms; -}; - -int -sysarch(p, uap, retval) - struct proc *p; - register struct sysarch_args *uap; - int *retval; -{ - int error = 0; - - switch(uap->op) { -#ifdef USER_LDT - case I386_GET_LDT: - error = i386_get_ldt(p, uap->parms, retval); - break; - - case I386_SET_LDT: - error = i386_set_ldt(p, uap->parms, retval); - break; -#endif - default: - error = EINVAL; - break; - } - return(error); -}