2011-12-22 15:19:25 +00:00
|
|
|
/*
|
|
|
|
* \brief Atomic operations for ARM on codezero
|
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2009-10-02
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2012-01-03 14:35:05 +00:00
|
|
|
* Copyright (C) 2009-2012 Genode Labs GmbH
|
2011-12-22 15:19:25 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__ARM__CPU__ATOMIC_H_
|
|
|
|
#define _INCLUDE__ARM__CPU__ATOMIC_H_
|
|
|
|
|
|
|
|
namespace Genode {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Atomic compare and exchange
|
|
|
|
*
|
|
|
|
* This function compares the value at dest with cmp_val.
|
|
|
|
* If both values are equal, dest is set to new_val. If
|
|
|
|
* both values are different, the value at dest remains
|
|
|
|
* unchanged.
|
|
|
|
*
|
|
|
|
* \return 1 if the value was successfully changed to new_val,
|
|
|
|
* 0 if cmp_val and the value at dest differ.
|
|
|
|
*/
|
|
|
|
int cmpxchg(volatile int *dest, int cmp_val, int new_val);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _INCLUDE__ARM__CPU__ATOMIC_H_ */
|