00001 #ifndef __MACH_H__
00002 #define __MACH_H__
00003
00004 #include <mach-o/loader.h>
00005
00006
00007 typedef integer_t host_flavor_t;
00008 #define HOST_BASIC_INFO 1
00009 #define HOST_SCHED_INFO 3
00010 #define HOST_RESOURCE_SIZES 4
00011 #define HOST_PRIORITY_INFO 5
00012 #define HOST_SEMAPHORE_TRAPS 7
00013 #define HOST_MACH_MSG_TRAP 8
00014
00015
00016 typedef natural_t mach_port_name_t;
00017 typedef mach_port_name_t mach_port_t;
00018 typedef unsigned int mach_msg_bits_t;
00019 typedef natural_t mach_msg_size_t;
00020 typedef integer_t mach_msg_id_t;
00021 typedef int kern_return_t;
00022 typedef unsigned int mach_msg_trailer_type_t;
00023 typedef unsigned int mach_msg_trailer_size_t;
00024 typedef integer_t cpu_threadtype_t;
00025
00026
00027 struct host_basic_info {
00028 integer_t max_cpus;
00029 integer_t avail_cpus;
00030 natural_t memory_size;
00031 cpu_type_t cpu_type;
00032 cpu_subtype_t cpu_subtype;
00033 cpu_threadtype_t cpu_threadtype;
00034 integer_t physical_cpu;
00035 integer_t physical_cpu_max;
00036 integer_t logical_cpu;
00037 integer_t logical_cpu_max;
00038 uint64_t max_mem;
00039 };
00040 typedef struct host_basic_info host_basic_info_data_t;
00041 typedef struct host_basic_info *host_basic_info_t;
00042
00043 #define HOST_BASIC_INFO_COUNT ((mach_msg_type_number_t) \
00044 (sizeof(host_basic_info_data_t)/sizeof(integer_t)))
00045
00046 #define KERN_SUCCESS 0
00047
00048
00049 typedef struct
00050 {
00051 mach_msg_bits_t msgh_bits;
00052 mach_msg_size_t msgh_size;
00053 mach_port_t msgh_remote_port;
00054 mach_port_t msgh_local_port;
00055 mach_msg_size_t msgh_reserved;
00056 mach_msg_id_t msgh_id;
00057 } mach_msg_header_t;
00058
00059
00060 typedef struct
00061 {
00062 mach_msg_trailer_type_t msgh_trailer_type;
00063 mach_msg_trailer_size_t msgh_trailer_size;
00064 } mach_msg_trailer_t;
00065
00066
00067 typedef struct {
00068 unsigned char mig_vers;
00069 unsigned char if_vers;
00070 unsigned char reserved1;
00071 unsigned char mig_encoding;
00072 unsigned char int_rep;
00073 unsigned char char_rep;
00074 unsigned char float_rep;
00075 unsigned char reserved2;
00076 } NDR_record_t;
00077
00078
00079 #endif