[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libcdio-devel] [PATCH] Remove unnecessary high-memory safe wrapper
From: |
Rocky Bernstein |
Subject: |
Re: [Libcdio-devel] [PATCH] Remove unnecessary high-memory safe wrapper for DosDevIOCtl() on OS/2 |
Date: |
Sun, 27 Nov 2016 14:35:52 -0500 |
At the risk of going down a rabbit hole of OS2 stuff which I doubt many
people use, (you are the only one I am aware of that has *ever* used
libcdio), I wonder about this. Is there harm in having the wrapper there?
The last OS2 release was in 2000 with and end release date of 2006, a
decade ago.
Removing the code above would force people to use
<https://trac.netlabs.org/libc>kLIBC v0.6.6 <https://trac.netlabs.org/libc>,
which I guess is an add-on.
I'd be grateful if you'd explain the harm of keeping the old code.
On Fri, Nov 25, 2016 at 8:37 AM, KO Myung-Hun <address@hidden> wrote:
> Since OS/2 kLIBC v0.6.6, DosDevIOCtl() is high-memory safe. So the
> wrapper is not needed any more.
> ---
> lib/driver/os2.c | 75 ------------------------------
> --------------------------
> 1 file changed, 75 deletions(-)
>
> diff --git a/lib/driver/os2.c b/lib/driver/os2.c
> index 23df59c..758c6c7 100644
> --- a/lib/driver/os2.c
> +++ b/lib/driver/os2.c
> @@ -90,81 +90,6 @@ run_mmc_cmd_os2( void *p_user_data, unsigned int
> i_timeout_ms,
> unsigned int i_buf, /*in/out*/ void *p_buf );
>
> /*!
> - High memory safe wrapper for DosDevIOCtl()
> -*/
> -static APIRET
> -SafeDosDevIOCtl( HFILE hdevice, ULONG category, ULONG function,
> - PVOID pParams, ULONG cbParamLenMax, PULONG pcbParamLen,
> - PVOID pData, ULONG cbDataLenMax, PULONG pcbDataLen )
> -{
> - PVOID pParamsLow = NULL;
> - PVOID pDataLow = NULL;
> - PULONG pcbParamLenLow = NULL;
> - PULONG pcbDataLenLow = NULL;
> - ULONG cbParamLenLow;
> - ULONG cbDataLenLow;
> -
> - APIRET rc = 0;
> -
> - if( pParams )
> - rc = DosAllocMem( &pParamsLow, cbParamLenMax, fALLOC );
> -
> - if( rc )
> - goto exit_free;
> -
> - if( pData )
> - rc = DosAllocMem( &pDataLow, cbDataLenMax, fALLOC );
> -
> - if( rc )
> - goto exit_free;
> -
> - if( pParams )
> - memcpy( pParamsLow, pParams, cbParamLenMax );
> -
> - if( pData )
> - memcpy( pDataLow, pData, cbDataLenMax );
> -
> - if( pcbParamLen )
> - {
> - pcbParamLenLow = &cbParamLenLow;
> - *pcbParamLenLow = *pcbParamLen;
> - }
> -
> - if( pcbDataLen )
> - {
> - pcbDataLenLow = &cbDataLenLow;
> - *pcbDataLenLow = *pcbDataLen;
> - }
> -
> - rc = DosDevIOCtl( hdevice, category, function,
> - pParamsLow, cbParamLenMax, pcbParamLenLow,
> - pDataLow, cbDataLenMax, pcbDataLenLow );
> -
> - if( !rc )
> - {
> - if( pParams )
> - memcpy( pParams, pParamsLow, cbParamLenMax );
> -
> - if( pData )
> - memcpy( pData, pDataLow, cbDataLenMax );
> -
> - if( pcbParamLen )
> - *pcbParamLen = *pcbParamLenLow;
> -
> - if( pcbDataLen )
> - *pcbDataLen = *pcbDataLenLow;
> - }
> -
> -exit_free:
> - DosFreeMem( pParamsLow);
> - DosFreeMem( pDataLow);
> -
> - return rc;
> -}
> -
> -#define DosDevIOCtl SafeDosDevIOCtl
> -
> -/*!
> Set the volume of an audio CD.
>
> @param p_cdio the CD object to be acted upon.
> --
> 2.9.2
>
>
>