Changeset 493 for GPL


Ignore:
Timestamp:
Jul 3, 2010, 7:26:36 PM (15 years ago)
Author:
David Azarewicz
Message:

Added status idc function

Location:
GPL/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/drv32/idc.c

    r479 r493  
    145145  }
    146146
     147  case IDC32_WAVE_GETSTATUS:
     148  {
     149       ULONG status = 0;
     150       rc = OSS32_WaveGetStatus(pPacket->streamid, &status);
     151       pPacket->status.state = status;
     152       return rc;
     153  }
     154
    147155  case IDC32_WAVE_SETVOLUME:
    148156       return OSS32_WaveSetVolume(pPacket->streamid, pPacket->setwavevol.volume);
     
    225233       return OSS32_MidiCommand(pPacket->streamid, cmd, pPacket->midicmd.channel, pPacket->midicmd.param1, pPacket->midicmd.param2);
    226234  }
    227   return 0;
     235
     236  return OSSERR_INVALID_PARAMETER;
    228237}
  • GPL/trunk/drv32/startup.asm

    r375 r493  
    1 ; $Id: startup.asm,v 1.1.1.1 2003/07/02 13:56:56 eleph Exp $ 
     1; $Id: startup.asm,v 1.1.1.1 2003/07/02 13:56:56 eleph Exp $
    22;*
    33;* 16bit entrypoints to the PDD with thunks to the 32bit functions
     
    5252                public _RM_Help3
    5353                public _RMFlags
     54IFDEF DEBUG
     55                public DbgU32TimerCnt
     56                public DbgU32IntCnt
     57ENDIF
    5458
    5559;*********************************************************************************************
     
    123127InitPktSeg      dw 0
    124128InitPktOff      dw 0
     129IFDEF DEBUG
     130DbgU32TimerCnt dd 0
     131DbgU32IntCnt dd 0
     132ENDIF
    125133;needed for rmcalls.lib
    126134_RM_Help0       dd 0
     
    165173        cmp     eax, 04h                        ; DosRead
    166174        je      uniaud_stub_strategy
    167        
     175
    168176        enter   0, 0
    169177        and     sp, 0fffch                      ; align stack
    170178
    171         pushad 
     179        pushad
    172180        push    ds
    173181        push    es
     
    235243        and     sp, 0fffch                      ; align stack
    236244
    237         pushad 
     245        pushad
    238246        push    ds
    239247        push    es
     
    328336; device_init
    329337;
    330 ; Use DosOpen to tell the 1st driver to handle init for us. We must do it this 
     338; Use DosOpen to tell the 1st driver to handle init for us. We must do it this
    331339; way since right now our CPL is 3 and the flat code selector has DPL 0, so
    332340; we can't load it. In the open strategy request, CPL is 0
     
    600608                call    near ptr _CallRM
    601609                mov     sp,bp
    602                 ret16     
     610                ret16
    603611DeAllocL1:      test    byte ptr _RMFlags,02H
    604612                je      short DeAllocL2
    605613                sub     ax,ax
    606                 ret16     
     614                ret16
    607615DeAllocL2:      mov     ax,0001H
    608                 ret16     
     616                ret16
    609617_RMDeallocResourceOrg endp
    610618
     
    622630
    623631                ALIGN 2
    624                 PUBLIC  MY_DEVHELP_ATTACHDD 
     632                PUBLIC  MY_DEVHELP_ATTACHDD
    625633MY_DEVHELP_ATTACHDD proc near
    626634                push    bp
     
    638646                pop     es
    639647                pop     di
    640                 leave   
     648                leave
    641649                ret     0004H
    642650L2:             pop     es
     
    659667                call    near ptr _CallRM
    660668                add     sp,0006H
    661                 ret16     
     669                ret16
    662670CreateDrL4:     test    byte ptr _RMFlags,02H
    663671                je      short CreateDrL6
     
    670678                pop     bx
    671679                pop     es
    672                 ret16     
     680                ret16
    673681CreateDrL6:     mov     ax, word ptr DevHelpInit + 2H
    674682                or      ax, word ptr DevHelpInit
    675683                jne     short CreateDrL7
    676684                mov     ax,0008H
    677                 ret16   
     685                ret16
    678686CreateDrL7:     push    offset ResMgr
    679687                push    offset _RMIDCTable
     
    708716
    709717                ALIGN 2
    710                 PUBLIC  _CallRM 
     718                PUBLIC  _CallRM
    711719_CallRM proc near
    712720                enter   0002H,00H
     
    719727                call    dword ptr _RM_Help3
    720728                add     sp,0006H
    721                 leave   
     729                leave
    722730                ret
    723731L1:             push    word ptr +6H[bp]
    724732                call    dword ptr _RM_Help0
    725                 leave   
     733                leave
    726734                ret
    727735_CallRM endp
     
    733741                pop     word ptr -2H[bp]
    734742                mov     ax,word ptr -2H[bp]
    735                 leave   
    736                 ret     
     743                leave
     744                ret
    737745_GetCS endp
    738746
     
    754762                je      short DestroyDrvL2
    755763                sub     ax,ax
    756                 ret16   
     764                ret16
    757765DestroyDrvL2:   mov     ax,0001H
    758766                ret16
     
    788796GetNodeInfo_L1: mov     ax,0014H
    789797                ret16
    790                 nop     
     798                nop
    791799GetNodeInfo_L2: test    byte ptr _RMFlags,02H
    792800                je      short GetNodeInfo_L3
     
    799807                ALIGN 2
    800808                PUBLIC  _RMGetNodeInfo16
    801 _RMGetNodeInfo16  proc far 
     809_RMGetNodeInfo16  proc far
    802810                enter32
    803811                xor     eax, eax
     
    825833                mov     sp,bp
    826834                ret16
    827 RMDevIDToHandleList_L1:             
     835RMDevIDToHandleList_L1:
    828836                mov     ax,0014H
    829837                ret16
    830                 nop     
    831 RMDevIDToHandleList_L2:             
     838                nop
     839RMDevIDToHandleList_L2:
    832840                test    byte ptr _RMFlags,02H
    833841                je      short RMDevIDToHandleList_L3
    834842                sub     ax,ax
    835843                ret16
    836                 nop     
    837 RMDevIDToHandleList_L3: 
     844                nop
     845RMDevIDToHandleList_L3:
    838846                mov     ax,0001H
    839847                ret16
    840                 nop     
     848                nop
    841849_RMDevIDToHandleListOrg endp
    842850
    843851                ALIGN 2
    844852                PUBLIC  _RMDevIDToHandleList16
    845 _RMDevIDToHandleList16  proc far 
     853_RMDevIDToHandleList16  proc far
    846854                enter32
    847855                xor     eax, eax
     
    874882                call    near ptr _CallRM
    875883                ret16
    876                 nop     
     884                nop
    877885RMHandleToResourceHandleList_L1:
    878886                mov     ax,0014H
    879887                ret16
    880                 nop     
     888                nop
    881889RMHandleToResourceHandleList_L2:
    882890                test    byte ptr _RMFlags,02H
     
    884892                sub     ax,ax
    885893                ret16
    886                 nop     
     894                nop
    887895RMHandleToResourceHandleList_L3:
    888896                 mov     ax,0001H
    889897                ret16
    890                 nop     
     898                nop
    891899_RMHandleToResourceHandleListOrg endp
    892900
    893901                ALIGN 2
    894902                PUBLIC  _RMHandleToResourceHandleList16
    895 _RMHandleToResourceHandleList16  proc far 
     903_RMHandleToResourceHandleList16  proc far
    896904                enter32
    897905                xor     eax, eax
     
    10821090        shr     edx, 13
    10831091        and     edx, 3
    1084        
     1092
    10851093        ;has the OS/2 kernel finally changed the DPL to 0?
    10861094        cmp     edx, 0
     
    10891097        mov     SelRef, 0
    10901098        jmp     short @@endchange
    1091        
     1099
    10921100@@changedpl:
    10931101        mov     oldDPL, eax
     
    11011109        inc     SelRef
    11021110@@fixdpl_end:
    1103         ret       
    1104 FixSelDPL endp       
     1111        ret
     1112FixSelDPL endp
    11051113;;******************************************************************************
    11061114; RestoreSelDPL:
     
    11141122        cmp     fWrongDPL, 1
    11151123        jne     short @@restdpl_end
    1116        
     1124
    11171125        cmp     SelRef, 1
    11181126        jne     short @@restdpl_endrest
     
    11381146;*******************************************************************************
    11391147;Copy parameters to 16 bits stack and call 16:32 IDC handler
    1140 ; 
     1148;
    11411149; Paramters: IDC16_HANDLER pHandler
    11421150;            ULONG         cmd
     
    11591167        call fword ptr [ebx]
    11601168        add  sp, 12
    1161        
     1169
    11621170        DevThunkStackTo32_Int
    11631171
     
    11981206        cmp     eax, 0
    11991207        jne     @@stackswitchfail_strat
    1200            
     1208
    12011209        call    ALSA_STRATEGY
    12021210
     
    12241232;*******************************************************************************
    12251233        ALIGN 4
    1226 IDC_ proc far       
     1234IDC_ proc far
    12271235        push    ds
    12281236        push    es
     
    12611269;*******************************************************************************
    12621270        ALIGN 4
    1263 TIMER_ proc far       
     1271TIMER_ proc far
    12641272        push    ds
    12651273        push    es
     
    12711279        mov     es, eax
    12721280
     1281IFDEF DEBUG
     1282        add     DbgU32TimerCnt, 1
     1283ENDIF
     1284
    12731285IFDEF FLATSTACK
    12741286        DevThunkStackTo32
     
    12851297        int     3
    12861298        call    ALSA_TIMER_
     1299ENDIF
     1300IFDEF DEBUG
     1301        add     DbgU32TimerCnt, -1
    12871302ENDIF
    12881303
     
    13161331
    13171332        pushfd
     1333
     1334IFDEF DEBUG
     1335                add         DbgU32IntCnt, 1
     1336ENDIF
     1337
    13181338        ; At this point a cli is redundant
    13191339        ; we enter the interrupt handler with interrupts disabled.
     
    13291349
    13301350        DevThunkStackTo16
    1331        
     1351
    13321352@@stackswitchfail_irq:
    13331353ELSE
     
    13361356ENDIF
    13371357
     1358IFDEF DEBUG
     1359                add         DbgU32IntCnt, -1
     1360ENDIF
     1361
    13381362        ;restore flags
    13391363        popfd
     
    13481372
    13491373endofirq:
    1350        
     1374
    13511375        pop     gs
    13521376        pop     fs
     
    15341558
    15351559    stackbase dd 0
    1536     stacksel  dd 0   
     1560    stacksel  dd 0
    15371561ELSE
    15381562
     
    15601584    _MSG_TABLE32     dw OFFSET  DATA16:_MSG_TABLE16
    15611585                     dw SEG     DATA16:_MSG_TABLE16
    1562          
    1563 ;16:16 address of driver name   
     1586
     1587;16:16 address of driver name
    15641588    PDDName          dw OFFSET  DATA16:pddname16
    15651589                     dw SEG     DATA16:pddname16
  • GPL/trunk/include/ossidc.h

    r485 r493  
    4141typedef struct
    4242{
    43   OSSSTREAMID streamid; //IN:  stream id
    44   ULONG       fileid;
    45   union {
    46         struct {
    47                 ULONG   handler16;      //IN: 16:16 address of pdd idc handler
    48         } init;
    49         struct {
    50                 ULONG   devicenr;       //IN:  nr of detected device
    51                 ULONG   streamtype;     //IN:  stream type
    52         } open;
    53         struct {
    54                 ULONG   devicenr;       //IN:  nr of detected device
    55                 ULONG   pDevCaps;       //IN:  16:16 stack based pointer to OSS32_DEVCAPS structure
    56         } devcaps;
    57         struct {
    58                 ULONG   position;       //OUT: stream position
    59         } getpos;
    60         struct {
    61                 ULONG   hwparams;       //IN:  16:16 pointer to OSS32_HWPARAMS structure
    62         } sethwparams;
    63         struct {
    64                 ULONG   bytesavail;     //OUT: bytes available in dma buffer
    65         } getspace;
    66         struct {
    67                 ULONG   volume;         //IN:  wave stream volume
    68         } setwavevol;
    69         struct {
    70                 ULONG   buffer;         //IN:  physical address of mmpm/2 buffer
    71                 ULONG   size;           //IN:  size of mmpm/2 buffer
    72                 ULONG   transferred;    //OUT: nr of bytes transferred
    73         } buffer;
    74         struct {
    75                 ULONG   midiByte;
    76         } midiwrite;
    77         struct {
    78                 ULONG   buffer;         //IN: data buffer
    79                 ULONG   bufsize;        //IN: size of data buffer
    80                 ULONG   transferred;    //OUT: nr of bytes transferred
    81         } midiread;
    82         struct {
    83                 ULONG   pCaps;          //IN: 16:16 stack based pointer to OSSMIDICAPS structure
    84         } midicaps;
    85         struct {
    86                 BYTE    channel;        //IN: channel nr
    87                 BYTE    param1;         //IN: midi command parameter 1
    88                 BYTE    param2;         //IN: midi command parameter 2
    89         } midicmd;
    90         struct {
    91                 ULONG   line;           //IN: mixer line
    92                 ULONG   volume;         //IN/OUT: volume (set/get)
    93         } mixvol;
    94         struct {
    95                 ULONG   property;       //IN: mixer property
    96                 ULONG   value;          //IN/OUT: property value (set/get)
    97         } mixprop;
    98         struct {
    99                 ULONG   pCaps;          //IN: 16:16 stack based pointer to OSSMIXCAPS structure
    100         } mixcaps;
    101         struct {
    102                 ULONG   param1;
    103                 ULONG   param2;
    104                 ULONG   param3;
     43        OSSSTREAMID streamid;   //IN:  stream id
     44        ULONG       fileid;
     45        union {
     46                struct {
     47                        ULONG   handler16;      //IN: 16:16 address of pdd idc handler
     48                } init;
     49                struct {
     50                        ULONG   devicenr;       //IN:  nr of detected device
     51                        ULONG   streamtype;     //IN:  stream type
     52                } open;
     53                struct {
     54                        ULONG   devicenr;       //IN:  nr of detected device
     55                        ULONG   pDevCaps;       //IN:  16:16 stack based pointer to OSS32_DEVCAPS structure
     56                } devcaps;
     57                struct {
     58                        ULONG   position;       //OUT: stream position
     59                } getpos;
     60                struct {
     61                        ULONG   state;  //OUT: stream state
     62                } status;
     63                struct {
     64                        ULONG   hwparams;       //IN:  16:16 pointer to OSS32_HWPARAMS structure
     65                } sethwparams;
     66                struct {
     67                        ULONG   bytesavail;     //OUT: bytes available in dma buffer
     68                } getspace;
     69                struct {
     70                        ULONG   volume;         //IN:  wave stream volume
     71                } setwavevol;
     72                struct {
     73                        ULONG   buffer;         //IN:  physical address of mmpm/2 buffer
     74                        ULONG   size;           //IN:  size of mmpm/2 buffer
     75                        ULONG   transferred;    //OUT: nr of bytes transferred
     76                } buffer;
     77                struct {
     78                        ULONG   midiByte;
     79                } midiwrite;
     80                struct {
     81                        ULONG   buffer;         //IN: data buffer
     82                        ULONG   bufsize;        //IN: size of data buffer
     83                        ULONG   transferred;    //OUT: nr of bytes transferred
     84                } midiread;
     85                struct {
     86                        ULONG   pCaps;          //IN: 16:16 stack based pointer to OSSMIDICAPS structure
     87                } midicaps;
     88                struct {
     89                        BYTE    channel;        //IN: channel nr
     90                        BYTE    param1;         //IN: midi command parameter 1
     91                        BYTE    param2;         //IN: midi command parameter 2
     92                } midicmd;
     93                struct {
     94                        ULONG   line;           //IN: mixer line
     95                        ULONG   volume;         //IN/OUT: volume (set/get)
     96                } mixvol;
     97                struct {
     98                        ULONG   property;       //IN: mixer property
     99                        ULONG   value;          //IN/OUT: property value (set/get)
     100                } mixprop;
     101                struct {
     102                        ULONG   pCaps;          //IN: 16:16 stack based pointer to OSSMIXCAPS structure
     103                } mixcaps;
     104                struct {
     105                        ULONG   param1;
     106                        ULONG   param2;
     107                        ULONG   param3;
     108                };
    105109        };
    106   };
    107110} IDC32_PACKET, NEAR *PIDC32_PACKET;
    108111
     
    165168#define IDC32_WAVE_SETVOLUME            0x1C
    166169#define IDC32_WAVE_GETHWPTR             0x1D
     170#define IDC32_WAVE_GETSTATUS             0x1E
    167171
    168172#define IDC32_MIXER_OPEN                0x20
  • GPL/trunk/include/ossidc32.h

    r386 r493  
    5959OSSRET OSS32_WaveGetSpace(OSSSTREAMID streamid, ULONG *pBytesAvail);
    6060OSSRET OSS32_WaveGetHwPtr(OSSSTREAMID streamid, ULONG *pBytesAvail);
     61OSSRET OSS32_WaveGetStatus(OSSSTREAMID streamid, ULONG *pStatus);
    6162OSSRET OSS32_WaveSetVolume(OSSSTREAMID streamid, ULONG volume);
    6263
  • GPL/trunk/include/watcom32.mak

    r433 r493  
    1414!if "$(DEBUG)" == "1"
    1515CFLAGS  = -dDEBUG -bt=os2v2 -e60 -hc -d2 -5r -omlinear -s -w4 -ze -zdp -zl -zq -nt=CODE32 -zff -zgf
    16 CPPFLAGS= -xd 
    17 ASFLAGS = -Mb -Li -Sv:M510
     16CPPFLAGS= -xd
     17ASFLAGS = -D:DEBUG -Mb -Li -Sv:M510
    1818!else
    1919CFLAGS  = -bt=os2v2 -e60 -5r -omlinear -s -w4 -ze -zdp -zl -zq -nt=CODE32 -zff -zgf
    20 CPPFLAGS= -xd 
     20CPPFLAGS= -xd
    2121ASFLAGS = -Mb -Li -Sv:M510
    2222!endif
     
    111111   @set WATCOM=$(WATCOM)
    112112   @if not exist .\$(OBJDIR) $(CREATEPATH) .\$(OBJDIR)
    113    @if not exist $(ALSA_LIB_) mkdir $(ALSA_LIB_) 
     113   @if not exist $(ALSA_LIB_) mkdir $(ALSA_LIB_)
    114114   @if not exist $(ALSA_LIB) mkdir $(ALSA_LIB)
    115    @if not exist $(ALSA_BIN_) mkdir $(ALSA_BIN_) 
     115   @if not exist $(ALSA_BIN_) mkdir $(ALSA_BIN_)
    116116   @if not exist $(ALSA_BIN) mkdir $(ALSA_BIN)
    117117
  • GPL/trunk/lib32/sound.c

    r484 r493  
    12081208    struct snd_pcm_status    status;
    12091209    int                 ret;
    1210     ULONG               delta;
    12111210
    12121211    if(pHandle == NULL || pHandle->magic != MAGIC_WAVE_ALSA32) {
     
    12731272    struct snd_pcm_status    status;
    12741273    int                 ret;
    1275     ULONG               delta;
    12761274
    12771275    if(pHandle == NULL || pHandle->magic != MAGIC_WAVE_ALSA32) {
     
    12981296    return OSSERR_SUCCESS;
    12991297}
    1300 
     1298//******************************************************************************
     1299//******************************************************************************
     1300OSSRET OSS32_WaveGetStatus(ULONG streamid, ULONG *pStatus)
     1301{
     1302    soundhandle        *pHandle = (soundhandle *)streamid;
     1303    struct snd_pcm_status    status;
     1304    int                 ret;
     1305
     1306    if(pHandle == NULL || pHandle->magic != MAGIC_WAVE_ALSA32) {
     1307        DebugInt3();
     1308        return OSSERR_INVALID_STREAMID;
     1309    }
     1310    if(pStatus == NULL) {
     1311        DebugInt3();
     1312        return OSSERR_INVALID_PARAMETER;
     1313    }
     1314
     1315    //set operation to non-blocking
     1316    pHandle->file.f_flags = O_NONBLOCK;
     1317
     1318    //Get the status of the stream
     1319    ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_STATUS, (ULONG)__Stack32ToFlat(&status));
     1320
     1321    if(ret) {
     1322        DebugInt3();
     1323        return UNIXToOSSError(ret);
     1324    }
     1325
     1326    *pStatus = status.state;
     1327    return OSSERR_SUCCESS;
     1328}
    13011329//******************************************************************************
    13021330//******************************************************************************
  • GPL/trunk/uniaud.inc

    r485 r493  
    77# BUILDVERSION must be 3 parts, and only numbers like 5.44.108
    88# It is best that 2'nd number is always 2 digits, eg at least 10
    9 BUILDVERSION = 1.9.22
     9BUILDVERSION = 1.9.23
    1010
    1111# Fixpack version
     
    1313# ex RC3  GA  FIXPACK2 beta_47
    1414# Comment out to avoid a fixpack line in bldlevel
    15 FIXPACK = SVN r485
     15FIXPACK = SVN r492
    1616
    1717# ALSA BUILD VERSION
Note: See TracChangeset for help on using the changeset viewer.