Changeset 588 for GPL/branches
- Timestamp:
- Feb 10, 2017, 2:50:49 AM (9 years ago)
- Location:
- GPL/branches/uniaud32-2.1.x
- Files:
-
- 35 added
- 37 deleted
- 19 edited
- 7 moved
-
!clean.cmd (modified) (1 diff)
-
Makefile (added)
-
alsa-kernel/Makefile (added)
-
alsa-kernel/core/Makefile (added)
-
alsa-kernel/core/makefile.os2 (deleted)
-
alsa-kernel/core/oss/Makefile (added)
-
alsa-kernel/core/oss/makefile.os2 (deleted)
-
alsa-kernel/core/seq/Makefile (added)
-
alsa-kernel/core/seq/makefile.os2 (deleted)
-
alsa-kernel/core/seq/oss/Makefile (added)
-
alsa-kernel/core/seq/oss/makefile.os2 (deleted)
-
alsa-kernel/drivers/Makefile (added)
-
alsa-kernel/drivers/makefile.os2 (deleted)
-
alsa-kernel/drivers/mpu401/Makefile (added)
-
alsa-kernel/drivers/mpu401/makefile.os2 (deleted)
-
alsa-kernel/drivers/opl3/Makefile (added)
-
alsa-kernel/drivers/opl3/makefile.os2 (deleted)
-
alsa-kernel/isa/Makefile (added)
-
alsa-kernel/isa/ad1848/Makefile (added)
-
alsa-kernel/isa/ad1848/makefile.os2 (deleted)
-
alsa-kernel/isa/cs423x/Makefile (added)
-
alsa-kernel/isa/cs423x/makefile.os2 (deleted)
-
alsa-kernel/isa/es1688/Makefile (added)
-
alsa-kernel/isa/es1688/makefile.os2 (deleted)
-
alsa-kernel/isa/gus/Makefile (added)
-
alsa-kernel/isa/gus/makefile.os2 (deleted)
-
alsa-kernel/isa/makefile.os2 (deleted)
-
alsa-kernel/isa/opti9xx/Makefile (added)
-
alsa-kernel/isa/opti9xx/makefile.os2 (deleted)
-
alsa-kernel/isa/sb/Makefile (added)
-
alsa-kernel/isa/sb/makefile.os2 (deleted)
-
alsa-kernel/isa/wavefront/Makefile (added)
-
alsa-kernel/isa/wavefront/makefile.os2 (deleted)
-
alsa-kernel/makefile.os2 (deleted)
-
alsa-kernel/pci/Makefile (added)
-
alsa-kernel/pci/ac97/Makefile (modified) (1 diff)
-
alsa-kernel/pci/ac97/makefile.os2 (deleted)
-
alsa-kernel/pci/ali5451/Makefile (added)
-
alsa-kernel/pci/ali5451/makefile.os2 (deleted)
-
alsa-kernel/pci/au88x0/Makefile (modified) (1 diff)
-
alsa-kernel/pci/au88x0/makefile.os2 (deleted)
-
alsa-kernel/pci/ca0106/Makefile (modified) (1 diff)
-
alsa-kernel/pci/ca0106/makefile.os2 (deleted)
-
alsa-kernel/pci/cs46xx/Makefile (added)
-
alsa-kernel/pci/cs46xx/makefile.os2 (deleted)
-
alsa-kernel/pci/cs5535audio/Makefile (added)
-
alsa-kernel/pci/cs5535audio/makefile.os2 (deleted)
-
alsa-kernel/pci/emu10k1/Makefile (added)
-
alsa-kernel/pci/emu10k1/makefile.os2 (deleted)
-
alsa-kernel/pci/hda/Makefile (added)
-
alsa-kernel/pci/hda/makefile.os2 (deleted)
-
alsa-kernel/pci/korg1212/Makefile (added)
-
alsa-kernel/pci/korg1212/makefile.os2 (deleted)
-
alsa-kernel/pci/makefile.os2 (deleted)
-
alsa-kernel/pci/nm256/Makefile (added)
-
alsa-kernel/pci/nm256/makefile.os2 (deleted)
-
alsa-kernel/pci/rme9652/Makefile (added)
-
alsa-kernel/pci/rme9652/makefile.os2 (deleted)
-
alsa-kernel/pci/trident/Makefile (added)
-
alsa-kernel/pci/trident/makefile.os2 (deleted)
-
alsa-kernel/pci/ymfpci/Makefile (added)
-
alsa-kernel/pci/ymfpci/makefile.os2 (deleted)
-
alsa-kernel/synth/Makefile (added)
-
alsa-kernel/synth/emux/Makefile (added)
-
alsa-kernel/synth/emux/makefile.os2 (deleted)
-
alsa-kernel/synth/makefile.os2 (deleted)
-
clean.cmd (modified) (1 diff)
-
drv32/Makefile (added)
-
drv32/dispatch.c (modified) (24 diffs)
-
drv32/idc.c (modified) (2 diffs)
-
drv32/init.c (modified) (10 diffs)
-
drv32/irq.c (moved) (moved from GPL/branches/uniaud32-2.1.x/drv32/irq.cpp ) (4 diffs)
-
drv32/irq.h (modified) (1 diff)
-
drv32/makefile.os2 (deleted)
-
drv32/parse.c (modified) (2 diffs)
-
drv32/read.c (moved) (moved from GPL/branches/uniaud32-2.1.x/drv32/read.cpp ) (4 diffs)
-
drv32/rmhelp.c (moved) (moved from GPL/branches/uniaud32-2.1.x/drv32/rmhelp.cpp ) (6 diffs)
-
drv32/strategy.c (modified) (5 diffs)
-
drv32/util.c (moved) (moved from GPL/branches/uniaud32-2.1.x/drv32/util.cpp ) (12 diffs)
-
howtobuild.txt (modified) (1 diff)
-
include/DEVINFO.H (modified) (1 diff)
-
include/DEVTYPE.H (modified) (6 diffs)
-
include/linux/types.h (modified) (2 diffs)
-
include/malloc.h (modified) (1 diff)
-
include/strategy.h (modified) (2 diffs)
-
include/version.mak (deleted)
-
lib32/Makefile (added)
-
lib32/initcall.h (modified) (3 diffs)
-
lib32/makefile.os2 (deleted)
-
lib32/malloc.c (moved) (moved from GPL/branches/uniaud32-2.1.x/lib32/malloc.cpp ) (4 diffs)
-
lib32/memory.c (moved) (moved from GPL/branches/uniaud32-2.1.x/lib32/memory.cpp ) (10 diffs)
-
lib32/ossidc.c (added)
-
lib32/ossidc.cpp (deleted)
-
lib32/stack.c (moved) (moved from GPL/branches/uniaud32-2.1.x/lib32/stack.cpp ) (3 diffs)
-
makefile.os2 (deleted)
-
tools/AddToFile.cmd (added)
-
tools/header.mif (added)
-
tools/mkversion.cmd (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-2.1.x/!clean.cmd
r573 r588 1 @echo off 2 SET KEE=0 3 wmake -ms -f makefile.os2 clean 4 wmake -ms -f makefile.os2 DEBUG=1 clean 5 SET KEE=1 6 wmake -ms -f makefile.os2 clean 7 wmake -ms -f makefile.os2 DEBUG=1 clean 8 SET KEE= 1 wmake clean 9 2 -
GPL/branches/uniaud32-2.1.x/alsa-kernel/pci/ac97/Makefile
r398 r588 1 !ifndef %ROOT 2 !error ROOT is not defined. Please check your SETENV.CMD. 3 !endif 4 ROOT=$(%ROOT) 5 6 !include $(ROOT)\tools\header.mif 7 8 9 #=================================================================== 1 10 # 2 # Makefile for ALSA 3 # Copyright (c) 2001 by Jaroslav Kysela <perex@perex.cz> 11 # List of source files 4 12 # 13 #=================================================================== 14 FILES = ac97_codec.obj ac97_pcm.obj ac97_proc.obj 5 15 6 snd-ac97-codec-y := ac97_codec.o ac97_pcm.o 7 snd-ac97-codec-$(CONFIG_PROC_FS) += ac97_proc.o 16 TARGET = ac97 8 17 9 # Toplevel Module Dependency 10 obj-$(CONFIG_SND_AC97_CODEC) += snd-ac97-codec.o 18 LNKFILE = $(OBJDIR)\$(TARGET).lnk 19 20 21 #=================================================================== 22 # 23 # Specific dependencies 24 # 25 #=================================================================== 26 all: $(OBJDIR)\$(TARGET).lib 27 28 29 $(LNKFILE): Makefile 30 @%create $(LNKFILE) 31 @for %f in ($(FILES)) do @%append $(LNKFILE) -+$(OBJDIR)\%f 32 33 $(OBJDIR)\$(TARGET).lib: $(LNKFILE) $(FILES) 34 $(LIB) $(OBJDIR)\$(TARGET).lib @$(LNKFILE) 35 copy $(OBJDIR)\$(TARGET).lib $(ALSA_LIB) 36 37 clean: .SYMBOLIC 38 -@rm *.err 39 @if exist obj @rm.exe -r obj 40 @if exist bin @rm.exe -r bin 41 -
GPL/branches/uniaud32-2.1.x/alsa-kernel/pci/au88x0/Makefile
r398 r588 1 snd-au8810-objs := au8810.o 2 snd-au8820-objs := au8820.o 3 snd-au8830-objs := au8830.o 1 !ifndef %ROOT 2 !error ROOT is not defined. Please check your SETENV.CMD. 3 !endif 4 ROOT=$(%ROOT) 4 5 5 obj-$(CONFIG_SND_AU8810) += snd-au8810.o 6 obj-$(CONFIG_SND_AU8820) += snd-au8820.o 7 obj-$(CONFIG_SND_AU8830) += snd-au8830.o 6 !include $(ROOT)\tools\header.mif 7 8 9 #=================================================================== 10 # 11 # List of source files 12 # 13 #=================================================================== 14 # au8810.obj au8810_core.obj au8810_pcm.obj au8810_mixer.obj au8810_mpu401.obj au8810_eq.obj 15 FILES = au8820.obj au8820_core.obj au8820_pcm.obj au8820_mixer.obj au8820_mpu401.obj au8820_synth.obj 16 # au8830.obj au8830_core.obj au8830_pcm.obj au8830_mixer.obj au8830_mpu401.obj au8830_eq.obj au8830_synth.obj 17 18 TARGET = au88xx 19 20 LNKFILE = $(OBJDIR)\$(TARGET).lnk 21 22 23 #=================================================================== 24 # 25 # Specific dependencies 26 # 27 #=================================================================== 28 all: $(OBJDIR)\$(TARGET).lib 29 30 31 $(LNKFILE): Makefile 32 @%create $(LNKFILE) 33 @for %f in ($(FILES)) do @%append $(LNKFILE) -+$(OBJDIR)\%f 34 35 $(OBJDIR)\$(TARGET).lib: $(LNKFILE) $(FILES) 36 $(LIB) $(OBJDIR)\$(TARGET).lib @$(LNKFILE) 37 copy $(OBJDIR)\$(TARGET).lib $(ALSA_LIB) 38 39 clean: .SYMBOLIC 40 -@rm *.err 41 @if exist obj @rm.exe -r obj 42 @if exist bin @rm.exe -r bin 43 -
GPL/branches/uniaud32-2.1.x/alsa-kernel/pci/ca0106/Makefile
r398 r588 1 snd-ca0106-objs := ca0106_main.o ca0106_proc.o ca0106_mixer.o ca_midi.o 1 !ifndef %ROOT 2 !error ROOT is not defined. Please check your SETENV.CMD. 3 !endif 4 ROOT=$(%ROOT) 2 5 3 obj-$(CONFIG_SND_CA0106) += snd-ca0106.o 6 !include $(ROOT)\tools\header.mif 7 8 9 #=================================================================== 10 # 11 # List of source files 12 # 13 #=================================================================== 14 FILES = ca0106_main.obj ca0106_proc.obj ca0106_mixer.obj & 15 ca_midi.obj 16 17 TARGET = ca0106 18 19 LNKFILE = $(OBJDIR)\$(TARGET).lnk 20 21 22 #=================================================================== 23 # 24 # Specific dependencies 25 # 26 #=================================================================== 27 all: $(OBJDIR)\$(TARGET).lib 28 29 30 $(LNKFILE): Makefile 31 @%create $(LNKFILE) 32 @for %f in ($(FILES)) do @%append $(LNKFILE) -+$(OBJDIR)\%f 33 34 $(OBJDIR)\$(TARGET).lib: $(LNKFILE) $(FILES) 35 $(LIB) $(OBJDIR)\$(TARGET).lib @$(LNKFILE) 36 copy $(OBJDIR)\$(TARGET).lib $(ALSA_LIB) 37 38 clean: .SYMBOLIC 39 -@rm *.err 40 @if exist obj @rm.exe -r obj 41 @if exist bin @rm.exe -r bin 42 -
GPL/branches/uniaud32-2.1.x/clean.cmd
r111 r588 8 8 wmake -ms -f makefile.os2 DEBUG=1 clean 9 9 SET KEE= 10 del drv32\bin\Release.W4\* 11 del drv32\bin\Release.kee\* 10 del drv32\bin\Release\* -
GPL/branches/uniaud32-2.1.x/drv32/dispatch.c
r543 r588 30 30 #include <devhelp.h> 31 31 #include <devtype.h> 32 #include < devrp.h>32 #include <strategy.h> 33 33 #include "devown.h" 34 34 #include <ossidc.h> … … 36 36 #include <version.h> 37 37 38 extern "C"int cdecl printk(const char * fmt, ...);38 extern int cdecl printk(const char * fmt, ...); 39 39 //****************************************************************************** 40 40 // Dispatch IOCtl requests received from the Strategy routine 41 41 //****************************************************************************** 42 extern "C"int GetUniaudCardInfo(ULONG deviceid, void *info);43 extern "C"int GetUniaudControlNum(ULONG deviceid);44 extern "C"int GetUniaudControls(ULONG deviceid, void *pids);45 extern "C"int GetUniaudControlInfo(ULONG deviceid, ULONG id, void *info);46 extern "C"int GetUniaudControlValueGet(ULONG deviceid, ULONG id, void *value);47 extern "C"int GetUniaudControlValuePut(ULONG deviceid, ULONG id, void *value);48 extern "C"int GetNumberOfPcm(int card_id);49 extern "C"int GetUniaudPcmCaps(ULONG deviceid, void *caps);50 extern "C"int SetPCMInstance(int card_id, int pcm);51 extern "C"int WaitForControlChange(int card_id, int timeout);52 extern "C"int GetNumberOfCards(void);53 extern "C"OSSRET OSS32_WaveOpen(ULONG deviceid, ULONG streamtype, OSSSTREAMID *pStreamId, int pcm, USHORT fileid);54 extern "C"OSSRET OSS32_WaveClose(OSSSTREAMID streamid);55 extern "C"int UniaudIoctlHWRefine(OSSSTREAMID streamid, void *pHwParams);56 extern "C"int UniaudIoctlHWParamSet(OSSSTREAMID streamid, void *pHwParams);57 extern "C"int UniaudIoctlSWParamSet(OSSSTREAMID streamid, void *pSwParams);58 extern "C"int UniaudIoctlPCMStatus(OSSSTREAMID streamid, void *pstatus);59 extern "C"int UniaudIoctlPCMWrite(OSSSTREAMID streamid, char *buf, int size);60 extern "C"int UniaudIoctlPCMRead(OSSSTREAMID streamid, char *buf, int size);61 extern "C"int UniaudIoctlPCMPrepare(OSSSTREAMID streamid);62 extern "C"int UniaudIoctlPCMStart(OSSSTREAMID streamid);63 extern "C"int UniaudIoctlPCMDrop(OSSSTREAMID streamid);64 extern "C"int UniaudIoctlPCMResume(OSSSTREAMID streamid, int pause);65 extern "C"void UniaudCloseAll(USHORT fileid);66 extern "C"int WaitForPCMInterrupt(void *file, int timeout);67 extern "C"int unlock_all;68 extern "C"int OSS32_CloseUNI16(void);69 extern "C"int UniaudCtlGetPowerState(ULONG deviceid, void *state);70 extern "C"int UniaudCtlSetPowerState(ULONG deviceid, void *state);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 71 72 72 typedef UCHAR LOCKHANDLE[12]; … … 85 85 #pragma pack() 86 86 87 ULONG StratIOCtl(R P __far* _rp)87 ULONG StratIOCtl(REQPACKET __far* rp) 88 88 { 89 RPIOCtl __far* rp = (RPIOCtl __far*)_rp;90 89 USHORT rc = 0;; 91 90 LOCKHANDLE lhParm, lhData; … … 96 95 ULONG ctl_id; 97 96 98 if (rp-> Category != CAT_IOCTL_OSS32)99 { 100 //printk("not our cat %x. func %x\n", rp->Category, rp->Function);97 if (rp->ioctl.bCategory != CAT_IOCTL_OSS32) 98 { 99 //printk("not our cat %x. func %x\n", rp->Category, rp->Function); 101 100 // not our category, exit with error 102 return (RPERR_ COMMAND | RPDONE);101 return (RPERR_BADCOMMAND | RPDONE); 103 102 } 104 103 105 #ifdef DEBUG104 #ifdef DEBUG 106 105 //printk("StratIOCtl 0x%x\n", rp->Function); 107 #endif108 // printk("cmd: %x, len: %i, pack: %x\n",rp->Function, rp->ParmLength, rp->ParmPacket);106 #endif 107 // printk("cmd: %x, len: %i, pack: %x\n",rp->Function, rp->ioctl.usParmLen, rp->ParmPacket); 109 108 // work with Parm Packet 110 if ((rp-> ParmLength!= 0 ||111 rp-> Function == IOCTL_OSS32_ATTACH /*16 bit ioctl*/) &&112 ((rp-> ParmPacket& 0xfffcffff) != 0))109 if ((rp->ioctl.usParmLen != 0 || 110 rp->ioctl.bFunction == IOCTL_OSS32_ATTACH /*16 bit ioctl*/) && 111 ((rp->ioctl.pvParm & 0xfffcffff) != 0)) 113 112 { 114 113 // got Parm Packet 115 rc = DevVirtToLin((USHORT)((ULONG)(rp-> ParmPacket) >> 16),116 (ULONG)((USHORT)(rp-> ParmPacket)),114 rc = DevVirtToLin((USHORT)((ULONG)(rp->ioctl.pvParm) >> 16), 115 (ULONG)((USHORT)(rp->ioctl.pvParm)), 117 116 (UCHAR * __far *)&linParm); 118 117 119 118 if (rc == 0) 120 119 { 121 if (rp->Function == IOCTL_OSS32_ATTACH) 122 { 123 rc = DevVMLock(VMDHL_LONG, 124 (ULONG)linParm, 125 4, 126 (LINEAR)-1L, 127 lhParm, 128 (UCHAR*)&pages); 129 }else 130 { 131 rc = DevVMLock(VMDHL_LONG, 132 (ULONG)linParm, 133 rp->ParmLength, 134 (LINEAR)-1L, 135 lhParm, 136 (UCHAR*)&pages); 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); 137 127 } 138 128 … … 154 144 155 145 // work with Data Packet 156 if ((rp-> DataLength!= 0) &&157 ((rp-> DataPacket& 0xfffcffff) != 0))146 if ((rp->ioctl.usDataLen != 0) && 147 ((rp->ioctl.pvData & 0xfffcffff) != 0)) 158 148 { 159 149 // got Data Packet 160 rc = DevVirtToLin((USHORT)((ULONG)(rp-> DataPacket) >> 16),161 (ULONG)((USHORT)(rp-> DataPacket)),150 rc = DevVirtToLin((USHORT)((ULONG)(rp->ioctl.pvData) >> 16), 151 (ULONG)((USHORT)(rp->ioctl.pvData)), 162 152 (UCHAR * __far *)&linData); 163 153 if (rc == 0) 164 154 { 165 rc = DevVMLock(VMDHL_LONG, 166 (ULONG)linData, 167 rp->DataLength, 168 (LINEAR)-1L, 169 lhData, 155 rc = DevVMLock(VMDHL_LONG, (ULONG)linData, rp->ioctl.usDataLen, (LINEAR)-1L, lhData, 170 156 (UCHAR*)&pages); 171 157 } else … … 193 179 rc = RPDONE; // ok by default 194 180 195 switch(rp-> Function)181 switch(rp->ioctl.bFunction) 196 182 { 197 183 case IOCTL_OSS32_ATTACH: … … 199 185 card_id = (ULONG) *linParm; 200 186 // Check if audio init was successful 201 if (OSS32_QueryNames(card_id, NULL, 0, 202 NULL, 0, FALSE) != OSSERR_SUCCESS) 187 if (OSS32_QueryNames(card_id, NULL, 0, NULL, 0, FALSE) != OSSERR_SUCCESS) 203 188 { 204 189 rc = RPERR_GENERAL | RPDONE; … … 208 193 case IOCTL_OSS32_VERSION: 209 194 { 210 if (rp-> DataLength< sizeof(ULONG))195 if (rp->ioctl.usDataLen < sizeof(ULONG)) 211 196 { 212 197 // invalid Data Pkt … … 221 206 case IOCTL_OSS32_GET_PCM_NUM: 222 207 { 223 if (rp-> DataLength< sizeof(ULONG))208 if (rp->ioctl.usDataLen < sizeof(ULONG)) 224 209 { 225 210 // invalid Data Pkt … … 234 219 235 220 case IOCTL_OSS32_CARDS_NUM: 236 if (rp-> DataLength< sizeof(ULONG))221 if (rp->ioctl.usDataLen < sizeof(ULONG)) 237 222 { 238 223 // invalid Data Pkt … … 246 231 case IOCTL_OSS32_PCM_CAPS: 247 232 { 248 if (rp-> DataLength< sizeof(ULONG))233 if (rp->ioctl.usDataLen < sizeof(ULONG)) 249 234 { 250 235 // invalid Data Pkt … … 259 244 case IOCTL_OSS32_CARD_INFO: 260 245 { 261 if (rp-> DataLength< sizeof(ULONG))246 if (rp->ioctl.usDataLen < sizeof(ULONG)) 262 247 { 263 248 // invalid Data Pkt … … 272 257 case IOCTL_OSS32_GET_POWER_STATE: 273 258 { 274 if (rp-> DataLength< sizeof(ULONG))259 if (rp->ioctl.usDataLen < sizeof(ULONG)) 275 260 { 276 261 // invalid Data Pkt … … 285 270 case IOCTL_OSS32_SET_POWER_STATE: 286 271 { 287 if (rp-> DataLength< sizeof(ULONG))272 if (rp->ioctl.usDataLen < sizeof(ULONG)) 288 273 { 289 274 // invalid Data Pkt … … 298 283 case IOCTL_OSS32_GET_CNTRLS_NUM: 299 284 { 300 if (rp-> DataLength< sizeof(ULONG))285 if (rp->ioctl.usDataLen < sizeof(ULONG)) 301 286 { 302 287 // invalid Data Pkt … … 313 298 case IOCTL_OSS32_GET_CNTRLS: 314 299 { 315 if (rp-> DataLength< sizeof(ULONG))300 if (rp->ioctl.usDataLen < sizeof(ULONG)) 316 301 { 317 302 // invalid Data Pkt … … 327 312 { 328 313 329 if (rp-> DataLength< sizeof(ULONG))330 { 331 // invalid Data Pkt 332 rc = RPERR_PARAMETER | RPDONE; 333 break; 334 } 335 336 if (rp-> ParmLength< sizeof(ULONG))314 if (rp->ioctl.usDataLen < sizeof(ULONG)) 315 { 316 // invalid Data Pkt 317 rc = RPERR_PARAMETER | RPDONE; 318 break; 319 } 320 321 if (rp->ioctl.usParmLen < sizeof(ULONG)) 337 322 { 338 323 // invalid Data Pkt … … 351 336 case IOCTL_OSS32_CNTRL_GET: 352 337 { 353 if (rp-> DataLength< sizeof(ULONG))354 { 355 // invalid Data Pkt 356 rc = RPERR_PARAMETER | RPDONE; 357 break; 358 } 359 360 if (rp-> ParmLength< sizeof(ULONG))338 if (rp->ioctl.usDataLen < sizeof(ULONG)) 339 { 340 // invalid Data Pkt 341 rc = RPERR_PARAMETER | RPDONE; 342 break; 343 } 344 345 if (rp->ioctl.usParmLen < sizeof(ULONG)) 361 346 { 362 347 // invalid Data Pkt … … 376 361 { 377 362 378 if (rp-> DataLength< sizeof(ULONG)) {379 // invalid Data Pkt 380 rc = RPERR_PARAMETER | RPDONE; 381 break; 382 } 383 384 if (rp-> ParmLength< sizeof(ULONG)) {363 if (rp->ioctl.usDataLen < sizeof(ULONG)) { 364 // invalid Data Pkt 365 rc = RPERR_PARAMETER | RPDONE; 366 break; 367 } 368 369 if (rp->ioctl.usParmLen < sizeof(ULONG)) { 385 370 // invalid Data Pkt 386 371 rc = RPERR_PARAMETER | RPDONE; … … 399 384 { 400 385 401 if (rp-> ParmLength< sizeof(ULONG))386 if (rp->ioctl.usParmLen < sizeof(ULONG)) 402 387 { 403 388 // invalid Data Pkt … … 414 399 case IOCTL_OSS32_CNTRL_WAIT: 415 400 { 416 if (rp-> DataLength< sizeof(ULONG))401 if (rp->ioctl.usDataLen < sizeof(ULONG)) 417 402 { 418 403 // invalid Data Pkt … … 430 415 ioctl_pcm *pcm = (ioctl_pcm *)linParm; 431 416 // close all pcms from uniaud16 first 432 pcm->ret = OSS32_WaveOpen(pcm->deviceid, pcm->streamtype, pData, pcm->pcm, rp-> FileID);417 pcm->ret = OSS32_WaveOpen(pcm->deviceid, pcm->streamtype, pData, pcm->pcm, rp->ioctl.usSysFileNum); 433 418 } 434 419 break; … … 536 521 default: 537 522 { 538 printk("invalid function code %i\n",rp-> Function);523 printk("invalid function code %i\n",rp->ioctl.bFunction); 539 524 // invalid function code 540 525 rc = RPERR_PARAMETER | RPDONE; … … 561 546 // Dispatch Close requests received from the strategy routine 562 547 //****************************************************************************** 563 ULONG StratClose(R P __far* _rp)548 ULONG StratClose(REQPACKET __far* rp) 564 549 { 565 RPOpenClose __far* rp = (RPOpenClose __far*)_rp;566 567 550 // only called if device successfully opened 568 // printk("strat close\n");551 // printk("strat close\n"); 569 552 numOS2Opens--; 570 553 571 UniaudCloseAll(rp-> FileID);554 UniaudCloseAll(rp->open_close.usSysFileNum); 572 555 573 556 if (numOS2Opens == 0) { 574 deviceOwner = DEV_NO_OWNER;557 deviceOwner = DEV_NO_OWNER; 575 558 } 576 559 return(RPDONE); 577 560 } 578 //****************************************************************************** 579 //****************************************************************************** 561 -
GPL/branches/uniaud32-2.1.x/drv32/idc.c
r550 r588 23 23 */ 24 24 25 extern "C" { // 16-bit header files are not C++ aware25 //DAZ extern "C" { // 16-bit header files are not C++ aware 26 26 #define INCL_NOPMAPI 27 27 #define INCL_DOSINFOSEG 28 28 #include <os2.h> 29 }29 //DAZ } 30 30 #include <devtype.h> 31 31 #include <devhelp.h> 32 #include <strategy.h>32 //#include <strategy.h> 33 33 #include <ossidc32.h> 34 34 #include <irqos2.h> … … 38 38 //16:32 address of 16 bits pdd idc handler 39 39 IDC16_HANDLER idc16_PddHandler = 0; 40 extern "C"int pcm_device;40 extern int pcm_device; 41 41 WORD32 OSS32IDC(ULONG cmd, PIDC32_PACKET pPacket); 42 extern "C"BOOL fRewired; //pci.c42 extern BOOL fRewired; //pci.c 43 43 44 44 //packet pointer must reference a structure on the stack 45 45 46 OSSRET AlsaIDC(ULONG cmd, ULONG packet);47 46 #pragma aux AlsaIDC "ALSA_IDC" parm reverse [ecx edx] 48 47 OSSRET AlsaIDC(ULONG cmd, ULONG packet) -
GPL/branches/uniaud32-2.1.x/drv32/init.c
r571 r588 31 31 #include <devhelp.h> 32 32 #include <devtype.h> 33 #include <devrp.h> 33 //DAZ #include <devrp.h> 34 #include <strategy.h> 34 35 #include "devown.h" 35 36 #include <version.h> … … 55 56 56 57 //const char szCopyRight1[]= "Copyright 2000-2002 InnoTek Systemberatung GmbH\r\n"; 57 const char szCopyRight2[]= "Copyright 2000-201 2The ALSA Project\r\n\r\n";58 const char szCopyRight3[]= "Copyright 2005-201 2Netlabs http://www.netlabs.org\r\n";58 const char szCopyRight2[]= "Copyright 2000-2010 The ALSA Project\r\n\r\n"; 59 const char szCopyRight3[]= "Copyright 2005-2010 Netlabs http://www.netlabs.org\r\n"; 59 60 60 61 const char szCodeStartEnd[] = "Code 0x%0x - 0x%0x\r\n\r\n"; … … 67 68 } MSG_TABLE; 68 69 69 extern "C"FARPTR16 MSG_TABLE32;70 extern "C"char szLastALSAError1[];71 extern "C"char szLastALSAError2[];72 extern "C"int sprintf (char *buffer, const char *format, ...);73 74 extern "C"APIRET APIENTRY DOS16OPEN(PSZ pszFileName, PHFILE phf, PULONG pulAction, ULONG cbFile, ULONG ulAttribute, ULONG fsOpenFlags, ULONG fsOpenMode, PEAOP2 peaop2 );75 extern "C"APIRET APIENTRY DOS16CLOSE(HFILE hFile);76 extern "C"APIRET APIENTRY DOS16WRITE(HFILE hFile, PVOID pBuffer, ULONG cbWrite, PULONG pcbActual);77 extern "C"void SaveBuffer(void);70 extern FARPTR16 MSG_TABLE32; 71 extern char szLastALSAError1[]; 72 extern char szLastALSAError2[]; 73 extern int sprintf (char *buffer, const char *format, ...); 74 75 extern APIRET APIENTRY DOS16OPEN(PSZ pszFileName, PHFILE phf, PULONG pulAction, ULONG cbFile, ULONG ulAttribute, ULONG fsOpenFlags, ULONG fsOpenMode, PEAOP2 peaop2 ); 76 extern APIRET APIENTRY DOS16CLOSE(HFILE hFile); 77 extern APIRET APIENTRY DOS16WRITE(HFILE hFile, PVOID pBuffer, ULONG cbWrite, PULONG pcbActual); 78 extern void SaveBuffer(void); 78 79 79 80 #define VMDHA_FIXED 0x0002 80 81 81 extern "C"APIRET VMAlloc(ULONG size, ULONG flags, char NEAR* *pAddr);82 extern APIRET VMAlloc(ULONG size, ULONG flags, char NEAR* *pAddr); 82 83 83 84 //Print messages with DosWrite when init is done or has failed (see startup.asm) … … 89 90 90 91 for(i=0;i<length;i++) { 91 str16[msg->MsgLength + i] = str[i];92 str16[msg->MsgLength + i] = str[i]; 92 93 } 93 94 str16[msg->MsgLength + length] = 0; … … 116 117 segsize = OffsetFinalDS32 - ((OffsetBeginDS32) & ~0xFFF); 117 118 if(segsize & 0xFFF) { 118 segsize += PAGE_SIZE;119 segsize += PAGE_SIZE; 119 120 } 120 121 segsize &= ~0xFFF; … … 134 135 (LINEAR)&PgCount)) { 135 136 #endif 136 return(1);137 return(1); 137 138 } 138 139 /* … … 141 142 segsize = OffsetFinalCS32 - ((OffsetBeginCS32) & ~0xFFF); 142 143 if(segsize & 0xFFF) { 143 segsize += PAGE_SIZE;144 segsize += PAGE_SIZE; 144 145 } 145 146 segsize &= ~0xFFF; … … 159 160 (LINEAR)&PgCount)) { 160 161 #endif 161 return(1);162 return(1); 162 163 } 163 164 return 0; … … 195 196 #endif 196 197 // Initialize device driver 197 WORD32 DiscardableInit(RPInit __far* rp) 198 { 199 char debugmsg[64]; 200 char FAR48 *args; 201 202 #ifdef KEE 203 GetTKSSBase(); 204 #endif 205 206 if(LockSegments()) { 207 WriteString(ERR_ERROR, sizeof(ERR_ERROR)-1); 208 WriteString(ERR_LOCK, sizeof(ERR_LOCK)-1); 209 return RPDONE | RPERR_COMMAND; 210 } 211 212 DebugLevel = 1; 213 rp->Out.FinalCS = 0; 214 rp->Out.FinalDS = 0; 215 216 if ( szprintBuf == 0 ) { 217 VMAlloc( DBG_MAX_BUF_SIZE, VMDHA_FIXED, &szprintBuf ); 218 if (szprintBuf) { 219 memset( szprintBuf, 0, DBG_MAX_BUF_SIZE ); 220 wrOffset= 0; 221 } 222 } 223 if (!HeapInit(HEAP_SIZE)) { 224 rprintf(("HeapInit failed!")); 225 } 226 227 args = MAKE_FARPTR32(rp->In.Args); 228 GetParms(args); 229 230 #ifdef DEBUG 231 rprintf(("Uniaud32 version %s-DEBUG",UNIAUD_VERSION)); 232 #else 233 rprintf(("Uniaud32 version %s",UNIAUD_VERSION)); 234 #endif 235 236 if(fVerbose) { 237 WriteString(szALSA, sizeof(szALSA)-1); 238 WriteString(szCopyRight3, sizeof(szCopyRight3)-1); 239 WriteString(szCopyRight2, sizeof(szCopyRight2)-1); 240 } 241 242 243 if(fDebug) { 244 sprintf(debugmsg, szCodeStartEnd, OffsetBeginCS32, OffsetFinalCS32); 245 WriteString(debugmsg, strlen(debugmsg)); 246 } 247 248 //get the current time (to force retrieval of GIS pointer) 249 os2gettimemsec(); 250 251 char szMixerName[64]; 252 char szDeviceName[128]; 253 254 if(OSS32_Initialize() != OSSERR_SUCCESS) 255 { 256 WriteString(ERR_ERROR, sizeof(ERR_ERROR)-1); 257 WriteString(ERR_INIT, sizeof(ERR_INIT)-1); 258 if(szLastALSAError1[0]) { 259 WriteString(szLastALSAError1, strlen(szLastALSAError1)); 260 } 261 if(szLastALSAError2[0]) { 262 WriteString(szLastALSAError2, strlen(szLastALSAError2)); 263 } 264 // !! dont exit when error !! return RPDONE | RPERR_COMMAND; 265 } else if (OSS32_QueryNames(OSS32_DEFAULT_DEVICE, szDeviceName, 266 sizeof(szDeviceName),szMixerName, 267 sizeof(szMixerName), TRUE) != OSSERR_SUCCESS) 268 { 269 WriteString(ERR_ERROR, sizeof(ERR_ERROR)-1); 270 WriteString(ERR_NAMES, sizeof(ERR_INIT)-1); 271 if(szLastALSAError1[0]) { 272 WriteString(szLastALSAError1, strlen(szLastALSAError1)); 273 } 274 if(szLastALSAError2[0]) { 275 WriteString(szLastALSAError2, strlen(szLastALSAError2)); 276 } 277 278 // !! dont exit when error !! return RPDONE | RPERR_COMMAND; 279 } 280 else 281 if(fVerbose) { 198 WORD32 DiscardableInit(REQPACKET __far* rp) 199 { 200 char debugmsg[64]; 201 char FAR48 *args; 202 203 #ifdef KEE 204 GetTKSSBase(); 205 #endif 206 207 if(LockSegments()) 208 { 209 WriteString(ERR_ERROR, sizeof(ERR_ERROR)-1); 210 WriteString(ERR_LOCK, sizeof(ERR_LOCK)-1); 211 return RPDONE | RPERR_BADCOMMAND; 212 } 213 214 DebugLevel = 1; 215 rp->init_out.usCodeEnd = 0; 216 rp->init_out.usDataEnd = 0; 217 218 if ( szprintBuf == 0 ) 219 { 220 VMAlloc( DBG_MAX_BUF_SIZE, VMDHA_FIXED, &szprintBuf ); 221 if (szprintBuf) 222 { 223 memset( szprintBuf, 0, DBG_MAX_BUF_SIZE ); 224 wrOffset= 0; 225 } 226 } 227 if (!HeapInit(HEAP_SIZE)) 228 { 229 rprintf(("HeapInit failed!")); 230 } 231 232 args = MAKE_FARPTR32(rp->init_in.szArgs); 233 GetParms(args); 234 235 #ifdef DEBUG 236 rprintf(("Uniaud32 version %s-DEBUG",UNIAUD_VERSION)); 237 #else 238 rprintf(("Uniaud32 version %s",UNIAUD_VERSION)); 239 #endif 240 241 if(fVerbose) 242 { 243 WriteString(szALSA, sizeof(szALSA)-1); 244 WriteString(szCopyRight3, sizeof(szCopyRight3)-1); 245 WriteString(szCopyRight2, sizeof(szCopyRight2)-1); 246 } 247 248 if(fDebug) 249 { 250 sprintf(debugmsg, szCodeStartEnd, OffsetBeginCS32, OffsetFinalCS32); 251 WriteString(debugmsg, strlen(debugmsg)); 252 } 253 254 //get the current time (to force retrieval of GIS pointer) 255 os2gettimemsec(); 256 257 char szMixerName[64]; 258 char szDeviceName[128]; 259 260 if(OSS32_Initialize() != OSSERR_SUCCESS) 261 { 262 WriteString(ERR_ERROR, sizeof(ERR_ERROR)-1); 263 WriteString(ERR_INIT, sizeof(ERR_INIT)-1); 264 if(szLastALSAError1[0]) 265 { 266 WriteString(szLastALSAError1, strlen(szLastALSAError1)); 267 } 268 if(szLastALSAError2[0]) 269 { 270 WriteString(szLastALSAError2, strlen(szLastALSAError2)); 271 } 272 // !! dont exit when error !! return RPDONE | RPERR_COMMAND; 273 } 274 else if (OSS32_QueryNames(OSS32_DEFAULT_DEVICE, szDeviceName, 275 sizeof(szDeviceName),szMixerName, 276 sizeof(szMixerName), TRUE) != OSSERR_SUCCESS) 277 { 278 WriteString(ERR_ERROR, sizeof(ERR_ERROR)-1); 279 WriteString(ERR_NAMES, sizeof(ERR_INIT)-1); 280 if(szLastALSAError1[0]) 281 { 282 WriteString(szLastALSAError1, strlen(szLastALSAError1)); 283 } 284 if(szLastALSAError2[0]) 285 { 286 WriteString(szLastALSAError2, strlen(szLastALSAError2)); 287 } 288 289 // !! dont exit when error !! return RPDONE | RPERR_COMMAND; 290 } 291 else 292 if(fVerbose) 293 { 294 WriteString(szDeviceName, strlen(szDeviceName)); 295 WriteString(szEOL, sizeof(szEOL)-1); 296 WriteString(szMixerFound, sizeof(szMixerFound)-1); 297 WriteString(szMixerName, strlen(szMixerName)); 298 WriteString(szEOL, sizeof(szEOL)-1); 299 300 #if 0 301 for(int i=1;i<OSS32_MAX_AUDIOCARDS;i++) 302 { 303 if(OSS32_QueryNames(i, szDeviceName, sizeof(szDeviceName), szMixerName, sizeof(szMixerName)) == OSSERR_SUCCESS) 304 { 282 305 WriteString(szDeviceName, strlen(szDeviceName)); 283 306 WriteString(szEOL, sizeof(szEOL)-1); … … 285 308 WriteString(szMixerName, strlen(szMixerName)); 286 309 WriteString(szEOL, sizeof(szEOL)-1); 287 288 #if 0 289 for(int i=1;i<OSS32_MAX_AUDIOCARDS;i++) { 290 if(OSS32_QueryNames(i, szDeviceName, sizeof(szDeviceName), szMixerName, sizeof(szMixerName)) == OSSERR_SUCCESS) 291 { 292 WriteString(szDeviceName, strlen(szDeviceName)); 293 WriteString(szEOL, sizeof(szEOL)-1); 294 WriteString(szMixerFound, sizeof(szMixerFound)-1); 295 WriteString(szMixerName, strlen(szMixerName)); 296 WriteString(szEOL, sizeof(szEOL)-1); 297 } 298 else break; 299 } 300 #endif 301 WriteString(szEOL, sizeof(szEOL)-1); 302 } 303 // Complete the installation 304 rp->Out.FinalCS = _OffsetFinalCS16; 305 rp->Out.FinalDS = _OffsetFinalDS16; 306 307 //SaveBuffer(); 308 309 // Confirm a successful installation 310 return RPDONE; 311 } 312 310 } 311 else break; 312 } 313 #endif 314 WriteString(szEOL, sizeof(szEOL)-1); 315 } 316 // Complete the installation 317 rp->init_out.usCodeEnd = _OffsetFinalCS16; 318 rp->init_out.usDataEnd = _OffsetFinalDS16; 319 320 //SaveBuffer(); 321 322 // Confirm a successful installation 323 return RPDONE; 324 } 325 -
GPL/branches/uniaud32-2.1.x/drv32/irq.c
r587 r588 46 46 }; 47 47 48 extern "C"DBGINT DbgInt;48 extern DBGINT DbgInt; 49 49 50 50 //****************************************************************************** … … 80 80 return TRUE; 81 81 } 82 //****************************************************************************** 82 83 83 //****************************************************************************** 84 84 BOOL ALSA_FreeIrq(ULONG ulIrq) … … 86 86 return (DevIRQClear((WORD16)ulIrq) == 0); 87 87 } 88 88 89 //****************************************************************************** 89 //******************************************************************************90 ULONG ALSA_Interrupt(ULONG ulSlotNo);91 90 #pragma aux ALSA_Interrupt "ALSA_Interrupt" parm [ebx] 92 91 ULONG ALSA_Interrupt(ULONG ulSlotNo) … … 113 112 return FALSE; 114 113 } 115 //****************************************************************************** 116 //****************************************************************************** 114 -
GPL/branches/uniaud32-2.1.x/drv32/irq.h
r63 r588 25 25 #define __IRQ_H__ 26 26 27 extern "C"FARPTR16 ISR00;28 extern "C"FARPTR16 ISR01;29 extern "C"FARPTR16 ISR02;30 extern "C"FARPTR16 ISR03;31 extern "C"FARPTR16 ISR04;32 extern "C"FARPTR16 ISR05;33 extern "C"FARPTR16 ISR06;34 extern "C"FARPTR16 ISR07;27 extern FARPTR16 ISR00; 28 extern FARPTR16 ISR01; 29 extern FARPTR16 ISR02; 30 extern FARPTR16 ISR03; 31 extern FARPTR16 ISR04; 32 extern FARPTR16 ISR05; 33 extern FARPTR16 ISR06; 34 extern FARPTR16 ISR07; 35 35 36 36 #endif //__IRQ_H__ -
GPL/branches/uniaud32-2.1.x/drv32/parse.c
r504 r588 34 34 #include <devhelp.h> 35 35 #include <devtype.h> 36 #include <devrp.h>37 36 #include <unicard.h> 38 37 #include "parse.h" // NUM_DEVICES … … 46 45 int ForceCard = CARD_NONE; 47 46 48 extern "C"short int midi_port;47 extern short int midi_port; 49 48 50 49 #ifdef COMM_DEBUG 51 extern "C"short int MAGIC_COMM_PORT;50 extern short int MAGIC_COMM_PORT; 52 51 #endif 53 52 -
GPL/branches/uniaud32-2.1.x/drv32/read.c
r587 r588 2 2 #include <os2.h> 3 3 #include <devhelp.h> 4 #include < devrp.h>4 #include <strategy.h> 5 5 #include <dbgos2.h> 6 6 #include <string.h> // memcpy 7 8 extern "C" {9 7 10 8 int rdOffset= 0; … … 15 13 void iounmap(void *addr); 16 14 17 } 18 19 ULONG StratRead(RP __far* _rp) 15 ULONG StratRead(REQPACKET __far* rp) 20 16 { 21 RPRWV __far* rp = (RPRWV __far*)_rp;22 23 17 char *lin; 24 int transferCount= rp-> Count;18 int transferCount= rp->io.usCount; 25 19 26 20 if( szprintBuf ) 27 21 { 28 lin= (char *)__ioremap( rp-> Transfer, transferCount, 0 );22 lin= (char *)__ioremap( rp->io.ulAddress, transferCount, 0 ); 29 23 if( lin ) 30 24 { … … 41 35 transferCount= diffCount; 42 36 43 rp-> Count= transferCount;37 rp->io.usCount= transferCount; 44 38 if( (rdOffset + transferCount) > DBG_MAX_BUF_SIZE ) 45 39 { … … 62 56 } else 63 57 { 64 rp-> Count= 0;58 rp->io.usCount= 0; 65 59 return RPDONE; 66 60 } -
GPL/branches/uniaud32-2.1.x/drv32/rmhelp.c
r587 r588 29 29 #include <string.h> 30 30 31 32 31 #define MAX_RESHANDLES 16 33 32 34 33 //****************************************************************************** 35 //****************************************************************************** 36 37 PFN RM_Help; 38 PFN RM_Help0; 39 PFN RM_Help3; 40 ULONG RMFlags; 34 35 //extern PFN RM_Help; 36 //extern PFN RM_Help0; 37 //extern PFN RM_Help3; 38 //extern ULONG RMFlags; 41 39 42 40 static HDRIVER DriverHandle = (HDRIVER)-1; … … 46 44 static HRESOURCE arResHandles[MAX_RESHANDLES]; 47 45 48 49 //******************************************************************************50 46 //****************************************************************************** 51 47 VOID RMInit(VOID) … … 78 74 DriverStruct.DrvrType = DRT_AUDIO; 79 75 DriverStruct.DrvrSubType = 0; 80 DriverStruct.DrvrCallback = NULL;76 DriverStruct.DrvrCallback = 0; 81 77 82 78 rc = RMCreateDriver( FlatToSel((ULONG)&DriverStruct), FlatToSel((ULONG)&hDriver) ); … … 306 302 AdapterStruct.HostBusType = AS_HOSTBUS_PCI; // HostBusType /* ### IHV */ 307 303 AdapterStruct.HostBusWidth = AS_BUSWIDTH_32BIT; // HostBusWidth /* ### IHV */ 308 AdapterStruct.pAdjunctList = NULL;// pAdjunctList /* ### IHV */304 AdapterStruct.pAdjunctList = 0; // pAdjunctList /* ### IHV */ 309 305 310 306 //--- Register adapter. We'll record any error code, but won't fail … … 314 310 FlatToSel((ULONG)&hAdapter), // (OUT) Handle to adapter 315 311 FlatToSel((ULONG)&AdapterStruct), // Adapter structure 316 NULL, // Parent device (defaults OK)317 NULL); // Allocated resources.312 0, // Parent device (defaults OK) 313 0); // Allocated resources. 318 314 319 315 dprintf(("RMCreateAdapter rc=%d", rc)); … … 330 326 DeviceStruct.DevFlags = DS_FIXED_LOGICALNAME; 331 327 DeviceStruct.DevType = DS_TYPE_AUDIO; 332 DeviceStruct.pAdjunctList = NULL;328 DeviceStruct.pAdjunctList = 0; 333 329 334 330 rc = RMCreateDevice(DriverHandle, // Handle to driver -
GPL/branches/uniaud32-2.1.x/drv32/strategy.c
r550 r588 5 5 * (C) 2000-2002 InnoTek Systemberatung GmbH 6 6 * (C) 2000-2001 Sander van Leeuwen (sandervl@xs4all.nl) 7 * Copyright (c) 2013-2015 David Azarewicz david@88watts.net 7 8 * 8 9 * This program is free software; you can redistribute it and/or … … 24 25 25 26 #define INCL_NOPMAPI 26 #define INCL_DOSINFOSEG // Need Global info seg in rm.cpp algorithms27 #define INCL_DOSINFOSEG // Need Global info seg in rm.cpp algorithms 27 28 #include <os2.h> 28 29 29 30 #include <devhelp.h> 30 #include <devrp.h>31 //DAZ #include <devrp.h> 31 32 #include <devown.h> 32 33 #include "strategy.h" … … 35 36 #include <string.h> 36 37 37 ULONG StratRead(R P__far *_rp);38 ULONG StratIOCtl(R P__far *_rp);39 ULONG StratClose(R P__far *_rp);38 ULONG StratRead(REQPACKET __far *_rp); 39 ULONG StratIOCtl(REQPACKET __far *_rp); 40 ULONG StratClose(REQPACKET __far *_rp); 40 41 41 ULONG DiscardableInit(R PInit__far*);42 ULONG DiscardableInit(REQPACKET __far*); 42 43 ULONG deviceOwner = DEV_NO_OWNER; 43 44 ULONG numOS2Opens = 0; 44 extern "C"BOOL fRewired; //pci.c45 extern BOOL fRewired; //pci.c 45 46 46 extern "C"DBGINT DbgInt;47 extern DBGINT DbgInt; 47 48 48 49 //****************************************************************************** 50 ULONG StratOpen(REQPACKET __far* rp) 51 { 52 if (numOS2Opens == 0) 53 { 54 deviceOwner = DEV_PDD_OWNER; 55 } 56 numOS2Opens++; 57 return RPDONE; 58 } 59 49 60 //****************************************************************************** 50 ULONG StratOpen(RP __far*) 51 { 52 if (numOS2Opens == 0) { 53 deviceOwner = DEV_PDD_OWNER; 54 } 55 numOS2Opens++; 56 return RPDONE; 57 } 58 //****************************************************************************** 59 //****************************************************************************** 60 #pragma off (unreferenced) 61 static ULONG StratWrite(RP __far* _rp) 62 #pragma on (unreferenced) 61 //DAZ #pragma off (unreferenced) 62 static ULONG StratWrite(REQPACKET __far* rp) 63 //DAZ #pragma on (unreferenced) 63 64 { 64 65 return RPDONE | RPERR; 65 66 } 67 66 68 //****************************************************************************** 67 69 // External initialization entry-point 68 70 //****************************************************************************** 69 ULONG StratInit(R P __far* _rp)71 ULONG StratInit(REQPACKET __far* rp) 70 72 { 71 ULONG rc;73 ULONG rc; 72 74 73 memset(&DbgInt, 0, sizeof(DbgInt));74 DbgPrintIrq();75 memset(&DbgInt, 0, sizeof(DbgInt)); 76 DbgPrintIrq(); 75 77 76 RPInit __far* rp = (RPInit __far*)_rp;77 rc = DiscardableInit(rp);78 //dprintf(("StratInit End rc=%d", rc));79 DbgPrintIrq();80 DbgInt.ulState = 1;81 return rc;78 //DAZ RPInit __far* rp = (RPInit __far*)_rp; 79 rc = DiscardableInit(rp); 80 //dprintf(("StratInit End rc=%d", rc)); 81 DbgPrintIrq(); 82 DbgInt.ulState = 1; 83 return rc; 82 84 } 85 83 86 //****************************************************************************** 84 87 // External initialization complete entry-point 85 #ifdef ACPI86 #include "irqos2.h"87 #endif //ACPI88 88 //****************************************************************************** 89 #pragma off (unreferenced)90 ULONG StratInitComplete(R P __far* _rp)91 #pragma on (unreferenced)89 //DAZ #pragma off (unreferenced) 90 ULONG StratInitComplete(REQPACKET __far* rp) 91 //DAZ #pragma on (unreferenced) 92 92 { 93 DbgInt.ulState = 2; 94 #ifdef ACPI 95 PciAdjustInterrupts(); 96 #endif 97 DbgPrintIrq(); 98 //dprintf(("StratInitComplete")); 99 return(RPDONE); 93 DbgInt.ulState = 2; 94 DbgPrintIrq(); 95 //dprintf(("StratInitComplete")); 96 return(RPDONE); 100 97 } 98 101 99 //****************************************************************************** 102 //****************************************************************************** 103 #pragma off (unreferenced) 104 ULONG StratShutdown(RP __far *_rp) 105 #pragma on (unreferenced) 100 //DAZ #pragma off (unreferenced) 101 ULONG StratShutdown(REQPACKET __far *rp) 102 //DAZ #pragma on (unreferenced) 106 103 { 107 RPShutdown __far *rp = (RPShutdown __far *)_rp;104 //DAZ RPShutdown __far *rp = (RPShutdown __far *)_rp; 108 105 109 //dprintf(("StratShutdown %d", rp->Function)); 110 if(rp->Function == 1) {//end of shutdown 111 OSS32_Shutdown(); 112 } 113 return(RPDONE); 106 //dprintf(("StratShutdown %d", rp->Function)); 107 if(rp->shutdown.Function == 1) //end of shutdown 108 { 109 OSS32_Shutdown(); 110 } 111 return(RPDONE); 114 112 } 115 //****************************************************************************** 113 116 114 //****************************************************************************** 117 115 // Handle unsupported requests 118 static ULONG StratError(R P __far*)116 static ULONG StratError(REQPACKET __far* rp) 119 117 { 120 return RPERR_ COMMAND | RPDONE;118 return RPERR_BADCOMMAND | RPDONE; 121 119 } 120 122 121 //****************************************************************************** 123 122 // Strategy dispatch table … … 125 124 // This table is used by the strategy routine to dispatch strategy requests 126 125 //****************************************************************************** 127 typedef ULONG (*RPHandler)(R P__far* rp);126 typedef ULONG (*RPHandler)(REQPACKET __far* rp); 128 127 RPHandler StratDispatch[] = 129 128 { 130 StratInit, // 00 (BC): Initialization131 StratError, // 01 (B ): Media check132 StratError, // 02 (B ): Build BIOS parameter block133 StratError, // 03 ( ): Unused134 StratRead, // 04 (BC): Read135 StratError, // 05 ( C): Nondestructive read with no wait136 StratError, // 06 ( C): Input status137 StratError, // 07 ( C): Input flush138 StratWrite, // 08 (BC): Write139 StratError, // 09 (BC): Write verify140 StratError, // 0A ( C): Output status141 StratError, // 0B ( C): Output flush142 StratError, // 0C ( ): Unused143 StratOpen, // 0D (BC): Open144 StratClose, // 0E (BC): Close145 StratError, // 0F (B ): Removable media check146 StratIOCtl, // 10 (BC): IO Control147 StratError, // 11 (B ): Reset media148 StratError, // 12 (B ): Get logical unit149 StratError, // 13 (B ): Set logical unit150 StratError, // 14 ( C): Deinstall character device driver151 StratError, // 15 ( ): Unused152 StratError, // 16 (B ): Count partitionable fixed disks153 StratError, // 17 (B ): Get logical unit mapping of fixed disk154 StratError, // 18 ( ): Unused155 StratError, // 19 ( ): Unused156 StratError, // 1A ( ): Unused157 StratError, // 1B ( ): Unused158 StratShutdown, // 1C (BC): Notify start or end of system shutdown159 StratError, // 1D (B ): Get driver capabilities160 StratError, // 1E ( ): Unused161 StratInitComplete // 1F (BC): Notify end of initialization129 StratInit, // 00 (BC): Initialization 130 StratError, // 01 (B ): Media check 131 StratError, // 02 (B ): Build BIOS parameter block 132 StratError, // 03 ( ): Unused 133 StratRead, // 04 (BC): Read 134 StratError, // 05 ( C): Nondestructive read with no wait 135 StratError, // 06 ( C): Input status 136 StratError, // 07 ( C): Input flush 137 StratWrite, // 08 (BC): Write 138 StratError, // 09 (BC): Write verify 139 StratError, // 0A ( C): Output status 140 StratError, // 0B ( C): Output flush 141 StratError, // 0C ( ): Unused 142 StratOpen, // 0D (BC): Open 143 StratClose, // 0E (BC): Close 144 StratError, // 0F (B ): Removable media check 145 StratIOCtl, // 10 (BC): IO Control 146 StratError, // 11 (B ): Reset media 147 StratError, // 12 (B ): Get logical unit 148 StratError, // 13 (B ): Set logical unit 149 StratError, // 14 ( C): Deinstall character device driver 150 StratError, // 15 ( ): Unused 151 StratError, // 16 (B ): Count partitionable fixed disks 152 StratError, // 17 (B ): Get logical unit mapping of fixed disk 153 StratError, // 18 ( ): Unused 154 StratError, // 19 ( ): Unused 155 StratError, // 1A ( ): Unused 156 StratError, // 1B ( ): Unused 157 StratShutdown, // 1C (BC): Notify start or end of system shutdown 158 StratError, // 1D (B ): Get driver capabilities 159 StratError, // 1E ( ): Unused 160 StratInitComplete // 1F (BC): Notify end of initialization 162 161 }; 162 163 163 //****************************************************************************** 164 164 // Strategy entry point … … 167 167 // calling convention, which fetches arguments from the correct registers. 168 168 //****************************************************************************** 169 ULONG Strategy(RP __far* rp);170 169 #pragma aux (STRATEGY) Strategy "ALSA_STRATEGY"; 171 ULONG Strategy(R P__far* rp)170 ULONG Strategy(REQPACKET __far* rp) 172 171 { 173 if (fRewired) { 174 fRewired = FALSE; 175 rprintf(("Strategy: Resuming")); 176 OSS32_APMResume(); 177 DbgPrintIrq(); 178 } 172 if (fRewired) 173 { 174 fRewired = FALSE; 175 rprintf(("Strategy: Resuming")); 176 OSS32_APMResume(); 177 DbgPrintIrq(); 178 } 179 179 180 if (rp->Command < sizeof(StratDispatch)/sizeof(StratDispatch[0])) 181 return(StratDispatch[rp->Command](rp)); 182 else return(RPERR_COMMAND | RPDONE); 180 if (rp->bCommand < sizeof(StratDispatch)/sizeof(StratDispatch[0])) return(StratDispatch[rp->bCommand](rp)); 181 else return(RPERR_BADCOMMAND | RPDONE); 183 182 } 184 //****************************************************************************** 185 //****************************************************************************** 183 -
GPL/branches/uniaud32-2.1.x/drv32/util.c
r587 r588 35 35 //***************************************************************************** 36 36 //***************************************************************************** 37 extern "C"void __wcpp_2_undefed_cdtor_(void)37 extern void __wcpp_2_undefed_cdtor_(void) 38 38 { 39 39 int3(); … … 41 41 //***************************************************************************** 42 42 //***************************************************************************** 43 extern "C"void __wcpp_2_undefined_member_function_(void)43 extern void __wcpp_2_undefined_member_function_(void) 44 44 { 45 45 int3(); … … 47 47 //***************************************************************************** 48 48 //***************************************************************************** 49 extern "C"void __wcpp_2_pure_error_(void)49 extern void __wcpp_2_pure_error_(void) 50 50 { 51 51 int3(); … … 53 53 //***************************************************************************** 54 54 //***************************************************************************** 55 extern "C"void __wcpp_2_undef_vfun_(void)55 extern void __wcpp_2_undef_vfun_(void) 56 56 { 57 57 int3(); … … 59 59 //***************************************************************************** 60 60 //***************************************************************************** 61 extern "C"void __wcpp_4_undefed_cdtor_(void)61 extern void __wcpp_4_undefed_cdtor_(void) 62 62 { 63 63 int3(); … … 65 65 //***************************************************************************** 66 66 //***************************************************************************** 67 extern "C"void __wcpp_4_undefined_member_function_(void)67 extern void __wcpp_4_undefined_member_function_(void) 68 68 { 69 69 int3(); … … 71 71 //***************************************************************************** 72 72 //***************************************************************************** 73 extern "C"void __wcpp_4_pure_error_(void)73 extern void __wcpp_4_pure_error_(void) 74 74 { 75 75 int3(); … … 77 77 //***************************************************************************** 78 78 //***************************************************************************** 79 extern "C"void __wcpp_4_undef_vfun_(void)79 extern void __wcpp_4_undef_vfun_(void) 80 80 { 81 81 int3(); 82 82 } 83 #ifdef NOT_USED 83 84 //***************************************************************************** 84 85 //***************************************************************************** … … 107 108 return u ? p : NULL; 108 109 } 109 //***************************************************************************** 110 #endif 111 110 112 //***************************************************************************** 111 113 #if !defined(KEE) 112 114 static GINFO FAR48 *pGIS = 0; 113 115 #endif 114 //***************************************************************************** 116 115 117 //***************************************************************************** 116 118 //PS++ Begin 117 extern "C"118 {119 119 #pragma pack(1) 120 120 #include "infoseg.h" … … 122 122 extern PVOID KernSISData; 123 123 #define KernSISData ((struct InfoSegGDT *)&KernSISData) 124 }125 124 ULONG os2gettimesec() 126 125 { … … 143 142 #endif 144 143 } 145 //***************************************************************************** 144 146 145 //***************************************************************************** 147 146 ULONG os2gettimemsec() … … 166 165 } 167 166 //PS++ End 168 //*****************************************************************************169 //*****************************************************************************170 167 -
GPL/branches/uniaud32-2.1.x/howtobuild.txt
r64 r588 1 NOTE! Use OpenWatcom 1. 4rc1 or later. Also you need IBM's ILINK for driver1 NOTE! Use OpenWatcom 1.9 or later. Also you need IBM's ILINK for driver 2 2 linking. Possible, you can try wlink, but I never did that. 3 3 4 1. Run Configure.cmd5 4 6 2. Enter path to watcom and ddk base 5 1. Setup WATCOM and DDK in your environment. 7 6 8 3. within created makefile.inc check for: 9 ALSA_SRC 10 ALSA_LIB_ 11 ALSA_BIN_ 12 define and create corresponding directories 7 2. type wmake or wmake -a 13 8 14 4. add following state if not added by configure:15 ################################################################################16 # Include the right watcom makefile17 ################################################################################18 !ifdef 32BIT19 !include E:\DEV\USS\test\GPL\include\watcom32.mk20 !include E:\DEV\USS\test\GPL\include\watcom32.mak21 !else22 !include E:\DEV\USS\ua2\OCO\include\watcom16.mk23 !include E:\DEV\USS\ua2\OCO\include\watcom16.mak24 !endif25 26 DDK_BASE = e:\ddk\base27 WATCOM = e:\owatcom28 29 5. run !m_kee.cmd or !m_v4.cmd scrips30 -
GPL/branches/uniaud32-2.1.x/include/DEVINFO.H
r32 r588 26 26 #if !defined(DevInfo_h) 27 27 #define DevInfo_h 1 28 29 #if !defined(__cplusplus)30 #error C++ must be used for strict type checking31 #endif32 33 28 34 29 // Include the fundamental type definitions -
GPL/branches/uniaud32-2.1.x/include/DEVTYPE.H
r32 r588 25 25 #if !defined(DevType_h) 26 26 #define DevType_h 1 27 28 #if !defined(__WATCOMC__) || !defined(__cplusplus)29 #error Watcom C++ must be used for strict type checking.30 #endif31 27 32 28 #pragma pack(1) … … 102 98 WORD16 Count; // Count of bytes in queue 103 99 }; 104 template <int s> struct QUEUE : public QBASE105 {106 BYTE Buffer[s]; // Queue buffer107 };100 //template <int s> struct QUEUE : public QBASE 101 // { 102 // BYTE Buffer[s]; // Queue buffer 103 // }; 108 104 109 105 // Inter device driver communication structure … … 137 133 struct DEVHEADER 138 134 { 139 DEVHEADER FAR* Link; // Link to next header in chain135 struct DEVHEADER FAR* Link; // Link to next header in chain 140 136 WORD16 DAWFlags; // Device attribute word 141 137 VOID* StrategyEntry; // Entry point to strategy routine … … 147 143 148 144 // Constant for final DEVHEADER in chain 149 #define FinalLink (( DEVHEADER FAR*)0xFFFFFFFFul)145 #define FinalLink ((struct DEVHEADER FAR*)0xFFFFFFFFul) 150 146 151 147 // Constants for device attribute word … … 182 178 #define OffsetBeginDS32 ((WORD32)&_OffBeginDS32) 183 179 184 extern "C"185 {180 //extern "C" 181 //{ 186 182 extern BYTE _OffFinalCS32; // End of resident code 187 183 extern BYTE _OffFinalDS32; // End of resident code … … 190 186 extern WORD16 _OffsetFinalCS16; 191 187 extern WORD16 _OffsetFinalDS16; 192 }188 //} 193 189 194 190 #pragma pack() -
GPL/branches/uniaud32-2.1.x/include/linux/types.h
r499 r588 111 111 }; 112 112 113 #define __inline__ __inline 113 #define __inline__ __inline 114 114 115 115 #ifdef FLATSTACK … … 138 138 typedef unsigned int fmode_t; 139 139 140 typedef int _Bool;140 //typedef int _Bool; 141 141 typedef _Bool bool; 142 142 -
GPL/branches/uniaud32-2.1.x/include/malloc.h
r504 r588 35 35 void NEAR *malloc(ULONG size, const char *filename, int lineno); 36 36 void free(void *NEAR ptr, const char *filename, int lineno); 37 void NEAR *realloc(void *NEAR ptr, unsigned newsize, const char *filename, int lineno);37 void NEAR *realloc(void *NEAR ptr, unsigned long newsize, const char *filename, int lineno); 38 38 #else 39 39 void NEAR *malloc(ULONG size); 40 40 void free(void NEAR *); 41 void NEAR *realloc(void NEAR *, unsigned );41 void NEAR *realloc(void NEAR *, unsigned long); 42 42 #endif 43 43 -
GPL/branches/uniaud32-2.1.x/include/strategy.h
r32 r588 1 /* $Id: strategy.h,v 1.1.1.1 2003/07/02 13:56:58 eleph Exp $ */ 2 /* 3 * OS/2 strategy handler definitions 4 * 5 * (C) 2000-2002 InnoTek Systemberatung GmbH 6 * (C) 2000-2001 Sander van Leeuwen (sandervl@xs4all.nl) 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License as 10 * published by the Free Software Foundation; either version 2 of 11 * the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public 19 * License along with this program; if not, write to the Free 20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 21 * USA. 22 * 23 */ 24 1 /**************************************************************************** 2 * * 3 * Copyright (c) IBM Corporation 1994 - 1997. * 4 * * 5 * The following IBM OS/2 source code is provided to you solely for the * 6 * the purpose of assisting you in your development of OS/2 device drivers. * 7 * You may use this code in accordance with the IBM License Agreement * 8 * provided in the IBM Device Driver Source Kit for OS/2. * 9 * * 10 * Copyright (c) 2013 David Azarewicz david@88watts.net * 11 * Modified to fix problems and for OpenWatcom compatibility * 12 ****************************************************************************/ 25 13 #ifndef STRATEGY_INCLUDED 26 14 #define STRATEGY_INCLUDED 27 15 16 #pragma pack(1); 28 17 29 /* Constants relating to the Strategy Routines 30 */ 18 typedef struct { /* template for request header */ 19 BYTE bLength; /* 00 request packet length */ 20 BYTE bUnit; /* 01 unit code for block DD only */ 21 BYTE bCommand; /* 02 command code */ 22 USHORT usStatus; /* 03 return status */ 23 ULONG dwReserved; /* 05 reserved bytes */ 24 ULONG ulQlink; /* 09 queue linkage */ 25 union { /* command-specific data */ 26 struct { 27 BYTE b; /* 0D */ 28 PFN ulDevHlp; /* 0E dev help address */ 29 ULONG szArgs; /* 12 argument pointer */ 30 BYTE bDrive; /* 16 */ 31 } init_in; 32 struct { 33 BYTE bUnits; 34 USHORT usCodeEnd; // final code offset 35 USHORT usDataEnd; // final data offset 36 ULONG ul; 37 } init_out; 38 struct { 39 BYTE bMedia; 40 ULONG ulAddress; 41 USHORT usCount; 42 ULONG ulStartSector; 43 USHORT usSysFileNum; 44 } io; 45 struct { 46 BYTE bData; 47 } peek; 48 struct { 49 BYTE bCategory; // category code 50 BYTE bFunction; // function code 51 ULONG pvParm; // address of parameter buffer 52 ULONG pvData; // address of data buffer 53 USHORT usSysFileNum; // system file number 54 USHORT usParmLen; // length of parameter buffer 55 USHORT usDataLen; // length of data buffer 56 } ioctl; 57 struct { 58 USHORT usSysFileNum; // system file number 59 } open_close; 60 struct { 61 BYTE Function; // Shutdown code: 0 = start, 1 = end 62 ULONG Reserved; // Reserved 63 } shutdown; 64 struct { 65 BYTE Function; 66 } save_restore; 67 }; 68 } REQPACKET; 69 70 #pragma pack(); 71 72 /* Constants relating to the Strategy Routines */ 31 73 32 74 #define RPDONE 0x0100 // return successful, must be set … … 35 77 #define RPERR 0x8000 // return error 36 78 37 // List of error codes, from chapter 8 of PDD reference 38 #define RPNOTREADY 0x0002 39 #define RPBADCMD 0x0003 40 #define RPGENFAIL 0x000c 41 #define RPDEVINUSE 0x0014 42 #define RPINITFAIL 0x0015 79 #define RPERR_PROTECT 0x8000 80 #define RPERR_UNIT 0x8001 81 #define RPERR_NOTREADY 0x8002 82 #define RPERR_BADCOMMAND 0x8003 83 #define RPERR_CRC 0x8004 84 #define RPERR_LENGTH 0x8005 85 #define RPERR_SEEK 0x8006 86 #define RPERR_FORMAT 0x8007 87 #define RPERR_SECTOR 0x8008 88 #define RPERR_PAPER 0x8009 89 #define RPERR_WRITE 0x800A 90 #define RPERR_READ 0x800B 91 #define RPERR_GENERAL 0x800C 92 #define RPERR_DISK 0x800D 93 #define RPERR_MEDIA 0x8010 94 #define RPERR_INTERRUPTED 0x8011 95 #define RPERR_MONITOR 0x8012 96 #define RPERR_PARAMETER 0x8013 97 #define RPERR_DEVINUSE 0x8014 98 #define RPERR_INITFAIL 0x8015 43 99 44 100 // list of Strategy commands from PDD reference 45 // Note this is only the list of commands audio device drivers care about 46 #define STRATEGY_INIT 0x00 47 #define STRATEGY_OPEN 0x0D 48 #define STRATEGY_CLOSE 0x0E 49 #define STRATEGY_GENIOCTL 0x10 50 #define STRATEGY_DEINSTALL 0x14 51 #define STRATEGY_INITCOMPLETE 0x1F 101 #define STRATEGY_INIT 0x00 102 #define STRATEGY_MEDIACHECK 0x01 103 #define STRATEGY_BUILDBPB 0x02 104 #define STRATEGY_IOCTLR 0x03 105 #define STRATEGY_READ 0x04 106 #define STRATEGY_NDR 0x05 107 #define STRATEGY_INPUTSTATUS 0x06 108 #define STRATEGY_FLUSHINPUT 0x07 109 #define STRATEGY_WRITE 0x08 110 #define STRATEGY_WRITEVERIFY 0x09 111 #define STRATEGY_OUTPUTSTATUS 0x0A 112 #define STRATEGY_FLUSHOUTPUT 0x0B 113 #define STRATEGY_IOCTLW 0x0C 114 #define STRATEGY_OPEN 0x0D 115 #define STRATEGY_CLOSE 0x0E 116 #define STRATEGY_REMOVEABLEMEDIA 0x0F 117 #define STRATEGY_GENIOCTL 0x10 118 #define STRATEGY_RESETMEDIA 0x11 119 #define STRATEGY_GETLOGMAP 0x12 120 #define STRATEGY_SETLOGMAP 0x13 121 #define STRATEGY_DEINSTALL 0x14 122 #define STRATEGY_PARTFIXEDDISKS 0x16 123 #define STRATEGY_GETFDLOGUNITMAP 0x17 124 #define STRATEGY_INPUTBYPASS 0x18 125 #define STRATEGY_OUTPUTBYPASS 0x19 126 #define STRATEGY_OUTPUTBYPASSV 0x1A 127 #define STRATEGY_BASEDEVINIT 0x1B 128 #define STRATEGY_SHUTDOWN 0x1C 129 #define STRATEGY_GETDRIVERCAPS 0x1D 130 #define STRATEGY_INITCOMPLETE 0x1F 131 #define STRATEGY_SAVERESTORE 0x20 132 133 #define IOCTL_ASYNC 0x0001 134 #define IOCTL_SCR_AND_PTRDRAW 0x0003 135 #define IOCTL_KEYBOARD 0x0004 136 #define IOCTL_PRINTER 0x0005 137 #define IOCTL_LIGHTPEN 0x0006 138 #define IOCTL_POINTINGDEVICE 0x0007 139 #define IOCTL_DISK 0x0008 140 #define IOCTL_PHYSICALDISK 0x0009 141 #define IOCTL_MONITOR 0x000A 142 #define IOCTL_GENERAL 0x000B 143 #define IOCTL_POWER 0x000C 144 #define IOCTL_OEMHLP 0x0080 145 #define IOCTL_TESTCFG_SYS 0x0080 146 #define IOCTL_CDROMDISK 0x0080 147 #define IOCTL_CDROMAUDIO 0x0081 148 #define IOCTL_TOUCH_DEVDEP 0x0081 149 #define IOCTL_TOUCH_DEVINDEP 0x0081 52 150 53 151 #endif -
GPL/branches/uniaud32-2.1.x/lib32/initcall.h
r568 r588 8 8 typedef void (*exitcall_t)(void); 9 9 10 extern "C"int use_internal_drums;10 extern int use_internal_drums; 11 11 12 12 #define __initcall(fn) \ … … 19 19 #define module_exit(x) __exitcall(x); 20 20 21 #define extern_module_init(x) extern "C"initcall_t __initcall_##x;22 #define extern_module_exit(x) extern "C"exitcall_t __exitcall_##x;21 #define extern_module_init(x) extern initcall_t __initcall_##x; 22 #define extern_module_exit(x) extern exitcall_t __exitcall_##x; 23 23 24 24 #define call_module_init(x) __initcall_##x() … … 108 108 extern_module_init(patch_analog_init) 109 109 extern_module_exit(patch_analog_exit) 110 #if 0 111 extern_module_init(patch_hdmi_init) 112 extern_module_exit(patch_hdmi_init) 113 #endif 110 extern_module_init(patch_atihdmi_init) 111 extern_module_exit(patch_atihdmi_init) 114 112 extern_module_init(patch_cmedia_init) 115 113 extern_module_exit(patch_cmedia_exit) -
GPL/branches/uniaud32-2.1.x/lib32/malloc.c
r587 r588 384 384 physically located after pmb. 385 385 386 Helper function remove() removes an element from the free list.386 Helper function h_remove() removes an element from the free list. 387 387 */ 388 388 389 389 #define after(pmb) ((PMEMBLOCK) ((char *) pmb + pmb->ulSize + HDR_SIZE)) 390 390 391 void remove(PMEMBLOCK pmb)391 void h_remove(PMEMBLOCK pmb) 392 392 { 393 393 PMEMBLOCK pmbPrev; 394 394 395 if (pmb == pmbFree) { 395 if (pmb == pmbFree) 396 { 396 397 pmbFree = pmbFree->pmbNext; 397 398 return; 398 399 } 399 400 400 for (pmbPrev=pmbFree; pmbPrev; pmbPrev=pmbPrev->pmbNext) { 401 if (pmbPrev->pmbNext == pmb) { 401 for (pmbPrev=pmbFree; pmbPrev; pmbPrev=pmbPrev->pmbNext) 402 { 403 if (pmbPrev->pmbNext == pmb) 404 { 402 405 pmbPrev->pmbNext = pmb->pmbNext; 403 406 return; … … 405 408 } 406 409 } 407 //***************************************************************************** 410 408 411 //***************************************************************************** 409 412 void compact(void) … … 417 420 // dprintf(("HEAP: compact found pointer %p (size=%ui) before pmbFree %p\n", (void __far *) pmb, pmb->uSize, (void __far *) pmbFree)); 418 421 pmb->ulSize += HDR_SIZE + pmbFree->ulSize; 419 remove(pmbFree);422 h_remove(pmbFree); 420 423 if (++sFreed == 2) break; 421 424 } else if (after(pmbFree) == pmb) { 422 425 // dprintf(("HEAP: compact found pointer %p (size=%ui) after pmbFree %p\n", (void __far *) pmb, pmb->uSize, (void __far *) pmbFree); 423 426 pmbFree->ulSize += HDR_SIZE + pmb->ulSize; 424 remove(pmb);427 h_remove(pmb); 425 428 if (++sFreed == 2) break; 426 429 } … … 554 557 } 555 558 //***************************************************************************** 556 extern "C"APIRET VMAlloc(ULONG size, ULONG flags, LINEAR *pAddr) ;559 extern APIRET VMAlloc(ULONG size, ULONG flags, LINEAR *pAddr) ; 557 560 //***************************************************************************** 558 561 ULONG HeapInit(ULONG ulSize) -
GPL/branches/uniaud32-2.1.x/lib32/memory.c
r587 r588 23 23 */ 24 24 25 extern "C" {26 25 #define INCL_NOPMAPI 27 26 #define INCL_DOSERRORS // for ERROR_INVALID_FUNCTION 28 27 #include <os2.h> 29 }30 28 #include <devhelp.h> 31 29 #include <ossidc.h> … … 43 41 #define PAGE_SIZE 4096 44 42 45 extern "C" {46 47 43 int free_pages(unsigned long addr, unsigned long order); 48 44 int __compat_get_order(unsigned long size); … … 174 170 } 175 171 //****************************************************************************** 176 extern "C"int fStrategyInit;172 extern int fStrategyInit; 177 173 //****************************************************************************** 178 174 APIRET VMAlloc(ULONG size, ULONG flags, LINEAR *pAddr) … … 180 176 APIRET rc; 181 177 ULONG addr; 178 SHORT sel; 182 179 183 180 if(fStrategyInit && !(flags & VMDHA_16M)) { … … 188 185 189 186 #ifdef KEE 190 SHORT sel;191 187 192 188 rc = KernVMAlloc(size, flags, (PVOID*)&addr, (PVOID*)-1, &sel); … … 566 562 return 0; 567 563 } 568 //****************************************************************************** 564 569 565 //****************************************************************************** 570 566 #ifdef DEBUGHEAP … … 598 594 return addr; 599 595 } 600 //****************************************************************************** 596 601 597 //****************************************************************************** 602 598 #ifdef DEBUGHEAP … … 609 605 610 606 addr = (ULONG)ptr; 611 if(addr == NULL) { 607 if(addr == 0) 608 { 612 609 DebugInt3(); 613 610 return; … … 623 620 else vfree((PVOID)addr); 624 621 } 625 //****************************************************************************** 622 626 623 //****************************************************************************** 627 624 void *kzalloc(size_t size, unsigned int flags) … … 641 638 return kzalloc(n * size, flags); 642 639 } 643 //****************************************************************************** 644 //****************************************************************************** 645 646 } 640 -
GPL/branches/uniaud32-2.1.x/lib32/stack.c
r587 r588 20 20 */ 21 21 22 extern "C" {23 22 #define INCL_NOPMAPI 24 23 #define INCL_DOSERRORS // for ERROR_INVALID_FUNCTION 25 24 #include <os2.h> 26 }27 25 #include <devhelp.h> 28 26 #include <ossidc.h> … … 144 142 return; 145 143 } 146 } 144 } 147 145 DevPopf(cpuflags); 148 146 DebugInt3(); … … 158 156 159 157 offset = addr32 - (ULONG)StackBase; 160 158 161 159 if(offset > TOTAL_STACKSIZE) { 162 160 //bad boy! -
GPL/branches/uniaud32-2.1.x/tools/mkversion.cmd
r576 r588 2 2 * Set time/date/hostname for uniaud build environment 3 3 */ 4 call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'; 5 call SysLoadFuncs; 4 6 5 parse arg s AlsaBase7 parse arg sDebugMode; 6 8 7 9 /* I don't this will ever change from Netlabs */ 8 projVendor = "Netlabs" 9 projProduct = "OS/2 Universal Audio 32 Driver" 10 projVendorNam = "Netlabs <www.netlabs.org>" 11 projAdapter = "OS/2 Universal Audio" 12 10 projVendor = EnvVar_Get_If('VENDOR', 'Netlabs'); 11 projProduct = "OS/2 Universal Audio 32 Driver"; 12 projVendorNam = "Netlabs <www.netlabs.org>"; 13 projAdapter = "OS/2 Universal Audio"; 13 14 14 15 /* uniaud.inc is located in the base gpl directory and … … 16 17 * written to include\version.h. 17 18 */ 18 if sAlsaBase = "" then sAlsaBase = "." 19 versConst = sAlsaBase "\uniaud.inc"19 sAlsaBase = Directory(); 20 versConst = sAlsaBase||"\uniaud.inc"; 20 21 21 versMak = sAlsaBase "\include\version.mak"22 versHdr = sAlsaBase "\include\version.h"23 AlsaVersHdr = sAlsaBase '\alsa-kernel\include\sound\version.h'22 versMak = sAlsaBase||"\include\version.mak"; 23 versHdr = sAlsaBase||"\include\version.h"; 24 AlsaVersHdr = sAlsaBase||'\alsa-kernel\include\sound\version.h'; 24 25 25 26 /* get and format date and time */ 26 curDate = DATE('S') 27 projDate = RIGHT(curDate, 2) "."SUBSTR(curDate, 5, 2)"."LEFT(curDate, 4)28 projDate2 = LEFT(curDate, 4) SUBSTR(curDate, 5, 2)RIGHT(curDate, 2)L29 projTime = TIME( ) 27 curDate = DATE('S'); 28 projDate = RIGHT(curDate, 2)||"."||SUBSTR(curDate, 5, 2)||"."||LEFT(curDate, 4); 29 projDate2 = LEFT(curDate, 4)||SUBSTR(curDate, 5, 2)||RIGHT(curDate, 2)L 30 projTime = TIME( ); 30 31 31 /* get hostname for build system */ 32 projHost = VALUE('HOSTNAME',,'OS2ENVIRONMENT') 32 if (sDebugMode<>'') then do 33 say "Project date: "projDate 34 say "Project time: "projTime 35 say "Inc File: "versConst 36 say "Version Mak: "versMak 37 say "Version Hdr: "versHdr 38 end 33 39 34 projString = left(Date() TIME(),25)left(projHost,10) 40 LINEIN(versConst,,0); 35 41 36 say "Project date: "projDate 37 say "Project time: "projTime 38 say "hostname: "projHost 39 say "Version In: "versConst 40 say "Version Mak: "versMak 41 say "Version Hdr: "versHdr 42 43 LINEIN(versConst,,0) 44 45 fixpack = '' 42 fixpack = ''; 46 43 47 44 do while(LINES(versConst)) 48 tmpLine = LINEIN(versConst)45 tmpLine = LINEIN(versConst); 49 46 50 IF POS('#', tmpline) = 1 Then iterate47 IF POS('#', tmpline) = 1 Then iterate; 51 48 52 opLoc = POS('BUILDVERSION', tmpLine)53 if opLoc > 0 then54 versionIn = STRIP((RIGHT(tmpLine, ( LENGTH(tmpLine) - (POS("=", tmpLine)+1) ))), B, ' ')49 opLoc = POS('BUILDVERSION', tmpLine); 50 if opLoc > 0 then 51 versionIn = STRIP((RIGHT(tmpLine, ( LENGTH(tmpLine) - (POS("=", tmpLine)+1) ))), B, ' ') 55 52 56 opLoc = POS('PRODUCTNAME', tmpLine)57 if opLoc > 0 then58 productName = STRIP((RIGHT(tmpLine, ( LENGTH(tmpLine) - (POS("=", tmpLine)+1) ))), B, ' ')53 opLoc = POS('PRODUCTNAME', tmpLine) 54 if opLoc > 0 then 55 productName = STRIP((RIGHT(tmpLine, ( LENGTH(tmpLine) - (POS("=", tmpLine)+1) ))), B, ' ') 59 56 60 opLoc = POS('FIXPACK', tmpLine) 61 if opLoc > 0 then 62 fixpack = STRIP((RIGHT(tmpLine, ( LENGTH(tmpLine) - (POS("=", tmpLine)+1) ))), B, ' ') 63 57 opLoc = POS('FIXPACK', tmpLine) 58 if opLoc > 0 then 59 fixpack = STRIP((RIGHT(tmpLine, ( LENGTH(tmpLine) - (POS("=", tmpLine)+1) ))), B, ' ') 64 60 end 65 61 66 if versionIn = "" then do 67 say "Could not find Version in "versConst 68 exit 62 if (sDebugMode<>'') then say 'versionIn='||versionIn; 63 64 if (versionIn = "") then do 65 say "Could not find Version in "||versConst; 66 exit; 69 67 end 70 68 … … 72 70 73 71 if fixpack="" then 74 projVers = versionIn 72 projVers = versionIn; 75 73 else 76 projVers = versionIn'-'fixpack 74 projVers = versionIn||'-'||fixpack; 77 75 78 projVers2 = major||minor||projVersion 76 projVers2 = major||minor||projVersion; 79 77 80 78 LINEIN(AlsaVersHdr,,0) … … 83 81 84 82 do while(LINES(AlsaVersHdr)) 85 tmpLine = LINEIN(AlsaVersHdr) 86 opLoc = POS('#define CONFIG_SND_VERSION', tmpLine) 87 if opLoc > 0 then 88 AlsaLevel = STRIP(RIGHT(tmpLine, ( LENGTH(tmpLine) - (POS('"', tmpLine)))),,'"') 83 tmpLine = LINEIN(AlsaVersHdr) 84 opLoc = POS('#define CONFIG_SND_VERSION', tmpLine) 85 if opLoc > 0 then AlsaLevel = STRIP(RIGHT(tmpLine, ( LENGTH(tmpLine) - (POS('"', tmpLine)))),,'"') 89 86 end 90 87 91 SAY 'Alsalevel = ' AlsaLevel 88 if (sDebugMode<>'') then do 89 SAY 'Alsalevel='||AlsaLevel; 90 say 'ProjVendor='||ProjVendor; 91 say 'versionIn='||versionIn; 92 say 'ProjString='||ProjString; 93 say 'alsalevel='||alsalevel; 94 say 'ProjVersion='||ProjVersion; 95 say 'projVers='||projVers; 96 say 'projVers2='||projVers2; 97 say 'Fixpack='||Fixpack; 98 end 92 99 93 SET "BUILDLEVEL=@#"ProjVendor":"versionIn"#@##1## "ProjString":"alsalevel":::"ProjVersion"::"Fixpack"@@"productname 94 95 call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs' 96 call SysLoadFuncs 97 dummy = SysFileDelete(versMak) 100 dummy = SysFileDelete(versMak); 98 101 99 102 if (stream(versMak, 'c', 'open write' ) = 'READY:') then 100 103 do 101 104 call lineout versMak, '#' 102 /*call lineout versMak, '# VERSION.MAK'105 call lineout versMak, '# VERSION.MAK' 103 106 call lineout versMak, '#' 104 107 call lineout versMak, '# Current build level for File Versioning' … … 106 109 call lineout versMak, '# Generated by mkversion.cmd, do NOT edit !' 107 110 call lineout versMak, '#' 108 call lineout versMak, 'BLDLVL_VENDOR = 'projVendor 109 call lineout versMak, 'BLDLVL_PRODUCT = 'projProduct 110 call lineout versMak, 'BLDLVL_REVISION = 'major'.'minor 111 call lineout versMak, 'BLDLVL_FILEVER = 'projVersion 112 call lineout versMak, 'BLDLVL_DATETIME = 'projDate' 'projTime 113 call lineout versMak, 'BLDLVL_MACHINE = 'projHost 111 call lineout versMak, 'BLDLVL_VENDOR = '||projVendor; 112 call lineout versMak, 'BLDLVL_VERSION = '||versionIn; 113 call lineout versMak, 'BLDLVL_FIXPACK = '||Fixpack; 114 call lineout versMak, 'BLDLVL_ALSA = '||alsalevel; 114 115 call stream versMak, 'c', 'close'; 115 */116 116 end 117 117 else … … 121 121 end 122 122 123 124 123 dummy = SysFileDelete(versHdr) 125 124 126 125 if (stream(versHdr, 'c', 'open write' ) = 'READY:') then 127 126 do 128 call lineout versHdr, '/*' 129 call lineout versHdr, ' * version.h Header for version string' 130 call lineout versHdr, ' *' 131 call lineout versHdr, ' * Generated by mkversion.cmd, do NOT edit !' 132 call lineout versHdr, ' *' 133 call lineout versHdr, ' */' 127 call lineout versHdr, '/*'; 128 call lineout versHdr, ' * version.h Header for version string'; 129 call lineout versHdr, ' *'; 130 call lineout versHdr, ' * Generated by mkversion.cmd, do NOT edit !'; 131 call lineout versHdr, ' *'; 132 call lineout versHdr, ' */'; 133 call lineout versHdr, ' '; 134 call lineout versHdr, ' '; 135 call lineout versHdr, '#ifndef __UNIAUDVERSION_H__'; 136 call lineout versHdr, '#define __UNIAUDVERSION_H__'; 137 call lineout versHdr, ' '; 138 call lineout versHdr, ' '; 139 call lineout versHdr, '#define PRODUCT_NAME "'||ProductName||'"'; 140 call lineout versHdr, '#define VENDOR_NAME "'||projVendor||'"'; 141 call lineout versHdr, '#define PRODUCT_TIMESTAMP '||projDate2||' // YYYYMMDD'; 142 call lineout versHdr, '#define UNIAUD_VERSION "'||projVers||'"'; 143 call lineout versHdr, '#define ALSA_VERSION "'||alsalevel||'"'; 134 144 call lineout versHdr, ' ' 135 145 call lineout versHdr, ' ' 136 call lineout versHdr, '#ifndef __UNIAUDVERSION_H__' 137 call lineout versHdr, '#define __UNIAUDVERSION_H__' 138 call lineout versHdr, ' ' 139 call lineout versHdr, ' ' 140 call lineout versHdr, '#define PRODUCT_NAME "'ProductName'"' 141 call lineout versHdr, '#define VENDOR_NAME "'projVendor'"' 142 call lineout versHdr, '#define PRODUCT_TIMESTAMP 'projDate2' // YYYYMMDD' 143 call lineout versHdr, '#define UNIAUD_VERSION "'projVers'"' 144 call lineout versHdr, '#define ALSA_VERSION "'alsalevel'"' 145 call lineout versHdr, ' ' 146 call lineout versHdr, ' ' 147 call lineout versHdr, '#define RM_VERSION 'projVers2 148 call lineout versHdr, '#define RM_DRIVER_NAME "UNIAUD32.SYS"' 149 call lineout versHdr, '#define RM_DRIVER_DESCRIPTION "'projProduct'"' 150 call lineout versHdr, '#define RM_ADAPTER_NAME "'projAdapter'"' 151 call lineout versHdr, '#define RM_DRIVER_VENDORNAME "'projVendorNam'"' 152 call lineout versHdr, '#define RM_DRIVER_BUILDYEAR (PRODUCT_TIMESTAMP / 10000)' 153 call lineout versHdr, '#define RM_DRIVER_BUILDMONTH ((PRODUCT_TIMESTAMP / 100) % 100)' 154 call lineout versHdr, '#define RM_DRIVER_BUILDDAY (PRODUCT_TIMESTAMP % 100)' 155 call lineout versHdr, ' ' 156 call lineout versHdr, ' ' 157 call lineout versHdr, "#endif //__UNIAUDVERSION_H__" 158 call lineout versHdr, ' ' 146 call lineout versHdr, '#define RM_VERSION '||projVers2; 147 call lineout versHdr, '#define RM_DRIVER_NAME "UNIAUD32.SYS"'; 148 call lineout versHdr, '#define RM_DRIVER_DESCRIPTION "'||projProduct||'"'; 149 call lineout versHdr, '#define RM_ADAPTER_NAME "'||projAdapter||'"'; 150 call lineout versHdr, '#define RM_DRIVER_VENDORNAME "'||projVendorNam||'"'; 151 call lineout versHdr, '#define RM_DRIVER_BUILDYEAR (PRODUCT_TIMESTAMP / 10000)'; 152 call lineout versHdr, '#define RM_DRIVER_BUILDMONTH ((PRODUCT_TIMESTAMP / 100) % 100)'; 153 call lineout versHdr, '#define RM_DRIVER_BUILDDAY (PRODUCT_TIMESTAMP % 100)'; 154 call lineout versHdr, ' '; 155 call lineout versHdr, ' '; 156 call lineout versHdr, "#endif //__UNIAUDVERSION_H__"; 157 call lineout versHdr, ' '; 159 158 call stream versHdr, 'c', 'close'; 160 159 end … … 167 166 exit 0; 168 167 168 /** 169 * Procedure section 170 **/ 169 171 172 EnvVar_Get: procedure 173 parse arg sEnvVar 174 if translate(sEnvVar) == 'BEGINLIBPATH' then 175 s = SysQueryExtLibpath('B') 176 else if translate(sEnvVar) == 'ENDLIBPATH' then 177 s = SysQueryExtLibpath('E') 178 else 179 s = value(sEnvVar,, 'OS2ENVIRONMENT') 180 return s; 170 181 182 /* 183 * Returns value of sEnvVar from environment if set or returns default value. 184 */ 185 EnvVar_Get_If: procedure 186 parse arg sEnvVar, sDefault; 187 s = EnvVar_Get(sEnvVar); 188 if s == '' then 189 s = sDefault; 190 return s; 191
Note:
See TracChangeset
for help on using the changeset viewer.
