aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/rtprio.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/rtprio.h')
-rw-r--r--sys/sys/rtprio.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/sys/rtprio.h b/sys/sys/rtprio.h
index dd9521e7c810..5b6830def121 100644
--- a/sys/sys/rtprio.h
+++ b/sys/sys/rtprio.h
@@ -28,7 +28,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: rtprio.h,v 1.4 1997/02/22 09:45:48 peter Exp $
*/
#ifndef _SYS_RTPRIO_H_
@@ -39,10 +39,29 @@
*/
/* priority types */
+
#define RTP_PRIO_REALTIME 0
#define RTP_PRIO_NORMAL 1
#define RTP_PRIO_IDLE 2
+/* RTP_PRIO_FIFO is Posix 4 SCHED_FIFO.
+ * Careful: These are based on the kernel config POSIX4 and not
+ * the compile time test _POSIX_PRIORITY_SCHEDULING since they
+ * set the behavior of the system.
+ */
+
+#ifdef POSIX4
+#define RTP_PRIO_FIFO_BIT 4
+#define RTP_PRIO_FIFO (RTP_PRIO_REALTIME | RTP_PRIO_FIFO_BIT)
+#define RTP_PRIO_BASE(P) ((P) & ~RTP_PRIO_FIFO_BIT)
+#define RTP_PRIO_IS_REALTIME(P) (RTP_PRIO_BASE(P) == RTP_PRIO_REALTIME)
+#define RTP_PRIO_NEED_RR(P) ((P) != RTP_PRIO_FIFO)
+#else
+#define RTP_PRIO_BASE(P) (P)
+#define RTP_PRIO_IS_REALTIME(P) (P == RTP_PRIO_REALTIME)
+#define RTP_PRIO_NEED_RR(P) (1)
+#endif
+
/* priority range */
#define RTP_PRIO_MIN 0 /* Highest priority */
#define RTP_PRIO_MAX 31 /* Lowest priority */