move wchan_t and syncobj_t to a dedicated header to simplify dependencies.
fix "XXX wchan_t".
This commit is contained in:
parent
e781af39bd
commit
3c4e459fcc
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.91 2007/02/09 21:55:37 ad Exp $
|
||||
# $NetBSD: Makefile,v 1.92 2007/02/26 10:50:22 yamt Exp $
|
||||
|
||||
INCSDIR= /usr/include/sys
|
||||
|
||||
|
@ -27,7 +27,7 @@ INCS= acct.h agpio.h ansi.h ataio.h audioio.h \
|
|||
shm.h siginfo.h signal.h signalvar.h sigtypes.h sleepq.h socket.h \
|
||||
socketvar.h sockio.h specificdata.h stat.h statvfs.h \
|
||||
syscall.h syscallargs.h sysctl.h systrace.h stdint.h swap.h \
|
||||
syslimits.h syslog.h \
|
||||
syncobj.h syslimits.h syslog.h \
|
||||
tape.h termios.h time.h timeb.h timepps.h times.h \
|
||||
timex.h trace.h tree.h tty.h ttychars.h ttycom.h \
|
||||
ttydefaults.h ttydev.h types.h \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: lwp.h,v 1.52 2007/02/26 09:20:52 yamt Exp $ */
|
||||
/* $NetBSD: lwp.h,v 1.53 2007/02/26 10:50:30 yamt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2001, 2006, 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -46,6 +46,7 @@
|
|||
#include <sys/condvar.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/specificdata.h>
|
||||
#include <sys/syncobj.h>
|
||||
|
||||
#if defined(_KERNEL)
|
||||
#include <machine/cpu.h> /* curcpu() and cpu_info */
|
||||
|
@ -53,8 +54,6 @@
|
|||
|
||||
#include <machine/proc.h> /* Machine-dependent proc substruct. */
|
||||
|
||||
typedef volatile const void *wchan_t;
|
||||
|
||||
/*
|
||||
* Lightweight process. Field markings and the corresponding locks:
|
||||
*
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sched.h,v 1.31 2007/02/26 09:20:52 yamt Exp $ */
|
||||
/* $NetBSD: sched.h,v 1.32 2007/02/26 10:50:30 yamt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -188,25 +188,5 @@ int sched_kpri(struct lwp *);
|
|||
void scheduler_fork_hook(struct proc *, struct proc *);
|
||||
void scheduler_wait_hook(struct proc *, struct proc *);
|
||||
|
||||
/*
|
||||
* Synchronisation object operations set.
|
||||
*/
|
||||
typedef struct syncobj {
|
||||
u_int sobj_flag;
|
||||
void (*sobj_unsleep)(struct lwp *);
|
||||
void (*sobj_changepri)(struct lwp *, int);
|
||||
void (*sobj_lendpri)(struct lwp *, int);
|
||||
struct lwp *(*sobj_owner)(volatile const void *); /* XXX wchan_t */
|
||||
} syncobj_t;
|
||||
|
||||
struct lwp *syncobj_noowner(volatile const void *); /* XXX wchan_t */
|
||||
|
||||
#define SOBJ_SLEEPQ_SORTED 0x01
|
||||
#define SOBJ_SLEEPQ_FIFO 0x02
|
||||
|
||||
extern syncobj_t sched_syncobj;
|
||||
extern syncobj_t mutex_syncobj;
|
||||
extern syncobj_t rw_syncobj;
|
||||
|
||||
#endif /* _KERNEL */
|
||||
#endif /* _SYS_SCHED_H_ */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sleepq.h,v 1.3 2007/02/26 09:20:52 yamt Exp $ */
|
||||
/* $NetBSD: sleepq.h,v 1.4 2007/02/26 10:50:30 yamt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2002, 2006, 2007 The NetBSD Foundation, Inc.
|
||||
|
@ -47,6 +47,7 @@
|
|||
#include <sys/queue.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/sched.h>
|
||||
#include <sys/syncobj.h>
|
||||
|
||||
/*
|
||||
* Generic sleep queues.
|
||||
|
|
|
@ -0,0 +1,70 @@
|
|||
/* $NetBSD: syncobj.h,v 1.1 2007/02/26 10:50:31 yamt Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999, 2000, 2001, 2002, 2007 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Ross Harvey, Jason R. Thorpe, Nathan J. Williams, and Andrew Doran.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#if !defined(_SYS_SYNCOBJ_H_)
|
||||
#define _SYS_SYNCOBJ_H_
|
||||
|
||||
struct lwp;
|
||||
|
||||
typedef volatile const void *wchan_t;
|
||||
|
||||
#if defined(_KERNEL)
|
||||
|
||||
/*
|
||||
* Synchronisation object operations set.
|
||||
*/
|
||||
typedef struct syncobj {
|
||||
u_int sobj_flag;
|
||||
void (*sobj_unsleep)(struct lwp *);
|
||||
void (*sobj_changepri)(struct lwp *, int);
|
||||
void (*sobj_lendpri)(struct lwp *, int);
|
||||
struct lwp *(*sobj_owner)(wchan_t);
|
||||
} syncobj_t;
|
||||
|
||||
struct lwp *syncobj_noowner(wchan_t);
|
||||
|
||||
#define SOBJ_SLEEPQ_SORTED 0x01
|
||||
#define SOBJ_SLEEPQ_FIFO 0x02
|
||||
|
||||
extern syncobj_t sched_syncobj;
|
||||
extern syncobj_t mutex_syncobj;
|
||||
extern syncobj_t rw_syncobj;
|
||||
|
||||
#endif /* defined(_KERNEL) */
|
||||
|
||||
#endif /* !_SYS_SYNCOBJ_H_ */
|
Loading…
Reference in New Issue