Rev 4410 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4410 | Rev 4416 | ||
---|---|---|---|
Line 110... | Line 110... | ||
110 | */ |
110 | */ |
111 | ipc_answer_0(callid, EHANGUP); |
111 | ipc_answer_0(callid, EHANGUP); |
112 | return; |
112 | return; |
113 | } |
113 | } |
114 | 114 | ||
115 | while (1) { |
115 | while (true) { |
116 | callid = async_get_call(&call); |
116 | callid = async_get_call(&call); |
117 | switch (IPC_GET_METHOD(call)) { |
117 | switch (IPC_GET_METHOD(call)) { |
118 | case IPC_M_PHONE_HUNGUP: |
118 | case IPC_M_PHONE_HUNGUP: |
119 | /* |
119 | /* |
120 | * The other side has hung up. |
120 | * The other side has hung up. |
Line 202... | Line 202... | ||
202 | return false; |
202 | return false; |
203 | } |
203 | } |
204 | 204 | ||
205 | printf(NAME ": Found RAM disk at %p, %d bytes\n", rd_ph_addr, rd_size); |
205 | printf(NAME ": Found RAM disk at %p, %d bytes\n", rd_ph_addr, rd_size); |
206 | 206 | ||
207 | int driver_phone = devmap_driver_register(NAME, rd_connection); |
207 | int rc = devmap_driver_register(NAME, rd_connection); |
208 | if (driver_phone < 0) { |
208 | if (rc < 0) { |
209 | printf(NAME ": Unable to register driver\n"); |
209 | printf(NAME ": Unable to register driver (%d)\n", rc); |
210 | return false; |
210 | return false; |
211 | } |
211 | } |
212 | 212 | ||
213 | dev_handle_t dev_handle; |
213 | dev_handle_t dev_handle; |
214 | if (devmap_device_register(driver_phone, "initrd", &dev_handle) != EOK) { |
214 | if (devmap_device_register("initrd", &dev_handle) != EOK) { |
215 | ipc_hangup(driver_phone); |
215 | devmap_hangup_phone(DEVMAP_DRIVER); |
216 | printf(NAME ": Unable to register device\n"); |
- | |
217 | return false; |
- | |
218 | } |
- | |
219 | - | ||
220 | /* |
- | |
221 | * Create the second device. |
- | |
222 | * We need at least two devices for the sake of testing of non-root |
- | |
223 | * mounts. Of course it would be better to allow the second device |
- | |
224 | * be created dynamically... |
- | |
225 | */ |
- | |
226 | if (devmap_device_register(driver_phone, "spared", &dev_handle) != EOK) { |
- | |
227 | ipc_hangup(driver_phone); |
- | |
228 | printf(NAME ": Unable to register device\n"); |
216 | printf(NAME ": Unable to register device\n"); |
229 | return false; |
217 | return false; |
230 | } |
218 | } |
231 | 219 | ||
232 | return true; |
220 | return true; |
Line 246... | Line 234... | ||
246 | return 0; |
234 | return 0; |
247 | } |
235 | } |
248 | 236 | ||
249 | /** |
237 | /** |
250 | * @} |
238 | * @} |
251 | */ |
239 | */ |