]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/mach/policy.h
xnu-792.6.56.tar.gz
[apple/xnu.git] / osfmk / mach / policy.h
index 0e004fc95fdba583a2e19836f04d5c0eef88d63a..80921e776e200edea8a8bf571d7228937403039f 100644 (file)
@@ -1,10 +1,8 @@
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2000-2005 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
- * Copyright (c) 1999-2003 Apple Computer, Inc.  All Rights Reserved.
- * 
  * This file contains Original Code and/or Modifications of Original Code
  * as defined in and that are subject to the Apple Public Source License
  * Version 2.0 (the 'License'). You may not use this file except in
  *     mach/policy.h
  *
  *     Definitions for scheduing policy.
- *
- *  N.B. The interfaces defined here are all obsolete!!
+ */
+
+/*
+ *  All interfaces defined here are obsolete.
  */
 
 #include <mach/boolean.h>
+#include <mach/message.h>
 #include <mach/vm_types.h>
 
-#include <sys/appleapiopts.h>
-
 /*
  *     Old scheduling control interface
  */
@@ -77,8 +76,6 @@ typedef integer_t                     *policy_info_t;
 typedef integer_t                      *policy_base_t;
 typedef integer_t                      *policy_limit_t;
 
-#ifdef __APPLE_API_UNSTABLE
-
 /*
  *     Policy definitions.  Policies should be powers of 2,
  *     but cannot be or'd together other than to test for a
@@ -131,12 +128,12 @@ typedef struct policy_timeshare_limit     policy_timeshare_limit_data_t;
 typedef struct policy_timeshare_info   policy_timeshare_info_data_t;
 
 
-#define POLICY_TIMESHARE_BASE_COUNT            \
-       (sizeof(struct policy_timeshare_base)/sizeof(integer_t))
-#define POLICY_TIMESHARE_LIMIT_COUNT           \
-       (sizeof(struct policy_timeshare_limit)/sizeof(integer_t))
-#define POLICY_TIMESHARE_INFO_COUNT            \
-       (sizeof(struct policy_timeshare_info)/sizeof(integer_t))
+#define POLICY_TIMESHARE_BASE_COUNT    ((mach_msg_type_number_t) \
+       (sizeof(struct policy_timeshare_base)/sizeof(integer_t)))
+#define POLICY_TIMESHARE_LIMIT_COUNT   ((mach_msg_type_number_t) \
+       (sizeof(struct policy_timeshare_limit)/sizeof(integer_t)))
+#define POLICY_TIMESHARE_INFO_COUNT    ((mach_msg_type_number_t) \
+       (sizeof(struct policy_timeshare_info)/sizeof(integer_t)))
 
 
 /*
@@ -165,12 +162,12 @@ typedef struct policy_rr_base             policy_rr_base_data_t;
 typedef struct policy_rr_limit         policy_rr_limit_data_t;
 typedef struct policy_rr_info          policy_rr_info_data_t;
 
-#define POLICY_RR_BASE_COUNT           \
-       (sizeof(struct policy_rr_base)/sizeof(integer_t))
-#define POLICY_RR_LIMIT_COUNT          \
-       (sizeof(struct policy_rr_limit)/sizeof(integer_t))
-#define POLICY_RR_INFO_COUNT           \
-       (sizeof(struct policy_rr_info)/sizeof(integer_t))
+#define POLICY_RR_BASE_COUNT   ((mach_msg_type_number_t)       \
+       (sizeof(struct policy_rr_base)/sizeof(integer_t)))
+#define POLICY_RR_LIMIT_COUNT  ((mach_msg_type_number_t)       \
+       (sizeof(struct policy_rr_limit)/sizeof(integer_t)))
+#define POLICY_RR_INFO_COUNT   ((mach_msg_type_number_t)       \
+       (sizeof(struct policy_rr_info)/sizeof(integer_t)))
 
 
 /*
@@ -197,12 +194,12 @@ typedef struct policy_fifo_base           policy_fifo_base_data_t;
 typedef struct policy_fifo_limit       policy_fifo_limit_data_t;
 typedef struct policy_fifo_info                policy_fifo_info_data_t;
 
-#define POLICY_FIFO_BASE_COUNT         \
-       (sizeof(struct policy_fifo_base)/sizeof(integer_t))
-#define POLICY_FIFO_LIMIT_COUNT                \
-       (sizeof(struct policy_fifo_limit)/sizeof(integer_t))
-#define POLICY_FIFO_INFO_COUNT         \
-       (sizeof(struct policy_fifo_info)/sizeof(integer_t))
+#define POLICY_FIFO_BASE_COUNT ((mach_msg_type_number_t)       \
+       (sizeof(struct policy_fifo_base)/sizeof(integer_t)))
+#define POLICY_FIFO_LIMIT_COUNT        ((mach_msg_type_number_t)       \
+       (sizeof(struct policy_fifo_limit)/sizeof(integer_t)))
+#define POLICY_FIFO_INFO_COUNT ((mach_msg_type_number_t)       \
+       (sizeof(struct policy_fifo_info)/sizeof(integer_t)))
 
 /*
  *     Aggregate policy types
@@ -230,6 +227,4 @@ typedef struct policy_bases         policy_base_data_t;
 typedef struct policy_limits           policy_limit_data_t;
 typedef struct policy_infos            policy_info_data_t;
 
-#endif /* __APPLE_API_UNSTABLE */
-
-#endif /* _MACH_POLICY_H_ */
+#endif /* _MACH_POLICY_H_ */