source: mainline/kernel/generic/src/ipc/sysipc_ops.c@ eca820c

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since eca820c was 37e8c4a, checked in by jzr <zarevucky.jiri@…>, 8 years ago

Disallow common symbols. They are never needed.

  • Property mode set to 100644
File size: 3.3 KB
Line 
1/*
2 * Copyright (c) 2012 Jakub Jermar
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
29/** @addtogroup genericipc
30 * @{
31 */
32/** @file
33 */
34
35#include <ipc/sysipc_ops.h>
36#include <abi/ipc/methods.h>
37#include <abi/errno.h>
38
39/* Forward declarations. */
40extern sysipc_ops_t ipc_m_connect_to_me_ops;
41extern sysipc_ops_t ipc_m_connect_me_to_ops;
42extern sysipc_ops_t ipc_m_page_in_ops;
43extern sysipc_ops_t ipc_m_share_out_ops;
44extern sysipc_ops_t ipc_m_share_in_ops;
45extern sysipc_ops_t ipc_m_data_write_ops;
46extern sysipc_ops_t ipc_m_data_read_ops;
47extern sysipc_ops_t ipc_m_state_change_authorize_ops;
48extern sysipc_ops_t ipc_m_debug_ops;
49
50static sysipc_ops_t *sysipc_ops[] = {
51 [IPC_M_CONNECT_TO_ME] = &ipc_m_connect_to_me_ops,
52 [IPC_M_CONNECT_ME_TO] = &ipc_m_connect_me_to_ops,
53 [IPC_M_PAGE_IN] = &ipc_m_page_in_ops,
54 [IPC_M_SHARE_OUT] = &ipc_m_share_out_ops,
55 [IPC_M_SHARE_IN] = &ipc_m_share_in_ops,
56 [IPC_M_DATA_WRITE] = &ipc_m_data_write_ops,
57 [IPC_M_DATA_READ] = &ipc_m_data_read_ops,
58 [IPC_M_STATE_CHANGE_AUTHORIZE] = &ipc_m_state_change_authorize_ops,
59 [IPC_M_DEBUG] = &ipc_m_debug_ops
60};
61
62static sysipc_ops_t null_ops = {
63 .request_preprocess = null_request_preprocess,
64 .request_forget = null_request_forget,
65 .request_process = null_request_process,
66 .answer_cleanup = null_answer_cleanup,
67 .answer_preprocess = null_answer_preprocess,
68 .answer_process = null_answer_process,
69};
70
71int null_request_preprocess(call_t *call, phone_t *phone)
72{
73 return EOK;
74}
75
76int null_request_forget(call_t *call)
77{
78 return EOK;
79}
80
81int null_request_process(call_t *call, answerbox_t *box)
82{
83 return EOK;
84}
85
86int null_answer_cleanup(call_t *call, ipc_data_t *data)
87{
88 return EOK;
89}
90
91int null_answer_preprocess(call_t *call, ipc_data_t *data)
92{
93 return EOK;
94}
95
96int null_answer_process(call_t *call)
97{
98 return EOK;
99}
100
101sysipc_ops_t *sysipc_ops_get(sysarg_t imethod)
102{
103 if (imethod < sizeof(sysipc_ops) / (sizeof(sysipc_ops_t *)))
104 return sysipc_ops[imethod] ? sysipc_ops[imethod] : &null_ops;
105
106 return &null_ops;
107}
108
109/** @}
110 */
Note: See TracBrowser for help on using the repository browser.