Changeset 1090b8c in mainline for uspace/srv
- Timestamp:
- 2009-05-18T19:45:17Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c00589d
- Parents:
- c5747fe
- Location:
- uspace/srv
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/rd/rd.c
rc5747fe r1090b8c 53 53 #include <futex.h> 54 54 #include <stdio.h> 55 #include < ipc/devmap.h>55 #include <devmap.h> 56 56 #include <ipc/bd.h> 57 57 … … 181 181 } 182 182 183 static int driver_register(char *name)184 {185 ipcarg_t retval;186 aid_t req;187 ipc_call_t answer;188 int phone;189 ipcarg_t callback_phonehash;190 191 phone = ipc_connect_me_to_blocking(PHONE_NS, SERVICE_DEVMAP, DEVMAP_DRIVER, 0);192 if (phone < 0) {193 printf(NAME ": Failed to connect to device mapper\n");194 return -1;195 }196 197 req = async_send_2(phone, DEVMAP_DRIVER_REGISTER, 0, 0, &answer);198 199 retval = ipc_data_write_start(phone, (char *) name, str_size(name) + 1);200 201 if (retval != EOK) {202 async_wait_for(req, NULL);203 return -1;204 }205 206 async_set_client_connection(rd_connection);207 208 ipc_connect_to_me(phone, 0, 0, 0, &callback_phonehash);209 async_wait_for(req, &retval);210 211 return phone;212 }213 214 static int device_register(int driver_phone, char *name, int *handle)215 {216 ipcarg_t retval;217 aid_t req;218 ipc_call_t answer;219 220 req = async_send_2(driver_phone, DEVMAP_DEVICE_REGISTER, 0, 0, &answer);221 222 retval = ipc_data_write_start(driver_phone, (char *) name,223 str_size(name) + 1);224 225 if (retval != EOK) {226 async_wait_for(req, NULL);227 return retval;228 }229 230 async_wait_for(req, &retval);231 232 if (handle != NULL)233 *handle = -1;234 235 if (EOK == retval) {236 if (NULL != handle)237 *handle = (int) IPC_GET_ARG1(answer);238 }239 240 return retval;241 }242 243 183 /** Prepare the ramdisk image for operation. */ 244 184 static bool rd_init(void) … … 265 205 printf(NAME ": Found RAM disk at %p, %d bytes\n", rd_ph_addr, rd_size); 266 206 267 int driver_phone = d river_register(NAME);207 int driver_phone = devmap_driver_register(NAME, rd_connection); 268 208 if (driver_phone < 0) { 269 209 printf(NAME ": Unable to register driver\n"); … … 272 212 273 213 int dev_handle; 274 if ( EOK != device_register(driver_phone, "initrd", &dev_handle)) {214 if (devmap_device_register(driver_phone, "initrd", &dev_handle) != EOK) { 275 215 ipc_hangup(driver_phone); 276 216 printf(NAME ": Unable to register device\n"); … … 284 224 * be created dynamically... 285 225 */ 286 if ( EOK != device_register(driver_phone, "spared", &dev_handle)) {226 if (devmap_device_register(driver_phone, "spared", &dev_handle) != EOK) { 287 227 ipc_hangup(driver_phone); 288 228 printf(NAME ": Unable to register device\n"); -
uspace/srv/vfs/vfs.h
rc5747fe r1090b8c 39 39 #include <rwlock.h> 40 40 #include <sys/types.h> 41 #include <devmap.h> 41 42 #include <bool.h> 42 43 … … 50 51 /* Basic types. */ 51 52 typedef int16_t fs_handle_t; 52 typedef int16_t dev_handle_t;53 53 typedef uint32_t fs_index_t; 54 54
Note:
See TracChangeset
for help on using the changeset viewer.