Prevent compile-time symlinks in userspace
[helenos.git] / abi / include / ipc / methods.h
blob63a0ea0acd2c485b2c91ebd9ac972ed313db2622
1 /*
2 * Copyright (c) 2006 Ondrej Palkovsky
3 * All rights reserved.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
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.
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.
29 /** @addtogroup genericipc
30 * @{
32 /** @file
35 #ifndef ABI_IPC_METHODS_H_
36 #define ABI_IPC_METHODS_H_
38 /* Well known phone descriptors */
39 #define PHONE_NS 0
41 /** Kernel IPC interfaces
44 #define IPC_IF_KERNEL 0
46 /** System-specific IPC methods
48 * These methods have special behaviour. These methods also
49 * have the implicit kernel interface zero (0).
53 /** This message is sent to answerbox when the phone is hung up
55 * The numerical value zero (0) of this method is important,
56 * so as the value can be easily tested in conditions.
59 #define IPC_M_PHONE_HUNGUP 0
61 /** Clone connection.
63 * The calling task clones one of its phones for the callee.
65 * - ARG1 - The caller sets ARG1 to the phone of the cloned connection.
66 * - The callee gets the new phone from ARG1.
68 * - on answer, the callee acknowledges the new connection by sending EOK back
69 * or the kernel closes it
72 #define IPC_M_CONNECTION_CLONE 1
74 /** Protocol for establishing a cloned connection.
76 * Through this call, the recipient learns about the new cloned connection.
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
83 #define IPC_M_CLONE_ESTABLISH 2
85 /** Protocol for initializing callback connections.
87 * Calling process asks the callee to create a callback connection,
88 * so that it can start initiating new messages.
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 allocated phone is passed to userspace
99 * (on the receiving side) as ARG5 of the call.
102 #define IPC_M_CONNECT_TO_ME 3
104 /** Protocol for initializing new foward connections.
106 * Calling process asks the callee to create for him a new connection.
107 * E.g. the caller wants a name server to connect him to print server.
109 * The protocol for negotiating is:
110 * - sys_connect_me_to - send a synchronous message to name server
111 * indicating that it wants to be connected to some
112 * service
113 * - arg1/2/3 are user specified, arg5 contains
114 * address of the phone that should be connected
115 * (TODO: it leaks to userspace)
116 * - recipient - if ipc_answer == 0, then accept connection
117 * - otherwise connection refused
118 * - recepient may forward message.
121 #define IPC_M_CONNECT_ME_TO 4
123 /** Send as_area over IPC.
124 * - ARG1 - source as_area base address
125 * - ARG2 - size of source as_area (filled automatically by kernel)
126 * - ARG3 - flags of the as_area being sent
128 * on answer, the recipient must set:
130 * - ARG1 - dst as_area lower bound
131 * - ARG2 - dst as_area base adress pointer
132 * (filled automatically by the kernel)
135 #define IPC_M_SHARE_OUT 5
137 /** Receive as_area over IPC.
138 * - ARG1 - destination as_area size
139 * - ARG2 - user defined argument
141 * on answer, the recipient must set:
143 * - ARG1 - source as_area base address
144 * - ARG2 - flags that will be used for sharing
145 * - ARG3 - dst as_area lower bound
146 * - ARG4 - dst as_area base address (filled automatically by kernel)
149 #define IPC_M_SHARE_IN 6
151 /** Send data to another address space over IPC.
152 * - ARG1 - source address space virtual address
153 * - ARG2 - size of data to be copied, may be overriden by the recipient
155 * on answer, the recipient must set:
157 * - ARG1 - final destination address space virtual address
158 * - ARG2 - final size of data to be copied
161 #define IPC_M_DATA_WRITE 7
163 /** Receive data from another address space over IPC.
164 * - ARG1 - destination virtual address in the source address space
165 * - ARG2 - size of data to be received, may be cropped by the recipient
167 * on answer, the recipient must set:
169 * - ARG1 - source virtual address in the destination address space
170 * - ARG2 - final size of data to be copied
173 #define IPC_M_DATA_READ 8
175 /** Authorize change of recipient's state in a third party task.
176 * - ARG1 - user protocol defined data
177 * - ARG2 - user protocol defined data
178 * - ARG3 - user protocol defined data
179 * - ARG5 - sender's phone to the third party task
181 * on EOK answer, the recipient must set:
183 * - ARG1 - recipient's phone to the third party task
185 #define IPC_M_STATE_CHANGE_AUTHORIZE 9
187 /** Debug the recipient.
188 * - ARG1 - specifies the debug method (from udebug_method_t)
189 * - other arguments are specific to the debug method
192 #define IPC_M_DEBUG 10
194 /** Last system IPC method */
195 #define IPC_M_LAST_SYSTEM 511
197 #endif
199 /** @}