20 |
#include "trace.h" |
#include "trace.h" |
21 |
#include "vm-object.h" |
#include "vm-object.h" |
22 |
#include "host.h" |
#include "host.h" |
23 |
|
#include "eventcnt.h" |
24 |
|
|
25 |
typedef struct thread *thread_t; |
typedef struct thread *thread_t; |
26 |
typedef struct task *task_t; |
typedef struct task *task_t; |
27 |
typedef struct vm_object *vm_object_t; |
typedef struct vm_object *vm_object_t; |
28 |
|
typedef struct eventcnt *eventcnt_t; |
29 |
|
|
30 |
#ifndef TRUE |
#ifndef TRUE |
31 |
# define TRUE 1 |
# define TRUE 1 |
142 |
*msgtp = (rtmk_msg_type_t *) (mfield + 1); |
*msgtp = (rtmk_msg_type_t *) (mfield + 1); |
143 |
return KERN_SUCCESS; |
return KERN_SUCCESS; |
144 |
} |
} |
145 |
|
|
146 |
|
static inline kern_return_t convert_evc_to_port (rtmk_msg_type_t **msgtp, |
147 |
|
struct eventcnt *evc) |
148 |
|
{ |
149 |
|
struct std_mfield_desc *mfield = (struct std_mfield_desc *) *msgtp; |
150 |
|
struct rtmk_msg_type type = |
151 |
|
{ |
152 |
|
RTMK_MSG_TYPE_COPY_SEND, |
153 |
|
32, |
154 |
|
TRUE, |
155 |
|
FALSE |
156 |
|
}; |
157 |
|
|
158 |
|
mfield->type = type; |
159 |
|
mfield->port = evc->port_self; |
160 |
|
|
161 |
|
*msgtp = (rtmk_msg_type_t *) (mfield + 1); |
162 |
|
return KERN_SUCCESS; |
163 |
|
} |
164 |
|
|
165 |
|
|
166 |
|
static inline kern_return_t convert_port_to_evc (rtmk_msg_type_t **msgtp, |
167 |
|
struct eventcnt **evcp) |
168 |
|
{ |
169 |
|
struct std_mfield_desc *mfield = (struct std_mfield_desc *) *msgtp; |
170 |
|
struct ipc_port *port = mfield->port; |
171 |
|
|
172 |
|
/* First check type. */ |
173 |
|
if (port->kobject.type != IPC_KOBJECT_TYPE_EVENTCNT) |
174 |
|
return KERN_INVALID_ARGUMENT; |
175 |
|
|
176 |
|
*evcp = (struct eventcnt *) port->kobject.port; |
177 |
|
*msgtp = (rtmk_msg_type_t *) (mfield + 1); |
178 |
|
return KERN_SUCCESS; |
179 |
|
} |