Changeset 58775d30 in mainline for uspace/srv/hw/bus/cuda_adb/cuda_adb.c
- Timestamp:
- 2015-03-16T16:07:21Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2003739
- Parents:
- 6069061 (diff), 795e2bf (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/hw/bus/cuda_adb/cuda_adb.c
r6069061 r58775d30 109 109 { 110 110 .base = 0, 111 .size = sizeof(cuda_t) 111 .size = sizeof(cuda_t) 112 112 } 113 113 }; … … 157 157 158 158 printf(NAME ": VIA-CUDA Apple Desktop Bus driver\n"); 159 160 /* 161 * Alleviate the virtual memory / page table pressure caused by 162 * interrupt storms when the default large stacks are used. 163 */ 164 async_set_notification_handler_stack_size(PAGE_SIZE); 159 165 160 166 for (i = 0; i < ADB_MAX_ADDR; ++i) { … … 306 312 fibril_mutex_lock(&instance->dev_lock); 307 313 314 switch (instance->xstate) { 315 case cx_listen: 316 cuda_irq_listen(); 317 break; 318 case cx_receive: 319 cuda_irq_receive(); 320 break; 321 case cx_rcv_end: 322 cuda_irq_rcv_end(rbuf, &len); 323 handle = true; 324 break; 325 case cx_send_start: 326 cuda_irq_send_start(); 327 break; 328 case cx_send: 329 cuda_irq_send(); 330 break; 331 } 332 308 333 /* Lower IFR.SR_INT so that CUDA can generate next int by raising it. */ 309 334 pio_write_8(&instance->cuda->ifr, SR_INT); 310 311 switch (instance->xstate) {312 case cx_listen: cuda_irq_listen(); break;313 case cx_receive: cuda_irq_receive(); break;314 case cx_rcv_end: cuda_irq_rcv_end(rbuf, &len);315 handle = true; break;316 case cx_send_start: cuda_irq_send_start(); break;317 case cx_send: cuda_irq_send(); break;318 }319 335 320 336 fibril_mutex_unlock(&instance->dev_lock); … … 331 347 static void cuda_irq_listen(void) 332 348 { 333 uint8_t b; 334 335 b = pio_read_8(&dev->b); 336 349 uint8_t b = pio_read_8(&dev->b); 350 337 351 if ((b & TREQ) != 0) { 338 352 printf("cuda_irq_listen: no TREQ?!\n"); 339 353 return; 340 354 } 341 342 pio_read_8(&dev->sr); 343 pio_write_8(&dev->b, pio_read_8(&dev->b) & ~TIP); 355 356 pio_write_8(&dev->b, b & ~TIP); 344 357 instance->xstate = cx_receive; 345 358 } … … 351 364 static void cuda_irq_receive(void) 352 365 { 353 uint8_t b, data; 354 355 data = pio_read_8(&dev->sr); 366 uint8_t data = pio_read_8(&dev->sr); 356 367 if (instance->bidx < CUDA_RCV_BUF_SIZE) 357 368 instance->rcv_buf[instance->bidx++] = data; 358 359 b = pio_read_8(&dev->b);360 369 370 uint8_t b = pio_read_8(&dev->b); 371 361 372 if ((b & TREQ) == 0) { 362 373 pio_write_8(&dev->b, b ^ TACK); … … 374 385 static void cuda_irq_rcv_end(void *buf, size_t *len) 375 386 { 376 uint8_t b; 377 378 b = pio_read_8(&dev->b); 379 pio_read_8(&dev->sr); 387 uint8_t b = pio_read_8(&dev->b); 380 388 381 389 if ((b & TREQ) == 0) { … … 523 531 } 524 532 525 526 533 /** @} 527 534 */
Note:
See TracChangeset
for help on using the changeset viewer.