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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [builtins/] [memops-asm-lib.c] - Blame information for rev 825

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

Line No. Rev Author Line
1 149 jeremybenn
extern void abort (void);
2
extern int inside_main;
3
typedef __SIZE_TYPE__ size_t;
4
 
5
#define TEST_ABORT if (inside_main) abort()
6
 
7
void *
8
my_memcpy (void *d, const void *s, size_t n)
9
{
10
  char *dst = (char *) d;
11
  const char *src = (const char *) s;
12
  while (n--)
13
    *dst++ = *src++;
14
  return (char *) d;
15
}
16
 
17
void
18
my_bcopy (const void *s, void *d, size_t n)
19
{
20
  char *dst = (char *) d;
21
  const char *src = (const char *) s;
22
  if (src >= dst)
23
    while (n--)
24
      *dst++ = *src++;
25
  else
26
    {
27
      dst += n;
28
      src += n;
29
      while (n--)
30
        *--dst = *--src;
31
    }
32
}
33
 
34
void *
35
my_memset (void *d, int c, size_t n)
36
{
37
  char *dst = (char *) d;
38
  while (n--)
39
    *dst++ = c;
40
  return (char *) d;
41
}
42
 
43
void
44
my_bzero (void *d, size_t n)
45
{
46
  char *dst = (char *) d;
47
  while (n--)
48
    *dst++ = '\0';
49
}
50
 
51
void *
52
memcpy (void *d, const void *s, size_t n)
53
{
54
  TEST_ABORT;
55
  return my_memcpy (d, s, n);
56
}
57
 
58
void
59
bcopy (const void *s, void *d, size_t n)
60
{
61
  TEST_ABORT;
62
  my_bcopy (s, d, n);
63
}
64
 
65
void *
66
memset (void *d, int c, size_t n)
67
{
68
  TEST_ABORT;
69
  return my_memset (d, c, n);
70
}
71
 
72
void
73
bzero (void *d, size_t n)
74
{
75
  TEST_ABORT;
76
  my_bzero (d, n);
77
}

powered by: WebSVN 2.1.0

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