OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [tests/] [sptests/] [sp13/] [fillbuff.c] - Blame information for rev 509

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  Fill_buffer
2
 *
3
 *  This test routine copies a given source string to a given destination
4
 *  buffer.
5
 *
6
 *  Input parameters:
7
 *    source - pointer to string to be copied
8
 *    buffer - pointer to message buffer to be filled
9
 *
10
 *  Output parameters:  NONE
11
 *
12
 *  COPYRIGHT (c) 1989-1999.
13
 *  On-Line Applications Research Corporation (OAR).
14
 *
15
 *  The license and distribution terms for this file may be
16
 *  found in the file LICENSE in this distribution or at
17
 *  http://www.OARcorp.com/rtems/license.html.
18
 *
19
 *  $Id: fillbuff.c,v 1.2 2001-09-27 12:02:32 chris Exp $
20
 */
21
 
22
#include "system.h"
23
 
24
#define MESSAGE_SIZE (sizeof(long) * 4)
25
 
26
void Fill_buffer(
27
  char *source,
28
  long *buffer
29
)
30
{
31
  char *p;
32
  int i;
33
/*
34
  memcpy( buffer, source, 16 );
35
*/
36
  p = source;
37
  for ( i=0 ; i<MESSAGE_SIZE ; i++ ) {
38
    buffer[i] = *p++;
39
    buffer[i] <<= 8;
40
    buffer[i] |= *p++;
41
    buffer[i] <<= 8;
42
    buffer[i] |= *p++;
43
    buffer[i] <<= 8;
44
    buffer[i] |= *p++;
45
  }
46
}

powered by: WebSVN 2.1.0

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