Ignore:
File:
1 edited

Legend:

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

    r45e0e07 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         memcpy_from_uspace(&target, va, (sizeof(target))); \
    373         if (dstarg) \
    374                 scratch[dstarg] = target; \
    375 } while(0)
    376 
    377 #define CMD_MEM_WRITE(val) \
    378 do { \
    379         void *va = code->cmds[i].addr; \
    380         if (AS != irq->driver_as) \
    381                 as_switch(AS, irq->driver_as); \
    382         memcpy_to_uspace(va, &val, sizeof(val)); \
    383 } while (0)
    384 
    385         as_t *current_as = AS;
    386366        size_t i;
    387367        for (i = 0; i < code->cmdcount; i++) {
     
    442422                        }
    443423                        break;
    444                 case CMD_MEM_READ_8: {
    445                         uint8_t val;
    446                         CMD_MEM_READ(val);
    447                         break;
    448                         }
    449                 case CMD_MEM_READ_16: {
    450                         uint16_t val;
    451                         CMD_MEM_READ(val);
    452                         break;
    453                         }
    454                 case CMD_MEM_READ_32: {
    455                         uint32_t val;
    456                         CMD_MEM_READ(val);
    457                         break;
    458                         }
    459                 case CMD_MEM_WRITE_8: {
    460                         uint8_t val = code->cmds[i].value;
    461                         CMD_MEM_WRITE(val);
    462                         break;
    463                         }
    464                 case CMD_MEM_WRITE_16: {
    465                         uint16_t val = code->cmds[i].value;
    466                         CMD_MEM_WRITE(val);
    467                         break;
    468                         }
    469                 case CMD_MEM_WRITE_32: {
    470                         uint32_t val = code->cmds[i].value;
    471                         CMD_MEM_WRITE(val);
    472                         break;
    473                         }
    474                 case CMD_MEM_WRITE_A_8:
    475                         if (srcarg) {
    476                                 uint8_t val = scratch[srcarg];
    477                                 CMD_MEM_WRITE(val);
    478                         }
    479                         break;
    480                 case CMD_MEM_WRITE_A_16:
    481                         if (srcarg) {
    482                                 uint16_t val = scratch[srcarg];
    483                                 CMD_MEM_WRITE(val);
    484                         }
    485                         break;
    486                 case CMD_MEM_WRITE_A_32:
    487                         if (srcarg) {
    488                                 uint32_t val = scratch[srcarg];
    489                                 CMD_MEM_WRITE(val);
    490                         }
    491                         break;
    492424                case CMD_BTEST:
    493425                        if ((srcarg) && (dstarg)) {
     
    503435                        break;
    504436                case CMD_ACCEPT:
    505                         if (AS != current_as)
    506                                 as_switch(AS, current_as);
    507437                        return IRQ_ACCEPT;
    508438                case CMD_DECLINE:
    509439                default:
    510                         if (AS != current_as)
    511                                 as_switch(AS, current_as);
    512440                        return IRQ_DECLINE;
    513441                }
    514442        }
    515         if (AS != current_as)
    516                 as_switch(AS, current_as);
    517443       
    518444        return IRQ_DECLINE;
Note: See TracChangeset for help on using the changeset viewer.