Changeset 9a1b20c in mainline for kernel/generic/src/ipc/sysipc.c


Ignore:
Timestamp:
2008-09-17T12:16:27Z (16 years ago)
Author:
Jiri Svoboda <jirik.svoboda@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fb9b0b0
Parents:
06a195bc
Message:

Merge syscall tracer (trace) and relevant part of udebug interface from tracing to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/sysipc.c

    r06a195bc r9a1b20c  
    4343#include <ipc/irq.h>
    4444#include <ipc/ipcrsc.h>
     45#include <ipc/ipc_kbox.h>
     46#include <udebug/udebug_ipc.h>
    4547#include <arch/interrupt.h>
    4648#include <print.h>
     
    296298 *
    297299 * @param call          Call structure with the request.
     300 * @param phone         Phone that the call will be sent through.
    298301 *
    299302 * @return              Return 0 on success, ELIMIT or EPERM on error.
    300303 */
    301 static int request_preprocess(call_t *call)
     304static int request_preprocess(call_t *call, phone_t *phone)
    302305{
    303306        int newphid;
     
    341344                }
    342345                break;
     346#ifdef CONFIG_UDEBUG
     347        case IPC_M_DEBUG_ALL:
     348                return udebug_request_preprocess(call, phone);
     349#endif
    343350        default:
    344351                break;
     
    370377        if (call->buffer) {
    371378                /* This must be an affirmative answer to IPC_M_DATA_READ. */
     379                /* or IPC_M_DEBUG_ALL/UDEBUG_M_MEM_READ... */
    372380                uintptr_t dst = IPC_GET_ARG1(call->data);
    373381                size_t size = IPC_GET_ARG2(call->data);
     
    400408                }
    401409                IPC_SET_ARG5(call->data, phoneid);
    402         }
     410        }
     411        switch (IPC_GET_METHOD(call->data)) {
     412        case IPC_M_DEBUG_ALL:
     413                return -1;
     414        default:
     415                break;
     416        }
    403417        return 0;
    404418}
     
    442456        IPC_SET_ARG5(call.data, 0);
    443457
    444         if (!(res = request_preprocess(&call))) {
     458        if (!(res = request_preprocess(&call, phone))) {
    445459                rc = ipc_call_sync(phone, &call);
    446460                if (rc != EOK)
     
    482496        GET_CHECK_PHONE(phone, phoneid, return ENOENT);
    483497
    484         if (!(res = request_preprocess(&call))) {
     498        if (!(res = request_preprocess(&call, phone))) {
    485499                rc = ipc_call_sync(phone, &call);
    486500                if (rc != EOK)
     
    551565        IPC_SET_ARG5(call->data, 0);
    552566
    553         if (!(res = request_preprocess(call)))
     567        if (!(res = request_preprocess(call, phone)))
    554568                ipc_call(phone, call);
    555569        else
     
    585599                return (unative_t) rc;
    586600        }
    587         if (!(res = request_preprocess(call)))
     601        if (!(res = request_preprocess(call, phone)))
    588602                ipc_call(phone, call);
    589603        else
     
    869883}
    870884
     885#include <console/console.h>
     886
     887/**
     888 * Syscall connect to a task by id.
     889 *
     890 * @return              Phone id on success, or negative error code.
     891 */
     892unative_t sys_ipc_connect_kbox(sysarg64_t *uspace_taskid_arg)
     893{
     894#ifdef CONFIG_UDEBUG
     895        sysarg64_t taskid_arg;
     896        int rc;
     897       
     898        rc = copy_from_uspace(&taskid_arg, uspace_taskid_arg, sizeof(sysarg64_t));
     899        if (rc != 0)
     900                return (unative_t) rc;
     901
     902        printf("sys_ipc_connect_kbox(%lld, %d)\n", taskid_arg.value);
     903
     904        return ipc_connect_kbox(taskid_arg.value);
     905#else
     906        return (unative_t) ENOTSUP;
     907#endif
     908}
     909
    871910/** @}
    872911 */
Note: See TracChangeset for help on using the changeset viewer.