/*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.                                */
/*                                                                           */
/*****************************************************************************/
/*static char *SCCSID = "src/dev/dasd/ibm/ibm1s506/s506csub.c, idsk, r207, 8.006 93/10/25";*/

/**************************************************************************
 *
 * SOURCE FILE NAME =  S506CSUB.C
 *
 * DESCRIPTIVE NAME =  IBM1S506.ADD - Adapter Driver for ST506/IDE DASD
 *
 *
 *
 * VERSION = V2.0
 *
 * DATE
 *
 * DESCRIPTION : Adapter Driver miscellaneous routines.
 *
 * Purpose:
 *
 *
 *
 *
 *
*/
 #define INCL_NOBASEAPI
 #define INCL_NOPMAPI
 #define INCL_NO_SCB
 #define INCL_INITRP_ONLY
 #define INCL_DOSERRORS
 #include "os2.h"
 #include "dos.h"
 #include "bseerr.h"
 #include "dskinit.h"
 #include <scb.h>
 #include <abios.h>

 #include "iorb.h"
 #include "reqpkt.h"
 #include "dhcalls.h"
 #include "addcalls.h"

 #include "s506cons.h"
 #include "s506type.h"
 #include "s506regs.h"
 #include "s506ext.h"
 #include "s506pro.h"


/*------------------------------------*/
/*                                    */
/*                                    */
/*                                    */
/*------------------------------------*/

VOID NEAR setmem( PBYTE d, USHORT c, USHORT len )
{
  USHORT   i;

  for ( i = 0; i < len ; i++ )  d[i] = (UCHAR) c;

  return;
}

/*------------------------------------*/
/*                                    */
/*                                    */
/*                                    */
/*------------------------------------*/

VOID NEAR memcpy( PBYTE d, PBYTE s, USHORT len )
{
  USHORT   i;
  USHORT   j;

  j = len >> 1;                                                      /*@V75140*/

  for ( i = 0; i < j ; i++ ) ((PUSHORT) d)[i] = ((PUSHORT) s)[i];

  if ( j & 1 ) d[len-1] = s[len-1];


  return;
}

