Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1357 → Rev 1360

/uspace/trunk/ns/ns.c
77,7 → 77,7
{
ipc_call_t call;
ipc_callid_t callid;
char *as;
char *as_area;
ipcarg_t retval, arg1, arg2;
 
92,13 → 92,13
callid = ipc_wait_for_call(&call, 0);
// printf("NS: Call in_phone_hash=%lX...", call.in_phone_hash);
switch (IPC_GET_METHOD(call)) {
case IPC_M_AS_SEND:
as = (char *)IPC_GET_ARG2(call);
printf("Received as: %P, size:%d\n", as, IPC_GET_ARG3(call));
case IPC_M_AS_AREA_SEND:
as_area = (char *)IPC_GET_ARG2(call);
printf("Received as_area: %P, size:%d\n", as_area, IPC_GET_ARG3(call));
retval = ipc_answer_fast(callid, 0,(sysarg_t)(1024*1024), 0);
if (!retval) {
printf("Reading shared memory...");
printf("Text: %s", as);
printf("Text: %s", as_area);
} else
printf("Failed answer: %d\n", retval);
continue;
/uspace/trunk/init/init.c
325,24 → 325,24
printf("Connected to PCI service through phone %d.\n", phone);
}
 
static int test_as_send()
static int test_as_area_send()
{
char *as;
char *as_area;
int retval;
ipcarg_t result;
 
as = as_area_create((void *)(1024*1024), 16384, AS_AREA_READ | AS_AREA_WRITE);
if (!as) {
printf("Error creating as.\n");
as_area = as_area_create((void *)(1024*1024), 16384, AS_AREA_READ | AS_AREA_WRITE);
if (!as_area) {
printf("Error creating as_area.\n");
return 0;
}
 
memcpy(as, "Hello world.\n", 14);
memcpy(as_area, "Hello world.\n", 14);
 
retval = ipc_call_sync_2(PHONE_NS, IPC_M_AS_SEND, 0, (sysarg_t) as,
retval = ipc_call_sync_2(PHONE_NS, IPC_M_AS_AREA_SEND, 0, (sysarg_t) as_area,
NULL, NULL);
if (retval) {
printf("AS_SEND failed.\n");
printf("AS_AREA_SEND failed.\n");
return 0;
}
printf("Done\n");
/uspace/trunk/libc/generic/ipc.c
325,7 → 325,7
/** Open shared memory connection over specified phoneid
*
*
* Allocates AS_area, notify the other side about our intention
* Allocate as_area, notify the other side about our intention
* to open the connection
*
* @return Connection id identifying this connection