Cleanup: Re-organise source dir Re-organise the sources, add a top level "src" and "include" dir and move relevant files. Disable autotools automated includes and define them manually. This fixes problems with collision of header names with system headers. Include the autoconf config.h in the default includes and remove it where it's explicitely included. Remove _GNU_SOURCE defines since it's detected at configure for platforms that requires it and added to the config.h. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fix: use clock_get_time for caa_get_cycles fallback on MacOSX Use clock_get_time as fallback to read time for caa_get_cycles on MacOSX. It should not matter much in practice, since x86 uses the cycle counter. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Support for NIOS2 architecture Add support for the Altera NIOS2 CPU archirecture. The atomic operations are handled by the GCC. The memory barriers on this systems are entirely trivial too, since the CPU does not support SMP at all. Signed-off-by: Marek Vasut <marex@denx.de> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
sparc64: allocate membarrier system call number Now that the membarrier system call is allocated on sparc, allocate its number in our architecture header if the system headers don't allocate it. This allows using the membarrier system call as soon as implemented in the kernel, even if the distribution has old kernel headers. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
hppa: allocate membarrier system call number Now that the membarrier system call is allocated on hppa (parisc), allocate its number in our architecture header if the system headers don't allocate it. This allows using the membarrier system call as soon as implemented in the kernel, even if the distribution has old kernel headers. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
caa_get_cycles: caa_ prefix for type, use CLOCK_MONOTONIC clock_gettime() of CLOCK_MONOTONIC mimicks better the behavior of a cycle counter, since it is not affected by NTP major time updates. Also, now prefix "cycles_t" with a caa_ prefix, so it does not clash with application namespaces. Anyway, caa_get_cycles() is mostly used in testing. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cleanup: move generic caa_get_cycles to arch/generic.h Eliminate some code duplication. It also implements a "generic" caa_get_cycles() on architectures where its support is not implemented. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
tile: allocate membarrier system call number Now that the membarrier system call is allocated on tile, allocate its number in our architecture header if the system headers don't allocate it. This allows using the membarrier system call as soon as implemented in the kernel, even if the distribution has old kernel headers. Do so by creating headers specifically for tile, which rely on the gcc atomic and memory barrier builtins. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ia64: allocate membarrier system call number Now that the membarrier system call is allocated on ia64, allocate its number in our architecture header if the system headers don't allocate it. This allows using the membarrier system call as soon as implemented in the kernel, even if the distribution has old kernel headers. Do so by creating headers specifically for ia64, which rely on the gcc atomic and memory barrier builtins. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
aarch64: allocate membarrier system call number Now that the membarrier system call is allocated on aarch64, allocate its number in our architecture header if the system headers don't allocate it. This allows using the membarrier system call as soon as implemented in the kernel, even if the distribution has old kernel headers. Do so by creating headers specifically for aarch64, which rely on the gcc atomic and memory barrier builtins. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
arm: allocate membarrier system call number Now that the membarrier system call is allocated on ARM, allocate its number in our architecture header if the system headers don't allocate it. This allows using the membarrier system call as soon as implemented in the kernel, even if the distribution has old kernel headers. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
s390: allocate membarrier system call number Now that the membarrier system call is allocated on s390/s390x, allocate its number in our architecture header if the system headers don't allocate it. This allows using the membarrier system call as soon as implemented in the kernel, even if the distribution has old kernel headers. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ppc: allocate membarrier system call number Now that the membarrier system call is allocated on powerpc, allocate its number in our architecture header if the system headers don't allocate it. This allows using the membarrier system call as soon as implemented in the kernel, even if the distribution has old kernel headers. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
x86: allocate membarrier system call number Now that the membarrier system call is allocated on x86 32/64, allocate its number in our architecture header if the system headers don't allocate it. This allows using the membarrier system call as soon as implemented in the kernel, even if the distribution has old kernel headers. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mark braced-groups within expressions with __extension__ Braced-groups within expressions are not valid ISO C, so if a macro uses them and it's included in a project built with -pedantic, the build will fail. GCC and CLANG do support them as extension, so marking them as such allows the build to complete even with -pedantic. Signed-off-by: Luca Boccassi <lboccass@brocade.com> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Add support for hppa/PA-RISC architecture Add the missing architecture specific functions to provide support for the hppa/PA-RISC architecture: - the processor internal time stamp counter (Control Register CR16) is used to get high-performance/low-latency cycle counts - gcc provides the necessary built-in atomic functions on hppa (which in turn uses the light-weigth atomic locking syscall-interface of the Linux kernel) Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>