Rev 1493 | Rev 1547 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1493 | Rev 1505 | ||
|---|---|---|---|
| Line 28... | Line 28... | ||
| 28 | 28 | ||
| 29 | #include <ipc/ipc.h> |
29 | #include <ipc/ipc.h> |
| 30 | #include <ipc/services.h> |
30 | #include <ipc/services.h> |
| 31 | #include <sysinfo.h> |
31 | #include <sysinfo.h> |
| 32 | #include <async.h> |
32 | #include <async.h> |
| - | 33 | #include <as.h> |
|
| - | 34 | #include <align.h> |
|
| - | 35 | #include <errno.h> |
|
| 33 | 36 | ||
| 34 | #include "fb.h" |
37 | #include "fb.h" |
| 35 | #include "sysio.h" |
38 | #include "sysio.h" |
| 36 | #include "ega.h" |
39 | #include "ega.h" |
| - | 40 | #include "main.h" |
|
| - | 41 | ||
| - | 42 | void receive_comm_area(ipc_callid_t callid, ipc_call_t *call, void **area, |
|
| - | 43 | size_t maxsize) |
|
| - | 44 | { |
|
| - | 45 | void *dest; |
|
| - | 46 | ||
| - | 47 | if (*area) { |
|
| - | 48 | ipc_answer_fast(callid, ELIMIT, 0, 0); |
|
| - | 49 | return; |
|
| - | 50 | } |
|
| - | 51 | if (IPC_GET_ARG2(*call) > ALIGN_UP(maxsize, PAGE_SIZE)) { |
|
| - | 52 | ipc_answer_fast(callid, EINVAL, 0, 0); |
|
| - | 53 | return; |
|
| - | 54 | } |
|
| - | 55 | ||
| - | 56 | dest = as_get_mappable_page(maxsize); |
|
| - | 57 | if (ipc_answer_fast(callid, 0, (sysarg_t)dest, 0) == 0) |
|
| - | 58 | *area = dest; |
|
| - | 59 | } |
|
| 37 | 60 | ||
| 38 | int main(int argc, char *argv[]) |
61 | int main(int argc, char *argv[]) |
| 39 | { |
62 | { |
| 40 | ipcarg_t phonead; |
63 | ipcarg_t phonead; |
| 41 | int initialized = 0; |
64 | int initialized = 0; |