Changeset 13dbaa8c in mainline for kernel/generic/src/ipc/ops/debug.c


Ignore:
Timestamp:
2012-08-21T21:37:54Z (12 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b1e6269
Parents:
1b186ed
Message:

Factor out dealing with call→buffer from process_answer() to
respective IPC_M_CONNECT_ME_TO and IPC_M_DEBUG ops routines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/ops/debug.c

    r1b186ed r13dbaa8c  
    3636#include <ipc/ipc.h>
    3737#include <udebug/udebug_ipc.h>
     38#include <syscall/copy.h>
     39#include <abi/errno.h>
    3840
    3941static int request_process(call_t *call, answerbox_t *box)
    4042{
    4143        return -1;
     44}
     45
     46static int answer_process(call_t *answer)
     47{
     48        if (answer->buffer) {
     49                uintptr_t dst = IPC_GET_ARG1(answer->data);
     50                size_t size = IPC_GET_ARG2(answer->data);
     51                int rc;
     52
     53                rc = copy_to_uspace((void *) dst, answer->buffer, size);
     54                if (rc)
     55                        IPC_SET_RETVAL(answer->data, rc);
     56        }
     57
     58        return EOK;
    4259}
    4360
     
    5067        .request_process = request_process,
    5168        .answer_preprocess = null_answer_preprocess,
    52         .answer_process = null_answer_process,
     69        .answer_process = answer_process,
    5370};
    5471
Note: See TracChangeset for help on using the changeset viewer.