Changeset 180255f in mainline
- Timestamp:
- 2011-05-06T12:45:29Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 03cfda08
- Parents:
- 561112f
- Location:
- kernel/generic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/ddi/irq.h
r561112f r180255f 224 224 /** Notification configuration structure. */ 225 225 ipc_notif_cfg_t notif_cfg; 226 227 as_t *driver_as; 226 228 } irq_t; 227 229 -
kernel/generic/src/ipc/irq.c
r561112f r180255f 174 174 irq->notif_cfg.code = code; 175 175 irq->notif_cfg.counter = 0; 176 irq->driver_as = AS; 176 177 177 178 /* … … 364 365 return IRQ_DECLINE; 365 366 367 #define CMD_MEM_READ(target) \ 368 do { \ 369 void *va = code->cmds[i].addr; \ 370 if (AS != irq->driver_as) \ 371 as_switch(AS, irq->driver_as); \ 372 printf("Copying data from address: %p.\n", va); \ 373 memcpy_from_uspace(&target, va, (sizeof(target))); \ 374 if (dstarg) \ 375 scratch[dstarg] = target; \ 376 } while(0) 377 378 #define CMD_MEM_WRITE(val) \ 379 do { \ 380 void *va = code->cmds[i].addr; \ 381 if (AS != irq->driver_as) \ 382 as_switch(AS, irq->driver_as); \ 383 printf("Writing data to address: %p.\n", va); \ 384 memcpy_to_uspace(va, &val, sizeof(val)); \ 385 } while (0) 386 387 as_t *current_as = AS; 366 388 size_t i; 367 389 for (i = 0; i < code->cmdcount; i++) { … … 422 444 } 423 445 break; 446 case CMD_MEM_READ_8: { 447 uint8_t val; 448 CMD_MEM_READ(val); 449 break; 450 } 451 case CMD_MEM_READ_16: { 452 uint16_t val; 453 CMD_MEM_READ(val); 454 break; 455 } 456 case CMD_MEM_READ_32: { 457 uint32_t val; 458 CMD_MEM_READ(val); 459 printf("mem READ value: %x.\n", val); 460 break; 461 } 462 case CMD_MEM_WRITE_8: { 463 uint8_t val = code->cmds[i].value; 464 CMD_MEM_WRITE(val); 465 break; 466 } 467 case CMD_MEM_WRITE_16: { 468 uint16_t val = code->cmds[i].value; 469 CMD_MEM_WRITE(val); 470 break; 471 } 472 case CMD_MEM_WRITE_32: { 473 uint32_t val = code->cmds[i].value; 474 CMD_MEM_WRITE(val); 475 break; 476 } 477 case CMD_MEM_WRITE_A_8: 478 if (srcarg) { 479 uint8_t val = scratch[srcarg]; 480 CMD_MEM_WRITE(val); 481 } 482 break; 483 case CMD_MEM_WRITE_A_16: 484 if (srcarg) { 485 uint16_t val = scratch[srcarg]; 486 CMD_MEM_WRITE(val); 487 } 488 break; 489 case CMD_MEM_WRITE_A_32: 490 if (srcarg) { 491 uint32_t val = scratch[srcarg]; 492 CMD_MEM_WRITE(val); 493 } 494 break; 424 495 case CMD_BTEST: 425 496 if ((srcarg) && (dstarg)) { … … 435 506 break; 436 507 case CMD_ACCEPT: 508 if (AS != current_as) 509 as_switch(AS, current_as); 437 510 return IRQ_ACCEPT; 438 511 case CMD_DECLINE: 439 512 default: 513 if (AS != current_as) 514 as_switch(AS, current_as); 440 515 return IRQ_DECLINE; 441 516 } 442 517 } 518 if (AS != current_as) 519 as_switch(AS, current_as); 443 520 444 521 return IRQ_DECLINE;
Note:
See TracChangeset
for help on using the changeset viewer.