source: mainline/abi/include/ipc/methods.h@ c0699467

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since c0699467 was c0699467, checked in by Martin Decky <martin@…>, 14 years ago

do not provide general access to kernel headers from uspace, only allow specific headers to be accessed or shared
externalize headers which serve as kernel/uspace API/ABI into a special tree

  • Property mode set to 100644
File size: 6.0 KB
Line 
1/*
2 * Copyright (c) 2006 Ondrej Palkovsky
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#ifndef ABI_IPC_METHODS_H_
36#define ABI_IPC_METHODS_H_
37
38/* Well known phone descriptors */
39#define PHONE_NS 0
40
41/** Kernel IPC interfaces
42 *
43 */
44#define IPC_IF_KERNEL 0
45
46/** System-specific IPC methods
47 *
48 * These methods have special behaviour. These methods also
49 * have the implicit kernel interface zero (0).
50 *
51 */
52
53/** This message is sent to answerbox when the phone is hung up
54 *
55 * The numerical value zero (0) of this method is important,
56 * so as the value can be easily tested in conditions.
57 *
58 */
59#define IPC_M_PHONE_HUNGUP 0
60
61/** Clone connection.
62 *
63 * The calling task clones one of its phones for the callee.
64 *
65 * - ARG1 - The caller sets ARG1 to the phone of the cloned connection.
66 * - The callee gets the new phone from ARG1.
67 *
68 * - on answer, the callee acknowledges the new connection by sending EOK back
69 * or the kernel closes it
70 *
71 */
72#define IPC_M_CONNECTION_CLONE 1
73
74/** Protocol for CONNECT - ME
75 *
76 * Through this call, the recipient learns about the new cloned connection.
77 *
78 * - ARG5 - the kernel sets ARG5 to contain the hash of the used phone
79 * - on answer, the callee acknowledges the new connection by sending EOK back
80 * or the kernel closes it
81 *
82 */
83#define IPC_M_CONNECT_ME 2
84
85/** Protocol for CONNECT - TO - ME
86 *
87 * Calling process asks the callee to create a callback connection,
88 * so that it can start initiating new messages.
89 *
90 * The protocol for negotiating is:
91 * - sys_connect_to_me - sends a message IPC_M_CONNECT_TO_ME
92 * - recipient - upon receipt tries to allocate new phone
93 * - if it fails, responds with ELIMIT
94 * - passes call to userspace. If userspace
95 * responds with error, phone is deallocated and
96 * error is sent back to caller. Otherwise
97 * the call is accepted and the response is sent back.
98 * - the hash of the client task is passed to userspace
99 * (on the receiving side) as ARG4 of the call.
100 * - the hash of the allocated phone is passed to userspace
101 * (on the receiving side) as ARG5 of the call.
102 *
103 */
104#define IPC_M_CONNECT_TO_ME 3
105
106/** Protocol for CONNECT - ME - TO
107 *
108 * Calling process asks the callee to create for him a new connection.
109 * E.g. the caller wants a name server to connect him to print server.
110 *
111 * The protocol for negotiating is:
112 * - sys_connect_me_to - send a synchronous message to name server
113 * indicating that it wants to be connected to some
114 * service
115 * - arg1/2/3 are user specified, arg5 contains
116 * address of the phone that should be connected
117 * (TODO: it leaks to userspace)
118 * - recipient - if ipc_answer == 0, then accept connection
119 * - otherwise connection refused
120 * - recepient may forward message.
121 *
122 */
123#define IPC_M_CONNECT_ME_TO 4
124
125/** Send as_area over IPC.
126 * - ARG1 - source as_area base address
127 * - ARG2 - size of source as_area (filled automatically by kernel)
128 * - ARG3 - flags of the as_area being sent
129 *
130 * on answer, the recipient must set:
131 * - ARG1 - dst as_area base adress
132 *
133 */
134#define IPC_M_SHARE_OUT 5
135
136/** Receive as_area over IPC.
137 * - ARG1 - destination as_area base address
138 * - ARG2 - destination as_area size
139 * - ARG3 - user defined argument
140 *
141 * on answer, the recipient must set:
142 *
143 * - ARG1 - source as_area base address
144 * - ARG2 - flags that will be used for sharing
145 *
146 */
147#define IPC_M_SHARE_IN 6
148
149/** Send data to another address space over IPC.
150 * - ARG1 - source address space virtual address
151 * - ARG2 - size of data to be copied, may be overriden by the recipient
152 *
153 * on answer, the recipient must set:
154 *
155 * - ARG1 - final destination address space virtual address
156 * - ARG2 - final size of data to be copied
157 *
158 */
159#define IPC_M_DATA_WRITE 7
160
161/** Receive data from another address space over IPC.
162 * - ARG1 - destination virtual address in the source address space
163 * - ARG2 - size of data to be received, may be cropped by the recipient
164 *
165 * on answer, the recipient must set:
166 *
167 * - ARG1 - source virtual address in the destination address space
168 * - ARG2 - final size of data to be copied
169 *
170 */
171#define IPC_M_DATA_READ 8
172
173/** Debug the recipient.
174 * - ARG1 - specifies the debug method (from udebug_method_t)
175 * - other arguments are specific to the debug method
176 *
177 */
178#define IPC_M_DEBUG 9
179
180/** Last system IPC method */
181#define IPC_M_LAST_SYSTEM 511
182
183#endif
184
185/** @}
186 */
Note: See TracBrowser for help on using the repository browser.