#ifndef _P30_TYPES_H_
#define _P30_TYPES_H_
-#ifdef __KERNEL__
-# include <linux/time.h>
+#ifdef __linux__
# include <asm/types.h>
-# include <asm/timex.h>
-#else /* !__KERNEL__ */
+# if defined(__powerpc__) && !defined(__KERNEL__)
+# define __KERNEL__
+# include <asm/timex.h>
+# undef __KERNEL__
+# else
+# include <asm/timex.h>
+# endif
+#else
# include <sys/types.h>
-# include <sys/time.h>
typedef u_int32_t __u32;
typedef u_int64_t __u64;
-# define do_gettimeofday(tv) gettimeofday(tv, NULL)
-# ifndef cycles_t
-typedef unsigned long cycles_t;
-# endif
-#endif /* !__KERNEL__ */
+#endif
+
+#ifdef __KERNEL__
+# include <linux/time.h>
+#else
+# include <sys/time.h>
+# define do_gettimeofday(tv) gettimeofday(tv, NULL);
+#endif
#include <portals/errno.h>
#ifndef _P30_TYPES_H_
#define _P30_TYPES_H_
-#ifdef __KERNEL__
-# include <linux/time.h>
+#ifdef __linux__
# include <asm/types.h>
-# include <asm/timex.h>
-#else /* !__KERNEL__ */
+# if defined(__powerpc__) && !defined(__KERNEL__)
+# define __KERNEL__
+# include <asm/timex.h>
+# undef __KERNEL__
+# else
+# include <asm/timex.h>
+# endif
+#else
# include <sys/types.h>
-# include <sys/time.h>
typedef u_int32_t __u32;
typedef u_int64_t __u64;
-# define do_gettimeofday(tv) gettimeofday(tv, NULL)
-# ifndef cycles_t
-typedef unsigned long cycles_t;
-# endif
-#endif /* !__KERNEL__ */
+#endif
+
+#ifdef __KERNEL__
+# include <linux/time.h>
+#else
+# include <sys/time.h>
+# define do_gettimeofday(tv) gettimeofday(tv, NULL);
+#endif
#include <portals/errno.h>