FreeBSD/Linux Kernel Cross Reference
sys/kern/rt_thread.h
1 /*
2 * Mach Operating System
3 * Copyright (c) 1993 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: rt_thread.h,v $
29 * Revision 2.2 93/11/17 17:20:11 dbg
30 * Renamed 'rt' or 'realtime' threads and timers to 'periodic'
31 * threads and timers (even though they can be used for nonperiodic
32 * threads).
33 * [93/11/16 dbg]
34 *
35 * Created.
36 * [93/05/12 dbg]
37 *
38 */
39
40 #ifndef _KERN_RT_THREAD_H_
41 #define _KERN_RT_THREAD_H_
42
43 #include <mach/time_spec.h>
44 #include <mach/realtime_policy.h>
45 #include <kern/clock.h>
46 #include <kern/thread.h>
47 #include <kern/mach_timer.h>
48 #include <ipc/ipc_types.h>
49
50 /*
51 * Common thread scheduling fields for real-time scheduling
52 * policies.
53 */
54
55 struct rt_sched_data {
56 time_spec_t start_time;
57 time_spec_t period;
58 time_spec_t deadline;
59 };
60
61 #define rt_sched(th) ((struct rt_sched_data *)&(th)->sched_data)
62
63 /*
64 * Periodic (real-time) thread routines.
65 */
66
67 extern kern_return_t
68 thread_get_periodic_timers(
69 thread_t thread,
70 mach_timer_t *wakeup_timer_p,
71 mach_timer_t *deadline_timer_p);
72
73 extern kern_return_t
74 thread_set_periodic_timers(
75 thread_t thread,
76 mach_timer_t wakeup_timer,
77 mach_timer_t deadline_timer);
78
79 extern kern_return_t
80 periodic_thread_create(
81 task_t parent_task,
82 mach_clock_t clock,
83 policy_param_realtime_t rt_attr,
84 ipc_port_t deadline_port,
85 int state_flavor,
86 thread_state_t state,
87 natural_t state_count,
88 thread_t *child_thread); /* out */
89
90 extern kern_return_t
91 periodic_thread_restart(
92 thread_t thread);
93
94 #endif /* _KERN_RT_THREAD_H_ */
Cache object: dc72e8c8e3eac6736b62735f2858b7cf
|