source: mainline/kernel/generic/src/udebug/udebug_ops.c

Last change on this file was dfa4be62, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 17 months ago

Thread lock is no longer necessary

  • Property mode set to 100644
File size: 15.4 KB
RevLine 
[9a1b20c]1/*
2 * Copyright (c) 2008 Jiri Svoboda
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
[174156fd]29/** @addtogroup kernel_generic
[9a1b20c]30 * @{
31 */
32
33/**
34 * @file
[da1bafb]35 * @brief Udebug operations.
[7dc62af]36 *
37 * Udebug operations on tasks and threads are implemented here. The
38 * functions defined here are called from the udebug_ipc module
39 * when servicing udebug IPC messages.
[9a1b20c]40 */
[da1bafb]41
[0108984a]42#include <debug.h>
[9a1b20c]43#include <proc/task.h>
44#include <proc/thread.h>
45#include <arch.h>
46#include <errno.h>
[b2a1fd92]47#include <stdbool.h>
[19f857a]48#include <str.h>
[9a1b20c]49#include <syscall/copy.h>
50#include <ipc/ipc.h>
51#include <udebug/udebug.h>
52#include <udebug/udebug_ops.h>
[b169619]53#include <memw.h>
[aafed15]54#include <stdlib.h>
[9a1b20c]55
[da1bafb]56/** Prepare a thread for a debugging operation.
[9a1b20c]57 *
58 * Simply put, return thread t with t->udebug.lock held,
59 * but only if it verifies all conditions.
60 *
61 * Specifically, verifies that thread t exists, is a userspace thread,
62 * and belongs to the current task (TASK). Verifies, that the thread
[1378b2b]63 * is (or is not) go according to being_go (typically false).
[8af9950]64 * It also locks t->udebug.lock, making sure that t->udebug.active
[9a1b20c]65 * is true - that the thread is in a valid debugging session.
66 *
67 * With this verified and the t->udebug.lock mutex held, it is ensured
68 * that the thread cannot leave the debugging session, let alone cease
69 * to exist.
70 *
71 * In this function, holding the TASK->udebug.lock mutex prevents the
72 * thread from leaving the debugging session, while relaxing from
73 * the t->lock spinlock to the t->udebug.lock mutex.
74 *
[da1bafb]75 * @param thread Pointer, need not at all be valid.
76 * @param being_go Required thread state.
[7dc62af]77 *
[9a1b20c]78 * Returns EOK if all went well, or an error code otherwise.
[da1bafb]79 *
[9a1b20c]80 */
[b7fd2a0]81static errno_t _thread_op_begin(thread_t *thread, bool being_go)
[9a1b20c]82{
83 mutex_lock(&TASK->udebug.lock);
[a35b458]84
[1871118]85 thread = thread_try_get(thread);
[a35b458]86
[1871118]87 if (!thread) {
[9a1b20c]88 mutex_unlock(&TASK->udebug.lock);
89 return ENOENT;
90 }
[a35b458]91
[da1bafb]92 /* Verify that 'thread' is a userspace thread. */
[6eef3c4]93 if (!thread->uspace) {
[9a1b20c]94 mutex_unlock(&TASK->udebug.lock);
95 return ENOENT;
96 }
[a35b458]97
[dfa4be62]98 /*
99 * Now we need to grab the thread's debug lock for synchronization
100 * of the threads stoppability/stop state.
101 *
102 */
103 mutex_lock(&thread->udebug.lock);
104
[1378b2b]105 /* Verify debugging state. */
[da1bafb]106 if (thread->udebug.active != true) {
[9a1b20c]107 /* Not in debugging session or undesired GO state */
[dfa4be62]108 mutex_unlock(&thread->udebug.lock);
[9a1b20c]109 mutex_unlock(&TASK->udebug.lock);
110 return ENOENT;
111 }
[a35b458]112
[1378b2b]113 /* Now verify that the thread belongs to the current task. */
[da1bafb]114 if (thread->task != TASK) {
[d1582b50]115 /* No such thread belonging this task */
[dfa4be62]116 mutex_unlock(&thread->udebug.lock);
[9a1b20c]117 mutex_unlock(&TASK->udebug.lock);
118 return ENOENT;
119 }
[a35b458]120
[1378b2b]121 /* The big task mutex is no longer needed. */
[9a1b20c]122 mutex_unlock(&TASK->udebug.lock);
[a35b458]123
[da1bafb]124 if (thread->udebug.go != being_go) {
[1378b2b]125 /* Not in debugging session or undesired GO state. */
[da1bafb]126 mutex_unlock(&thread->udebug.lock);
[9a1b20c]127 return EINVAL;
128 }
[a35b458]129
[da1bafb]130 /* Only thread->udebug.lock left. */
[a35b458]131
[da1bafb]132 return EOK; /* All went well. */
[9a1b20c]133}
134
[7dc62af]135/** End debugging operation on a thread. */
[da1bafb]136static void _thread_op_end(thread_t *thread)
[9a1b20c]137{
[da1bafb]138 mutex_unlock(&thread->udebug.lock);
[1871118]139
140 /* Drop reference from _thread_op_begin() */
141 thread_put(thread);
[9a1b20c]142}
143
[7dc62af]144/** Begin debugging the current task.
145 *
146 * Initiates a debugging session for the current task (and its threads).
[b2a1fd92]147 * When the debugging session has started a reply should be sent to the
[7dc62af]148 * UDEBUG_BEGIN call. This may happen immediately in this function if
149 * all the threads in this task are stoppable at the moment and in this
[b2a1fd92]150 * case the function sets @a *active to @c true.
[7dc62af]151 *
[b2a1fd92]152 * Otherwise the function sets @a *active to false and the resonse should
153 * be sent as soon as all the threads become stoppable (i.e. they can be
154 * considered stopped).
[7dc62af]155 *
[da1bafb]156 * @param call The BEGIN call we are servicing.
[b2a1fd92]157 * @param active Place to store @c true iff we went directly to active state,
158 * @c false if we only went to beginning state
[da1bafb]159 *
[b2a1fd92]160 * @return EOK on success, EBUSY if the task is already has an active
161 * debugging session.
[9a1b20c]162 */
[b7fd2a0]163errno_t udebug_begin(call_t *call, bool *active)
[9a1b20c]164{
[da1bafb]165 LOG("Debugging task %" PRIu64, TASK->taskid);
[a35b458]166
[9a1b20c]167 mutex_lock(&TASK->udebug.lock);
[a35b458]168
[9a1b20c]169 if (TASK->udebug.dt_state != UDEBUG_TS_INACTIVE) {
170 mutex_unlock(&TASK->udebug.lock);
171 return EBUSY;
172 }
[a35b458]173
[9a1b20c]174 TASK->udebug.dt_state = UDEBUG_TS_BEGINNING;
175 TASK->udebug.begin_call = call;
176 TASK->udebug.debugger = call->sender;
[a35b458]177
[bd253241]178 if (TASK->udebug.not_stoppable_count == 0) {
179 TASK->udebug.dt_state = UDEBUG_TS_ACTIVE;
180 TASK->udebug.begin_call = NULL;
[b2a1fd92]181 *active = true; /* directly to active state */
[bd253241]182 } else
[b2a1fd92]183 *active = false; /* only in beginning state */
[a35b458]184
[8af9950]185 /* Set udebug.active on all of the task's userspace threads. */
[a35b458]186
[feeac0d]187 list_foreach(TASK->threads, th_link, thread_t, thread) {
[da1bafb]188 mutex_lock(&thread->udebug.lock);
[6eef3c4]189 if (thread->uspace) {
[da1bafb]190 thread->udebug.active = true;
191 mutex_unlock(&thread->udebug.lock);
192 condvar_broadcast(&thread->udebug.active_cv);
193 } else
194 mutex_unlock(&thread->udebug.lock);
[9a1b20c]195 }
[a35b458]196
[9a1b20c]197 mutex_unlock(&TASK->udebug.lock);
[b2a1fd92]198 return EOK;
[9a1b20c]199}
200
[7dc62af]201/** Finish debugging the current task.
202 *
203 * Closes the debugging session for the current task.
[da1bafb]204 *
[cde999a]205 * @return Zero on success or an error code.
[da1bafb]206 *
[7dc62af]207 */
[b7fd2a0]208errno_t udebug_end(void)
[9a1b20c]209{
[ae5aa90]210 LOG("Task %" PRIu64, TASK->taskid);
[a35b458]211
[9a1b20c]212 mutex_lock(&TASK->udebug.lock);
[b7fd2a0]213 errno_t rc = udebug_task_cleanup(TASK);
[9a1b20c]214 mutex_unlock(&TASK->udebug.lock);
[a35b458]215
[9a1b20c]216 return rc;
217}
218
[7dc62af]219/** Set the event mask.
220 *
221 * Sets the event mask that determines which events are enabled.
222 *
[da1bafb]223 * @param mask Or combination of events that should be enabled.
224 *
[cde999a]225 * @return Zero on success or an error code.
[da1bafb]226 *
[7dc62af]227 */
[b7fd2a0]228errno_t udebug_set_evmask(udebug_evmask_t mask)
[9a1b20c]229{
[ae5aa90]230 LOG("mask = 0x%x", mask);
[a35b458]231
[9a1b20c]232 mutex_lock(&TASK->udebug.lock);
[a35b458]233
[9a1b20c]234 if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) {
235 mutex_unlock(&TASK->udebug.lock);
236 return EINVAL;
237 }
[a35b458]238
[9a1b20c]239 TASK->udebug.evmask = mask;
240 mutex_unlock(&TASK->udebug.lock);
[a35b458]241
[7f11dc6]242 return EOK;
[9a1b20c]243}
244
[7dc62af]245/** Give thread GO.
246 *
[1378b2b]247 * Upon recieving a go message, the thread is given GO. Being GO
[7dc62af]248 * means the thread is allowed to execute userspace code (until
249 * a debugging event or STOP occurs, at which point the thread loses GO.
250 *
[da1bafb]251 * @param thread The thread to operate on (unlocked and need not be valid).
252 * @param call The GO call that we are servicing.
253 *
[7dc62af]254 */
[b7fd2a0]255errno_t udebug_go(thread_t *thread, call_t *call)
[9a1b20c]256{
[da1bafb]257 /* On success, this will lock thread->udebug.lock. */
[b7fd2a0]258 errno_t rc = _thread_op_begin(thread, false);
[da1bafb]259 if (rc != EOK)
[9a1b20c]260 return rc;
[a35b458]261
[da1bafb]262 thread->udebug.go_call = call;
263 thread->udebug.go = true;
264 thread->udebug.cur_event = 0; /* none */
[a35b458]265
[9a1b20c]266 /*
[da1bafb]267 * Neither thread's lock nor threads_lock may be held during wakeup.
268 *
[9a1b20c]269 */
[111b9b9]270 waitq_wake_all(&thread->udebug.go_wq);
[a35b458]271
[da1bafb]272 _thread_op_end(thread);
[a35b458]273
[7f11dc6]274 return EOK;
[9a1b20c]275}
276
[7dc62af]277/** Stop a thread (i.e. take its GO away)
278 *
279 * Generates a STOP event as soon as the thread becomes stoppable (i.e.
280 * can be considered stopped).
281 *
[da1bafb]282 * @param thread The thread to operate on (unlocked and need not be valid).
283 * @param call The GO call that we are servicing.
284 *
[7dc62af]285 */
[b7fd2a0]286errno_t udebug_stop(thread_t *thread, call_t *call)
[9a1b20c]287{
[ae5aa90]288 LOG("udebug_stop()");
[a35b458]289
[9a1b20c]290 /*
[da1bafb]291 * On success, this will lock thread->udebug.lock. Note that this
292 * makes sure the thread is not stopped.
293 *
[9a1b20c]294 */
[b7fd2a0]295 errno_t rc = _thread_op_begin(thread, true);
[da1bafb]296 if (rc != EOK)
[9a1b20c]297 return rc;
[a35b458]298
[1378b2b]299 /* Take GO away from the thread. */
[da1bafb]300 thread->udebug.go = false;
[a35b458]301
[da1bafb]302 if (thread->udebug.stoppable != true) {
[1378b2b]303 /* Answer will be sent when the thread becomes stoppable. */
[da1bafb]304 _thread_op_end(thread);
[7f11dc6]305 return EOK;
[9a1b20c]306 }
[a35b458]307
[9a1b20c]308 /*
[1378b2b]309 * Answer GO call.
[da1bafb]310 *
[9a1b20c]311 */
[a35b458]312
[1378b2b]313 /* Make sure nobody takes this call away from us. */
[da1bafb]314 call = thread->udebug.go_call;
315 thread->udebug.go_call = NULL;
[a35b458]316
[fafb8e5]317 ipc_set_retval(&call->data, 0);
318 ipc_set_arg1(&call->data, UDEBUG_EVENT_STOP);
[a35b458]319
[9a1b20c]320 THREAD->udebug.cur_event = UDEBUG_EVENT_STOP;
[a35b458]321
[da1bafb]322 _thread_op_end(thread);
[a35b458]323
[741fd16]324 mutex_lock(&TASK->udebug.lock);
[9a1b20c]325 ipc_answer(&TASK->answerbox, call);
326 mutex_unlock(&TASK->udebug.lock);
[a35b458]327
[7f11dc6]328 return EOK;
[9a1b20c]329}
330
[7dc62af]331/** Read the list of userspace threads in the current task.
332 *
333 * The list takes the form of a sequence of thread hashes (i.e. the pointers
334 * to thread structures). A buffer of size @a buf_size is allocated and
335 * a pointer to it written to @a buffer. The sequence of hashes is written
336 * into this buffer.
337 *
338 * If the sequence is longer than @a buf_size bytes, only as much hashes
[336db295]339 * as can fit are copied. The number of bytes copied is stored in @a stored.
340 * The total number of thread bytes that could have been saved had there been
341 * enough space is stored in @a needed.
[7dc62af]342 *
343 * The rationale for having @a buf_size is that this function is only
344 * used for servicing the THREAD_READ message, which always specifies
345 * a maximum size for the userspace buffer.
346 *
[da1bafb]347 * @param buffer The buffer for storing thread hashes.
348 * @param buf_size Buffer size in bytes.
349 * @param stored The actual number of bytes copied will be stored here.
350 * @param needed Total number of hashes that could have been saved.
351 *
[7dc62af]352 */
[b7fd2a0]353errno_t udebug_thread_read(void **buffer, size_t buf_size, size_t *stored,
[336db295]354 size_t *needed)
[9a1b20c]355{
[ae5aa90]356 LOG("udebug_thread_read()");
[a35b458]357
[9a1b20c]358 /* Allocate a buffer to hold thread IDs */
[11b285d]359 sysarg_t *id_buffer = malloc(buf_size + 1);
[7473807]360 if (!id_buffer)
361 return ENOMEM;
[a35b458]362
[9a1b20c]363 mutex_lock(&TASK->udebug.lock);
[a35b458]364
[9a1b20c]365 /* Verify task state */
366 if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) {
367 mutex_unlock(&TASK->udebug.lock);
[87a2f9b]368 free(id_buffer);
[9a1b20c]369 return EINVAL;
370 }
[a35b458]371
[da1bafb]372 irq_spinlock_lock(&TASK->lock, true);
[a35b458]373
[9a1b20c]374 /* Copy down the thread IDs */
[a35b458]375
[96b02eb9]376 size_t max_ids = buf_size / sizeof(sysarg_t);
[da1bafb]377 size_t copied_ids = 0;
378 size_t extra_ids = 0;
[a35b458]379
[9a1b20c]380 /* FIXME: make sure the thread isn't past debug shutdown... */
[feeac0d]381 list_foreach(TASK->threads, th_link, thread_t, thread) {
[6eef3c4]382 bool uspace = thread->uspace;
[a35b458]383
[1378b2b]384 /* Not interested in kernel threads. */
[6eef3c4]385 if (!uspace)
[336db295]386 continue;
[a35b458]387
[336db295]388 if (copied_ids < max_ids) {
[9a1b20c]389 /* Using thread struct pointer as identification hash */
[96b02eb9]390 id_buffer[copied_ids++] = (sysarg_t) thread;
[da1bafb]391 } else
[336db295]392 extra_ids++;
[9a1b20c]393 }
[a35b458]394
[da1bafb]395 irq_spinlock_unlock(&TASK->lock, true);
[a35b458]396
[9a1b20c]397 mutex_unlock(&TASK->udebug.lock);
[a35b458]398
[9a1b20c]399 *buffer = id_buffer;
[96b02eb9]400 *stored = copied_ids * sizeof(sysarg_t);
401 *needed = (copied_ids + extra_ids) * sizeof(sysarg_t);
[a35b458]402
[7f11dc6]403 return EOK;
[9a1b20c]404}
405
[3698e44]406/** Read task name.
407 *
408 * Returns task name as non-terminated string in a newly allocated buffer.
409 * Also returns the size of the data.
410 *
[da1bafb]411 * @param data Place to store pointer to newly allocated block.
412 * @param data_size Place to store size of the data.
413 *
[fa603e99]414 * @return EOK on success, ENOMEM if memory allocation failed.
[3698e44]415 *
416 */
[b7fd2a0]417errno_t udebug_name_read(char **data, size_t *data_size)
[3698e44]418{
[da1bafb]419 size_t name_size = str_size(TASK->name) + 1;
[a35b458]420
[11b285d]421 *data = malloc(name_size);
[7473807]422 if (!*data)
423 return ENOMEM;
[3698e44]424 *data_size = name_size;
[a35b458]425
[3698e44]426 memcpy(*data, TASK->name, name_size);
[a35b458]427
[7f11dc6]428 return EOK;
[3698e44]429}
430
[7dc62af]431/** Read the arguments of a system call.
432 *
433 * The arguments of the system call being being executed are copied
434 * to an allocated buffer and a pointer to it is written to @a buffer.
435 * The size of the buffer is exactly such that it can hold the maximum number
436 * of system-call arguments.
437 *
438 * Unless the thread is currently blocked in a SYSCALL_B or SYSCALL_E event,
439 * this function will fail with an EINVAL error code.
440 *
[da1bafb]441 * @param thread Thread where call arguments are to be read.
442 * @param buffer Place to store pointer to new buffer.
443 *
444 * @return EOK on success, ENOENT if @a t is invalid, EINVAL
445 * if thread state is not valid for this operation.
446 *
[7dc62af]447 */
[b7fd2a0]448errno_t udebug_args_read(thread_t *thread, void **buffer)
[9a1b20c]449{
[1378b2b]450 /* On success, this will lock t->udebug.lock. */
[b7fd2a0]451 errno_t rc = _thread_op_begin(thread, false);
[da1bafb]452 if (rc != EOK)
[9a1b20c]453 return rc;
[a35b458]454
[1378b2b]455 /* Additionally we need to verify that we are inside a syscall. */
[da1bafb]456 if ((thread->udebug.cur_event != UDEBUG_EVENT_SYSCALL_B) &&
457 (thread->udebug.cur_event != UDEBUG_EVENT_SYSCALL_E)) {
458 _thread_op_end(thread);
[9a1b20c]459 return EINVAL;
460 }
[a35b458]461
[87a2f9b]462 /* Prepare a buffer to hold the arguments. */
[11b285d]463 sysarg_t *arg_buffer = malloc(6 * sizeof(sysarg_t));
[7473807]464 if (!arg_buffer) {
465 _thread_op_end(thread);
466 return ENOMEM;
467 }
[a35b458]468
[1378b2b]469 /* Copy to a local buffer before releasing the lock. */
[96b02eb9]470 memcpy(arg_buffer, thread->udebug.syscall_args, 6 * sizeof(sysarg_t));
[a35b458]471
[da1bafb]472 _thread_op_end(thread);
[a35b458]473
[9a1b20c]474 *buffer = arg_buffer;
[7f11dc6]475 return EOK;
[9a1b20c]476}
477
[80487bc5]478/** Read the register state of the thread.
479 *
480 * The contents of the thread's istate structure are copied to a newly
481 * allocated buffer and a pointer to it is written to @a buffer. The size of
482 * the buffer will be sizeof(istate_t).
483 *
484 * Currently register state cannot be read if the thread is inside a system
485 * call (as opposed to an exception). This is an implementation limit.
486 *
[da1bafb]487 * @param thread Thread whose state is to be read.
488 * @param buffer Place to store pointer to new buffer.
489 *
490 * @return EOK on success, ENOENT if @a t is invalid, EINVAL
491 * if thread is not in valid state, EBUSY if istate
492 * is not available.
493 *
[80487bc5]494 */
[b7fd2a0]495errno_t udebug_regs_read(thread_t *thread, void **buffer)
[80487bc5]496{
497 /* On success, this will lock t->udebug.lock */
[b7fd2a0]498 errno_t rc = _thread_op_begin(thread, false);
[da1bafb]499 if (rc != EOK)
[80487bc5]500 return rc;
[a35b458]501
[da1bafb]502 istate_t *state = thread->udebug.uspace_state;
[80487bc5]503 if (state == NULL) {
[da1bafb]504 _thread_op_end(thread);
[80487bc5]505 return EBUSY;
506 }
[a35b458]507
[87a2f9b]508 /* Prepare a buffer to hold the data. */
[11b285d]509 istate_t *state_buf = malloc(sizeof(istate_t));
[7473807]510 if (!state_buf) {
511 _thread_op_end(thread);
512 return ENOMEM;
513 }
[a35b458]514
[80487bc5]515 /* Copy to the allocated buffer */
516 memcpy(state_buf, state, sizeof(istate_t));
[a35b458]517
[da1bafb]518 _thread_op_end(thread);
[a35b458]519
[80487bc5]520 *buffer = (void *) state_buf;
[7f11dc6]521 return EOK;
[80487bc5]522}
523
[7dc62af]524/** Read the memory of the debugged task.
525 *
526 * Reads @a n bytes from the address space of the debugged task, starting
527 * from @a uspace_addr. The bytes are copied into an allocated buffer
528 * and a pointer to it is written into @a buffer.
529 *
[da1bafb]530 * @param uspace_addr Address from where to start reading.
531 * @param n Number of bytes to read.
532 * @param buffer For storing a pointer to the allocated buffer.
533 *
[7dc62af]534 */
[5a5269d]535errno_t udebug_mem_read(uspace_addr_t uspace_addr, size_t n, void **buffer)
[9a1b20c]536{
537 /* Verify task state */
538 mutex_lock(&TASK->udebug.lock);
[a35b458]539
[9a1b20c]540 if (TASK->udebug.dt_state != UDEBUG_TS_ACTIVE) {
541 mutex_unlock(&TASK->udebug.lock);
542 return EBUSY;
543 }
[a35b458]544
[11b285d]545 void *data_buffer = malloc(n);
[7473807]546 if (!data_buffer) {
547 mutex_unlock(&TASK->udebug.lock);
548 return ENOMEM;
549 }
[a35b458]550
[da1bafb]551 /*
552 * NOTE: this is not strictly from a syscall... but that shouldn't
553 * be a problem
554 *
555 */
[5a5269d]556 errno_t rc = copy_from_uspace(data_buffer, uspace_addr, n);
[9a1b20c]557 mutex_unlock(&TASK->udebug.lock);
[a35b458]558
[a53ed3a]559 if (rc != EOK)
[da1bafb]560 return rc;
[a35b458]561
[9a1b20c]562 *buffer = data_buffer;
[7f11dc6]563 return EOK;
[9a1b20c]564}
565
566/** @}
567 */
Note: See TracBrowser for help on using the repository browser.