134925Sdufault#ifndef _P1003_1B_P1003_1B_H_
234925Sdufault#define _P1003_1B_P1003_1B_H_
334030Sdufault/*-
434030Sdufault * Copyright (c) 1996, 1997, 1998
534030Sdufault *	HD Associates, Inc.  All rights reserved.
634030Sdufault *
734030Sdufault * Redistribution and use in source and binary forms, with or without
834030Sdufault * modification, are permitted provided that the following conditions
934030Sdufault * are met:
1034030Sdufault * 1. Redistributions of source code must retain the above copyright
1134030Sdufault *    notice, this list of conditions and the following disclaimer.
1234030Sdufault * 2. Redistributions in binary form must reproduce the above copyright
1334030Sdufault *    notice, this list of conditions and the following disclaimer in the
1434030Sdufault *    documentation and/or other materials provided with the distribution.
1534030Sdufault * 3. All advertising materials mentioning features or use of this software
1634030Sdufault *    must display the following acknowledgement:
1734030Sdufault *	This product includes software developed by HD Associates, Inc
1834030Sdufault * 4. Neither the name of the author nor the names of any co-contributors
1934030Sdufault *    may be used to endorse or promote products derived from this software
2034030Sdufault *    without specific prior written permission.
2134030Sdufault *
2234030Sdufault * THIS SOFTWARE IS PROVIDED BY HD ASSOCIATES AND CONTRIBUTORS ``AS IS'' AND
2334030Sdufault * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2434030Sdufault * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2534030Sdufault * ARE DISCLAIMED.  IN NO EVENT SHALL HD ASSOCIATES OR CONTRIBUTORS BE LIABLE
2634030Sdufault * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2734030Sdufault * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2834030Sdufault * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2934030Sdufault * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3034030Sdufault * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3134030Sdufault * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3234030Sdufault * SUCH DAMAGE.
3334030Sdufault *
3455140Sbde * $FreeBSD$
3534030Sdufault */
3634030Sdufault
3734030Sdufault#include <sys/param.h>
3834030Sdufault#include <sys/ioccom.h>
3934925Sdufault#include <sys/malloc.h>
40164183Strhodes#include <sys/sched.h>
4134030Sdufault
4234925Sdufault/* Generate syscall stubs for when something is optionally
4345739Speter * loadable as a module.  References "syscall_not_present".
4434925Sdufault * XXX Good candidate for sys/syscall.h
4534030Sdufault */
4634925Sdufaultstruct proc;
4734925Sdufaultstruct nosys_args;
4883366Sjulianextern int syscall_not_present(struct thread *, const char *, struct nosys_args *);
4934030Sdufault
5034925Sdufault#define SYSCALL_NOT_PRESENT_GEN(SC) \
51225617Skmacyint sys_ ## SC (struct thread *td, struct SC##_args *uap) \
5234925Sdufault{ \
5383366Sjulian	return syscall_not_present(td, #SC , (struct nosys_args *)uap); \
5434925Sdufault}
5534030Sdufault
5634030Sdufault
5734925SdufaultMALLOC_DECLARE(M_P31B);
5834030Sdufault
59111119Simp#define p31b_malloc(SIZE) malloc((SIZE), M_P31B, M_WAITOK)
6034925Sdufault#define p31b_free(P) free((P), M_P31B)
6134925Sdufault
6292727Salfredint p31b_proc(struct proc *, pid_t, struct proc **);
6334925Sdufault
6492727Salfredvoid p31b_setcfg(int, int);
65103574Salfredint p31b_getcfg(int);
66106998Salfredint p31b_iscfg(int);
67208731Skibvoid p31b_unsetcfg(int);
6834925Sdufault
6934925Sdufault#ifdef _KPOSIX_PRIORITY_SCHEDULING
7034925Sdufault
7134030Sdufault/*
7234030Sdufault * KSCHED_OP_RW is a vector of read/write flags for each entry indexed
7334030Sdufault * by the enum ksched_op.
7434030Sdufault *
7534030Sdufault * 1 means you need write access, 0 means read is sufficient.
7634030Sdufault */
7734030Sdufault
7834030Sdufaultenum ksched_op {
7934030Sdufault
8034030Sdufault#define KSCHED_OP_RW { 1, 0, 1, 0, 0, 0, 0, 0 }
8134030Sdufault
8234030Sdufault	SCHED_SETPARAM,
8334030Sdufault	SCHED_GETPARAM,
8434030Sdufault	SCHED_SETSCHEDULER,
8534030Sdufault	SCHED_GETSCHEDULER,
8634030Sdufault	SCHED_YIELD,
8734030Sdufault	SCHED_GET_PRIORITY_MAX,
8834030Sdufault	SCHED_GET_PRIORITY_MIN,
8934030Sdufault	SCHED_RR_GET_INTERVAL,
9034030Sdufault	SCHED_OP_MAX
9134030Sdufault};
9234030Sdufault
9334925Sdufaultstruct ksched;
9434030Sdufault
9534925Sdufaultint ksched_attach(struct ksched **);
9634925Sdufaultint ksched_detach(struct ksched *);
9734030Sdufault
98160257Sdavidxuint ksched_setparam(struct ksched *,
9983366Sjulian	struct thread *, const struct sched_param *);
100160257Sdavidxuint ksched_getparam(struct ksched *,
10183366Sjulian	struct thread *, struct sched_param *);
10234030Sdufault
103160257Sdavidxuint ksched_setscheduler(struct ksched *,
10483366Sjulian	struct thread *, int, const struct sched_param *);
105160257Sdavidxuint ksched_getscheduler(struct ksched *, struct thread *, int *);
10634030Sdufault
107160257Sdavidxuint ksched_yield(struct ksched *);
10834030Sdufault
109160257Sdavidxuint ksched_get_priority_max(struct ksched *, int, int *);
110160257Sdavidxuint ksched_get_priority_min(struct ksched *, int, int *);
11134030Sdufault
112160257Sdavidxuint ksched_rr_get_interval(struct ksched *,
11383366Sjulian	struct thread *, struct timespec *);
11434030Sdufault
11534925Sdufault#endif /* _KPOSIX_PRIORITY_SCHEDULING */
11634030Sdufault
11734925Sdufault#endif /* _P1003_1B_P1003_1B_H_ */
118