-
Notifications
You must be signed in to change notification settings - Fork 0
/
kcasfull.h
32 lines (25 loc) · 859 Bytes
/
kcasfull.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
#include <cassert>
#include <stdint.h>
#include <sstream>
#include <cstring>
#include <limits.h>
#define CASWORD_BITS_TYPE casword_t
#define casword_t uintptr_t
#define SHIFT_BITS 2
#define CASWORD_CAST(x) ((CASWORD_BITS_TYPE) (x))
#include "kcas_reuse_htm_impl.h"
namespace kcas {
extern KCASHTM<100000> instance;
void writeInitPtr(uintptr_t volatile * addr, uintptr_t const newval);
void writeInitVal(uintptr_t volatile * addr, uintptr_t const newval);
uintptr_t readPtr(uintptr_t volatile * addr);
uintptr_t readVal(uintptr_t volatile * addr);
bool execute();
kcasptr_t getDescriptor();
void start();
template<typename T>
void add(casword<T> * caswordptr, T oldVal, T newVal);
template<typename T, typename... Args>
void add(casword<T> * caswordptr, T oldVal, T newVal, Args... args);
};