Ignore:
Timestamp:
Jul 20, 2010, 5:52:49 PM (15 years ago)
Author:
David Azarewicz
Message:

Changes to PCI bus scan, malloc, cleanup all warnings, misc other changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GPL/branches/uniaud32-2.1.x/drv32/strategy.c

    r504 r519  
    2424
    2525#define INCL_NOPMAPI
    26 #define INCL_DOSINFOSEG     // Need Global info seg in rm.cpp algorithms
     26#define INCL_DOSINFOSEG         // Need Global info seg in rm.cpp algorithms
    2727#include <os2.h>
    2828
     
    5151        }
    5252        numOS2Opens++;
    53         return RPDONE;
     53                return RPDONE;
    5454}
    5555//******************************************************************************
     
    6666ULONG StratInit(RP __far* _rp)
    6767{
    68     ULONG rc;
    69 
    70     RPInit __far* rp = (RPInit __far*)_rp;
    71     rc = DiscardableInit(rp);
    72     dprintf(("StratInit End rc=%d", rc));
    73     return rc;
     68        ULONG rc;
     69
     70        RPInit __far* rp = (RPInit __far*)_rp;
     71        rc = DiscardableInit(rp);
     72        dprintf(("StratInit End rc=%d", rc));
     73        return rc;
    7474}
    7575//******************************************************************************
     
    7777#ifdef ACPI
    7878// See desription in irq.cpp
    79 #include "irqos2.h"                 //PS+++
     79#include "irqos2.h"                             //PS+++
    8080#ifdef __cplusplus
    8181extern "C" {
    8282#endif
    83 ULONG InitCompleteWas = 0;          //PS+++ Indication of InitComplete call
     83ULONG InitCompleteWas = 0;                      //PS+++ Indication of InitComplete call
    8484struct SaveIRQForSlot
    8585{
    86     ULONG  ulSlotNo;
    87     BYTE   LowIRQ;
    88     BYTE   HighIRQ;
    89     BYTE   Pin;
     86        ULONG  ulSlotNo;
     87        BYTE   LowIRQ;
     88        BYTE   HighIRQ;
     89        BYTE   Pin;
    9090};
    9191extern struct SaveIRQForSlot sISRHigh[];
    92 extern int  SaveIRQCounter;
     92extern int      SaveIRQCounter;
    9393#ifdef __cplusplus
    9494}
     
    102102#ifdef ACPI
    103103//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     }
     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        }
    119119#endif
    120120//PS++ End
    121 #ifdef DEBUG
    122     dprintf(("StratInitComplete"));
    123 #endif
     121        dprintf(("StratInitComplete"));
    124122  return(RPDONE);
    125123}
     
    130128#pragma on (unreferenced)
    131129{
    132  RPShutdown __far *rp = (RPShutdown __far *)_rp;
    133 
    134 #ifdef DEBUG
    135  dprintf(("StratShutdown %d", rp->Function));
    136 #endif
    137   if(rp->Function == 1) {//end of shutdown
    138         OSS32_Shutdown();
    139   }
     130        RPShutdown __far *rp = (RPShutdown __far *)_rp;
     131
     132        dprintf(("StratShutdown Start %d", rp->Function));
     133        if(rp->Function == 1) {//end of shutdown
     134                OSS32_Shutdown();
     135        }
     136        dprintf(("StratShutdown End"));
    140137  return(RPDONE);
    141138}
     
    155152RPHandler StratDispatch[] =
    156153{
    157   StratInit,                  // 00 (BC): Initialization
    158   StratError,                 // 01 (B ): Media check
    159   StratError,                 // 02 (B ): Build BIOS parameter block
    160   StratError,                 // 03 (  ): Unused
    161   StratRead,                  // 04 (BC): Read
    162   StratError,                 // 05 ( C): Nondestructive read with no wait
    163   StratError,                 // 06 ( C): Input status
    164   StratError,                 // 07 ( C): Input flush
    165   StratWrite,                 // 08 (BC): Write
    166   StratError,                 // 09 (BC): Write verify
    167   StratError,                 // 0A ( C): Output status
    168   StratError,                 // 0B ( C): Output flush
    169   StratError,                 // 0C (  ): Unused
    170   StratOpen,                  // 0D (BC): Open
    171   StratClose,                 // 0E (BC): Close
    172   StratError,                 // 0F (B ): Removable media check
    173   StratIOCtl,                 // 10 (BC): IO Control
    174   StratError,                 // 11 (B ): Reset media
    175   StratError,                 // 12 (B ): Get logical unit
    176   StratError,                 // 13 (B ): Set logical unit
    177   StratError,                 // 14 ( C): Deinstall character device driver
    178   StratError,                 // 15 (  ): Unused
    179   StratError,                 // 16 (B ): Count partitionable fixed disks
    180   StratError,                 // 17 (B ): Get logical unit mapping of fixed disk
    181   StratError,                 // 18 (  ): Unused
    182   StratError,                 // 19 (  ): Unused
    183   StratError,                 // 1A (  ): Unused
    184   StratError,                 // 1B (  ): Unused
    185   StratShutdown,              // 1C (BC): Notify start or end of system shutdown
    186   StratError,                 // 1D (B ): Get driver capabilities
    187   StratError,                 // 1E (  ): Unused
    188   StratInitComplete           // 1F (BC): Notify end of initialization
     154  StratInit,                              // 00 (BC): Initialization
     155  StratError,                             // 01 (B ): Media check
     156  StratError,                             // 02 (B ): Build BIOS parameter block
     157  StratError,                             // 03 (  ): Unused
     158  StratRead,                              // 04 (BC): Read
     159  StratError,                             // 05 ( C): Nondestructive read with no wait
     160  StratError,                             // 06 ( C): Input status
     161  StratError,                             // 07 ( C): Input flush
     162  StratWrite,                             // 08 (BC): Write
     163  StratError,                             // 09 (BC): Write verify
     164  StratError,                             // 0A ( C): Output status
     165  StratError,                             // 0B ( C): Output flush
     166  StratError,                             // 0C (  ): Unused
     167  StratOpen,                              // 0D (BC): Open
     168  StratClose,                             // 0E (BC): Close
     169  StratError,                             // 0F (B ): Removable media check
     170  StratIOCtl,                             // 10 (BC): IO Control
     171  StratError,                             // 11 (B ): Reset media
     172  StratError,                             // 12 (B ): Get logical unit
     173  StratError,                             // 13 (B ): Set logical unit
     174  StratError,                             // 14 ( C): Deinstall character device driver
     175  StratError,                             // 15 (  ): Unused
     176  StratError,                             // 16 (B ): Count partitionable fixed disks
     177  StratError,                             // 17 (B ): Get logical unit mapping of fixed disk
     178  StratError,                             // 18 (  ): Unused
     179  StratError,                             // 19 (  ): Unused
     180  StratError,                             // 1A (  ): Unused
     181  StratError,                             // 1B (  ): Unused
     182  StratShutdown,                          // 1C (BC): Notify start or end of system shutdown
     183  StratError,                             // 1D (B ): Get driver capabilities
     184  StratError,                             // 1E (  ): Unused
     185  StratInitComplete               // 1F (BC): Notify end of initialization
    189186};
    190187//******************************************************************************
     
    199196{
    200197  if (rp->Command < sizeof(StratDispatch)/sizeof(StratDispatch[0]))
    201         return(StratDispatch[rp->Command](rp));
     198                return(StratDispatch[rp->Command](rp));
    202199  else  return(RPERR_COMMAND | RPDONE);
    203200}
Note: See TracChangeset for help on using the changeset viewer.