aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/rtprio.h
diff options
context:
space:
mode:
authorPeter Dufault <dufault@FreeBSD.org>1998-03-04 10:27:00 +0000
committerPeter Dufault <dufault@FreeBSD.org>1998-03-04 10:27:00 +0000
commit917e476dad16ee2bb972f70adede8bd9693aca13 (patch)
tree9a4a250a06cdd01d476f1e2cce24699984e7a22a /sys/sys/rtprio.h
parent644d85f4ca78ccb6055a1246fa5ec3124bd43182 (diff)
downloadsrc-917e476dad16ee2bb972f70adede8bd9693aca13.tar.gz
src-917e476dad16ee2bb972f70adede8bd9693aca13.zip
Reviewed by: msmith, bde long ago
POSIX.4 headers and sysctl variables. Nothing should change unless POSIX4 is defined or _POSIX_VERSION is set to 199309.
Notes
Notes: svn path=/head/; revision=34030
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 */