Commit | Line | Data |
---|---|---|
d3d3857f MJ |
1 | // SPDX-FileCopyrightText: 2014 Helge Deller <deller@gmx.de> |
2 | // | |
3 | // SPDX-License-Identifier: LGPL-2.1-or-later | |
4 | ||
13e0bc72 HD |
5 | #ifndef _URCU_ARCH_HPPA_H |
6 | #define _URCU_ARCH_HPPA_H | |
7 | ||
f8c43f45 MD |
8 | /* |
9 | * arch/hppa.h: definitions for hppa architecture | |
f8c43f45 MD |
10 | */ |
11 | ||
13e0bc72 HD |
12 | #include <urcu/compiler.h> |
13 | #include <urcu/config.h> | |
999991c6 | 14 | #include <urcu/syscall-compat.h> |
13e0bc72 HD |
15 | |
16 | #ifdef __cplusplus | |
17 | extern "C" { | |
18 | #endif | |
19 | ||
20 | #include <stdlib.h> | |
21 | #include <sys/time.h> | |
22 | ||
1a186a88 MD |
23 | /* |
24 | * On Linux, define the membarrier system call number if not yet available in | |
25 | * the system headers. | |
26 | */ | |
27 | #if (defined(__linux__) && !defined(__NR_membarrier)) | |
28 | #define __NR_membarrier 343 | |
29 | #endif | |
30 | ||
f8c43f45 | 31 | #define HAS_CAA_GET_CYCLES |
3fa18286 | 32 | typedef unsigned long caa_cycles_t; |
13e0bc72 | 33 | |
3fa18286 | 34 | static inline caa_cycles_t caa_get_cycles(void) |
13e0bc72 | 35 | { |
3fa18286 | 36 | caa_cycles_t cycles; |
13e0bc72 HD |
37 | |
38 | asm volatile("mfctl 16, %0" : "=r" (cycles)); | |
39 | return cycles; | |
40 | } | |
41 | ||
42 | #ifdef __cplusplus | |
43 | } | |
44 | #endif | |
45 | ||
46 | #include <urcu/arch/generic.h> | |
47 | ||
48 | #endif /* _URCU_ARCH_HPPA_H */ |