1 /*********************************************************************
2 * Copyright (C) 2003 Tord Lindstrom (pukko@home.se)
3 * This file is subject to the terms and conditions of the PS2Link License.
4 * See the file LICENSE in the main directory of this distribution for more
17 ////////////////////////////////////////////////////////////////////////
19 #define RPC_NPM_USER 0x014d704e
21 ////////////////////////////////////////////////////////////////////////
23 naplinkRpcHandler(int cmd
, void *buffer
, int size
)
25 // Only supports npmPrintf of course
31 printf("unknown npm rpc call\n");
37 ////////////////////////////////////////////////////////////////////////
38 static SifRpcServerData_t server
__attribute((aligned(16)));
39 static SifRpcDataQueue_t queue
__attribute((aligned(16)));
40 static unsigned char rpc_buffer
[512] __attribute((aligned(16)));
49 SifSetRpcQueue(&queue
, pid
);
50 SifRegisterRpc(&server
, RPC_NPM_USER
, naplinkRpcHandler
,
51 rpc_buffer
, 0, 0, &queue
);
52 SifRpcLoop(&queue
); // Never exits
55 ////////////////////////////////////////////////////////////////////////
59 struct _iop_thread th_attr
;
63 th_attr
.attr
= 0x02000000;
65 th_attr
.thread
= napThread
;
66 th_attr
.stacksize
= 0x800;
67 th_attr
.priority
= 79;
69 pid
= CreateThread(&th_attr
);
71 printf("IOP: napRpc createThread failed %d\n", pid
);
75 ret
= StartThread(pid
, 0);
77 printf("IOP: napRpc startThread failed %d\n", ret
);