OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [sptests/] [sp13/] [fillbuff.c] - Diff between revs 30 and 173

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 30 Rev 173
/*  Fill_buffer
/*  Fill_buffer
 *
 *
 *  This test routine copies a given source string to a given destination
 *  This test routine copies a given source string to a given destination
 *  buffer.
 *  buffer.
 *
 *
 *  Input parameters:
 *  Input parameters:
 *    source - pointer to string to be copied
 *    source - pointer to string to be copied
 *    buffer - pointer to message buffer to be filled
 *    buffer - pointer to message buffer to be filled
 *
 *
 *  Output parameters:  NONE
 *  Output parameters:  NONE
 *
 *
 *  COPYRIGHT (c) 1989-1999.
 *  COPYRIGHT (c) 1989-1999.
 *  On-Line Applications Research Corporation (OAR).
 *  On-Line Applications Research Corporation (OAR).
 *
 *
 *  The license and distribution terms for this file may be
 *  The license and distribution terms for this file may be
 *  found in the file LICENSE in this distribution or at
 *  found in the file LICENSE in this distribution or at
 *  http://www.OARcorp.com/rtems/license.html.
 *  http://www.OARcorp.com/rtems/license.html.
 *
 *
 *  $Id: fillbuff.c,v 1.2 2001-09-27 12:02:32 chris Exp $
 *  $Id: fillbuff.c,v 1.2 2001-09-27 12:02:32 chris Exp $
 */
 */
 
 
#include "system.h"
#include "system.h"
 
 
#define MESSAGE_SIZE (sizeof(long) * 4)
#define MESSAGE_SIZE (sizeof(long) * 4)
 
 
void Fill_buffer(
void Fill_buffer(
  char *source,
  char *source,
  long *buffer
  long *buffer
)
)
{
{
  char *p;
  char *p;
  int i;
  int i;
/*
/*
  memcpy( buffer, source, 16 );
  memcpy( buffer, source, 16 );
*/
*/
  p = source;
  p = source;
  for ( i=0 ; i<MESSAGE_SIZE ; i++ ) {
  for ( i=0 ; i<MESSAGE_SIZE ; i++ ) {
    buffer[i] = *p++;
    buffer[i] = *p++;
    buffer[i] <<= 8;
    buffer[i] <<= 8;
    buffer[i] |= *p++;
    buffer[i] |= *p++;
    buffer[i] <<= 8;
    buffer[i] <<= 8;
    buffer[i] |= *p++;
    buffer[i] |= *p++;
    buffer[i] <<= 8;
    buffer[i] <<= 8;
    buffer[i] |= *p++;
    buffer[i] |= *p++;
  }
  }
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.