Changeset 545 for GPL/trunk/drv32
- Timestamp:
- Mar 3, 2011, 8:43:04 PM (15 years ago)
- Location:
- GPL/trunk/drv32
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/drv32/irq.cpp
r518 r545 47 47 48 48 //****************************************************************************** 49 #ifdef ACPI50 //PS+++ fix description51 // Problem is in open high IRQ (acpi.psd /SMP /APIC) at boot time.52 // In my case - this IRQ use SATA and we have flood IRQ. This flood do53 // MASK this IRQ from kernel. Next danis506.add has very slow read from54 // disk.55 // How to fix.56 // At boot time (from DevInit to DevInitComplete) we use low IRQ. In57 // DevInitComplete we close low IRQ and open high IRQ. All values for58 // IRQ we are getting from ACPI call.59 60 //PS+++ Array with saving IRQ number61 #ifdef __cplusplus62 extern "C" {63 #endif64 struct SaveIRQForSlot65 {66 ULONG ulSlotNo;67 BYTE LowIRQ;68 BYTE HighIRQ;69 BYTE Pin;70 } sISRHigh[8]; //FIX me to MAX_DEVICES or same71 72 int SaveIRQCounter = 0; //PS+++ current position in array73 extern ULONG InitCompleteWas; //PS+++ Indication of InitComplete call74 #ifdef __cplusplus75 }76 #endif77 78 #endif //ACPI79 //******************************************************************************80 49 BOOL ALSA_SetIrq(ULONG ulIrq, ULONG ulSlotNo, BOOL fShared) 81 50 { … … 106 75 return FALSE; 107 76 } 108 109 //PS+++ Begin110 #ifdef ACPI111 if (InitCompleteWas == 0)112 {113 dprintf(("RMSetIrq saved %d %d %x was %d", (ULONG)ulIrq, ulSlotNo,(ULONG)sISRHigh[SaveIRQCounter].LowIRQ));114 sISRHigh[SaveIRQCounter].ulSlotNo = ulSlotNo;115 ulIrq = sISRHigh[SaveIRQCounter].LowIRQ;116 SaveIRQCounter++;117 }118 119 #endif120 //PS End121 77 122 78 return TRUE; -
GPL/trunk/drv32/rmhelp.cpp
r518 r545 149 149 //****************************************************************************** 150 150 //****************************************************************************** 151 //PS+++ see to irq.cpp 152 #ifdef ACPI 153 #ifdef __cplusplus 154 extern "C" { 155 #endif 156 struct SaveIRQForSlot 157 { 158 ULONG ulSlotNo; 159 BYTE LowIRQ; 160 BYTE HighIRQ; 161 BYTE Pin; 162 }; 163 extern struct SaveIRQForSlot sISRHigh[]; 164 extern int SaveIRQCounter; 165 #ifdef __cplusplus 166 } 167 #endif 168 #endif 169 BOOL RMRequestIRQ(ULONG ulIrq, BOOL fShared) 170 { 171 RESOURCESTRUCT Resource; 172 HRESOURCE hres; 173 APIRET rc; 174 175 Resource.ResourceType = RS_TYPE_IRQ; 176 #ifdef ACPI //PS+++ 177 Resource.IRQResource.PCIIrqPin = (USHORT)(sISRHigh[SaveIRQCounter].Pin & 0xf); 178 if (sISRHigh[SaveIRQCounter].HighIRQ) 179 Resource.IRQResource.IRQLevel = (USHORT)sISRHigh[SaveIRQCounter].HighIRQ & 0xff; 180 else 181 Resource.IRQResource.IRQLevel = (USHORT)ulIrq & 0xff; 182 #else 183 Resource.IRQResource.IRQLevel = (USHORT)ulIrq & 0xff; 184 Resource.IRQResource.PCIIrqPin = 0; 185 #endif 186 Resource.IRQResource.IRQFlags = ( fShared ) ? RS_IRQ_SHARED : RS_IRQ_EXCLUSIVE; 187 188 rc = RMAllocResource(DriverHandle, // Handle to driver. 189 FlatToSel((ULONG)&hres), // OUT: "allocated" resource node handle 151 BOOL RMRequestIRQ(ULONG ulIrq, BOOL fShared, PHRESOURCE phRes) 152 { 153 RESOURCESTRUCT Resource; 154 HRESOURCE hres; 155 APIRET rc; 156 157 Resource.ResourceType = RS_TYPE_IRQ; 158 Resource.IRQResource.IRQLevel = (USHORT)ulIrq & 0xff; 159 Resource.IRQResource.PCIIrqPin = 0; 160 Resource.IRQResource.IRQFlags = ( fShared ) ? RS_IRQ_SHARED : RS_IRQ_EXCLUSIVE; 161 162 rc = RMAllocResource(DriverHandle, // Handle to driver. 163 FlatToSel((ULONG)&hres), // OUT: "allocated" resource node handle 190 164 FlatToSel((ULONG)&Resource)); // Resource to allocate. 191 165 192 if( rc == 0 && ctResHandles < MAX_RESHANDLES ) 193 { 194 arResHandles[ctResHandles++] = hres; return TRUE; 195 } 196 197 dprintf(("RMAllocResource[%d] IRQ rc = %d\n", ctResHandles, rc)); 198 199 return rc == 0; 166 if (rc == 0) { 167 if (ctResHandles < MAX_RESHANDLES ) arResHandles[ctResHandles++] = hres; 168 *phRes = hres; 169 } 170 171 dprintf(("RMAllocResource[%d] IRQ rc = %d\n", ctResHandles, rc)); 172 173 return rc == 0; 174 } 175 176 //****************************************************************************** 177 //****************************************************************************** 178 BOOL RMDeallocateIRQ(HRESOURCE hRes) 179 { 180 ULONG ulI; 181 182 RMDeallocResource(DriverHandle, hRes); 183 184 for (ulI=0; ulI<ctResHandles; ulI++) { 185 if (arResHandles[ulI] == hRes) { 186 arResHandles[ulI] = 0; 187 break; 188 } 189 } 190 191 return 0; 200 192 } 201 193 -
GPL/trunk/drv32/strategy.c
r521 r545 39 39 40 40 ULONG DiscardableInit(RPInit __far*); 41 42 41 ULONG deviceOwner = DEV_NO_OWNER; 43 42 ULONG numOS2Opens = 0; … … 76 75 // External initialization complete entry-point 77 76 #ifdef ACPI 78 // See desription in irq.cpp 79 #include "irqos2.h" //PS+++ 80 #ifdef __cplusplus 81 extern "C" { 82 #endif 83 ULONG InitCompleteWas = 0; //PS+++ Indication of InitComplete call 84 struct SaveIRQForSlot 85 { 86 ULONG ulSlotNo; 87 BYTE LowIRQ; 88 BYTE HighIRQ; 89 BYTE Pin; 90 }; 91 extern struct SaveIRQForSlot sISRHigh[]; 92 extern int SaveIRQCounter; 93 #ifdef __cplusplus 94 } 95 #endif 77 #include "irqos2.h" 96 78 #endif //ACPI 97 79 //****************************************************************************** … … 101 83 { 102 84 #ifdef ACPI 103 //PS+++ Begin 104 ULONG i, rc = 0; 105 106 InitCompleteWas = 1; 107 for (i = 0; i < SaveIRQCounter; i++) 108 { 109 dprintf(("Close IRQ%d - Open IRQ%d",(ULONG)sISRHigh[i].LowIRQ,(ULONG)sISRHigh[i].HighIRQ)); 110 if (sISRHigh[i].HighIRQ) 111 { 112 ALSA_FreeIrq(sISRHigh[i].LowIRQ); 113 if (!ALSA_SetIrq(sISRHigh[i].HighIRQ, sISRHigh[i].ulSlotNo, 1)) 114 { 115 return (RPERR_COMMAND | RPDONE); 116 } 117 } 118 } 85 PciAdjustInterrupts(); 119 86 #endif 120 //PS++ End121 87 //dprintf(("StratInitComplete")); 122 88 return(RPDONE);
Note:
See TracChangeset
for help on using the changeset viewer.