sched.h revision 1.3
1/*	$OpenBSD: sched.h,v 1.3 2020/06/08 04:48:15 jsg Exp $	*/
2/*
3 * Copyright (c) 2013, 2014, 2015 Mark Kettenis
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef _LINUX_SCHED_H
19#define _LINUX_SCHED_H
20
21#include <sys/param.h>
22#include <sys/systm.h>
23#include <sys/kernel.h>
24#include <sys/stdint.h>
25#include <sys/mutex.h>
26#include <linux/wait.h>
27#include <linux/hrtimer.h>
28#include <linux/sem.h>
29
30#define TASK_NORMAL		1
31#define TASK_UNINTERRUPTIBLE	0
32#define TASK_INTERRUPTIBLE	PCATCH
33#define TASK_RUNNING		-1
34
35#define MAX_SCHEDULE_TIMEOUT	(INT32_MAX)
36
37#define TASK_COMM_LEN		(MAXCOMLEN + 1)
38
39#define cond_resched()		sched_pause(yield)
40#define drm_need_resched() \
41    (curcpu()->ci_schedstate.spc_schedflags & SPCF_SHOULDYIELD)
42
43void set_current_state(int);
44void __set_current_state(int);
45void schedule(void);
46long schedule_timeout(long);
47long schedule_timeout_uninterruptible(long);
48
49#define io_schedule_timeout(x)	schedule_timeout(x)
50
51struct proc;
52int wake_up_process(struct proc *p);
53
54#endif
55