Changeset 679 for GPL/trunk/drv32
- Timestamp:
- Mar 18, 2021, 8:57:36 PM (5 years ago)
- Location:
- GPL/trunk
- Files:
-
- 5 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-linux-3.2.102 (added) merged: 611-614 /GPL/branches/uniaud32-next (added) merged: 615-678
- Property svn:mergeinfo changed
-
GPL/trunk/drv32/Makefile
r604 r679 54 54 #=================================================================== 55 55 56 FILES = begin.obj startup.obj & 57 strategy.obj read.obj & 58 init.obj parse.obj & 59 devhlp.obj & 60 idc.obj dispatch.obj & 61 rmhelp.obj irq.obj util.obj & 62 impdos.lib 63 !if "$(KEE)" == "1" 64 FILES += impkee.lib 65 !endif 66 FILES += end.obj 56 FILES = startup.obj strategy.obj read.obj init.obj parse.obj idc.obj & 57 dispatch.obj rmhelp.obj irq.obj impdos.lib impkee.lib 67 58 68 59 LIBS = $(ALSA_LIB)\linuxlib.lib $(ALSA_LIB)\core.lib $(ALSA_LIB)\ac97.lib $(ALSA_LIB)\pci.lib & … … 70 61 $(ALSA_LIB)\mpu401.lib $(ALSA_LIB)\synth.lib $(ALSA_LIB)\cs46xx.lib $(ALSA_LIB)\cs5535audio.lib & 71 62 $(ALSA_LIB)\emu10k1.lib $(ALSA_LIB)\ymfpci.lib $(ALSA_LIB)\ali5451.lib $(ALSA_LIB)\trident.lib & 72 $(ALSA_LIB)\nm256.lib $(ALSA_LIB)\sb.lib $(ALSA_LIB)\core_oss.lib 63 $(ALSA_LIB)\nm256.lib $(ALSA_LIB)\sb.lib $(ALSA_LIB)\core_oss.lib $(ALSA_LIB)\hdac.lib 73 64 WMAPNAME = $(OBJDIR)\$(TARGET).wmap 74 65 … … 94 85 @for %f in ($(LIBS)) do @%append $^@ library %f 95 86 @%write $^@ library $(WATCOM)\lib386\os2\clib3r.lib 96 @%write $^@ library $(WATCOM)\lib386\os2\os2386.lib97 87 !else 98 88 $(LNKFILE): $(MAKEFILE) … … 102 92 @for %f in ($(LIBS)) do @%append $^@ %f 103 93 @%write $^@ $(WATCOM)\lib386\os2\clib3r.lib 104 @%write $^@ $(WATCOM)\lib386\os2\os2386.lib105 94 !ifdef %DRV32KIT 106 95 @%write $^@ $(%DRV32KIT)\drv32.lib … … 123 112 cd ..\.. 124 113 copy $(OBJDIR)\$(TARGET).sym $(ALSA_BIN) 114 copy $(OBJDIR)\$(TARGET).map $(ALSA_BIN) 125 115 126 116 clean: .SYMBOLIC -
GPL/trunk/drv32/devown.h
r32 r679 23 23 */ 24 24 25 26 extern WORD32 deviceOwner;27 extern WORD32 numOS2Opens;28 29 25 #define DEV_NO_OWNER 0 30 26 #define DEV_PDD_OWNER 1 //owner is still unknown -
GPL/trunk/drv32/dispatch.c
r598 r679 28 28 29 29 #include <dbgos2.h> 30 #include <devhelp.h>31 #include <devtype.h>32 #include <strategy.h>33 #include "devown.h"34 30 #include <ossidc.h> 35 31 #include <ossidc32.h> 36 32 #include <version.h> 37 38 extern int cdecl printk(const char * fmt, ...); 39 //****************************************************************************** 40 // Dispatch IOCtl requests received from the Strategy routine 41 //****************************************************************************** 42 extern int GetUniaudCardInfo(ULONG deviceid, void *info); 43 extern int GetUniaudControlNum(ULONG deviceid); 44 extern int GetUniaudControls(ULONG deviceid, void *pids); 45 extern int GetUniaudControlInfo(ULONG deviceid, ULONG id, void *info); 46 extern int GetUniaudControlValueGet(ULONG deviceid, ULONG id, void *value); 47 extern int GetUniaudControlValuePut(ULONG deviceid, ULONG id, void *value); 48 extern int GetNumberOfPcm(int card_id); 49 extern int GetUniaudPcmCaps(ULONG deviceid, void *caps); 50 extern int SetPCMInstance(int card_id, int pcm); 51 extern int WaitForControlChange(int card_id, int timeout); 52 extern int GetNumberOfCards(void); 53 extern OSSRET OSS32_WaveOpen(ULONG deviceid, ULONG streamtype, OSSSTREAMID *pStreamId, int pcm, USHORT fileid); 54 extern OSSRET OSS32_WaveClose(OSSSTREAMID streamid); 55 extern int UniaudIoctlHWRefine(OSSSTREAMID streamid, void *pHwParams); 56 extern int UniaudIoctlHWParamSet(OSSSTREAMID streamid, void *pHwParams); 57 extern int UniaudIoctlSWParamSet(OSSSTREAMID streamid, void *pSwParams); 58 extern int UniaudIoctlPCMStatus(OSSSTREAMID streamid, void *pstatus); 59 extern int UniaudIoctlPCMWrite(OSSSTREAMID streamid, char *buf, int size); 60 extern int UniaudIoctlPCMRead(OSSSTREAMID streamid, char *buf, int size); 61 extern int UniaudIoctlPCMPrepare(OSSSTREAMID streamid); 62 extern int UniaudIoctlPCMStart(OSSSTREAMID streamid); 63 extern int UniaudIoctlPCMDrop(OSSSTREAMID streamid); 64 extern int UniaudIoctlPCMResume(OSSSTREAMID streamid, int pause); 65 extern void UniaudCloseAll(USHORT fileid); 66 extern int WaitForPCMInterrupt(void *file, int timeout); 67 extern int unlock_all; 68 extern int OSS32_CloseUNI16(void); 69 extern int UniaudCtlGetPowerState(ULONG deviceid, void *state); 70 extern int UniaudCtlSetPowerState(ULONG deviceid, void *state); 71 72 typedef UCHAR LOCKHANDLE[12]; 33 #include <kee.h> 34 #include <u32ioctl.h> 35 #include "strategy.h" 73 36 74 37 /* … … 87 50 ULONG StratIOCtl(REQPACKET __far* rp) 88 51 { 89 USHORT rc = 0; ;90 LOCKHANDLElhParm, lhData;91 LINEAR linParm, linData;92 ULONG pages;52 USHORT rc = 0; 53 KEEVMLock lhParm, lhData; 54 char *linParm; 55 char *linData; 93 56 ULONG *pData; 94 57 ULONG card_id; … … 112 75 { 113 76 // got Parm Packet 114 rc = DevVirtToLin((USHORT)((ULONG)(rp->ioctl.pvParm) >> 16), 115 (ULONG)((USHORT)(rp->ioctl.pvParm)), 116 (UCHAR * __far *)&linParm); 117 118 if (rc == 0) 119 { 120 if (rp->ioctl.bFunction == IOCTL_OSS32_ATTACH) 121 { 122 rc = DevVMLock(VMDHL_LONG, (ULONG)linParm, 4, (LINEAR)-1L, lhParm, (UCHAR*)&pages); 123 } 124 else 125 { 126 rc = DevVMLock(VMDHL_LONG, (ULONG)linParm, rp->ioctl.usParmLen, (LINEAR)-1L, lhParm, (UCHAR*)&pages); 127 } 128 129 if (rc != 0) 130 { 131 printk("error in DevVMLock rc = %i\n",rc); 132 return (RPERR_PARAMETER | RPDONE); 133 } 134 } else 135 { 136 printk("error in VirtToLin rc = %i\n",rc); 77 linParm = (char*)KernSelToFlat(rp->ioctl.pvParm); 78 79 if (rp->ioctl.bFunction == IOCTL_OSS32_ATTACH) 80 { 81 rc = KernVMLock(KEE_VML_LONGLOCK, (PVOID)linParm, 4, &lhParm, (KEEVMPageList*)-1, 0); 82 } 83 else 84 { 85 rc = KernVMLock(KEE_VML_LONGLOCK, (PVOID)linParm, rp->ioctl.usParmLen, &lhParm, (KEEVMPageList*)-1, 0); 86 } 87 88 if (rc != 0) 89 { 90 printk("error in KernVMLock rc = %i\n",rc); 137 91 return (RPERR_PARAMETER | RPDONE); 138 92 } 139 } else 93 } 94 else 140 95 { 141 96 // no Parm Packet … … 148 103 { 149 104 // got Data Packet 150 rc = DevVirtToLin((USHORT)((ULONG)(rp->ioctl.pvData) >> 16), 151 (ULONG)((USHORT)(rp->ioctl.pvData)), 152 (UCHAR * __far *)&linData); 153 if (rc == 0) 154 { 155 rc = DevVMLock(VMDHL_LONG, (ULONG)linData, rp->ioctl.usDataLen, (LINEAR)-1L, lhData, 156 (UCHAR*)&pages); 157 } else 158 printk("error in VirtToLin rc = %i\n",rc); 159 105 linData = (char*)KernSelToFlat(rp->ioctl.pvData); 106 107 rc = KernVMLock(KEE_VML_LONGLOCK, (PVOID)linData, rp->ioctl.usDataLen, &lhData, (KEEVMPageList*)-1, 0); 160 108 if (rc != 0) 161 109 { 162 163 printk("error in DevVMLock rc = %i\n",rc); 164 // error in VirtToLin or DevVMLock 110 printk("error in KernVMLock rc = %i\n",rc); 165 111 if (linParm != NULL) 166 112 { 167 113 // linParm present & locked, must to unlock it 168 DevVMUnLock(lhParm);114 KernVMUnlock(&lhParm); 169 115 } 170 116 return (RPERR_PARAMETER | RPDONE); … … 577 523 { 578 524 // linParm present & locked, must to unlock it 579 DevVMUnLock(lhParm);525 KernVMUnlock(&lhParm); 580 526 } 581 527 if (linData != NULL) 582 528 { 583 529 // linData present & locked, must to unlock it 584 DevVMUnLock(lhData);530 KernVMUnlock(&lhData); 585 531 } 586 532 … … 588 534 return (rc); 589 535 } 590 591 //******************************************************************************592 // Dispatch Close requests received from the strategy routine593 //******************************************************************************594 ULONG StratClose(REQPACKET __far* rp)595 {596 // only called if device successfully opened597 // printk("strat close\n");598 numOS2Opens--;599 600 UniaudCloseAll(rp->open_close.usSysFileNum);601 602 if (numOS2Opens == 0) {603 deviceOwner = DEV_NO_OWNER;604 }605 return(RPDONE);606 }607 -
GPL/trunk/drv32/idc.c
r591 r679 29 29 //DAZ } 30 30 #include <devtype.h> 31 #include <devhelp.h> 32 //#include <strategy.h> 31 #include <stacktoflat.h> 33 32 #include <ossidc32.h> 34 33 #include <irqos2.h> 35 #include <stacktoflat.h>36 34 #include <dbgos2.h> 37 35 … … 39 37 IDC16_HANDLER idc16_PddHandler = 0; 40 38 extern int pcm_device; 41 WORD32OSS32IDC(ULONG cmd, PIDC32_PACKET pPacket);39 OSSRET OSS32IDC(ULONG cmd, PIDC32_PACKET pPacket); 42 40 43 41 //packet pointer must reference a structure on the stack -
GPL/trunk/drv32/impdos.def
r32 r679 1 ;*2 ;* Import definitions for DOSCALLS APIs3 ;*4 ;* (C) 2000-2002 InnoTek Systemberatung GmbH5 ;* (C) 2000-2001 Sander van Leeuwen (sandervl@xs4all.nl)6 ;*7 ;* This program is free software; you can redistribute it and/or8 ;* modify it under the terms of the GNU General Public License as9 ;* published by the Free Software Foundation; either version 2 of10 ;* the License, or (at your option) any later version.11 ;*12 ;* This program is distributed in the hope that it will be useful,13 ;* but WITHOUT ANY WARRANTY; without even the implied warranty of14 ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15 ;* GNU General Public License for more details.16 ;*17 ;* You should have received a copy of the GNU General Public18 ;* License along with this program; if not, write to the Free19 ;* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,20 ;* USA.21 ;*22 23 24 ;; ImpDos.def25 ;;26 ;; Export/import information for DOS* APIs callable at Init time.27 ;;28 ;; History:29 ;;30 ;; Sep 30, 94 David Bollo Initial version31 ;; Jan 22, 97 Sander van Leeuwen Added DOSFLATCS & DOSFLATDS32 33 1 LIBRARY DOSCALLS 34 2 35 3 EXPORTS 36 DOSBEEP @5037 DOSCHGFILEPTR @5838 4 DOSCLOSE @59 39 5 DOSOPEN @70 40 DOSDELETE @60 41 DOSDEVCONFIG @52 42 DOSDEVIOCTL @53 43 DOSFINDCLOSE @63 44 DOSFINDFIRST @64 45 DOSFINDNEXT @65 46 DOSGETENV @91 47 DOSGETHUGESHIFT @41 48 DOSGETMACHINEMODE @49 49 DOSGETVERSION @92 50 DOSQCURDIR @71 51 DOSQCURDISK @72 52 DOSQFILEINFO @74 53 DOSQFILEMODE @75 54 DOSREAD @137 55 DOSWRITE @138 6 _DOSWRITE @138 7 DosExit @234 8 DosWrite @282 9 DosQueryCp @291 10 DosQuerySysInfo @348 56 11 DOS32FLATDS @370 57 D OS32FLATCS @36912 DosQueryDBCSEnv @396 58 13 DOSIODELAYCNT @427 -
GPL/trunk/drv32/init.c
r587 r679 29 29 30 30 // Device support 31 #include <devhelp.h>32 31 #include <devtype.h> 33 //DAZ #include <devrp.h> 34 #include <strategy.h> 35 #include "devown.h" 32 #include <stacktoflat.h> 36 33 #include <version.h> 37 34 #include <ossidc32.h> 38 35 #include <dbgos2.h> 39 #include <irqos2.h> 40 //#include <bsedos16.h> 41 #ifdef KEE 36 #include <osspci.h> 42 37 #include <kee.h> 43 # endif38 #include <malloc.h> 44 39 #include "parse.h" 45 #include "malloc.h" 40 #include "sound/version.h" 41 #include "strategy.h" 46 42 47 43 const char ERR_ERROR[] = "ERROR: "; … … 50 46 const char ERR_NAMES[] = "Query names failed\r\r\n"; 51 47 #ifdef DEBUG 52 const char szALSA[] = "\r\n"PRODUCT_NAME" v"UNIAUD_VERSION"-DEBUG\r\nBased on ALSA"ALSA_VERSION"\r\n";48 const char szALSA[] = "\r\n"PRODUCT_NAME" v"UNIAUD_VERSION"-DEBUG\r\nBased on Linux "ALSA_VERSION"\r\n"; 53 49 #else 54 const char szALSA[] = "\r\n"PRODUCT_NAME" v"UNIAUD_VERSION"\r\nBased on ALSA"ALSA_VERSION"\r\n";50 const char szALSA[] = "\r\n"PRODUCT_NAME" v"UNIAUD_VERSION"\r\nBased on Linux "ALSA_VERSION"\r\n"; 55 51 #endif 56 52 57 53 //const char szCopyRight1[]= "Copyright 2000-2002 InnoTek Systemberatung GmbH\r\n"; 58 const char szCopyRight2[]= "Copyright 2000-20 10The ALSA Project\r\n\r\n";59 const char szCopyRight3[]= "Copyright 2005-20 10Netlabs http://www.netlabs.org\r\n";54 const char szCopyRight2[]= "Copyright 2000-2021 The ALSA Project\r\n\r\n"; 55 const char szCopyRight3[]= "Copyright 2005-2021 Netlabs http://www.netlabs.org\r\n"; 60 56 61 57 const char szCodeStartEnd[] = "Code 0x%0x - 0x%0x\r\n\r\n"; … … 101 97 int LockSegments(void) 102 98 { 103 #ifdef KEE104 99 KEEVMLock lock; 105 #else106 char lock[12];107 ULONG PgCount;108 #endif109 100 ULONG segsize; 110 101 … … 120 111 } 121 112 segsize &= ~0xFFF; 122 #ifdef KEE 123 if(KernVMLock( VMDHL_LONG,113 114 if(KernVMLock(KEE_VML_LONGLOCK, 124 115 (PVOID)((OffsetBeginDS32) & ~0xFFF), 125 116 segsize, … … 127 118 (KEEVMPageList*)-1, 128 119 0)) { 129 #else130 if(DevVMLock(VMDHL_LONG,131 ((OffsetBeginDS32) & ~0xFFF),132 segsize,133 (LINEAR)-1,134 (LINEAR)lock,135 (LINEAR)&PgCount)) {136 #endif137 120 return(1); 138 121 } … … 145 128 } 146 129 segsize &= ~0xFFF; 147 #ifdef KEE 148 if(KernVMLock( VMDHL_LONG,130 131 if(KernVMLock(KEE_VML_LONGLOCK, 149 132 (PVOID)((OffsetBeginCS32) & ~0xFFF), 150 133 segsize, … … 152 135 (KEEVMPageList*)-1, 153 136 0)) { 154 #else155 if(DevVMLock(VMDHL_LONG,156 ((OffsetBeginCS32) & ~0xFFF),157 segsize,158 (LINEAR)-1,159 (LINEAR)lock,160 (LINEAR)&PgCount)) {161 #endif162 137 return(1); 163 138 } … … 201 176 char FAR48 *args; 202 177 203 #ifdef KEE 204 GetTKSSBase();205 #endif 178 DebugLevel = 1; 179 rp->init_out.usCodeEnd = 0; 180 rp->init_out.usDataEnd = 0; 206 181 207 182 if(LockSegments()) … … 212 187 } 213 188 214 DebugLevel = 1; 215 rp->init_out.usCodeEnd = 0; 216 rp->init_out.usDataEnd = 0; 189 RMCreateDriverU32(); // register driver in Resource Manager 217 190 218 191 if ( szprintBuf == 0 ) … … 238 211 rprintf(("Uniaud32 version %s",UNIAUD_VERSION)); 239 212 #endif 213 rprintf(("Based on linux %s",CONFIG_SND_VERSION)); 240 214 241 215 if(fVerbose) … … 251 225 WriteString(debugmsg, strlen(debugmsg)); 252 226 } 253 254 //get the current time (to force retrieval of GIS pointer)255 os2gettimemsec();256 227 257 228 char szMixerName[64]; … … 323 294 return RPDONE; 324 295 } 325 -
GPL/trunk/drv32/irq.c
r604 r679 26 26 #include <os2.h> 27 27 28 #include <devtype.h>29 #include <devinfo.h>30 28 #include <devhelp.h> 31 29 #include <include.h> // Defn's for WatCom based drivers. -
GPL/trunk/drv32/parse.c
r607 r679 32 32 #endif 33 33 34 #include <devhelp.h>35 34 #include <devtype.h> 36 #include < unicard.h>35 #include <string.h> 37 36 #include "parse.h" // NUM_DEVICES 38 #include <string.h>39 37 40 38 #define COMM_DEBUG -
GPL/trunk/drv32/read.c
r587 r679 1 1 #define INCL_NOPMAPI 2 2 #include <os2.h> 3 #include <devhelp.h>4 #include <strategy.h>5 3 #include <dbgos2.h> 6 4 #include <string.h> // memcpy 5 #include "strategy.h" 7 6 8 7 int rdOffset= 0; -
GPL/trunk/drv32/rmhelp.c
r587 r679 13 13 #include <os2.h> 14 14 15 #include <devhelp.h> 16 #include <devinfo.h> 17 18 #include <rmbase.h> // Resource manager definitions. 19 #include "rmcalls.h" 20 #include <rmioctl.h> 21 15 #include <devtype.h> 16 #include <stacktoflat.h> 22 17 #include <version.h> 23 18 #include <dbgos2.h> 24 #include <unicard.h>25 19 #include <osspci.h> 26 20 #include <ossidc32.h> 21 #include <string.h> 22 #include "rmbase.h" // Resource manager definitions. 23 #include "rmcalls.h" 27 24 #include "pciids.h" 28 25 29 #include <string.h>30 31 26 #define MAX_RESHANDLES 16 32 27 33 //****************************************************************************** 34 35 //extern PFN RM_Help; 36 //extern PFN RM_Help0; 37 //extern PFN RM_Help3; 38 //extern ULONG RMFlags; 39 40 static HDRIVER DriverHandle = (HDRIVER)-1; 41 static HDEVICE DeviceHandle = 0; 28 static HDRIVER DriverHandle = (HDRIVER)-1; 42 29 static HADAPTER AdapterHandle = 0; 43 static ULONG ctResHandles = 0; 44 static HRESOURCE arResHandles[MAX_RESHANDLES]; 45 46 //****************************************************************************** 47 VOID RMInit(VOID) 48 { 49 APIRET rc; 50 HDRIVER hDriver; 51 DRIVERSTRUCT DriverStruct; 52 char DriverName[sizeof(RM_DRIVER_NAME)]; 53 char VendorName[sizeof(RM_DRIVER_VENDORNAME)]; 54 char DriverDesc[sizeof(RM_DRIVER_DESCRIPTION)]; 55 56 if( DriverHandle == (HDRIVER)-1 ) 57 { 58 memset( (PVOID) &DriverStruct, 0, sizeof(DriverStruct) ); 59 60 //copy strings to stack, because we need to give RM 16:16 pointers 61 //(which can only be (easily) generated from 32 bits stack addresses) 62 strcpy(DriverName, RM_DRIVER_NAME); 63 strcpy(VendorName, RM_DRIVER_VENDORNAME); 64 strcpy(DriverDesc, RM_DRIVER_DESCRIPTION); 65 66 DriverStruct.DrvrName = FlatToSel((ULONG)DriverName); /* ### IHV */ 67 DriverStruct.DrvrDescript = FlatToSel((ULONG)DriverDesc); /* ### IHV */ 68 DriverStruct.VendorName = FlatToSel((ULONG)VendorName); /* ### IHV */ 69 DriverStruct.MajorVer = CMVERSION_MAJOR; //rmbase.h /* ### IHV */ 70 DriverStruct.MinorVer = CMVERSION_MINOR; //rmbase.h /* ### IHV */ 71 DriverStruct.Date.Year = RM_DRIVER_BUILDYEAR; /* ### IHV */ 72 DriverStruct.Date.Month = RM_DRIVER_BUILDMONTH; /* ### IHV */ 73 DriverStruct.Date.Day = RM_DRIVER_BUILDDAY; /* ### IHV */ 74 DriverStruct.DrvrType = DRT_AUDIO; 75 DriverStruct.DrvrSubType = 0; 76 DriverStruct.DrvrCallback = 0; 77 78 rc = RMCreateDriver( FlatToSel((ULONG)&DriverStruct), FlatToSel((ULONG)&hDriver) ); 79 80 if( rc == RMRC_SUCCESS ) DriverHandle = hDriver; 81 dprintf(("RMCreateDriver rc=%d DriverHandle=%x", rc, DriverHandle)); 82 } 83 84 while( ctResHandles ) 85 RMDeallocResource(DriverHandle, arResHandles[--ctResHandles]); 86 } 87 30 31 typedef struct 32 { 33 ULONG NumResource; 34 HRESOURCE hResource[MAX_RESHANDLES]; 35 } RESOURCES; 36 37 static RESOURCES Resource_stt = {0}; 38 39 //****************************************************************************** 40 //****************************************************************************** 41 VOID RMCreateDriverU32(VOID) 42 { 43 HDRIVER hDriver; 44 DRIVERSTRUCT DriverStruct; 45 char DriverName[sizeof(RM_DRIVER_NAME)]; 46 char VendorName[sizeof(RM_DRIVER_VENDORNAME)]; 47 char DriverDesc[sizeof(RM_DRIVER_DESCRIPTION)]; 48 49 //copy strings to stack, because we need to give RM 16:16 pointers 50 //(which can only be (easily) generated from 32 bits stack addresses) 51 strcpy(DriverName, RM_DRIVER_NAME); 52 strcpy(VendorName, RM_DRIVER_VENDORNAME); 53 strcpy(DriverDesc, RM_DRIVER_DESCRIPTION); 54 55 DriverStruct.DrvrName = FlatToSel((ULONG)DriverName); 56 DriverStruct.DrvrDescript = FlatToSel((ULONG)DriverDesc); 57 DriverStruct.VendorName = FlatToSel((ULONG)VendorName); 58 DriverStruct.MajorVer = RM_VMAJOR; 59 DriverStruct.MinorVer = RM_VMINOR; 60 DriverStruct.Date.Year = RM_DRIVER_BUILDYEAR; 61 DriverStruct.Date.Month = RM_DRIVER_BUILDMONTH; 62 DriverStruct.Date.Day = RM_DRIVER_BUILDDAY; 63 DriverStruct.DrvrFlags = 0; 64 DriverStruct.DrvrType = DRT_AUDIO; 65 DriverStruct.DrvrSubType = 0; 66 DriverStruct.DrvrCallback = 0; 67 68 APIRET rc = RMCreateDriver( FlatToSel((ULONG)&DriverStruct), 69 FlatToSel((ULONG)&hDriver) ); 70 71 if( rc == RMRC_SUCCESS ) 72 { 73 DriverHandle = hDriver; 74 } 75 dprintf(("RMCreateDriver rc=%d DriverHandle=%x", rc, DriverHandle)); 76 } 77 78 //****************************************************************************** 79 //****************************************************************************** 80 VOID RMCreateAdapterU32(ULONG DevID, ULONG *phAdapter, USHORT BusDevFunc, ULONG CardNum) 81 { 82 APIRET rc; 83 char szAdapterName[128]; 84 char szMixerName[64]; 85 86 szAdapterName[0] = szMixerName[0] = '\0'; 87 88 if(OSS32_QueryNames(CardNum, szAdapterName, sizeof(szAdapterName), 89 szMixerName, sizeof(szMixerName), FALSE) != OSSERR_SUCCESS ) 90 { 91 return; // error 92 } 93 94 switch(DevID) 95 { 96 case PCIID_VIA_686A: 97 case PCIID_VIA_8233: 98 case PCIID_SI_7012: 99 case PCIID_INTEL_82801: 100 case PCIID_INTEL_82901: 101 case PCIID_INTEL_92801BA: 102 case PCIID_INTEL_440MX: 103 case PCIID_INTEL_ICH3: 104 case PCIID_INTEL_ICH4: 105 case PCIID_INTEL_ICH5: 106 case PCIID_INTEL_ICH6: 107 case PCIID_INTEL_ICH7: 108 case PCIID_NVIDIA_MCP_AUDIO: 109 case PCIID_NVIDIA_MCP2_AUDIO: 110 case PCIID_NVIDIA_MCP3_AUDIO: 111 case PCIID_NVIDIA_CK8S_AUDIO: 112 case PCIID_NVIDIA_CK8_AUDIO: 113 strcat(szAdapterName, " with "); 114 strcat(szAdapterName, szMixerName); 115 break; 116 /* 117 case PCIID_CREATIVELABS_SBLIVE: 118 case PCIID_ALS4000: 119 case PCIID_CMEDIA_CM8338A: 120 case PCIID_CMEDIA_CM8338B: 121 case PCIID_CMEDIA_CM8738: 122 case PCIID_CMEDIA_CM8738B: 123 case PCIID_CIRRUS_4281: 124 case PCIID_CIRRUS_4280: 125 case PCIID_CIRRUS_4612: 126 case PCIID_CIRRUS_4615: 127 case PCIID_ESS_ALLEGRO_1: 128 case PCIID_ESS_ALLEGRO: 129 case PCIID_ESS_MAESTRO3: 130 case PCIID_ESS_MAESTRO3_1: 131 case PCIID_ESS_MAESTRO3_HW: 132 case PCIID_ESS_MAESTRO3_2: 133 case PCIID_ESS_CANYON3D_2LE: 134 case PCIID_ESS_CANYON3D_2: 135 case PCIID_ESS_ES1938: 136 case PCIID_AUREAL_VORTEX: 137 case PCIID_AUREAL_VORTEX2: 138 case PCIID_AUREAL_ADVANTAGE: 139 case PCIID_ENSONIQ_CT5880: 140 case PCIID_ENSONIQ_ES1371: 141 case PCIID_YAMAHA_YMF724: 142 case PCIID_YAMAHA_YMF724F: 143 case PCIID_YAMAHA_YMF740: 144 case PCIID_YAMAHA_YMF740C: 145 case PCIID_YAMAHA_YMF744: 146 case PCIID_YAMAHA_YMF754: 147 case PCIID_ESS_M2E: 148 case PCIID_ESS_M2: 149 case PCIID_ESS_M1: 150 case PCIID_ALI_5451: 151 case PCIID_TRIDENT_4DWAVE_DX: 152 case PCIID_TRIDENT_4DWAVE_NX: 153 case PCIID_SI_7018: 154 case PCIID_FM801: 155 case PCIID_ATIIXP_SB200: 156 case PCIID_ATIIXP_SB300: 157 case PCIID_ATIIXP_SB400: 158 case PCIID_AUDIGYLS: 159 case PCIID_AUDIGYLS1: 160 case PCIID_AUDIGYLS2: 161 break; 162 */ 163 } 164 165 if( !szAdapterName[0] ) 166 { 167 strcpy(szAdapterName, "Unknown"); 168 } 169 170 //copy to stack, because we need to give RM 16:16 pointers 171 //(which can only be (easily) generated from 32 bits stack addresses) 172 RESOURCES Resource_loc; 173 // is any resoures detected and registered in RM ? 174 if( Resource_stt.NumResource ) 175 { 176 memcpy( &Resource_loc, &Resource_stt, sizeof(Resource_loc) ); 177 } 178 else 179 { 180 dprintf(("No resources allocated !!!")); 181 Resource_loc.NumResource = 0; 182 } 183 184 ADJUNCT adjBusDevFunc; 185 adjBusDevFunc.pNextAdj = NULL; 186 adjBusDevFunc.AdjLength = sizeof(adjBusDevFunc); 187 adjBusDevFunc.AdjType = ADJ_PCI_DEVFUNC; 188 adjBusDevFunc.PCI_DevFunc = BusDevFunc; 189 190 ADAPTERSTRUCT AdapterStruct; 191 AdapterStruct.AdaptDescriptName = FlatToSel((ULONG)szAdapterName); /* ### IHV */ 192 AdapterStruct.AdaptFlags = AS_16MB_ADDRESS_LIMIT; // AdaptFlags /* ### IHV */ 193 AdapterStruct.BaseType = AS_BASE_MMEDIA; // BaseType 194 AdapterStruct.SubType = AS_SUB_MM_AUDIO; // SubType 195 AdapterStruct.InterfaceType = AS_INTF_GENERIC; // InterfaceType 196 AdapterStruct.HostBusType = AS_HOSTBUS_PCI; // HostBusType /* ### IHV */ 197 AdapterStruct.HostBusWidth = AS_BUSWIDTH_32BIT; // HostBusWidth /* ### IHV */ 198 AdapterStruct.pAdjunctList = FlatToSel((ULONG)&adjBusDevFunc);// pAdjunctList /* ### IHV */ 199 AdapterStruct.Reserved = 0; 200 201 //--- Register adapter. We'll record any error code, but won't fail 202 // the driver initialization and won't return resources. 203 //NOTE: hAdapter must be used as FlatToSel only works for stack variables 204 HADAPTER hAdapter; 205 rc = RMCreateAdapter(DriverHandle, // Handle to driver 206 FlatToSel((ULONG)&hAdapter), // (OUT) Handle to adapter 207 FlatToSel((ULONG)&AdapterStruct), // Adapter structure 208 0, // Parent device (defaults OK) 209 Resource_loc.NumResource ? (FlatToSel((ULONG)&Resource_loc)) : 0); // Allocated resources. 210 211 dprintf(("RMCreateAdapter rc=%d", rc)); 212 213 if( rc == 0 ) 214 { 215 AdapterHandle = hAdapter; 216 *phAdapter = hAdapter; 217 Resource_stt.NumResource = 0; // no resource handles to be freed 218 } 219 else 220 { 221 RMDeallocRes(); 222 } 223 } 88 224 89 225 //****************************************************************************** … … 105 241 FlatToSel((ULONG)&Resource)); // Resource to allocate. 106 242 107 if( rc == 0 && ctResHandles< MAX_RESHANDLES )243 if( rc == 0 && Resource_stt.NumResource < MAX_RESHANDLES ) 108 244 { 109 arResHandles[ctResHandles++] = hres; return TRUE;245 Resource_stt.hResource[Resource_stt.NumResource++] = hres; return TRUE; 110 246 } 111 247 112 dprintf(("RMAllocResource[%d] IO rc = %d", ctResHandles, rc));248 dprintf(("RMAllocResource[%d] IO rc = %d", Resource_stt.NumResource, rc)); 113 249 114 250 return FALSE; … … 133 269 FlatToSel((ULONG)&Resource)); // Resource to allocate. 134 270 135 if( rc == 0 && ctResHandles< MAX_RESHANDLES )271 if( rc == 0 && Resource_stt.NumResource < MAX_RESHANDLES ) 136 272 { 137 arResHandles[ctResHandles++] = hres; return TRUE;273 Resource_stt.hResource[Resource_stt.NumResource++] = hres; return TRUE; 138 274 } 139 275 140 dprintf(("RMAllocResource[%d] MEM rc = %d", ctResHandles, rc));276 dprintf(("RMAllocResource[%d] MEM rc = %d", Resource_stt.NumResource, rc)); 141 277 142 278 return rc == 0; … … 148 284 BOOL RMRequestIRQ(ULONG ulIrq, BOOL fShared, PHRESOURCE phRes) 149 285 { 150 RESOURCESTRUCT Resource; 151 HRESOURCE hRes; 152 APIRET rc; 153 154 Resource.ResourceType = RS_TYPE_IRQ; 155 Resource.IRQResource.IRQLevel = (USHORT)ulIrq & 0xff; 156 Resource.IRQResource.PCIIrqPin = 0; 157 Resource.IRQResource.IRQFlags = ( fShared ) ? RS_IRQ_SHARED : RS_IRQ_EXCLUSIVE; 158 159 rc = RMAllocResource(DriverHandle, // Handle to driver. 160 FlatToSel((ULONG)&hRes), // OUT: "allocated" resource node handle 161 FlatToSel((ULONG)&Resource)); // Resource to allocate. 162 163 164 if (rc == 0) { 165 *phRes = hRes; 166 if (DeviceHandle) { 167 dprintf(("RMRequestIRQ: DriverHandle=%x DeviceHandle=%x hRes=%x", DriverHandle, DeviceHandle, hRes)); 168 rc = RMModifyResources(DriverHandle, DeviceHandle, RM_MODIFY_ADD, hRes); 169 } else { 170 if (ctResHandles < MAX_RESHANDLES ) arResHandles[ctResHandles++] = hRes; 171 } 286 RESOURCESTRUCT Resource; 287 HRESOURCE hRes; 288 APIRET rc; 289 290 memset( &Resource, 0, sizeof(Resource) ); 291 Resource.ResourceType = RS_TYPE_IRQ; 292 Resource.IRQResource.IRQLevel = (USHORT)ulIrq & 0xff; 293 Resource.IRQResource.PCIIrqPin = 0; 294 Resource.IRQResource.IRQFlags = ( fShared ) ? RS_IRQ_SHARED : RS_IRQ_EXCLUSIVE; 295 296 rc = RMAllocResource(DriverHandle, // Handle to driver. 297 FlatToSel((ULONG)&hRes), // OUT: "allocated" resource node handle 298 FlatToSel((ULONG)&Resource)); // Resource to allocate. 299 300 if (rc == 0) 301 { 302 *phRes = hRes; 303 if (AdapterHandle) 304 { 305 dprintf(("RMRequestIRQ: DriverHandle=%x AdapterHandle=%x hRes=%x", DriverHandle, AdapterHandle, hRes)); 306 rc = RMModifyResources(DriverHandle, AdapterHandle, RM_MODIFY_ADD, hRes); 307 } 308 else 309 { 310 if (Resource_stt.NumResource < MAX_RESHANDLES ) 311 { 312 Resource_stt.hResource[Resource_stt.NumResource++] = hRes; 313 } 172 314 } 173 174 dprintf(("RMAllocResource[%d] IRQ=%d rc=%d", ctResHandles, ulIrq, rc)); 315 } 316 dprintf(("RMAllocResource[%d] IRQ=%d rc=%d", Resource_stt.NumResource, ulIrq, rc)); 317 return rc == 0; 318 } 319 320 //****************************************************************************** 321 //****************************************************************************** 322 BOOL RMDeallocateIRQ(HRESOURCE hRes) 323 { 324 APIRET rc; 325 326 dprintf(("RMDeallocateIRQ: DriverHandle=%x AdapterHandle=%x hRes=%x", DriverHandle, AdapterHandle, hRes)); 327 rc = RMModifyResources(DriverHandle, AdapterHandle, RM_MODIFY_DELETE, hRes); 175 328 176 329 return rc == 0; … … 179 332 //****************************************************************************** 180 333 //****************************************************************************** 181 BOOL RMDeallocateIRQ(HRESOURCE hRes) 182 { 183 APIRET rc; 184 185 dprintf(("RMDeallocateIRQ: DriverHandle=%x DeviceHandle=%x hRes=%x", DriverHandle, DeviceHandle, hRes)); 186 rc = RMModifyResources(DriverHandle, DeviceHandle, RM_MODIFY_DELETE, hRes); 187 188 return rc == 0; 189 } 190 191 192 //****************************************************************************** 193 //****************************************************************************** 194 VOID RMDone(ULONG DevID, PHADAPTER phAdapter, PHDEVICE phDevice) 195 { 196 APIRET rc; 197 HDEVICE hDevice; 198 HADAPTER hAdapter; 199 ADAPTERSTRUCT AdapterStruct; 200 DEVICESTRUCT DeviceStruct; 201 char AdapterName[sizeof(RM_ADAPTER_NAME)]; 202 char szDeviceName[128]; 203 char szMixerName[64]; 204 struct { 205 ULONG NumResource; 206 HRESOURCE hResource[MAX_RESHANDLES]; 207 } ahResource; 208 209 szDeviceName[0] = szMixerName[0] = '\0'; 210 211 if( DevID && OSS32_QueryNames(OSS32_DEFAULT_DEVICE, 212 szDeviceName, sizeof(szDeviceName), 213 szMixerName, sizeof(szMixerName), FALSE) == OSSERR_SUCCESS ) 214 { 215 switch(DevID) { 216 case PCIID_VIA_686A: 217 case PCIID_VIA_8233: 218 case PCIID_SI_7012: 219 case PCIID_INTEL_82801: 220 case PCIID_INTEL_82901: 221 case PCIID_INTEL_92801BA: 222 case PCIID_INTEL_440MX: 223 case PCIID_INTEL_ICH3: 224 case PCIID_INTEL_ICH4: 225 case PCIID_INTEL_ICH5: 226 case PCIID_INTEL_ICH6: 227 case PCIID_INTEL_ICH7: 228 case PCIID_NVIDIA_MCP_AUDIO: 229 case PCIID_NVIDIA_MCP2_AUDIO: 230 case PCIID_NVIDIA_MCP3_AUDIO: 231 case PCIID_NVIDIA_CK8S_AUDIO: 232 case PCIID_NVIDIA_CK8_AUDIO: 233 strcat(szDeviceName, " with "); 234 strcat(szDeviceName, szMixerName); 235 break; 236 /* 237 case PCIID_CREATIVELABS_SBLIVE: 238 case PCIID_ALS4000: 239 case PCIID_CMEDIA_CM8338A: 240 case PCIID_CMEDIA_CM8338B: 241 case PCIID_CMEDIA_CM8738: 242 case PCIID_CMEDIA_CM8738B: 243 case PCIID_CIRRUS_4281: 244 case PCIID_CIRRUS_4280: 245 case PCIID_CIRRUS_4612: 246 case PCIID_CIRRUS_4615: 247 case PCIID_ESS_ALLEGRO_1: 248 case PCIID_ESS_ALLEGRO: 249 case PCIID_ESS_MAESTRO3: 250 case PCIID_ESS_MAESTRO3_1: 251 case PCIID_ESS_MAESTRO3_HW: 252 case PCIID_ESS_MAESTRO3_2: 253 case PCIID_ESS_CANYON3D_2LE: 254 case PCIID_ESS_CANYON3D_2: 255 case PCIID_ESS_ES1938: 256 case PCIID_AUREAL_VORTEX: 257 case PCIID_AUREAL_VORTEX2: 258 case PCIID_AUREAL_ADVANTAGE: 259 case PCIID_ENSONIQ_CT5880: 260 case PCIID_ENSONIQ_ES1371: 261 case PCIID_YAMAHA_YMF724: 262 case PCIID_YAMAHA_YMF724F: 263 case PCIID_YAMAHA_YMF740: 264 case PCIID_YAMAHA_YMF740C: 265 case PCIID_YAMAHA_YMF744: 266 case PCIID_YAMAHA_YMF754: 267 case PCIID_ESS_M2E: 268 case PCIID_ESS_M2: 269 case PCIID_ESS_M1: 270 case PCIID_ALI_5451: 271 case PCIID_TRIDENT_4DWAVE_DX: 272 case PCIID_TRIDENT_4DWAVE_NX: 273 case PCIID_SI_7018: 274 case PCIID_FM801: 275 case PCIID_ATIIXP_SB200: 276 case PCIID_ATIIXP_SB300: 277 case PCIID_ATIIXP_SB400: 278 case PCIID_AUDIGYLS: 279 case PCIID_AUDIGYLS1: 280 case PCIID_AUDIGYLS2: 281 break; 282 */ 283 } /* switch */ 284 285 286 if( ctResHandles ) 287 { 288 ahResource.NumResource = ctResHandles; 289 memcpy(ahResource.hResource, 290 arResHandles, ctResHandles * sizeof(arResHandles[0])); 291 292 //copy string to stack, because we need to give RM 16:16 pointers 293 //(which can only be (easily) generated from 32 bits stack addresses) 294 strcpy(AdapterName, RM_ADAPTER_NAME); 295 296 memset( (PVOID) &AdapterStruct, 0, sizeof(AdapterStruct) ); 297 AdapterStruct.AdaptDescriptName = FlatToSel((ULONG)AdapterName); /* ### IHV */ 298 AdapterStruct.AdaptFlags = AS_16MB_ADDRESS_LIMIT; // AdaptFlags /* ### IHV */ 299 AdapterStruct.BaseType = AS_BASE_MMEDIA; // BaseType 300 AdapterStruct.SubType = AS_SUB_MM_AUDIO; // SubType 301 AdapterStruct.InterfaceType = AS_INTF_GENERIC; // InterfaceType 302 AdapterStruct.HostBusType = AS_HOSTBUS_PCI; // HostBusType /* ### IHV */ 303 AdapterStruct.HostBusWidth = AS_BUSWIDTH_32BIT; // HostBusWidth /* ### IHV */ 304 AdapterStruct.pAdjunctList = 0; // pAdjunctList /* ### IHV */ 305 306 //--- Register adapter. We'll record any error code, but won't fail 307 // the driver initialization and won't return resources. 308 //NOTE: hAdapter must be used as FlatToSel only works for stack variables 309 rc = RMCreateAdapter(DriverHandle, // Handle to driver 310 FlatToSel((ULONG)&hAdapter), // (OUT) Handle to adapter 311 FlatToSel((ULONG)&AdapterStruct), // Adapter structure 312 0, // Parent device (defaults OK) 313 0); // Allocated resources. 314 315 dprintf(("RMCreateAdapter rc=%d", rc)); 316 317 if( rc == 0 ) 318 { 319 AdapterHandle = hAdapter; 320 if (phAdapter) *phAdapter = hAdapter; 321 if( !szDeviceName[0] ) strcpy(szDeviceName, "Unknown"); 322 323 //NOTE: Assumes szDeviceName is a stack pointer!! 324 memset( (PVOID) &DeviceStruct, 0, sizeof(DeviceStruct) ); 325 DeviceStruct.DevDescriptName = FlatToSel((ULONG)szDeviceName); 326 DeviceStruct.DevFlags = DS_FIXED_LOGICALNAME; 327 DeviceStruct.DevType = DS_TYPE_AUDIO; 328 DeviceStruct.pAdjunctList = 0; 329 330 rc = RMCreateDevice(DriverHandle, // Handle to driver 331 FlatToSel((ULONG)&hDevice), // (OUT) Handle to device, unused. 332 FlatToSel((ULONG)&DeviceStruct), // Device structure 333 hAdapter, // Parent adapter 334 FlatToSel((ULONG)&ahResource)); // Allocated resources 335 336 dprintf(("RMCreateDevice rc=%d", rc)); 337 338 if( rc == 0 ) 339 { 340 DeviceHandle = hDevice; 341 if (phDevice) *phDevice = hDevice; 342 ctResHandles = 0; // no resource handles to be freed 343 dprintf(("RMDone: DriverHandle=%x DeviceHandle=%x", DriverHandle, DeviceHandle)); 344 return; 345 } 346 347 // !!! Not implemented in startup.asm 348 // RMDestroyAdapter(DriverHandle, hAdapter); 349 } /* if rc == 0 */ 350 } /* ctResHandles */ 351 else dprintf(("No resources allocated !!!")); 352 } /* if DevID */ 353 354 355 // free resource handles 356 while( ctResHandles ) 357 RMDeallocResource(DriverHandle, arResHandles[--ctResHandles]); 358 } 359 334 VOID RMDeallocRes(VOID) 335 { 336 // free resource handles 337 while( Resource_stt.NumResource ) 338 { 339 RMDeallocResource(DriverHandle, Resource_stt.hResource[--Resource_stt.NumResource]); 340 } 341 } 360 342 361 343 /* DAZ - dirty hack so that resource manager is updated correctly 362 344 * when using APIC and multiple adapters */ 363 VOID RMSetHandles(HADAPTER hAdapter , HDEVICE hDevice)345 VOID RMSetHandles(HADAPTER hAdapter) 364 346 { 365 347 AdapterHandle = hAdapter; 366 DeviceHandle = hDevice; 367 } 368 348 } -
GPL/trunk/drv32/segments.inc
r32 r679 38 38 _TEXT ends 39 39 40 BEGTEXT segment dword public use32 'CODE' 41 BEGTEXT ends 42 40 43 LASTCODE32 segment dword public use32 'CODE' 41 44 LASTCODE32 ends … … 68 71 CONST2 ENDS 69 72 70 IFDEF KEE71 73 LASTDATA32 SEGMENT DWORD PUBLIC USE32 'DATA' 72 74 LASTDATA32 ENDS 73 ELSE74 LASTDATA32 SEGMENT DWORD PUBLIC USE32 'BSS'75 LASTDATA32 ENDS76 ENDIF77 75 78 76 ;order is important! 79 IFDEF KEE80 77 DGROUP group BSS32, DATA32, _DATA, CONST32, C_COMMON, c_common, CONST2, CONST, _BSS, LASTDATA32 81 ELSE82 DGROUP group DATA32, CONST32, C_COMMON, c_common, CONST2, CONST, _BSS, BSS32, _DATA, LASTDATA3283 ENDIF84 78 85 CGROUP group FIRSTCODE32, CODE32, _TEXT, LASTCODE3279 CGROUP group FIRSTCODE32, CODE32, _TEXT, BEGTEXT, LASTCODE32 -
GPL/trunk/drv32/startup.asm
r577 r679 37 37 DATA16 segment 38 38 extrn DOS32FLATDS : abs ; ring 0 FLAT kernel data selector 39 public __OffFinalDS1640 public help_header41 public uniaud_header42 public _MSG_TABLE1643 public DevHelpInit44 public fOpen45 public InitPktSeg46 public InitPktOff47 public _MESSAGE_STR48 public pddname1649 public FileName50 public _RM_Help051 public _RM_Help152 public _RM_Help353 public _RMFlags54 IFDEF DEBUG55 public DbgU32TimerCnt56 public DbgU32IntCnt57 ENDIF58 59 39 ;********************************************************************************************* 60 40 ;************************* Device Driver Header ********************************************** 61 41 ;********************************************************************************************* 42 public help_header 62 43 help_header dw OFFSET DATA16:uniaud_header ; Pointer to next driver 63 44 dw SEG DATA16:uniaud_header … … 92 73 dw 0000000000000000b 93 74 94 uniaud_header dd -1 75 public uniaud_header 76 uniaud_header dd -1 95 77 dw 1101100110000000b ; Device attributes 96 78 ; ||||| +-+ |||| … … 123 105 dw 0000000000000000b 124 106 107 108 public DevHelpInit 125 109 DevHelpInit dd 0 110 111 public fOpen 126 112 fOpen dd 0 113 114 public InitPktSeg 115 public InitPktOff 127 116 InitPktSeg dw 0 128 117 InitPktOff dw 0 118 129 119 IFDEF DEBUG 130 DbgU32TimerCnt dd 0 131 DbgU32IntCnt dd 0 120 public DbgU32TimerCnt 121 public DbgU32IntCnt 122 DbgU32TimerCnt dd 0 123 DbgU32IntCnt dd 0 132 124 ENDIF 125 133 126 ;needed for rmcalls.lib 127 public _RM_Help0 128 public _RM_Help1 129 public _RM_Help3 130 public _RMFlags 134 131 _RM_Help0 dd 0 135 132 _RM_Help1 dd 0 136 133 _RM_Help3 dd 0 137 134 _RMFlags dd 0 135 136 public _MESSAGE_STR 137 public _MSG_TABLE16 138 138 _MESSAGE_STR db 1024 dup (0) 139 139 _MSG_TABLE16 dw 0 ;message length … … 141 141 dw SEG _MESSAGE_STR 142 142 143 pddname16 db 'ALSA32$' 144 FileName db "ALSAHLP$", 0 145 ResMgr DB 52H,45H,53H,4dH,47H,52H,24H,20H 146 DB 00H 143 FileName db 'ALSAHLP$', 0 144 ResMgr db 'RESMGR$ ',0 145 147 146 _RMIDCTable DB 00H,00H,00H,00H,00H,00H,00H,00H 148 147 DB 00H,00H,00H,00H 149 148 150 149 ;last byte in 16 bits data segment 151 __OffFinalDS16 label byte 150 public __OffFinalDS16 151 __OffFinalDS16 label byte 152 152 153 153 DATA16 ends 154 154 ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 155 155 CODE16 segment 156 156 assume cs:CODE16, ds:DATA16 157 157 158 public __OffFinalCS16159 160 public help_stub_strategy161 public uniaud_stub_strategy162 public uniaud_stub_idc163 public uniaud_stub_timer164 public thunk3216_devhelp165 public thunk3216_devhelp_modified_ds166 158 extrn DOSOPEN : far 167 extrn DOSWRITE: far159 extrn _DOSWRITE : far 168 160 extrn DOSCLOSE : far 169 161 … … 394 386 lea dx, [bp - 2] 395 387 push dx 396 call DOSWRITE388 call _DOSWRITE 397 389 398 390 pop eax … … 413 405 ALIGN 2 414 406 ;use devhlp pointer stored in 16 bits code segment 407 public thunk3216_devhelp 415 408 thunk3216_devhelp: 416 409 push ds … … 419 412 call dword ptr DevHelpInit 420 413 pop ds 421 422 414 jmp far ptr FLAT:thunk1632_devhelp 423 415 424 416 ALIGN 2 417 public thunk3216_devhelp_modified_ds 425 418 thunk3216_devhelp_modified_ds: 426 419 push gs … … 1020 1013 1021 1014 ;end of 16 bits code segment 1015 public __OffFinalCS16 1022 1016 __OffFinalCS16 label byte 1023 1017 1024 1018 CODE16 ends 1025 1019 ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 1020 ;Label to mark start of 32 bits code section 1021 FIRSTCODE32 segment 1022 public __OffBeginCS32 1023 __OffBeginCS32 label byte 1024 FIRSTCODE32 ends 1025 ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 1026 1026 CODE32 segment 1027 1027 ASSUME CS:FLAT, DS:FLAT, ES:FLAT 1028 1028 1029 public __GETDS1030 public thunk1632_devhelp1031 public thunk1632_devhelp_modified_ds1032 public DevHlp1033 public DevHlp_ModifiedDS1034 public STRATEGY_1035 public IDC_1036 public TIMER_1037 1029 extrn ALSA_STRATEGY : near 1038 1030 extrn ALSA_IDC : near 1039 1031 extrn ALSA_TIMER_ : near 1040 1032 extrn ALSA_Interrupt : near 1041 extrn GetTKSSBase : near1042 1033 extrn _rdOffset: dword 1043 1044 IFDEF KEE1045 1034 extrn KernThunkStackTo16 : near 1046 1035 extrn KernThunkStackTo32 : near 1047 ELSE1048 extrn StackAlloc : near1049 extrn StackFree : near1050 ENDIF1051 1036 1052 1037 ;Called by Watcom to set the DS … … 1067 1052 DevHelpDebug endp 1068 1053 1069 ALIGN 4 1070 1071 ALIGN 4 1054 ALIGN 4 1055 public DevHlp 1072 1056 DevHlp proc near 1073 IFDEF FLATSTACK1074 1057 DevThunkStackTo16_Int 1075 ENDIF1076 1077 1058 jmp far ptr CODE16:thunk3216_devhelp 1078 1059 ALIGN 4 1079 1060 thunk1632_devhelp: 1080 IFDEF FLATSTACK1081 1061 DevThunkStackTo32_Int 1082 ENDIF1083 1062 ret 1084 1063 DevHlp endp … … 1086 1065 ALIGN 4 1087 1066 DevHlp_ModifiedDS proc near 1088 IFDEF FLATSTACK1089 1067 DevThunkStackTo16_Int 1090 ENDIF1091 1068 jmp far ptr CODE16:thunk3216_devhelp_modified_ds 1092 1069 ALIGN 4 1093 1070 thunk1632_devhelp_modified_ds: 1094 IFDEF FLATSTACK1095 1071 DevThunkStackTo32_Int 1096 ENDIF1097 1072 ret 1098 1073 DevHlp_ModifiedDS endp 1099 1100 1101 IFNDEF KEE1102 ;;******************************************************************************1103 ;FixSelDPL:1104 ;1105 ; Set DPL of DOS32FLATDS selector to 0 or else we'll get a trap D when loading1106 ; it into the SS register (DPL must equal CPL when loading a selector into SS)1107 ;;******************************************************************************1108 PUBLIC FixSelDPL1109 ALIGN 41110 FixSelDPL proc near1111 cmp fWrongDPL, 11112 jne short @@fixdpl_end1113 cmp SelRef, 01114 jne short @@fixdpl_endfix1115 push eax1116 push ebx1117 push edx1118 sgdt fword ptr [gdtsave] ; access the GDT ptr1119 mov ebx, dword ptr [gdtsave+2] ; get lin addr of GDT1120 mov eax, ds ; build offset into table1121 and eax, 0fffffff8h ; mask away DPL1122 add ebx, eax ; build address1123 1124 mov eax, dword ptr [ebx+4]1125 mov edx, eax1126 shr edx, 131127 and edx, 31128 1129 ;has the OS/2 kernel finally changed the DPL to 0?1130 cmp edx, 01131 jne @@changedpl1132 mov fWrongDPL, 0 ;don't bother anymore1133 mov SelRef, 01134 jmp short @@endchange1135 1136 @@changedpl:1137 mov oldDPL, eax1138 and eax, NOT 6000h ;clear bits 5 & 6 in the high word (DPL)1139 mov dword ptr [ebx+4], eax1140 @@endchange:1141 pop edx1142 pop ebx1143 pop eax1144 @@fixdpl_endfix:1145 inc SelRef1146 @@fixdpl_end:1147 ret1148 FixSelDPL endp1149 ;;******************************************************************************1150 ; RestoreSelDPL:1151 ;1152 ; Restore DPL of DOS32FLATDS selector or else OS/2 kernel code running in ring 31153 ; will trap (during booting only; this sel has a DPL of 0 when PM starts up)1154 ;;******************************************************************************1155 PUBLIC RestoreSelDPL1156 ALIGN 41157 RestoreSelDPL proc near1158 cmp fWrongDPL, 11159 jne short @@restdpl_end1160 1161 cmp SelRef, 11162 jne short @@restdpl_endrest1163 push eax1164 push ebx1165 sgdt fword ptr [gdtsave] ; access the GDT ptr1166 mov ebx, dword ptr [gdtsave+2] ; get lin addr of GDT1167 mov eax, ds ; build offset into table1168 and eax, 0fffffff8h ; mask away DPL1169 add ebx, eax ; build address1170 1171 mov eax, oldDPL1172 mov dword ptr [ebx+4], eax1173 pop ebx1174 pop eax1175 @@restdpl_endrest:1176 dec SelRef1177 @@restdpl_end:1178 ret1179 RestoreSelDPL endp1180 ENDIF1181 1074 1182 1075 ;******************************************************************************* … … 1194 1087 mov ebp, esp 1195 1088 push ebx 1196 1197 1089 lea ebx, [ebp+8] 1198 1090 DevThunkStackTo16_Int 1199 1200 1091 push dword ptr [ebx+16] ;param2 1201 1092 push dword ptr [ebx+12] ;param1 … … 1203 1094 call fword ptr [ebx] 1204 1095 add sp, 12 1205 1206 1096 DevThunkStackTo32_Int 1207 1208 1097 pop ebx 1209 1098 pop ebp … … 1222 1111 push fs 1223 1112 push gs 1224 1225 1113 mov eax, DOS32FLATDS 1226 1114 mov ds, eax 1227 1115 mov es, eax 1228 1229 IFDEF FLATSTACK1230 1231 IFNDEF KEE1232 ;done in init.cpp for the KEE version1233 cmp dword ptr [intSwitchStack], 01234 jne stratcontinue1235 1236 ;get TKSSBase & intSwitchStack pointers1237 call GetTKSSBase1238 stratcontinue:1239 ENDIF1240 1241 1116 DevThunkStackTo32 1242 cmp eax, 01243 jne @@stackswitchfail_strat1244 1245 1117 call ALSA_STRATEGY 1246 1247 1118 DevThunkStackTo16 1248 1249 @@stackswitchfail_strat:1250 ELSE1251 int 31252 call ALSA_STRATEGY1253 ENDIF1254 1255 1119 pop gs 1256 1120 pop fs … … 1273 1137 push fs 1274 1138 push gs 1275 1276 1139 mov eax, DOS32FLATDS 1277 1140 mov ds, eax 1278 1141 mov es, eax 1279 1280 IFDEF FLATSTACK1281 1142 DevThunkStackTo32 1282 cmp eax, 01283 jne @@stackswitchfail_idc1284 1285 1143 call ALSA_IDC 1286 1287 1144 DevThunkStackTo16 1288 1289 @@stackswitchfail_idc:1290 1291 ELSE1292 int 31293 call ALSA_IDC1294 ENDIF1295 1296 1145 pop gs 1297 1146 pop fs … … 1310 1159 push fs 1311 1160 push gs 1312 1313 1161 mov eax, DOS32FLATDS 1314 1162 mov ds, eax 1315 1163 mov es, eax 1316 1317 1164 IFDEF DEBUG 1318 1165 add DbgU32TimerCnt, 1 1319 1166 ENDIF 1320 1321 IFDEF FLATSTACK1322 1167 DevThunkStackTo32 1323 cmp eax, 01324 jne @@stackswitchfail_timer1325 1326 1168 call ALSA_TIMER_ 1327 1328 1169 DevThunkStackTo16 1329 1330 @@stackswitchfail_timer:1331 1332 ELSE1333 int 31334 call ALSA_TIMER_1335 ENDIF1336 1170 IFDEF DEBUG 1337 1171 add DbgU32TimerCnt, -1 1338 1172 ENDIF 1339 1340 1173 pop gs 1341 1174 pop fs … … 1355 1188 enter 0, 0 1356 1189 and sp, 0fffch ; align stack 1357 1358 1190 pushad 1359 1191 push ds … … 1361 1193 push fs 1362 1194 push gs 1363 1364 1195 mov eax, DOS32FLATDS 1365 1196 mov ds, eax 1366 1197 mov es, eax 1367 1368 1198 pushfd 1369 1370 1199 IFDEF DEBUG 1371 1200 add DbgU32IntCnt, 1 1372 1201 ENDIF 1373 1374 1202 ; At this point a cli is redundant 1375 1203 ; we enter the interrupt handler with interrupts disabled. 1376 1204 ;cli 1377 1378 IFDEF FLATSTACK1379 1205 DevThunkStackTo32 1380 cmp eax, 01381 jne @@stackswitchfail_irq1382 1383 1206 ;returns irq status in eax (1=handled; 0=unhandled) 1384 1207 call ALSA_Interrupt 1385 1386 1208 DevThunkStackTo16 1387 1388 @@stackswitchfail_irq:1389 ELSE1390 int 31391 call ALSA_Interrupt1392 ENDIF1393 1394 1209 IFDEF DEBUG 1395 1210 add DbgU32IntCnt, -1 1396 1211 ENDIF 1397 1398 1212 ;restore flags 1399 1213 popfd 1400 1401 1214 cmp eax, 1 1402 1215 je irqhandled 1403 1216 stc ;tell OS/2 kernel we didn't handle this interrupt 1404 1217 jmp short endofirq 1405 1406 1218 irqhandled: 1407 1219 clc ;tell OS/2 kernel this interrupt was ours 1408 1409 1220 endofirq: 1410 1411 1221 pop gs 1412 1222 pop fs … … 1414 1224 pop ds 1415 1225 popad 1416 1417 1226 leave 1418 1227 retf … … 1572 1381 _RMHandleToResourceHandleList endp 1573 1382 1383 ; shifted from devhlp.asm 1384 extrn DOSIODELAYCNT : ABS 1385 ALIGN 4 1386 public iodelay32_ 1387 iodelay32_ proc near 1388 mov eax, DOSIODELAYCNT 1389 align 4 1390 @@: dec eax 1391 jnz @b 1392 loop iodelay32_ 1393 ret 1394 iodelay32_ endp 1574 1395 1575 1396 CODE32 ends 1576 1397 ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 1398 ;Label to mark end of 32 bits code section 1399 LASTCODE32 segment 1400 public __OffFinalCS32 1401 __OffFinalCS32 label byte 1402 LASTCODE32 ends 1403 ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 1404 ;Label to mark start of 32 bits data section 1405 BSS32 segment 1406 public __OffBeginDS32 1407 __OffBeginDS32 dd 0 1408 BSS32 ends 1409 ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 1577 1410 DATA32 segment 1411 1412 public stackbase 1413 public stacksel 1414 stackbase dd 0 1415 stacksel dd 0 1416 1578 1417 public __OffsetFinalCS16 1579 1418 public __OffsetFinalDS16 1580 public PDDName 1419 __OffsetFinalCS16 dw OFFSET CODE16:__OffFinalCS16 1420 __OffsetFinalDS16 dw OFFSET DATA16:__OffFinalDS16 1421 1581 1422 public _MSG_TABLE32 1423 _MSG_TABLE32 dw OFFSET DATA16:_MSG_TABLE16 1424 dw SEG DATA16:_MSG_TABLE16 1425 1426 ;16:32 addresses of resource manager functions in 16 bits code segment 1582 1427 public RMAllocResource1632 1583 1428 public RMModifyResources1632 … … 1590 1435 public RMDevIDToHandleList1632 1591 1436 public RMHandleToResourceHandleList1632 1592 public _TimerHandler161593 public _ISR001594 public _ISR011595 public _ISR021596 public _ISR031597 public _ISR041598 public _ISR051599 public _ISR061600 public _ISR071601 1602 IFDEF FLATSTACK1603 extrn intSwitchStack : dword1604 ENDIF1605 1606 IFDEF KEE1607 public stackbase1608 public stacksel1609 1610 stackbase dd 01611 stacksel dd 01612 ELSE1613 1614 public gdtsave1615 public fWrongDPL1616 public oldDPL1617 public SelRef1618 1619 tempeax dd 01620 tempedx dd 01621 tempesi dd 01622 cpuflags dd 01623 1624 gdtsave dq 01625 fWrongDPL dd 1 ;DOS32FLATDS has the wrong DPL for SS1626 SelRef dd 01627 oldDPL dd 01628 1629 fInitStack dd 01630 ENDIF1631 1632 __OffsetFinalCS16 dw OFFSET CODE16:__OffFinalCS161633 __OffsetFinalDS16 dw OFFSET DATA16:__OffFinalDS161634 1635 _MSG_TABLE32 dw OFFSET DATA16:_MSG_TABLE161636 dw SEG DATA16:_MSG_TABLE161637 1638 ;16:16 address of driver name1639 PDDName dw OFFSET DATA16:pddname161640 dw SEG DATA16:pddname161641 1642 ;16:32 addresses of resource manager functions in 16 bits code segment1643 1437 RMAllocResource1632 dd OFFSET CODE16:_RMAllocResource16 1644 1438 dw SEG CODE16:_RMAllocResource16 … … 1674 1468 1675 1469 ;16:16 address of uniaud_stub_timer 1470 public _TimerHandler16 1676 1471 _TimerHandler16 dd OFFSET CODE16:uniaud_stub_timer 1677 1472 dw OFFSET CODE16:uniaud_stub_timer 1678 1473 1679 1474 ;16:16 addresses of interrupt dispatchers 1475 public _ISR00 1476 public _ISR01 1477 public _ISR02 1478 public _ISR03 1479 public _ISR04 1480 public _ISR05 1481 public _ISR06 1482 public _ISR07 1680 1483 _ISR00 dw OFFSET CODE16:ISR00_16 1681 1484 dw SEG CODE16:ISR00_16 … … 1694 1497 _ISR07 dw OFFSET CODE16:ISR07_16 1695 1498 dw SEG CODE16:ISR07_16 1696 DATA32 ends 1697 1698 end 1699 1499 DATA32 ends 1500 ; ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ 1501 ;Label to mark end of 32 bits data section 1502 LASTDATA32 segment 1503 public __OffFinalDS32 1504 __OffFinalDS32 dd 0 1505 LASTDATA32 ends 1506 1507 end -
GPL/trunk/drv32/startup.inc
r32 r679 53 53 ENDM 54 54 55 56 IFDEF KEE57 55 ;pushfd/popfd trashed by fucking BUGY KernThunkStackTo32 58 56 ;fix idea by zuko … … 64 62 push stacksel 65 63 push stackbase 66 67 64 push edx 68 65 mov edx, ss 69 66 mov stacksel, edx 70 67 pushfd 71 72 68 call KernThunkStackTo32 73 69 popfd 74 70 mov stackbase, edx 75 pop edx ;trashed by KernThunkStackTo32 76 xor eax, eax ; mark success 71 pop edx ;trashed by KernThunkStackTo32 77 72 ENDM 73 78 74 ;;****************************************************************************** 79 75 ;;****************************************************************************** … … 87 83 pop eax ;trashed by KernThunkStackTo32 88 84 ENDM 85 89 86 ;;****************************************************************************** 90 87 ;;****************************************************************************** … … 97 94 pop eax ;trashed by KernThunkStackTo16 98 95 pop edx ;trashed by KernThunkStackTo16 when called in interrupt context 99 100 96 pop stackbase 101 97 pop stacksel … … 113 109 pop edx ;trashed by KernThunkStackTo16 when called in interrupt context 114 110 ENDM 115 ;;******************************************************************************116 ;;******************************************************************************117 111 118 ELSE119 120 ;;******************************************************************************121 ;;Need to preserve fs:ebx!! (all other registers must be saved by the caller)122 ;;******************************************************************************123 DevThunkStackTo32 MACRO124 LOCAL @@stackok, @@stackchangeend125 126 ;;;; int 3127 128 pushfd129 cli130 pop dword ptr [cpuflags]131 132 ;check if kernel DS selector DPL == 3; if so, change to 0133 call FixSelDPL134 135 ;allocate private stack136 push fs137 call StackAlloc138 pop fs ;trashed by StackAlloc139 mov dword ptr [fInitStack], 1140 141 cmp eax, 0142 jne @@stackok143 144 IFDEF DEBUG145 int 3 ;this is very fatal146 ENDIF147 call RestoreSelDPL148 mov eax, -1 ;mark failure149 150 push dword ptr [cpuflags]151 popfd152 jmp short @@stackchangeend153 154 @@stackok:155 ;stack ptr in eax156 call dword ptr [intSwitchStack]157 158 push dword ptr [cpuflags]159 popfd160 161 mov eax, 0 ;mark success162 @@stackchangeend:163 ENDM164 165 ;;******************************************************************************166 ;;******************************************************************************167 DevThunkStackTo32_Int MACRO168 LOCAL @@cont32169 170 cmp dword ptr [fInitStack], 0171 je @@cont32172 173 ;;;; int 3174 pushfd175 cli176 pop dword ptr [cpuflags]177 178 mov dword ptr [tempeax], eax ;save eax179 180 pop eax ;pop saved flat stack pointer181 182 ;and switch back to our flat stack again183 call dword ptr [intSwitchStack]184 185 mov eax, dword ptr [tempeax] ;restore eax186 push dword ptr [cpuflags]187 popfd188 189 @@cont32:190 ENDM191 192 ;;******************************************************************************193 ;;******************************************************************************194 DevThunkStackTo16 MACRO195 ;;;; int 3196 197 pushfd198 cli199 pop dword ptr [cpuflags]200 201 mov dword ptr [tempeax], eax ;save eax202 mov dword ptr [tempesi], esi ;save esi203 204 mov esi, esp205 xor eax, eax ;switch to 16 bits stack206 call dword ptr [intSwitchStack]207 208 mov eax, esi209 call StackFree210 211 call RestoreSelDPL212 213 mov eax, dword ptr [tempeax]214 mov esi, dword ptr [tempesi]215 216 push dword ptr [cpuflags]217 popfd218 219 ENDM220 221 ;;******************************************************************************222 ;;******************************************************************************223 DevThunkStackTo16_Int MACRO224 LOCAL @@cont16225 226 cmp dword ptr [fInitStack], 0227 je @@cont16228 229 ;;;; int 3230 pushfd231 cli232 pop dword ptr [cpuflags]233 234 mov dword ptr [tempeax], eax ;save eax235 mov dword ptr [tempesi], esi ;save esi236 mov esi, esp237 xor eax, eax ;switch to 16 bits stack238 call dword ptr [intSwitchStack]239 push esi ;flat stack ptr (popped before switching back to flat)240 241 mov eax, dword ptr [tempeax]242 mov esi, dword ptr [tempesi]243 push dword ptr [cpuflags]244 popfd245 246 @@cont16:247 ENDM248 249 ENDIF ;KEE250 251 IFDEF FLATSTACK252 112 ;******************************************************************************* 253 113 ;enter a function that needs to switch to a 16 bits stack … … 263 123 push esi 264 124 push edi 265 266 125 ;to access the parameters on the 32 bits stack, once we've switched 267 126 mov edi, ebp 268 269 127 DevThunkStackTo16_Int 270 128 ENDM 129 271 130 ;******************************************************************************* 272 131 ;switch stack from 16 bits to 32 bits and return … … 288 147 ;;****************************************************************************** 289 148 290 ENDIF291 149 292 150 ;Constants and structure definitions 293 294 DevHlp_VirtToLin EQU 5Bh295 DevHlp_VMLock EQU 55h296 151 297 152 ; Status word masks … … 330 185 o_status dw ? 331 186 rpInitOut ends 332 333 334 ; definitions for 16 bits resource manager buffers335 ; (also in rm.hpp!!)336 MAXSIZE_RMNodeData EQU 1024337 MAXSIZE_RMResources EQU 128338 MAXSIZE_RMHandleList EQU 128339 MAXSIZE_RMResourceList EQU 256 -
GPL/trunk/drv32/strategy.c
r591 r679 24 24 */ 25 25 26 #define INCL_NOPMAPI27 #define INCL_DOSINFOSEG // Need Global info seg in rm.cpp algorithms28 26 #include <os2.h> 29 30 27 #include <devhelp.h> 31 //DAZ #include <devrp.h>32 #include <devown.h>33 #include "strategy.h"34 28 #include <ossidc32.h> 35 29 #include <dbgos2.h> 36 30 #include <string.h> 31 #include <u32ioctl.h> 32 #include "devown.h" 33 #include "strategy.h" 37 34 38 35 ULONG StratRead(REQPACKET __far *_rp); 39 36 ULONG StratIOCtl(REQPACKET __far *_rp); 40 ULONG StratClose(REQPACKET __far *_rp);41 37 42 38 ULONG DiscardableInit(REQPACKET __far*); … … 54 50 } 55 51 numOS2Opens++; 52 return RPDONE; 53 } 54 55 //****************************************************************************** 56 ULONG StratClose(REQPACKET __far* rp) 57 { 58 // only called if device successfully opened 59 // printk("strat close\n"); 60 numOS2Opens--; 61 62 UniaudCloseAll(rp->open_close.usSysFileNum); 63 64 if (numOS2Opens == 0) 65 { 66 deviceOwner = DEV_NO_OWNER; 67 } 56 68 return RPDONE; 57 69 } … … 172 184 else return(RPERR_BADCOMMAND | RPDONE); 173 185 } 174
Note:
See TracChangeset
for help on using the changeset viewer.