- Timestamp:
- Jun 8, 2017, 3:02:10 AM (8 years ago)
- Location:
- trunk/src/os2ahci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/os2ahci/Makefile
r186 r188 12 12 # Define default build version if not specified in environment 13 13 BLD_MAJOR=2 14 BLD_MINOR=0 1# must be 2 digits14 BLD_MINOR=02 # must be 2 digits 15 15 BLD_REV=0 # not used at this time 16 16 -
trunk/src/os2ahci/ahci.c
r185 r188 79 79 }; 80 80 81 /* IRQ levels for stub interrupt handlers. OS/2 calls interrupt handlers 82 * without passing the IRQ level, yet it expects the interrupt handler to 83 * know the IRQ level for EOI processing. Thus we need multiple interrupt 84 * handlers, one for each IRQ, and some mapping from the interrupt handler 85 * index to the corresponding IRQ. 86 */ 87 static u16 irq_map[MAX_AD]; /* IRQ level for each stub IRQ func */ 88 static int irq_map_cnt; /* number of IRQ stub funcs used */ 81 #define MAX_IRQ_HANDLERS 8 /* This is the maximum number of handlers that Dev32Help_SetIRQ can register */ 82 static u16 irq_used[MAX_IRQ_HANDLERS]; /* IRQ level for each used IRQ */ 83 static int irq_used_cnt; /* number of IRQs used */ 89 84 90 85 /* ----------------------------- start of code ----------------------------- */ 91 92 /******************************************************************************93 * Interrupt handlers. Those are stubs which call the real interrupt handler94 * with the IRQ level as parameter. This mapping is required because OS/295 * calls interrupt handlers without any parameters, yet expects them to know96 * which IRQ level to complete when calling DevHelp_EOI().97 *98 * This array of functions needs to be extended when increasing MAX_AD.99 */100 #if MAX_AD > 8101 #error must extend irq_handler_xx and irq_handlers[] when increasing MAX_AD102 #endif103 104 /* Macro to call AHCI interrupt handler and set/clear carry flag accordingly.105 * We need to set the carry flag if the interrupt was not handled. This is106 * done by shifting the return value of ahci_intr() to the right, implying107 * bit 0 will be set when the interrupt was not handled.108 */109 #define call_ahci_intr(i) return(ahci_intr(irq_map[i]))110 111 static USHORT _cdecl irq_handler_00(void) { call_ahci_intr(0); }112 static USHORT _cdecl irq_handler_01(void) { call_ahci_intr(1); }113 static USHORT _cdecl irq_handler_02(void) { call_ahci_intr(2); }114 static USHORT _cdecl irq_handler_03(void) { call_ahci_intr(3); }115 static USHORT _cdecl irq_handler_04(void) { call_ahci_intr(4); }116 static USHORT _cdecl irq_handler_05(void) { call_ahci_intr(5); }117 static USHORT _cdecl irq_handler_06(void) { call_ahci_intr(6); }118 static USHORT _cdecl irq_handler_07(void) { call_ahci_intr(7); }119 120 PFN irq_handlers[] =121 {122 (PFN) irq_handler_00, (PFN) irq_handler_01, (PFN) irq_handler_02,123 (PFN) irq_handler_03, (PFN) irq_handler_04, (PFN) irq_handler_05,124 (PFN) irq_handler_06, (PFN) irq_handler_07125 };126 86 127 87 #ifdef DEBUG … … 702 662 703 663 /* register IRQ handlers; each IRQ level is registered only once */ 704 for (i = 0; i < irq_map_cnt; i++) 705 { 706 if (irq_map[i] == ai->irq) break; /* we already have this IRQ registered */ 707 } 708 if (i >= irq_map_cnt) 709 { 664 for (i = 0; i < irq_used_cnt; i++) 665 { 666 if (irq_used[i] == ai->irq) break; /* we already have this IRQ registered */ 667 } 668 if (i >= irq_used_cnt) 669 { 670 if (i >= MAX_IRQ_HANDLERS) return -1; /* no more handlers available */ 710 671 DPRINTF(2,"registering interrupt #%d\n", ai->irq); 711 if (Dev32Help_SetIRQ( irq_handlers[irq_map_cnt], ai->irq, 1) != 0)672 if (Dev32Help_SetIRQ(ahci_intr, ai->irq, 1, ai->irq) != 0) 712 673 { 713 674 DPRINTF(0,"failed to register shared interrupt\n"); 714 if (Dev32Help_SetIRQ( irq_handlers[irq_map_cnt], ai->irq, 0) != 0)675 if (Dev32Help_SetIRQ(ahci_intr, ai->irq, 0, ai->irq) != 0) 715 676 { 716 dprintf(0,"failed to register exclusive interrupt\n");677 dprintf(0,"failed to register interrupt %d\n", ai->irq); 717 678 return(-1); 718 679 } 719 680 } 720 irq_ map[irq_map_cnt++] = ai->irq;681 irq_used[irq_used_cnt++] = ai->irq; 721 682 } 722 683 … … 1434 1395 * queues, ...) 1435 1396 */ 1397 #pragma aux ahci_intr parm [eax] 1436 1398 int ahci_intr(u16 irq) 1437 1399 { -
trunk/src/os2ahci/ata.c
r186 r188 286 286 cmd_hdr->options |= n << 16; 287 287 288 #ifdef DEBUG 288 289 if ((D32g_DbgLevel >= 7) || (atapi_cmd != NULL)) 289 290 { … … 300 301 } 301 302 } 303 #endif 302 304 303 305 return(ATA_CMD_SUCCESS); -
trunk/src/os2ahci/pci.c
r185 r188 535 535 */ 536 536 537 ciprintf("Adapter %d PCI=%d:%d:%d ID=%04x:%04x\n", ad_info_cnt, PCI_BUS_FROM_BDF(BusDevFunc), 538 PCI_DEV_FROM_BDF(BusDevFunc), PCI_FUNC_FROM_BDF(BusDevFunc), vendor, device); 537 539 DPRINTF(1,"Adapter %d PCI=%d:%d:%d ID=%04x:%04x\n", ad_info_cnt, PCI_BUS_FROM_BDF(BusDevFunc), 538 540 PCI_DEV_FROM_BDF(BusDevFunc), PCI_FUNC_FROM_BDF(BusDevFunc), vendor, device);
Note:
See TracChangeset
for help on using the changeset viewer.