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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [pr39804.c] - Blame information for rev 318

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 318 jeremybenn
/* { dg-do compile } */
2
/* { dg-require-effective-target ilp32 } */
3
/* { dg-options "-O" } */
4
 
5
typedef unsigned char u8;
6
struct __large_struct { unsigned long buf[100]; };
7
static inline __attribute__((always_inline)) unsigned long
8
__copy_from_user_inatomic(void *to, const void *from, unsigned long n)
9
{
10
  unsigned long ret = 0;
11
  asm volatile("1:      mov""b"" %2,%""b""1\n" "2:\n"
12
               ".section .fixup,\"ax\"\n"
13
               "3:      mov %3,%0\n"
14
               "        xor""b"" %""b""1,%""b""1\n"
15
               "        jmp 2b\n"
16
               ".previous\n"
17
               " .section __ex_table,\"a\"\n"
18
               " " ".balign 4" " " "\n"
19
               " " ".long" " " "1b" "," "3b" "\n"
20
               " .previous\n"
21
               : "=r" (ret), "=q"(*(u8 *)to)
22
               : "m" ((*(struct __large_struct *)(from))), "i" (1), "0" (ret));
23
  return ret;
24
}
25
void romchecksum(const unsigned char *rom, unsigned char c)
26
{
27
  unsigned char sum;
28
  for (sum = 0;
29
       !__copy_from_user_inatomic(&(c), ( typeof(c) *)(rom++), sizeof(c));)
30
    sum += c;
31
}

powered by: WebSVN 2.1.0

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