projects
/
lttv.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
update split script
[lttv.git]
/
ltt-usertrace
/
ltt
/
kernelutils-i386.h
diff --git
a/ltt-usertrace/ltt/kernelutils-i386.h
b/ltt-usertrace/ltt/kernelutils-i386.h
index df7e695d21c9919fe3ca69976da4762fd47178db..6c13f12d06b9afee19812d282d2b99d6c2058ea4 100644
(file)
--- a/
ltt-usertrace/ltt/kernelutils-i386.h
+++ b/
ltt-usertrace/ltt/kernelutils-i386.h
@@
-13,13
+13,15
@@
#ifndef _KERNELUTILS_I386_H
#define _KERNELUTILS_I386_H
#ifndef _KERNELUTILS_I386_H
#define _KERNELUTILS_I386_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
// We are careful, so we assume a possibly SMP machine
#define LOCK "lock ; "
#define LOCK_PREFIX "lock ; "
// We are careful, so we assume a possibly SMP machine
#define LOCK "lock ; "
#define LOCK_PREFIX "lock ; "
-
-
// From atomic.h
// From atomic.h
@@
-106,26
+108,26
@@
struct __xchg_dummy { unsigned long a[100]; };
(unsigned long)(n),sizeof(*(ptr))))
static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
(unsigned long)(n),sizeof(*(ptr))))
static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
- unsigned long new, int size)
+ unsigned long new
val
, int size)
{
unsigned long prev;
switch (size) {
case 1:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
: "=a"(prev)
{
unsigned long prev;
switch (size) {
case 1:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)), "0"(old)
+ : "q"(new
val
), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 2:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
: "=a"(prev)
: "memory");
return prev;
case 2:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
: "=a"(prev)
- : "r"(new), "m"(*__xg(ptr)), "0"(old)
+ : "r"(new
val
), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 4:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
: "=a"(prev)
: "memory");
return prev;
case 4:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
: "=a"(prev)
- : "r"(new), "m"(*__xg(ptr)), "0"(old)
+ : "r"(new
val
), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
}
: "memory");
return prev;
}
@@
-150,5
+152,8
@@
static inline cycles_t get_cycles (void)
return ret;
}
return ret;
}
+#ifdef __cplusplus
+} /* end of extern "C" */
+#endif
#endif // _KERNELUTILS_I386_H
#endif // _KERNELUTILS_I386_H
This page took
0.023836 seconds
and
4
git commands to generate.