]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/kern/kern_types.h
xnu-344.tar.gz
[apple/xnu.git] / osfmk / kern / kern_types.h
index 8d0ab03d2975f588f4778a5e42b28fb2298148bc..13f58fb7415c3c5965d79bcffed87181ba1e276e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
+ * Copyright (c) 2002,2000 Apple Computer, Inc. All rights reserved.
  *
  * @APPLE_LICENSE_HEADER_START@
  * 
 #ifndef        _KERN_KERN_TYPES_H_
 #define        _KERN_KERN_TYPES_H_
 
-#ifdef KERNEL_PRIVATE
-
 #include <stdint.h>
-
+#include <mach/mach_types.h>
 #include <mach/machine/vm_types.h>
-#include <ipc/ipc_types.h>
+
+#include <sys/appleapiopts.h>
 
 #if !defined(MACH_KERNEL_PRIVATE)
 
  * of type checking, without exposing our internal data
  * structures.
  */
-struct thread_shuttle ;
-struct task ;
-struct host ;
-struct processor ;
-struct processor_set ;
-struct thread_activation ;
-struct subsystem ;
-struct semaphore ;
-struct lock_set ;
-struct ledger ;
-struct alarm ;
-struct clock ;
+
 struct zone ;
-struct wait_queue_sub ;
-struct wait_queue_link;
+struct wait_queue { unsigned int opaque[2]; uintptr_t opaquep[2]; } ;
+
+
+#endif /* MACH_KERNEL_PRIVATE */
+
 
-#else /* MACH_KERNEL_PRIVATE */
+typedef struct zone                    *zone_t;
+#define                ZONE_NULL                       ((zone_t) 0)
+
+typedef struct wait_queue              *wait_queue_t;
+#define                WAIT_QUEUE_NULL         ((wait_queue_t) 0)
+#define                SIZEOF_WAITQUEUE        sizeof(struct wait_queue)
+
+typedef vm_offset_t                    ipc_kobject_t;
+#define                IKO_NULL                        ((ipc_kobject_t) 0)
+
+typedef        void *event_t;          /* wait event */
+#define                NO_EVENT                        ((event_t) 0)
+
+typedef uint64_t event64_t;            /* 64 bit wait event */
+#define                NO_EVENT64              ((event64_t) 0)
+
+/*
+ *     Possible wait_result_t values.
+ */
+typedef int wait_result_t;
+#define THREAD_WAITING         -1              /* thread is waiting */
+#define THREAD_AWAKENED                0               /* normal wakeup */
+#define THREAD_TIMED_OUT       1               /* timeout expired */
+#define THREAD_INTERRUPTED     2               /* aborted/interrupted */
+#define THREAD_RESTART         3               /* restart operation entirely */
+
+
+typedef        void (*thread_continue_t)(void);                        /* where to resume it */
+#define        THREAD_CONTINUE_NULL    ((thread_continue_t) 0)
+
+/*
+ * Interruptible flag for waits.
+ */
+typedef int wait_interrupt_t;
+#define THREAD_UNINT                   0               /* not interruptible      */
+#define THREAD_INTERRUPTIBLE   1               /* may not be restartable */
+#define THREAD_ABORTSAFE               2               /* abortable safely       */
+
+#ifdef __APPLE_API_PRIVATE
+
+#ifdef MACH_KERNEL_PRIVATE
 
 #include <kern/misc_protos.h>
-typedef struct clock                   *clock_t;          /* Internal use only */
+typedef  struct clock                  *clock_t;
 
-#endif /* MACH_KERNEL_PRIVATE */
+#endif /* MACH_KERNEL_PRIVATE */
+
+#ifdef __APPLE_API_EVOLVING
+
+#ifndef MACH_KERNEL_PRIVATE
+struct wait_queue_set ;
+struct wait_queue_link ;
+#endif
+
+typedef struct wait_queue_set  *wait_queue_set_t;
+#define WAIT_QUEUE_SET_NULL    ((wait_queue_set_t)0)
+#define SIZEOF_WAITQUEUE_SET   wait_queue_set_size()
+
+typedef struct wait_queue_link *wait_queue_link_t;
+#define WAIT_QUEUE_LINK_NULL   ((wait_queue_link_t)0)
+#define SIZEOF_WAITQUEUE_LINK  wait_queue_link_size()
 
 typedef struct mig_object              *mig_object_t;
+#define MIG_OBJECT_NULL                        ((mig_object_t) 0)
+
 typedef struct mig_notify              *mig_notify_t;
-typedef struct thread_shuttle          *thread_t;
-typedef struct thread_shuttle          *thread_shuttle_t;
-typedef struct task                    *task_t;
-typedef struct host                    *host_t;
-typedef struct processor               *processor_t;
-typedef struct processor_set           *processor_set_t;
-typedef struct thread_activation       *thread_act_t;
-typedef struct subsystem               *subsystem_t;
-typedef struct semaphore               *semaphore_t;
-typedef struct lock_set                *lock_set_t;
-typedef struct ledger                  *ledger_t;
-typedef        struct alarm                    *alarm_t;
-typedef        struct clock                    *clock_serv_t;
-typedef        struct clock                    *clock_ctrl_t;
-typedef struct zone                    *zone_t;
-typedef struct wait_queue              *wait_queue_t;
-typedef struct wait_queue_sub          *wait_queue_sub_t;
-typedef struct wait_queue_link         *wait_queue_link_t;
+#define MIG_NOTIFY_NULL                ((mig_notify_t) 0)
 
-typedef host_t host_priv_t;
-typedef host_t host_security_t;
-typedef processor_set_t processor_set_name_t;
-typedef vm_offset_t    ipc_kobject_t;
+typedef boolean_t (*thread_roust_t)(wait_result_t);    /* how to roust it */
+#define THREAD_ROUST_NULL              ((thread_roust_t) 0)
 
-typedef        void    *event_t;                       /* wait event */
-typedef        void    (*continuation_t)(void);        /* continuation */
+#endif /* __APPLE_API_EVOLVING */
 
-#define                ZONE_NULL       ((zone_t) 0)
+#ifdef __APPLE_API_UNSTABLE
 
-#define                NO_EVENT        ((event_t) 0)
-#define                WAIT_QUEUE_NULL ((wait_queue_t) 0)
+typedef struct thread_shuttle  *thread_shuttle_t;
+#define THREAD_SHUTTLE_NULL            ((thread_shuttle_t)0)
+
+/* legacy definitions - going away */
+struct wait_queue_sub ;
+typedef struct wait_queue_sub  *wait_queue_sub_t;
+#define WAIT_QUEUE_SUB_NULL    ((wait_queue_sub_t)0)
+#define SIZEOF_WAITQUEUE_SUB   wait_queue_set_size()
 
-#define                IKO_NULL        ((ipc_kobject_t) 0)
-#define                MIG_OBJECT_NULL ((mig_object_t) 0)
-#define        MIG_NOTIFY_NULL ((mig_notify_t) 0)
+#endif   /* __APPLE_API_UNSTABLE */
 
-#endif /* KERNEL_PRIVATE */
+#endif /* __APPLE_API_PRIVATE */
 
 #endif /* _KERN_KERN_TYPES_H_ */