Changeset eb522e8 in mainline for uspace/srv/bd/gxe_bd/gxe_bd.c
- Timestamp:
- 2011-06-01T08:43:42Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8d6c1f1
- Parents:
- 9e2e715 (diff), e51a514 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/gxe_bd/gxe_bd.c
r9e2e715 reb522e8 39 39 #include <libarch/ddi.h> 40 40 #include <ddi.h> 41 #include <ipc/ipc.h>42 41 #include <ipc/bd.h> 43 42 #include <async.h> … … 93 92 static gxe_bd_t *dev; 94 93 95 static dev _handle_t dev_handle[MAX_DISKS];94 static devmap_handle_t devmap_handle[MAX_DISKS]; 96 95 97 96 static fibril_mutex_t dev_lock[MAX_DISKS]; … … 143 142 for (i = 0; i < MAX_DISKS; i++) { 144 143 snprintf(name, 16, "%s/disk%d", NAMESPACE, i); 145 rc = devmap_device_register(name, &dev _handle[i]);144 rc = devmap_device_register(name, &devmap_handle[i]); 146 145 if (rc != EOK) { 147 devmap_hangup_phone(DEVMAP_DRIVER);148 146 printf(NAME ": Unable to register device %s.\n", name); 149 147 return rc; … … 160 158 ipc_callid_t callid; 161 159 ipc_call_t call; 162 ipcarg_t method;163 dev _handle_t dh;164 int flags;160 sysarg_t method; 161 devmap_handle_t dh; 162 unsigned int flags; 165 163 int retval; 166 164 uint64_t ba; … … 174 172 disk_id = -1; 175 173 for (i = 0; i < MAX_DISKS; i++) 176 if (dev _handle[i] == dh)174 if (devmap_handle[i] == dh) 177 175 disk_id = i; 178 176 179 177 if (disk_id < 0) { 180 ipc_answer_0(iid, EINVAL);178 async_answer_0(iid, EINVAL); 181 179 return; 182 180 } 183 181 184 182 /* Answer the IPC_M_CONNECT_ME_TO call. */ 185 ipc_answer_0(iid, EOK);183 async_answer_0(iid, EOK); 186 184 187 185 if (!async_share_out_receive(&callid, &comm_size, &flags)) { 188 ipc_answer_0(callid, EHANGUP);186 async_answer_0(callid, EHANGUP); 189 187 return; 190 188 } 191 189 192 190 if (comm_size < block_size) { 193 ipc_answer_0(callid, EHANGUP);191 async_answer_0(callid, EHANGUP); 194 192 return; 195 193 } … … 197 195 fs_va = as_get_mappable_page(comm_size); 198 196 if (fs_va == NULL) { 199 ipc_answer_0(callid, EHANGUP);197 async_answer_0(callid, EHANGUP); 200 198 return; 201 199 } … … 205 203 while (1) { 206 204 callid = async_get_call(&call); 207 method = IPC_GET_ METHOD(call);205 method = IPC_GET_IMETHOD(call); 208 206 switch (method) { 209 207 case IPC_M_PHONE_HUNGUP: 210 208 /* The other side has hung up. */ 211 ipc_answer_0(callid, EOK);209 async_answer_0(callid, EOK); 212 210 return; 213 211 case BD_READ_BLOCKS: … … 232 230 break; 233 231 case BD_GET_BLOCK_SIZE: 234 ipc_answer_1(callid, EOK, block_size);232 async_answer_1(callid, EOK, block_size); 235 233 continue; 236 234 case BD_GET_NUM_BLOCKS: … … 241 239 break; 242 240 } 243 ipc_answer_0(callid, retval);241 async_answer_0(callid, retval); 244 242 } 245 243 }
Note:
See TracChangeset
for help on using the changeset viewer.