USER_O=userprog.o
USER_H=libthreads.h libatomic.h
-MODEL_CC=libthreads.cc schedule.cc libatomic.cc model.cc malloc.c threads.cc tree.cc
-MODEL_O=libthreads.o schedule.o libatomic.o model.o malloc.o threads.o tree.o
-MODEL_H=libthreads.h schedule.h common.h libatomic.h model.h threads.h tree.h
+MODEL_CC=libthreads.cc schedule.cc libatomic.cc model.cc malloc.c threads.cc tree.cc librace.cc
+MODEL_O=libthreads.o schedule.o libatomic.o model.o malloc.o threads.o tree.o librace.o
+MODEL_H=libthreads.h schedule.h common.h libatomic.h model.h threads.h tree.h librace.h
CPPFLAGS=-Wall -g
LDFLAGS=-ldl
--- /dev/null
+#include "librace.h"
+#include "common.h"
+
+void store_8(void *addr, uint8_t val)
+{
+ DEBUG("addr = %p, val = %u\n", addr, val);
+}
+
+void store_16(void *addr, uint16_t val)
+{
+ DEBUG("addr = %p, val = %u\n", addr, val);
+}
+
+void store_32(void *addr, uint32_t val)
+{
+ DEBUG("addr = %p, val = %u\n", addr, val);
+}
+
+void store_64(void *addr, uint64_t val)
+{
+ DEBUG("addr = %p, val = %llu\n", addr, val);
+}
+
+uint8_t load_8(void *addr)
+{
+ DEBUG("addr = %p\n", addr);
+ return 0;
+}
+
+uint16_t load_16(void *addr)
+{
+ DEBUG("addr = %p\n", addr);
+ return 0;
+}
+
+uint32_t load_32(void *addr)
+{
+ DEBUG("addr = %p\n", addr);
+ return 0;
+}
+
+uint64_t load_64(void *addr)
+{
+ DEBUG("addr = %p\n", addr);
+ return 0;
+}
--- /dev/null
+#ifndef __LIBRACE_H__
+#define __LIBRACE_H__
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ void store_8(void *addr, uint8_t val);
+ void store_16(void *addr, uint16_t val);
+ void store_32(void *addr, uint32_t val);
+ void store_64(void *addr, uint64_t val);
+
+ uint8_t load_8(void *addr);
+ uint16_t load_16(void *addr);
+ uint32_t load_32(void *addr);
+ uint64_t load_64(void *addr);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __LIBRACE_H__ */