1 /* { dg-do compile } */
2 /* { dg-skip-if "incompatible options" { arm*-*-* } { "-march=*" } { "-march=armv7-a" } } */
3 /* { dg-options "-O2 -fno-omit-frame-pointer -marm -march=armv7-a -mfpu=vfp3" } */
12 /* This is here to ensure that the offset of perf_event_id below
13 relative to the LANCHOR symbol exceeds the allowed displacement. */
14 static int __warned
[300];
18 extern void *kmem_cache_alloc_trace (void *cachep
);
19 extern void *cs_cachep
;
20 extern int nr_cpu_ids
;
25 static unsigned long long __attribute__((aligned(8))) perf_event_id
;
27 unsigned long long result
;
30 if (cpu
>= nr_cpu_ids
)
33 event
= kmem_cache_alloc_trace (cs_cachep
);
35 __asm__
__volatile__ ("dmb" : : : "memory");
37 __asm__
__volatile__("@ atomic64_add_return\n"
38 "1: ldrexd %0, %H0, [%3]\n"
40 " adc %H0, %H0, %H4\n"
41 " strexd %1, %0, %H0, [%3]\n"
44 : "=&r" (result
), "=&r" (tmp
), "+Qo" (perf_event_id
)
45 : "r" (&perf_event_id
), "r" (1LL)
48 __asm__
__volatile__ ("dmb" : : : "memory");
55 for (cpu
= 0; cpu
< nr_cpu_ids
; cpu
++)
56 kmem_cache_alloc_trace (cs_cachep
);