Changeset 41811af in mainline for uspace/lib/c/generic/udebug.c
- Timestamp:
- 2011-06-10T10:14:26Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ab547063
- Parents:
- 9536e6e (diff), 390d80d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/udebug.c
r9536e6e r41811af 35 35 #include <udebug.h> 36 36 #include <sys/types.h> 37 #include <kernel/ipc/ipc_methods.h> 37 38 #include <async.h> 38 39 39 int udebug_begin( int phoneid)40 int udebug_begin(async_sess_t *sess) 40 41 { 41 return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_BEGIN); 42 async_exch_t *exch = async_exchange_begin(sess); 43 return async_req_1_0(exch, IPC_M_DEBUG, UDEBUG_M_BEGIN); 42 44 } 43 45 44 int udebug_end( int phoneid)46 int udebug_end(async_sess_t *sess) 45 47 { 46 return async_req_1_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_END); 48 async_exch_t *exch = async_exchange_begin(sess); 49 return async_req_1_0(exch, IPC_M_DEBUG, UDEBUG_M_END); 47 50 } 48 51 49 int udebug_set_evmask( int phoneid, udebug_evmask_t mask)52 int udebug_set_evmask(async_sess_t *sess, udebug_evmask_t mask) 50 53 { 51 return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_SET_EVMASK,52 54 async_exch_t *exch = async_exchange_begin(sess); 55 return async_req_2_0(exch, IPC_M_DEBUG, UDEBUG_M_SET_EVMASK, mask); 53 56 } 54 57 55 int udebug_thread_read( int phoneid, void *buffer, size_t n,56 58 int udebug_thread_read(async_sess_t *sess, void *buffer, size_t n, 59 size_t *copied, size_t *needed) 57 60 { 58 61 sysarg_t a_copied, a_needed; 59 int rc;60 61 rc = async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_THREAD_READ,62 (sysarg_t)buffer, n, NULL, &a_copied, &a_needed);63 64 *copied = (size_t) a_copied;65 *needed = (size_t) a_needed;66 62 63 async_exch_t *exch = async_exchange_begin(sess); 64 int rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_THREAD_READ, 65 (sysarg_t) buffer, n, NULL, &a_copied, &a_needed); 66 67 *copied = (size_t) a_copied; 68 *needed = (size_t) a_needed; 69 67 70 return rc; 68 71 } 69 72 70 int udebug_name_read( int phoneid, void *buffer, size_t n,71 73 int udebug_name_read(async_sess_t *sess, void *buffer, size_t n, 74 size_t *copied, size_t *needed) 72 75 { 73 76 sysarg_t a_copied, a_needed; 74 int rc;75 76 rc = async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_NAME_READ,77 (sysarg_t)buffer, n, NULL, &a_copied, &a_needed);78 79 *copied = (size_t) a_copied;80 *needed = (size_t) a_needed;81 77 78 async_exch_t *exch = async_exchange_begin(sess); 79 int rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_NAME_READ, 80 (sysarg_t) buffer, n, NULL, &a_copied, &a_needed); 81 82 *copied = (size_t) a_copied; 83 *needed = (size_t) a_needed; 84 82 85 return rc; 83 86 } 84 87 85 int udebug_areas_read( int phoneid, void *buffer, size_t n,86 88 int udebug_areas_read(async_sess_t *sess, void *buffer, size_t n, 89 size_t *copied, size_t *needed) 87 90 { 88 91 sysarg_t a_copied, a_needed; 89 int rc;90 91 rc = async_req_3_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_AREAS_READ,92 (sysarg_t)buffer, n, NULL, &a_copied, &a_needed);93 94 *copied = (size_t) a_copied;95 *needed = (size_t) a_needed;96 92 93 async_exch_t *exch = async_exchange_begin(sess); 94 int rc = async_req_3_3(exch, IPC_M_DEBUG, UDEBUG_M_AREAS_READ, 95 (sysarg_t) buffer, n, NULL, &a_copied, &a_needed); 96 97 *copied = (size_t) a_copied; 98 *needed = (size_t) a_needed; 99 97 100 return rc; 98 101 } 99 102 100 int udebug_mem_read( int phoneid, void *buffer, uintptr_t addr, size_t n)103 int udebug_mem_read(async_sess_t *sess, void *buffer, uintptr_t addr, size_t n) 101 104 { 102 return async_req_4_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_MEM_READ, 103 (sysarg_t)buffer, addr, n); 105 async_exch_t *exch = async_exchange_begin(sess); 106 return async_req_4_0(exch, IPC_M_DEBUG, UDEBUG_M_MEM_READ, 107 (sysarg_t) buffer, addr, n); 104 108 } 105 109 106 int udebug_args_read( int phoneid, thash_t tid, sysarg_t *buffer)110 int udebug_args_read(async_sess_t *sess, thash_t tid, sysarg_t *buffer) 107 111 { 108 return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_ARGS_READ, 109 tid, (sysarg_t)buffer); 112 async_exch_t *exch = async_exchange_begin(sess); 113 return async_req_3_0(exch, IPC_M_DEBUG, UDEBUG_M_ARGS_READ, 114 tid, (sysarg_t) buffer); 110 115 } 111 116 112 int udebug_regs_read( int phoneid, thash_t tid, void *buffer)117 int udebug_regs_read(async_sess_t *sess, thash_t tid, void *buffer) 113 118 { 114 return async_req_3_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_REGS_READ, 115 tid, (sysarg_t)buffer); 119 async_exch_t *exch = async_exchange_begin(sess); 120 return async_req_3_0(exch, IPC_M_DEBUG, UDEBUG_M_REGS_READ, 121 tid, (sysarg_t) buffer); 116 122 } 117 123 118 int udebug_go( int phoneid, thash_t tid, udebug_event_t *ev_type,124 int udebug_go(async_sess_t *sess, thash_t tid, udebug_event_t *ev_type, 119 125 sysarg_t *val0, sysarg_t *val1) 120 126 { 121 127 sysarg_t a_ev_type; 122 int rc;123 124 rc = async_req_2_3(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_GO,128 129 async_exch_t *exch = async_exchange_begin(sess); 130 int rc = async_req_2_3(exch, IPC_M_DEBUG, UDEBUG_M_GO, 125 131 tid, &a_ev_type, val0, val1); 126 132 127 133 *ev_type = a_ev_type; 128 134 return rc; 129 135 } 130 136 131 int udebug_stop( int phoneid, thash_t tid)137 int udebug_stop(async_sess_t *sess, thash_t tid) 132 138 { 133 return async_req_2_0(phoneid, IPC_M_DEBUG_ALL, UDEBUG_M_STOP,134 139 async_exch_t *exch = async_exchange_begin(sess); 140 return async_req_2_0(exch, IPC_M_DEBUG, UDEBUG_M_STOP, tid); 135 141 } 136 142
Note:
See TracChangeset
for help on using the changeset viewer.