Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/ipc/irq.c

    r180255f r8add9ca5  
    174174        irq->notif_cfg.code = code;
    175175        irq->notif_cfg.counter = 0;
    176         irq->driver_as = AS;
    177176       
    178177        /*
     
    365364                return IRQ_DECLINE;
    366365       
    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;
    388366        size_t i;
    389367        for (i = 0; i < code->cmdcount; i++) {
     
    444422                        }
    445423                        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;
    495424                case CMD_BTEST:
    496425                        if ((srcarg) && (dstarg)) {
     
    506435                        break;
    507436                case CMD_ACCEPT:
    508                         if (AS != current_as)
    509                                 as_switch(AS, current_as);
    510437                        return IRQ_ACCEPT;
    511438                case CMD_DECLINE:
    512439                default:
    513                         if (AS != current_as)
    514                                 as_switch(AS, current_as);
    515440                        return IRQ_DECLINE;
    516441                }
    517442        }
    518         if (AS != current_as)
    519                 as_switch(AS, current_as);
    520443       
    521444        return IRQ_DECLINE;
Note: See TracChangeset for help on using the changeset viewer.