18 |
#ifndef __ipc_kmsg_h |
#ifndef __ipc_kmsg_h |
19 |
#define __ipc_kmsg_h 1 |
#define __ipc_kmsg_h 1 |
20 |
|
|
21 |
|
#include <stdbool.h> |
22 |
#include <rtmk/ipc-message.h> |
#include <rtmk/ipc-message.h> |
23 |
|
#include <rtmk/kern-return.h> |
24 |
|
#include "task.h" |
25 |
|
|
26 |
#include "queue.h" |
#include "queue.h" |
27 |
|
|
28 |
struct ipc_kmsg |
struct ipc_kmsg |
40 |
/* Flags for a kernel message: |
/* Flags for a kernel message: |
41 |
. complex: the port includes compex types |
. complex: the port includes compex types |
42 |
. intra: message is an intra-message. */ |
. intra: message is an intra-message. */ |
43 |
unsigned int |
|
44 |
/* bool */ complex: 1, |
bool complex_p: 1; |
45 |
/* bool */ intra: 1; |
bool intratask_p: 1; |
46 |
|
|
47 |
/* Header, followed by message data. */ |
/* Header, followed by message data. */ |
48 |
rtmk_msg_header_t header; |
struct rtmk_msg_header header; |
49 |
}; |
}; |
50 |
|
|
51 |
#define ipc_kmsg_hdr_start(ikm) ((vm_offset_t) (&(ikm)->header + 1)) |
#define ipc_kmsg_hdr_start(ikm) ((vm_offset_t) (&(ikm)->header + 1)) |
53 |
+ (ikm)->length \ |
+ (ikm)->length \ |
54 |
- sizeof (rtmk_msg_header_t)) |
- sizeof (rtmk_msg_header_t)) |
55 |
|
|
56 |
|
/* Initialize kernel messages. */ |
57 |
|
|
58 |
|
extern void ipc_kmsg_init (void); |
59 |
|
|
60 |
|
/* Allocate a new kernel message with SIZE bytes payload. |
61 |
|
SIZE includes the size of the header. */ |
62 |
|
|
63 |
|
extern struct ipc_kmsg *ipc_kmsg_alloc (vm_size_t size); |
64 |
|
|
65 |
|
/* Free a kernel message allocated with ipc_kmsg_alloc. */ |
66 |
|
|
67 |
|
extern void ipc_kmsg_free (struct ipc_kmsg *kmsg); |
68 |
|
|
69 |
|
/* Copy in a kernel message from kernel address/ipc space into a |
70 |
|
kernel message buffer. TASK must be kernel task. */ |
71 |
|
|
72 |
|
extern kern_return_t ipc_kmsg_copyin_kernel (struct task *task, |
73 |
|
struct ipc_kmsg *kmsg); |
74 |
|
|
75 |
#endif /* ipc-kmsg.h */ |
#endif /* ipc-kmsg.h */ |