/branches/tracing/uspace/app/sctrace/ipcp.h |
---|
18,6 → 18,9 |
void ipcp_call_in(ipc_call_t *call, ipc_callid_t hash); |
void ipcp_hangup(int phone, int rc); |
void ipcp_connection_set(int phone, int server, proto_t *proto); |
void ipcp_connection_clear(int phone); |
#endif |
/** @} |
/branches/tracing/uspace/app/sctrace/sctrace.c |
---|
18,6 → 18,7 |
#include "proto.h" |
#include <ipc/services.h> |
#include "../../srv/vfs/vfs.h" |
#include "../../srv/console/console.h" |
#include "syscalls.h" |
#include "ipcp.h" |
35,6 → 36,7 |
void thread_trace_start(unsigned thread_hash); |
static proto_t *proto_console; |
int task_connect(int taskid) |
{ |
350,6 → 352,7 |
printf("Connected to task %d\n", taskid); |
ipcp_init(); |
ipcp_connection_set(1, 0, proto_console); |
rc = get_thread_list(); |
if (rc < 0) { |
392,6 → 395,14 |
proto_add_oper(p, VFS_MOUNT, o); |
proto_register(SERVICE_VFS, p); |
p = proto_new("console"); |
o = malloc(sizeof(oper_t)); |
o->name = "putchar"; |
proto_add_oper(p, CONSOLE_PUTCHAR, o); |
proto_console = p; |
proto_register(SERVICE_CONSOLE, p); |
} |
int main(void) |
/branches/tracing/uspace/app/sctrace/ipcp.c |
---|
63,7 → 63,7 |
.remove_callback = pending_call_remove_callback |
}; |
static void connection_set(int phone, int server, proto_t *proto) |
void ipcp_connection_set(int phone, int server, proto_t *proto) |
{ |
if (phone <0 || phone >= MAX_PHONE) return; |
connections[phone].server = server; |
71,7 → 71,7 |
have_conn[phone] = 1; |
} |
static void connection_clear(int phone) |
void ipcp_connection_clear(int phone) |
{ |
have_conn[phone] = 0; |
connections[phone].server = 0; |
172,7 → 172,7 |
cphone = IPC_GET_ARG5(*answer); |
printf("registering connection (phone %d, protocol: %s)\n", cphone, |
proto->name); |
connection_set(cphone, 0, proto); |
ipcp_connection_set(cphone, 0, proto); |
} |
} |
221,7 → 221,7 |
void ipcp_hangup(int phone, int rc) |
{ |
printf("hangup phone %d -> %d\n", phone, rc); |
connection_clear(phone); |
ipcp_connection_clear(phone); |
} |
/** @} |