1 | #ifndef _clock_user_ |
2 | #define _clock_user_ |
3 | |
4 | /* Module clock */ |
5 | |
6 | #include <string.h> |
7 | #include <mach/ndr.h> |
8 | #include <mach/boolean.h> |
9 | #include <mach/kern_return.h> |
10 | #include <mach/notify.h> |
11 | #include <mach/mach_types.h> |
12 | #include <mach/message.h> |
13 | #include <mach/mig_errors.h> |
14 | #include <mach/port.h> |
15 | |
16 | /* BEGIN MIG_STRNCPY_ZEROFILL CODE */ |
17 | |
18 | #if defined(__has_include) |
19 | #if __has_include(<mach/mig_strncpy_zerofill_support.h>) |
20 | #ifndef USING_MIG_STRNCPY_ZEROFILL |
21 | #define USING_MIG_STRNCPY_ZEROFILL |
22 | #endif |
23 | #ifndef __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ |
24 | #define __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ |
25 | #ifdef __cplusplus |
26 | extern "C" { |
27 | #endif |
28 | extern int mig_strncpy_zerofill(char *dest, const char *src, int len) __attribute__((weak_import)); |
29 | #ifdef __cplusplus |
30 | } |
31 | #endif |
32 | #endif /* __MIG_STRNCPY_ZEROFILL_FORWARD_TYPE_DECLS__ */ |
33 | #endif /* __has_include(<mach/mig_strncpy_zerofill_support.h>) */ |
34 | #endif /* __has_include */ |
35 | |
36 | /* END MIG_STRNCPY_ZEROFILL CODE */ |
37 | |
38 | |
39 | #ifdef AUTOTEST |
40 | #ifndef FUNCTION_PTR_T |
41 | #define FUNCTION_PTR_T |
42 | typedef void (*function_ptr_t)(mach_port_t, char *, mach_msg_type_number_t); |
43 | typedef struct { |
44 | char *name; |
45 | function_ptr_t function; |
46 | } function_table_entry; |
47 | typedef function_table_entry *function_table_t; |
48 | #endif /* FUNCTION_PTR_T */ |
49 | #endif /* AUTOTEST */ |
50 | |
51 | #ifndef clock_MSG_COUNT |
52 | #define clock_MSG_COUNT 3 |
53 | #endif /* clock_MSG_COUNT */ |
54 | |
55 | #include <mach/std_types.h> |
56 | #include <mach/mig.h> |
57 | #include <mach/mig.h> |
58 | #include <mach/mach_types.h> |
59 | #include <mach/mach_types.h> |
60 | |
61 | #ifdef __BeforeMigUserHeader |
62 | __BeforeMigUserHeader |
63 | #endif /* __BeforeMigUserHeader */ |
64 | |
65 | #include <sys/cdefs.h> |
66 | __BEGIN_DECLS |
67 | |
68 | |
69 | /* Routine clock_get_time */ |
70 | #ifdef mig_external |
71 | mig_external |
72 | #else |
73 | extern |
74 | #endif /* mig_external */ |
75 | kern_return_t clock_get_time |
76 | ( |
77 | clock_serv_t clock_serv, |
78 | mach_timespec_t *cur_time |
79 | ); |
80 | |
81 | /* Routine clock_get_attributes */ |
82 | #ifdef mig_external |
83 | mig_external |
84 | #else |
85 | extern |
86 | #endif /* mig_external */ |
87 | kern_return_t clock_get_attributes |
88 | ( |
89 | clock_serv_t clock_serv, |
90 | clock_flavor_t flavor, |
91 | clock_attr_t clock_attr, |
92 | mach_msg_type_number_t *clock_attrCnt |
93 | ); |
94 | |
95 | /* Routine clock_alarm */ |
96 | #ifdef mig_external |
97 | mig_external |
98 | #else |
99 | extern |
100 | #endif /* mig_external */ |
101 | kern_return_t clock_alarm |
102 | ( |
103 | clock_serv_t clock_serv, |
104 | alarm_type_t alarm_type, |
105 | mach_timespec_t alarm_time, |
106 | clock_reply_t alarm_port |
107 | ); |
108 | |
109 | __END_DECLS |
110 | |
111 | /********************** Caution **************************/ |
112 | /* The following data types should be used to calculate */ |
113 | /* maximum message sizes only. The actual message may be */ |
114 | /* smaller, and the position of the arguments within the */ |
115 | /* message layout may vary from what is presented here. */ |
116 | /* For example, if any of the arguments are variable- */ |
117 | /* sized, and less than the maximum is sent, the data */ |
118 | /* will be packed tight in the actual message to reduce */ |
119 | /* the presence of holes. */ |
120 | /********************** Caution **************************/ |
121 | |
122 | /* typedefs for all requests */ |
123 | |
124 | #ifndef __Request__clock_subsystem__defined |
125 | #define __Request__clock_subsystem__defined |
126 | |
127 | #ifdef __MigPackStructs |
128 | #pragma pack(4) |
129 | #endif |
130 | typedef struct { |
131 | mach_msg_header_t Head; |
132 | } __Request__clock_get_time_t __attribute__((unused)); |
133 | #ifdef __MigPackStructs |
134 | #pragma pack() |
135 | #endif |
136 | |
137 | #ifdef __MigPackStructs |
138 | #pragma pack(4) |
139 | #endif |
140 | typedef struct { |
141 | mach_msg_header_t Head; |
142 | NDR_record_t NDR; |
143 | clock_flavor_t flavor; |
144 | mach_msg_type_number_t clock_attrCnt; |
145 | } __Request__clock_get_attributes_t __attribute__((unused)); |
146 | #ifdef __MigPackStructs |
147 | #pragma pack() |
148 | #endif |
149 | |
150 | #ifdef __MigPackStructs |
151 | #pragma pack(4) |
152 | #endif |
153 | typedef struct { |
154 | mach_msg_header_t Head; |
155 | /* start of the kernel processed data */ |
156 | mach_msg_body_t msgh_body; |
157 | mach_msg_port_descriptor_t alarm_port; |
158 | /* end of the kernel processed data */ |
159 | NDR_record_t NDR; |
160 | alarm_type_t alarm_type; |
161 | mach_timespec_t alarm_time; |
162 | } __Request__clock_alarm_t __attribute__((unused)); |
163 | #ifdef __MigPackStructs |
164 | #pragma pack() |
165 | #endif |
166 | #endif /* !__Request__clock_subsystem__defined */ |
167 | |
168 | /* union of all requests */ |
169 | |
170 | #ifndef __RequestUnion__clock_subsystem__defined |
171 | #define __RequestUnion__clock_subsystem__defined |
172 | union __RequestUnion__clock_subsystem { |
173 | __Request__clock_get_time_t Request_clock_get_time; |
174 | __Request__clock_get_attributes_t Request_clock_get_attributes; |
175 | __Request__clock_alarm_t Request_clock_alarm; |
176 | }; |
177 | #endif /* !__RequestUnion__clock_subsystem__defined */ |
178 | /* typedefs for all replies */ |
179 | |
180 | #ifndef __Reply__clock_subsystem__defined |
181 | #define __Reply__clock_subsystem__defined |
182 | |
183 | #ifdef __MigPackStructs |
184 | #pragma pack(4) |
185 | #endif |
186 | typedef struct { |
187 | mach_msg_header_t Head; |
188 | NDR_record_t NDR; |
189 | kern_return_t RetCode; |
190 | mach_timespec_t cur_time; |
191 | } __Reply__clock_get_time_t __attribute__((unused)); |
192 | #ifdef __MigPackStructs |
193 | #pragma pack() |
194 | #endif |
195 | |
196 | #ifdef __MigPackStructs |
197 | #pragma pack(4) |
198 | #endif |
199 | typedef struct { |
200 | mach_msg_header_t Head; |
201 | NDR_record_t NDR; |
202 | kern_return_t RetCode; |
203 | mach_msg_type_number_t clock_attrCnt; |
204 | int clock_attr[1]; |
205 | } __Reply__clock_get_attributes_t __attribute__((unused)); |
206 | #ifdef __MigPackStructs |
207 | #pragma pack() |
208 | #endif |
209 | |
210 | #ifdef __MigPackStructs |
211 | #pragma pack(4) |
212 | #endif |
213 | typedef struct { |
214 | mach_msg_header_t Head; |
215 | NDR_record_t NDR; |
216 | kern_return_t RetCode; |
217 | } __Reply__clock_alarm_t __attribute__((unused)); |
218 | #ifdef __MigPackStructs |
219 | #pragma pack() |
220 | #endif |
221 | #endif /* !__Reply__clock_subsystem__defined */ |
222 | |
223 | /* union of all replies */ |
224 | |
225 | #ifndef __ReplyUnion__clock_subsystem__defined |
226 | #define __ReplyUnion__clock_subsystem__defined |
227 | union __ReplyUnion__clock_subsystem { |
228 | __Reply__clock_get_time_t Reply_clock_get_time; |
229 | __Reply__clock_get_attributes_t Reply_clock_get_attributes; |
230 | __Reply__clock_alarm_t Reply_clock_alarm; |
231 | }; |
232 | #endif /* !__RequestUnion__clock_subsystem__defined */ |
233 | |
234 | #ifndef subsystem_to_name_map_clock |
235 | #define subsystem_to_name_map_clock \ |
236 | { "clock_get_time", 1000 },\ |
237 | { "clock_get_attributes", 1001 },\ |
238 | { "clock_alarm", 1002 } |
239 | #endif |
240 | |
241 | #ifdef __AfterMigUserHeader |
242 | __AfterMigUserHeader |
243 | #endif /* __AfterMigUserHeader */ |
244 | |
245 | #endif /* _clock_user_ */ |
246 | |