/*DDK*************************************************************************/
/*                                                                           */
/* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
/*                                                                           */
/*    The following IBM OS/2 WARP source code is provided to you solely for  */
/*    the purpose of assisting you in your development of OS/2 WARP device   */
/*    drivers. You may use this code in accordance with the IBM License      */
/*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
/*    Copyright statement may not be removed.                                */
/*                                                                           */
/*****************************************************************************/
/**************************************************************************
 *
 * SOURCE FILE NAME =  RMCALL.C
 *
 * DESCRIPTIVE NAME =
 *
 *
 *
 * VERSION = V0.5
 *
 * DATE
 *
 * DESCRIPTION :
 *
 * Purpose:
 *
 *
 *
 * FUNCTIONS  :
 *
 * NOTES
 *
 *
 * STRUCTURES
 *
 * EXTERNAL REFERENCES
 *
 *
 *
 * EXTERNAL FUNCTIONS
 *
*/

#define INCL_NOPMAPI
#include <os2.h>

#include "dhcalls.h"
#include "rmlib.h"
#include "rmdata.h"

/******************************************/
/*                                        */
/*                                        */
/*                                        */
/*                                        */
/*                                        */
/******************************************/

USHORT FAR CallRM( USHORT RMIndex, PVOID pCallerParms )
{
  USHORT rc = 0;

  if ( GetCS() & RM_CPL_RING3 )
  {
    rc = (*RM_Help3)( RMIndex, pCallerParms );
  }
  else
  {
    rc = (*RM_Help0)( RMIndex );
  }

  return( rc );
}

USHORT NEAR GetCS()
{
   USHORT    CSValue;

  _asm push  cs
  _asm pop   CSValue

  return( CSValue );
}

