Changeset 1b93658 in mainline
- Timestamp:
- 2011-11-14T11:08:19Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c885a21
- Parents:
- 85c4cc45
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/isa/dma_controller.c
r85c4cc45 r1b93658 35 35 #include <bool.h> 36 36 #include <errno.h> 37 #include <fibril_synch.h> 37 38 #include <ddi.h> /* pio_enable */ 38 39 #include <libarch/ddi.h> /* pio_write */ … … 265 266 return EINVAL; 266 267 268 static fibril_mutex_t guard = FIBRIL_MUTEX_INITIALIZER(guard); 269 270 fibril_mutex_lock(&guard); 271 267 272 if (!controller_8237.initialized) 268 273 dma_controller_init(&controller_8237); 269 274 270 if (!controller_8237.initialized) 275 if (!controller_8237.initialized) { 276 fibril_mutex_unlock(&guard); 271 277 return EIO; 278 } 272 279 273 280 /* 16 bit transfers are a bit special */ … … 275 282 if (channel > 4) { 276 283 /* Size must be aligned to 16 bits */ 277 if ((size & 1) != 0) 284 if ((size & 1) != 0) { 285 fibril_mutex_unlock(&guard); 278 286 return EINVAL; 287 } 279 288 size >>= 1; 280 289 /* Address is fun: lower 16bits need to be shifted by 1 */ … … 339 348 pio_write_8(dma_channel.single_mask_address, value); 340 349 350 fibril_mutex_unlock(&guard); 351 341 352 return EOK; 342 353 }
Note:
See TracChangeset
for help on using the changeset viewer.