Ignore:
Timestamp:
2012-08-20T23:21:41Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0343a1b
Parents:
642dc72
Message:

Separate system IPC logic into dedicated ops structure hooks.

File:
1 edited

Legend:

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

    r642dc72 re8039a86  
    3434
    3535#include <ipc/sysipc_ops.h>
     36#include <ipc/ipc.h>
     37#include <mm/as.h>
     38#include <synch/spinlock.h>
     39#include <proc/task.h>
     40#include <abi/errno.h>
     41#include <arch.h>
     42
     43static int answer_preprocess(call_t *answer, ipc_data_t *olddata)
     44{
     45        if (!IPC_GET_RETVAL(answer->data)) {
     46                irq_spinlock_lock(&answer->sender->lock, true);
     47                as_t *as = answer->sender->as;
     48                irq_spinlock_unlock(&answer->sender->lock, true);
     49                       
     50                uintptr_t dst_base = (uintptr_t) -1;
     51                int rc = as_area_share(AS, IPC_GET_ARG1(answer->data),
     52                    IPC_GET_ARG1(*olddata), as, IPC_GET_ARG2(answer->data),
     53                    &dst_base, IPC_GET_ARG3(answer->data));
     54                IPC_SET_ARG4(answer->data, dst_base);
     55                IPC_SET_RETVAL(answer->data, rc);
     56        }
     57       
     58        return EOK;
     59}
    3660
    3761sysipc_ops_t ipc_m_share_in_ops = {
    3862        .request_preprocess = null_request_preprocess,
    3963        .request_process = null_request_process,
    40         .answer_preprocess = null_answer_preprocess,
     64        .answer_preprocess = answer_preprocess,
    4165        .answer_process = null_answer_process,
    4266};
Note: See TracChangeset for help on using the changeset viewer.