Implement a few changes needed to properly resolve PR#30924, as
discussed in the PR. - introduce sys/timevar.h to hold kernel-specific stuff relevant to sys/time.h. Ideally, timevar.h would contain all (or almost) of the #ifdef _KERNEL part of time.h, but that's a pretty big and tedious change to make. For now, it will contain only the prototypes I introduced when working on COMPAT_NETBSD32. - split copyinout_t into copyin_t and copyout_t, it makes prototypes more explicit about the meaning of a given argument. Suggested by yamt@. - move copyinout_t definition in sys/time.h to systm.h as copyin_t and copyout_t - make everything uses the new types and include the proper headers at the proper places.
This commit is contained in:
parent
2ce4c16c0d
commit
388b97e039
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: netbsd32_time.c,v 1.12 2005/08/19 04:24:38 christos Exp $ */
|
||||
/* $NetBSD: netbsd32_time.c,v 1.13 2005/10/23 00:09:14 cube Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998, 2001 Matthew R. Green
|
||||
@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.12 2005/08/19 04:24:38 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.13 2005/10/23 00:09:14 cube Exp $");
|
||||
|
||||
#if defined(_KERNEL_OPT)
|
||||
#include "opt_ntp.h"
|
||||
@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_time.c,v 1.12 2005/08/19 04:24:38 christos
|
||||
#include <sys/mount.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/timex.h>
|
||||
#include <sys/timevar.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/pool.h>
|
||||
#include <sys/resourcevar.h>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_sig.c,v 1.209 2005/10/02 17:51:27 chs Exp $ */
|
||||
/* $NetBSD: kern_sig.c,v 1.210 2005/10/23 00:09:14 cube Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1989, 1991, 1993
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.209 2005/10/02 17:51:27 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_sig.c,v 1.210 2005/10/23 00:09:14 cube Exp $");
|
||||
|
||||
#include "opt_ktrace.h"
|
||||
#include "opt_compat_sunos.h"
|
||||
@ -2349,7 +2349,7 @@ sys___sigtimedwait(struct lwp *l, void *v, register_t *retval)
|
||||
|
||||
int
|
||||
__sigtimedwait1(struct lwp *l, void *v, register_t *retval,
|
||||
copyinout_t put_info, copyinout_t fetch_timeout, copyinout_t put_timeout)
|
||||
copyout_t put_info, copyin_t fetch_timeout, copyout_t put_timeout)
|
||||
{
|
||||
struct sys___sigtimedwait_args /* {
|
||||
syscallarg(const sigset_t *) set;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_time.c,v 1.94 2005/10/02 17:51:27 chs Exp $ */
|
||||
/* $NetBSD: kern_time.c,v 1.95 2005/10/23 00:09:14 cube Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000, 2004, 2005 The NetBSD Foundation, Inc.
|
||||
@ -68,7 +68,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.94 2005/10/02 17:51:27 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.95 2005/10/23 00:09:14 cube Exp $");
|
||||
|
||||
#include "fs_nfs.h"
|
||||
#include "opt_nfs.h"
|
||||
@ -85,6 +85,7 @@ __KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.94 2005/10/02 17:51:27 chs Exp $");
|
||||
#include <sys/vnode.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/syslog.h>
|
||||
#include <sys/timevar.h>
|
||||
|
||||
#include <sys/mount.h>
|
||||
#include <sys/syscallargs.h>
|
||||
@ -510,7 +511,7 @@ sys_timer_create(struct lwp *l, void *v, register_t *retval)
|
||||
|
||||
int
|
||||
timer_create1(timer_t *tid, clockid_t id, struct sigevent *evp,
|
||||
copyinout_t fetch_event, struct proc *p)
|
||||
copyin_t fetch_event, struct proc *p)
|
||||
{
|
||||
int error;
|
||||
timer_t timerid;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: signalvar.h,v 1.59 2005/10/02 17:51:27 chs Exp $ */
|
||||
/* $NetBSD: signalvar.h,v 1.60 2005/10/23 00:09:14 cube Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1991, 1993
|
||||
@ -37,6 +37,7 @@
|
||||
#include <sys/siginfo.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/queue.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
/*
|
||||
* Kernel signal definitions and data structures,
|
||||
@ -180,8 +181,8 @@ void kpsendsig(struct lwp *, const struct ksiginfo *, const sigset_t *);
|
||||
siginfo_t *siginfo_alloc(int);
|
||||
void siginfo_free(void *);
|
||||
|
||||
int __sigtimedwait1(struct lwp *, void *, register_t *, copyinout_t,
|
||||
copyinout_t, copyinout_t);
|
||||
int __sigtimedwait1(struct lwp *, void *, register_t *, copyout_t,
|
||||
copyin_t, copyout_t);
|
||||
|
||||
/*
|
||||
* Machine-dependent functions:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: systm.h,v 1.180 2005/08/28 20:58:14 reinoud Exp $ */
|
||||
/* $NetBSD: systm.h,v 1.181 2005/10/23 00:09:14 cube Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1988, 1991, 1993
|
||||
@ -240,6 +240,11 @@ int copyoutstr(const void *, void *, size_t, size_t *);
|
||||
int copyin(const void *, void *, size_t);
|
||||
int copyout(const void *, void *, size_t);
|
||||
|
||||
#ifdef _KERNEL
|
||||
typedef int (*copyin_t)(const void *, void *, size_t);
|
||||
typedef int (*copyout_t)(const void *, void *, size_t);
|
||||
#endif
|
||||
|
||||
int copyin_proc(struct proc *, const void *, void *, size_t);
|
||||
int copyout_proc(struct proc *, const void *, void *, size_t);
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: time.h,v 1.50 2005/09/12 16:21:31 christos Exp $ */
|
||||
/* $NetBSD: time.h,v 1.51 2005/10/23 00:09:14 cube Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1993
|
||||
@ -227,24 +227,6 @@ void timers_alloc(struct proc *);
|
||||
void timers_free(struct proc *, int);
|
||||
void realtimerexpire(void *);
|
||||
|
||||
int dogetitimer(struct proc *, int, struct itimerval *);
|
||||
int dosetitimer(struct proc *, int, struct itimerval *);
|
||||
|
||||
/*
|
||||
* XXX-cube
|
||||
*
|
||||
* This definition really should be in systm.h, but systm.h cannot be
|
||||
* included before time.h, otherwise it breaks kern/kern_clock.c
|
||||
* because "clockframe" gets redefined by cpu.h (at least on i386 and
|
||||
* amd64).
|
||||
*/
|
||||
typedef int (*copyinout_t)(const void *, void *, size_t);
|
||||
|
||||
int timer_create1(timer_t *, clockid_t, struct sigevent *,
|
||||
copyinout_t, struct proc *);
|
||||
int dotimer_settime(int, struct itimerspec *, struct itimerspec *, int,
|
||||
struct proc *);
|
||||
int dotimer_gettime(int, struct proc *, struct itimerspec *);
|
||||
#else /* !_KERNEL */
|
||||
|
||||
#ifndef _STANDALONE
|
||||
|
53
sys/sys/timevar.h
Normal file
53
sys/sys/timevar.h
Normal file
@ -0,0 +1,53 @@
|
||||
/* $NetBSD: timevar.h,v 1.1 2005/10/23 00:09:14 cube Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005 The NetBSD Foundation.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to the NetBSD Foundation
|
||||
* by Quentin Garnier.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _SYS_TIMEVAR_H_
|
||||
#define _SYS_TIMEVAR_H_
|
||||
|
||||
#include <sys/systm.h>
|
||||
|
||||
int dogetitimer(struct proc *, int, struct itimerval *);
|
||||
int dosetitimer(struct proc *, int, struct itimerval *);
|
||||
|
||||
int timer_create1(timer_t *, clockid_t, struct sigevent *, copyin_t,
|
||||
struct proc *);
|
||||
int dotimer_settime(int, struct itimerspec *, struct itimerspec *, int,
|
||||
struct proc *);
|
||||
int dotimer_gettime(int, struct proc *, struct itimerspec *);
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user