Changeset 12956e57 in mainline for uspace/srv/bd/gxe_bd/gxe_bd.c
- Timestamp:
- 2009-06-20T19:31:19Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2dfd9fa
- Parents:
- ac47b7c2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/bd/gxe_bd/gxe_bd.c
rac47b7c2 r12956e57 43 43 #include <async.h> 44 44 #include <as.h> 45 #include <f utex.h>45 #include <fibril_sync.h> 46 46 #include <devmap.h> 47 47 #include <sys/types.h> … … 92 92 static dev_handle_t dev_handle[MAX_DISKS]; 93 93 94 static atomic_t dev_futex = FUTEX_INITIALIZER;94 static fibril_mutex_t dev_lock[MAX_DISKS]; 95 95 96 96 static int gxe_bd_init(void); … … 146 146 return rc; 147 147 } 148 fibril_mutex_initialize(&dev_lock[i]); 148 149 } 149 150 … … 257 258 uint32_t w; 258 259 259 f utex_down(&dev_futex);260 fibril_mutex_lock(&dev_lock[disk_id]); 260 261 pio_write_32(&dev->offset_lo, (uint32_t) offset); 261 262 pio_write_32(&dev->offset_hi, offset >> 32); … … 265 266 status = pio_read_32(&dev->status); 266 267 if (status == STATUS_FAILURE) { 268 fibril_mutex_unlock(&dev_lock[disk_id]); 267 269 return EIO; 268 270 } … … 272 274 } 273 275 274 f utex_up(&dev_futex);276 fibril_mutex_unlock(&dev_lock[disk_id]); 275 277 return EOK; 276 278 } … … 286 288 } 287 289 288 f utex_down(&dev_futex);290 fibril_mutex_lock(&dev_lock[disk_id]); 289 291 pio_write_32(&dev->offset_lo, (uint32_t) offset); 290 292 pio_write_32(&dev->offset_hi, offset >> 32); … … 294 296 status = pio_read_32(&dev->status); 295 297 if (status == STATUS_FAILURE) { 298 fibril_mutex_unlock(&dev_lock[disk_id]); 296 299 return EIO; 297 300 } 298 301 299 f utex_up(&dev_futex);302 fibril_mutex_unlock(&dev_lock[disk_id]); 300 303 return EOK; 301 304 }
Note:
See TracChangeset
for help on using the changeset viewer.