Cleanup: remove trailing whitespaces at EOL
[urcu.git] / urcu / arch / s390.h
1 #ifndef _URCU_ARCH_S390_H
2 #define _URCU_ARCH_S390_H
3
4 /*
5 * Trivial definitions for the S390 architecture based on information from the
6 * Principles of Operation "CPU Serialization" (5-91), "BRANCH ON CONDITION"
7 * (7-25) and "STORE CLOCK" (7-169).
8 *
9 * Copyright (c) 2009 Novell, Inc.
10 * Author: Jan Blunck <jblunck@suse.de>
11 *
12 * Permission is hereby granted, free of charge, to any person obtaining a copy
13 * of this software and associated documentation files (the "Software"), to
14 * deal in the Software without restriction, including without limitation the
15 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
16 * sell copies of the Software, and to permit persons to whom the Software is
17 * furnished to do so, subject to the following conditions:
18 *
19 * The above copyright notice and this permission notice shall be included in
20 * all copies or substantial portions of the Software.
21 *
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
28 * IN THE SOFTWARE.
29 */
30
31 #include <urcu/compiler.h>
32 #include <urcu/config.h>
33 #include <urcu/syscall-compat.h>
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 #define CAA_CACHE_LINE_SIZE 128
40
41 #define cmm_mb() __asm__ __volatile__("bcr 15,0" : : : "memory")
42
43 #define HAS_CAA_GET_CYCLES
44
45 typedef unsigned long long cycles_t;
46
47 static inline cycles_t caa_get_cycles (void)
48 {
49 cycles_t cycles;
50
51 __asm__ __volatile__("stck %0" : "=m" (cycles) : : "cc", "memory" );
52
53 return cycles;
54 }
55
56 /*
57 * Define the membarrier system call number if not yet available in the
58 * system headers.
59 */
60 #ifndef __NR_membarrier
61 #define __NR_membarrier 356
62 #endif
63
64 #ifdef __cplusplus
65 }
66 #endif
67
68 #include <urcu/arch/generic.h>
69
70 #endif /* _URCU_ARCH_S390_H */
This page took 0.048727 seconds and 4 git commands to generate.