OLD | NEW |
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ | 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 /* | 6 /* |
7 * This file is used by not only Linux but also other glibc systems | 7 * This file is used by not only Linux but also other glibc systems |
8 * such as GNU/Hurd and GNU/k*BSD. | 8 * such as GNU/Hurd and GNU/k*BSD. |
9 */ | 9 */ |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 /* | 74 /* |
75 * Elf linux supports dl* functions | 75 * Elf linux supports dl* functions |
76 */ | 76 */ |
77 #define HAVE_DLL | 77 #define HAVE_DLL |
78 #define USE_DLFCN | 78 #define USE_DLFCN |
79 #if defined(ANDROID) | 79 #if defined(ANDROID) |
80 #define NO_DLOPEN_NULL | 80 #define NO_DLOPEN_NULL |
81 #endif | 81 #endif |
82 | 82 |
83 #ifdef __FreeBSD_kernel__ | 83 #if defined(__FreeBSD_kernel__) || defined(__GNU__) |
84 #define _PR_HAVE_SOCKADDR_LEN | 84 #define _PR_HAVE_SOCKADDR_LEN |
85 #endif | 85 #endif |
86 | 86 |
87 #if defined(__i386__) | 87 #if defined(__i386__) |
88 #define _PR_HAVE_ATOMIC_OPS | 88 #define _PR_HAVE_ATOMIC_OPS |
89 #define _MD_INIT_ATOMIC() | 89 #define _MD_INIT_ATOMIC() |
90 extern PRInt32 _PR_x86_AtomicIncrement(PRInt32 *val); | 90 extern PRInt32 _PR_x86_AtomicIncrement(PRInt32 *val); |
91 #define _MD_ATOMIC_INCREMENT _PR_x86_AtomicIncrement | 91 #define _MD_ATOMIC_INCREMENT _PR_x86_AtomicIncrement |
92 extern PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val); | 92 extern PRInt32 _PR_x86_AtomicDecrement(PRInt32 *val); |
93 #define _MD_ATOMIC_DECREMENT _PR_x86_AtomicDecrement | 93 #define _MD_ATOMIC_DECREMENT _PR_x86_AtomicDecrement |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 extern PRInt32 _PR_ppc_AtomicIncrement(PRInt32 *val); | 129 extern PRInt32 _PR_ppc_AtomicIncrement(PRInt32 *val); |
130 #define _MD_ATOMIC_INCREMENT _PR_ppc_AtomicIncrement | 130 #define _MD_ATOMIC_INCREMENT _PR_ppc_AtomicIncrement |
131 extern PRInt32 _PR_ppc_AtomicDecrement(PRInt32 *val); | 131 extern PRInt32 _PR_ppc_AtomicDecrement(PRInt32 *val); |
132 #define _MD_ATOMIC_DECREMENT _PR_ppc_AtomicDecrement | 132 #define _MD_ATOMIC_DECREMENT _PR_ppc_AtomicDecrement |
133 extern PRInt32 _PR_ppc_AtomicAdd(PRInt32 *ptr, PRInt32 val); | 133 extern PRInt32 _PR_ppc_AtomicAdd(PRInt32 *ptr, PRInt32 val); |
134 #define _MD_ATOMIC_ADD _PR_ppc_AtomicAdd | 134 #define _MD_ATOMIC_ADD _PR_ppc_AtomicAdd |
135 extern PRInt32 _PR_ppc_AtomicSet(PRInt32 *val, PRInt32 newval); | 135 extern PRInt32 _PR_ppc_AtomicSet(PRInt32 *val, PRInt32 newval); |
136 #define _MD_ATOMIC_SET _PR_ppc_AtomicSet | 136 #define _MD_ATOMIC_SET _PR_ppc_AtomicSet |
137 #endif | 137 #endif |
138 | 138 |
| 139 #if defined(__powerpc64__) |
| 140 #if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) |
| 141 /* Use GCC built-in functions */ |
| 142 #define _PR_HAVE_ATOMIC_OPS |
| 143 #define _MD_INIT_ATOMIC() |
| 144 #define _MD_ATOMIC_INCREMENT(ptr) __sync_add_and_fetch(ptr, 1) |
| 145 #define _MD_ATOMIC_DECREMENT(ptr) __sync_sub_and_fetch(ptr, 1) |
| 146 #define _MD_ATOMIC_ADD(ptr, i) __sync_add_and_fetch(ptr, i) |
| 147 #define _MD_ATOMIC_SET(ptr, nv) __sync_lock_test_and_set(ptr, nv) |
| 148 #endif |
| 149 #endif |
| 150 |
139 #if defined(__alpha) | 151 #if defined(__alpha) |
140 #define _PR_HAVE_ATOMIC_OPS | 152 #define _PR_HAVE_ATOMIC_OPS |
141 #define _MD_INIT_ATOMIC() | 153 #define _MD_INIT_ATOMIC() |
142 #define _MD_ATOMIC_ADD(ptr, i) ({ \ | 154 #define _MD_ATOMIC_ADD(ptr, i) ({ \ |
143 PRInt32 __atomic_tmp, __atomic_ret; \ | 155 PRInt32 __atomic_tmp, __atomic_ret; \ |
144 __asm__ __volatile__( \ | 156 __asm__ __volatile__( \ |
145 "1: ldl_l %[ret], %[val] \n" \ | 157 "1: ldl_l %[ret], %[val] \n" \ |
146 " addl %[ret], %[inc], %[tmp] \n" \ | 158 " addl %[ret], %[inc], %[tmp] \n" \ |
147 " addl %[ret], %[inc], %[ret] \n" \ | 159 " addl %[ret], %[inc], %[ret] \n" \ |
148 " stl_c %[tmp], %[val] \n" \ | 160 " stl_c %[tmp], %[val] \n" \ |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 int timeout); | 661 int timeout); |
650 #define _MD_POLL __syscall_poll | 662 #define _MD_POLL __syscall_poll |
651 #endif | 663 #endif |
652 | 664 |
653 /* For writev() */ | 665 /* For writev() */ |
654 #include <sys/uio.h> | 666 #include <sys/uio.h> |
655 | 667 |
656 extern void _MD_linux_map_sendfile_error(int err); | 668 extern void _MD_linux_map_sendfile_error(int err); |
657 | 669 |
658 #endif /* nspr_linux_defs_h___ */ | 670 #endif /* nspr_linux_defs_h___ */ |
OLD | NEW |