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