Changeset 389

Show
Ignore:
Timestamp:
10/08/08 16:42:59 (8 weeks ago)
Author:
rjerant
Message:

Port interrupt fixes to 1.1.4 code base

Location:
GPL/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • GPL/trunk/drv32/irq.cpp

    r63 r389  
    9292    ULONG       ulIrqNo; 
    9393 
     94    // enable interrupts that have higher priority we should 
     95    // allow higher priority interrupts 
     96    sti(); 
    9497    if( process_interrupt(ulSlotNo, &ulIrqNo) ) { 
     98        // We've cleared all service requests. 
     99        // Clear (disable) Interrupts, Send EOI 
     100        // and clear the carry flag (tells OS/2 kernel that Int was handled). 
     101        // Note carry flag is handled in setup.asm 
    95102        cli(); 
    96         // We've cleared all service requests.  Send EOI and clear 
    97         // the carry flag (tells OS/2 kernel that Int was handled). 
    98103        DevEOI( (WORD16)ulIrqNo ); 
    99104        return TRUE; 
    100    } 
    101    // Indicate Interrupt not serviced by setting carry flag before 
    102    // returning to OS/2 kernel.  OS/2 will then shut down the interrupt! 
    103    // NOTE: Make sure interrupts are not turned on again when this irq isn't ours! 
    104    return FALSE; 
     105    } 
     106    // Indicate Interrupt not serviced by setting carry flag before 
     107    // returning to OS/2 kernel.  OS/2 will then shut down the interrupt! 
     108    // NOTE: Make sure interrupts are not turned on again when this irq isn't ours! 
     109    return FALSE; 
    105110} 
    106111//****************************************************************************** 
  • GPL/trunk/drv32/startup.asm

    r63 r389  
    1 ; $Id: startup.asm,v 1.1.1.1 2003/07/02 13:56:56 eleph Exp $  
     1; $Id: startup.asm,v 1.1.1.1 2003/07/02 13:56:56 eleph Exp $ 
    22;* 
    33;* 16bit entrypoints to the PDD with thunks to the 32bit functions 
     
    4242                public _MSG_TABLE16 
    4343                public DevHelpInit 
    44                 public fOpen     
     44                public fOpen 
    4545                public InitPktSeg 
    4646                public InitPktOff 
     
    165165        cmp     eax, 04h                        ; DosRead 
    166166        je      uniaud_stub_strategy 
    167          
     167 
    168168        enter   0, 0 
    169169        and     sp, 0fffch                      ; align stack 
    170170 
    171         pushad   
     171        pushad 
    172172        push    ds 
    173173        push    es 
     
    208208        leave 
    209209        ret 
    210                  
     210 
    211211@@help_init: 
    212212        mov     eax, dword ptr es:[bx].i_devHelp 
     
    218218        mov     ax, STDON 
    219219        jmp     short @@help_ret 
    220          
     220 
    221221@@help_close: 
    222222        call    far ptr FLAT:HelpClose 
     
    235235        and     sp, 0fffch                      ; align stack 
    236236 
    237         pushad   
     237        pushad 
    238238        push    ds 
    239239        push    es 
     
    251251        push    es 
    252252        mov     ax, bx 
    253         xor     ebx, ebx                         
     253        xor     ebx, ebx 
    254254        mov     bx, ax 
    255255        mov     ax, es 
     
    328328; device_init 
    329329; 
    330 ; Use DosOpen to tell the 1st driver to handle init for us. We must do it this  
     330; Use DosOpen to tell the 1st driver to handle init for us. We must do it this 
    331331; way since right now our CPL is 3 and the flat code selector has DPL 0, so 
    332332; we can't load it. In the open strategy request, CPL is 0 
     
    600600                call    near ptr _CallRM 
    601601                mov     sp,bp 
    602                 ret16      
     602                ret16 
    603603DeAllocL1:      test    byte ptr _RMFlags,02H 
    604604                je      short DeAllocL2 
    605605                sub     ax,ax 
    606                 ret16      
     606                ret16 
    607607DeAllocL2:      mov     ax,0001H 
    608                 ret16      
     608                ret16 
    609609_RMDeallocResourceOrg endp 
    610610 
     
    622622 
    623623                ALIGN 2 
    624                 PUBLIC  MY_DEVHELP_ATTACHDD  
     624                PUBLIC  MY_DEVHELP_ATTACHDD 
    625625MY_DEVHELP_ATTACHDD proc near 
    626626                push    bp 
     
    638638                pop     es 
    639639                pop     di 
    640                 leave    
     640                leave 
    641641                ret     0004H 
    642642L2:             pop     es 
    643643                pop     di 
    644                 leave            
     644                leave 
    645645                ret     0004H 
    646646MY_DEVHELP_ATTACHDD endp 
     
    659659                call    near ptr _CallRM 
    660660                add     sp,0006H 
    661                 ret16      
     661                ret16 
    662662CreateDrL4:     test    byte ptr _RMFlags,02H 
    663663                je      short CreateDrL6 
     
    670670                pop     bx 
    671671                pop     es 
    672                 ret16      
     672                ret16 
    673673CreateDrL6:     mov     ax, word ptr DevHelpInit + 2H 
    674674                or      ax, word ptr DevHelpInit 
    675675                jne     short CreateDrL7 
    676676                mov     ax,0008H 
    677                 ret16     
     677                ret16 
    678678CreateDrL7:     push    offset ResMgr 
    679679                push    offset _RMIDCTable 
     
    708708 
    709709                ALIGN 2 
    710                 PUBLIC  _CallRM  
     710                PUBLIC  _CallRM 
    711711_CallRM proc near 
    712712                enter   0002H,00H 
     
    719719                call    dword ptr _RM_Help3 
    720720                add     sp,0006H 
    721                 leave    
     721                leave 
    722722                ret 
    723723L1:             push    word ptr +6H[bp] 
    724724                call    dword ptr _RM_Help0 
    725                 leave    
     725                leave 
    726726                ret 
    727727_CallRM endp 
     
    733733                pop     word ptr -2H[bp] 
    734734                mov     ax,word ptr -2H[bp] 
    735                 leave    
    736                 ret      
     735                leave 
     736                ret 
    737737_GetCS endp 
    738738 
     
    754754                je      short DestroyDrvL2 
    755755                sub     ax,ax 
    756                 ret16    
     756                ret16 
    757757DestroyDrvL2:   mov     ax,0001H 
    758758                ret16 
     
    788788GetNodeInfo_L1: mov     ax,0014H 
    789789                ret16 
    790                 nop      
     790                nop 
    791791GetNodeInfo_L2: test    byte ptr _RMFlags,02H 
    792792                je      short GetNodeInfo_L3 
     
    799799                ALIGN 2 
    800800                PUBLIC  _RMGetNodeInfo16 
    801 _RMGetNodeInfo16  proc far  
     801_RMGetNodeInfo16  proc far 
    802802                enter32 
    803803                xor     eax, eax 
    804                 push    word ptr  [bp+18]       ;pushed as dword by watcom       
    805                 push    dword ptr [bp+14]        
     804                push    word ptr  [bp+18]       ;pushed as dword by watcom 
     805                push    dword ptr [bp+14] 
    806806                push    dword ptr [bp+10] 
    807807                call    _RMGetNodeInfoOrg 
     
    825825                mov     sp,bp 
    826826                ret16 
    827 RMDevIDToHandleList_L1:              
     827RMDevIDToHandleList_L1: 
    828828                mov     ax,0014H 
    829829                ret16 
    830                 nop      
    831 RMDevIDToHandleList_L2:              
     830                nop 
     831RMDevIDToHandleList_L2: 
    832832                test    byte ptr _RMFlags,02H 
    833833                je      short RMDevIDToHandleList_L3 
    834834                sub     ax,ax 
    835835                ret16 
    836                 nop      
    837 RMDevIDToHandleList_L3:  
     836                nop 
     837RMDevIDToHandleList_L3: 
    838838                mov     ax,0001H 
    839839                ret16 
    840                 nop      
     840                nop 
    841841_RMDevIDToHandleListOrg endp 
    842842 
    843843                ALIGN 2 
    844844                PUBLIC  _RMDevIDToHandleList16 
    845 _RMDevIDToHandleList16  proc far  
     845_RMDevIDToHandleList16  proc far 
    846846                enter32 
    847847                xor     eax, eax 
     
    874874                call    near ptr _CallRM 
    875875                ret16 
    876                 nop      
     876                nop 
    877877RMHandleToResourceHandleList_L1: 
    878878                mov     ax,0014H 
    879879                ret16 
    880                 nop      
     880                nop 
    881881RMHandleToResourceHandleList_L2: 
    882882                test    byte ptr _RMFlags,02H 
     
    884884                sub     ax,ax 
    885885                ret16 
    886                 nop      
     886                nop 
    887887RMHandleToResourceHandleList_L3: 
    888888                 mov     ax,0001H 
    889889                ret16 
    890                 nop      
     890                nop 
    891891_RMHandleToResourceHandleListOrg endp 
    892892 
    893893                ALIGN 2 
    894894                PUBLIC  _RMHandleToResourceHandleList16 
    895 _RMHandleToResourceHandleList16  proc far  
     895_RMHandleToResourceHandleList16  proc far 
    896896                enter32 
    897897                xor     eax, eax 
     
    985985        public __GETDS 
    986986        public thunk1632_devhelp 
    987         public thunk1632_devhelp_modified_ds     
     987        public thunk1632_devhelp_modified_ds 
    988988        public DevHlp 
    989989        public DevHlp_ModifiedDS 
     
    10821082        shr     edx, 13 
    10831083        and     edx, 3 
    1084          
     1084 
    10851085        ;has the OS/2 kernel finally changed the DPL to 0? 
    10861086        cmp     edx, 0 
     
    10891089        mov     SelRef, 0 
    10901090        jmp     short @@endchange 
    1091          
     1091 
    10921092@@changedpl: 
    10931093        mov     oldDPL, eax 
     
    11011101        inc     SelRef 
    11021102@@fixdpl_end: 
    1103         ret         
    1104 FixSelDPL endp         
     1103        ret 
     1104FixSelDPL endp 
    11051105;;****************************************************************************** 
    11061106; RestoreSelDPL: 
     
    11141114        cmp     fWrongDPL, 1 
    11151115        jne     short @@restdpl_end 
    1116          
     1116 
    11171117        cmp     SelRef, 1 
    11181118        jne     short @@restdpl_endrest 
     
    11381138;******************************************************************************* 
    11391139;Copy parameters to 16 bits stack and call 16:32 IDC handler 
    1140 ;  
     1140; 
    11411141; Paramters: IDC16_HANDLER pHandler 
    11421142;            ULONG         cmd 
     
    11591159        call fword ptr [ebx] 
    11601160        add  sp, 12 
    1161          
     1161 
    11621162        DevThunkStackTo32_Int 
    11631163 
     
    11731173;******************************************************************************* 
    11741174        ALIGN 4 
    1175 STRATEGY_ proc far       
     1175STRATEGY_ proc far 
    11761176        push    ds 
    11771177        push    es 
     
    11981198        cmp     eax, 0 
    11991199        jne     @@stackswitchfail_strat 
    1200             
     1200 
    12011201        call    ALSA_STRATEGY 
    12021202 
     
    12241224;******************************************************************************* 
    12251225        ALIGN 4 
    1226 IDC_ proc far        
     1226IDC_ proc far 
    12271227        push    ds 
    12281228        push    es 
     
    12611261;******************************************************************************* 
    12621262        ALIGN 4 
    1263 TIMER_ proc far        
     1263TIMER_ proc far 
    12641264        push    ds 
    12651265        push    es 
     
    13161316 
    13171317        pushfd 
    1318         cli 
     1318 
     1319        ; At this point a cli is redundant 
     1320        ; we enter the interrupt handler with interrupts disabled. 
     1321        ;cli 
    13191322 
    13201323IFDEF FLATSTACK 
     
    13271330 
    13281331        DevThunkStackTo16 
    1329          
     1332 
    13301333@@stackswitchfail_irq: 
    13311334ELSE 
     
    13461349 
    13471350endofirq: 
    1348         
     1351 
    13491352        pop     gs 
    13501353        pop     fs 
     
    13581361 
    13591362        ALIGN 4 
    1360 HelpClose proc far       
     1363HelpClose proc far 
    13611364        push    ds 
    13621365        mov     eax, DOS32FLATDS 
     
    14591462        enterKEERM 
    14601463        xor     eax, eax 
    1461         push    dword ptr [edi+16]       
    1462         push    dword ptr [edi+12]       
     1464        push    dword ptr [edi+16] 
     1465        push    dword ptr [edi+12] 
    14631466        push    dword ptr [edi+8] 
    14641467        call    fword ptr RMGetNodeInfo1632 
     
    15321535 
    15331536    stackbase dd 0 
    1534     stacksel  dd 0     
     1537    stacksel  dd 0 
    15351538ELSE 
    15361539 
     
    15581561    _MSG_TABLE32     dw OFFSET  DATA16:_MSG_TABLE16 
    15591562                     dw SEG     DATA16:_MSG_TABLE16 
    1560            
    1561 ;16:16 address of driver name    
     1563 
     1564;16:16 address of driver name 
    15621565    PDDName          dw OFFSET  DATA16:pddname16 
    15631566                     dw SEG     DATA16:pddname16 
  • GPL/trunk/lib32/irq.c

    r346 r389  
    200200                rc = pSlot->irqHandlers[u].handler(pSlot->irqNo, 
    201201                                                   pSlot->irqHandlers[u].x2, 0); 
     202 
     203                // HDA Hardware generates controller interrupts and stream interrupts 
     204                // the uniaud16 driver only cares about stream interrupts. 
     205                // azx_process_interrupt will return rc 2 if the interttupt is from the 
     206                // controller. There is no need to call uniaud16 for these interrupts 
     207                if ( rc == 2 ) { 
     208                    fInInterrupt = FALSE; 
     209                    *pulIrq = pSlot->irqNo; 
     210                    eoiIrq[pSlot->irqNo] = 0; 
     211                    return TRUE; 
     212                } 
     213 
    202214                if (rc == 1) eoi_irq(pSlot->irqNo); 
    203215                rc = (eoiIrq[pSlot->irqNo] > 0);