![]() |
The ROme OpTimistic Simulator
2.0.0
A General-Purpose Multithreaded Parallel/Distributed Simulation Platform
|
x86 synchronization primitives More...
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <arch/atomic.h>
#include <mm/dymelor.h>
Go to the source code of this file.
Functions | |
bool | iCAS (volatile uint32_t *ptr, uint32_t oldVal, uint32_t newVal) |
int | atomic_test_and_set (int *b) |
void | atomic_inc (atomic_t *v) |
void | atomic_dec (atomic_t *v) |
int | atomic_inc_and_test (atomic_t *v) |
void | spin_lock (spinlock_t *s) |
bool | spin_trylock (spinlock_t *s) |
void | spin_unlock (spinlock_t *s) |
x86 synchronization primitives
This module implements atomic and non-blocking operations used within ROOT-Sim to coordinate threads and processes (on shared memory)
This file is part of ROOT-Sim (ROme OpTimistic Simulator).
ROOT-Sim is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; only version 3 of the License applies.
ROOT-Sim is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with ROOT-Sim; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Definition in file x86.c.
|
inline |
|
inline |
|
inline |
This function implements (on x86-64 architectures) the atomic dec operation. It decrements the atomic counter 'v' by 1 unit
v | the atomic counter which is the destination of the operation |
Definition at line 118 of file x86.c.
|
inline |
|
inline |
This function implements a compare-and-swap atomic operation on x86-64 for integers
ptr | the address where to perform the CAS operation on |
oldVal | the old value we expect to find before swapping |
newVal | the new value to place in ptr if ptr contains oldVal |
Definition at line 49 of file x86.c.
|
inline |
|
inline |
|
inline |