#include <errno.h>
#include <syscall.h>
-#include <linux/unistd.h>
#include <string.h>
-#include <sys/types.h>
#include <stdint.h>
-#ifdef powerpc
-#define __KERNEL__ /* Ugly hack : atomic.h is broken */
-#endif
-#include <asm/atomic.h>
+#include <sys/types.h>
+#include <linux/unistd.h>
+#if defined(__powerpc__) || defined(__powerpc64__)
#include "ltt/ltt-usertrace-ppc.h"
-#ifdef powerpc
-#undef __KERNEL__ /* Ugly hack : atomic.h is broken */
+#else
+#include <asm/atomic.h>
#endif
#ifndef min