lib/aos/aos_rpc.c
errval_t aos_rpc_process_spawn(struct aos_rpc *chan, char *name,
        coreid_t core, domainid_t *newpid) {
    if (RPC_DEBUG_SPAWN) {
        debug_printf("Entering aos_rpc_process_spawn\n");
        debug_printf("name: %p\n", name);
        debug_printf("name: %s\n", name);
        debug_printf("core: %d\n", core);
        if (newpid != NULL) {
            debug_printf("newpid: %p\n", newpid);
        }
    }

    aos_rpc_send_string(chan, name);
    
    uintptr_t args[3];
    args[0] = (uintptr_t) chan;
    args[1] = (uintptr_t) core;
    args[2] = (uintptr_t) newpid;
    
    lmp_chan_register_send(&chan->channel, chan->ws, MKCLOSURE((void *) spawn_send_handler, args));
 
    lmp_chan_register_recv(&chan->channel, chan->ws, MKCLOSURE((void *) spawn_recv_handler, args));
 
    event_dispatch(chan->ws);

    if (RPC_DEBUG_SPAWN)
        debug_printf("Exiting aos_rpc_process_spawn\n");
    return SYS_ERR_OK;
}
/**
 * \brief Request process manager to start a new process
 * \arg name the name of the process that needs to be spawned (without a
 *           path prefix)
 * \arg newpid the process id of the newly spawned process
 */
\brief Request process manager to start a new process
\arg name the name of the process that needs to be spawned (without a
path prefix)
\arg newpid the process id of the newly spawned process
\ brief Request process manager to start a new process \ arg name the name of the process that needs to be spawned ( without a path prefix ) \ arg newpid the process id of the newly spawned process
errval_t aos_rpc_process_spawn(struct aos_rpc *chan, char *name,
        coreid_t core, domainid_t *newpid) {
    if (RPC_DEBUG_SPAWN) {
        debug_printf("Entering aos_rpc_process_spawn\n");
        debug_printf("name: %p\n", name);
        debug_printf("name: %s\n", name);
        debug_printf("core: %d\n", core);
        if (newpid != NULL) {
            debug_printf("newpid: %p\n", newpid);
        }
    }
    aos_rpc_send_string(chan, name);
    uintptr_t args[3];
    args[0] = (uintptr_t) chan;
    args[1] = (uintptr_t) core;
    args[2] = (uintptr_t) newpid;
    lmp_chan_register_send(&chan->channel, chan->ws, MKCLOSURE((void *) spawn_send_handler, args));
    lmp_chan_register_recv(&chan->channel, chan->ws, MKCLOSURE((void *) spawn_recv_handler, args));
    event_dispatch(chan->ws);
    if (RPC_DEBUG_SPAWN)
        debug_printf("Exiting aos_rpc_process_spawn\n");
    return SYS_ERR_OK;
}
errval_t aos_rpc_process_spawn ( struct aos_rpc * chan , char * name , coreid_t core , domainid_t * newpid ) { if ( RPC_DEBUG_SPAWN ) { debug_printf ( " \n " ) ; debug_printf ( " \n " , name ) ; debug_printf ( " \n " , name ) ; debug_printf ( " \n " , core ) ; if ( newpid != NULL ) { debug_printf ( " \n " , newpid ) ; } } aos_rpc_send_string ( chan , name ) ; uintptr_t args [ 3 ] ; args [ 0 ] = ( uintptr_t ) chan ; args [ 1 ] = ( uintptr_t ) core ; args [ 2 ] = ( uintptr_t ) newpid ; lmp_chan_register_send ( & chan -> channel , chan -> ws , MKCLOSURE ( ( void * ) spawn_send_handler , args ) ) ; lmp_chan_register_recv ( & chan -> channel , chan -> ws , MKCLOSURE ( ( void * ) spawn_recv_handler , args ) ) ; event_dispatch ( chan -> ws ) ; if ( RPC_DEBUG_SPAWN ) debug_printf ( " \n " ) ; return SYS_ERR_OK ; }
\brief Request process manager to start a new process
 \arg name the name of the process that needs to be spawned (without a
           path prefix)
 \arg newpid the process id of the newly spawned process
\ brief Request process manager to start a new process \ arg name the name of the process that needs to be spawned ( without a path prefix ) \ arg newpid the process id of the newly spawned process