Commit | Line | Data |
---|---|---|
d3d3857f MJ |
1 | // SPDX-FileCopyrightText: 2009 Novell, Inc. |
2 | // | |
3 | // SPDX-License-Identifier: MIT | |
4 | ||
2041a99a MD |
5 | #ifndef _URCU_ARCH_S390_H |
6 | #define _URCU_ARCH_S390_H | |
ac26f1a8 JB |
7 | |
8 | /* | |
7039fa6f JB |
9 | * Trivial definitions for the S390 architecture based on information from the |
10 | * Principles of Operation "CPU Serialization" (5-91), "BRANCH ON CONDITION" | |
11 | * (7-25) and "STORE CLOCK" (7-169). | |
ac26f1a8 | 12 | * |
ac26f1a8 | 13 | * Author: Jan Blunck <jblunck@suse.de> |
ac26f1a8 JB |
14 | */ |
15 | ||
14714b51 | 16 | #include <urcu/compiler.h> |
1655f018 | 17 | #include <urcu/config.h> |
999991c6 | 18 | #include <urcu/syscall-compat.h> |
3fa18286 | 19 | #include <stdint.h> |
ac26f1a8 | 20 | |
36bc70a8 MD |
21 | #ifdef __cplusplus |
22 | extern "C" { | |
67ecffc0 | 23 | #endif |
36bc70a8 | 24 | |
06f22bdb | 25 | #define CAA_CACHE_LINE_SIZE 128 |
5b3c6672 | 26 | |
5481ddb3 | 27 | #define cmm_mb() __asm__ __volatile__("bcr 15,0" : : : "memory") |
ac26f1a8 | 28 | |
f8c43f45 MD |
29 | #define HAS_CAA_GET_CYCLES |
30 | ||
3fa18286 | 31 | typedef uint64_t caa_cycles_t; |
ac26f1a8 | 32 | |
3fa18286 | 33 | static inline caa_cycles_t caa_get_cycles (void) |
ac26f1a8 | 34 | { |
3fa18286 | 35 | caa_cycles_t cycles; |
ac26f1a8 JB |
36 | |
37 | __asm__ __volatile__("stck %0" : "=m" (cycles) : : "cc", "memory" ); | |
38 | ||
39 | return cycles; | |
40 | } | |
41 | ||
33f0d0b1 | 42 | /* |
84f4ccb4 MD |
43 | * On Linux, define the membarrier system call number if not yet available in |
44 | * the system headers. | |
33f0d0b1 | 45 | */ |
84f4ccb4 | 46 | #if (defined(__linux__) && !defined(__NR_membarrier)) |
33f0d0b1 MD |
47 | #define __NR_membarrier 356 |
48 | #endif | |
49 | ||
67ecffc0 | 50 | #ifdef __cplusplus |
36bc70a8 MD |
51 | } |
52 | #endif | |
53 | ||
1b9119f8 | 54 | #include <urcu/arch/generic.h> |
e4d1eb09 | 55 | |
2041a99a | 56 | #endif /* _URCU_ARCH_S390_H */ |