--- /dev/null
+#ifndef _ASM_IA64_UV_UV_H
+#define _ASM_IA64_UV_UV_H
+
+#include <asm/system.h>
+#include <asm/sn/simulator.h>
+
+static inline int is_uv_system(void)
+{
+       /* temporary support for running on hardware simulator */
+       return IS_MEDUSA() || ia64_platform_is("uv");
+}
+
+#endif /* _ASM_IA64_UV_UV_H */
 
 #ifndef __GRU_H__
 #define __GRU_H__
 
-#include <asm/uv/uv.h>
-
 /*
  * GRU architectural definitions
  */
 
 #include <linux/interrupt.h>
 #include <linux/proc_fs.h>
 #include <linux/uaccess.h>
+#include <asm/uv/uv.h>
 #include "gru.h"
 #include "grulib.h"
 #include "grutables.h"
 
-#if defined CONFIG_X86_64
-#include <asm/genapic.h>
-#include <asm/irq.h>
-#define IS_UV()                is_uv_system()
-#elif defined CONFIG_IA64
-#include <asm/system.h>
-#include <asm/sn/simulator.h>
-/* temp support for running on hardware simulator */
-#define IS_UV()                IS_MEDUSA() || ia64_platform_is("uv")
-#else
-#define IS_UV()                0
-#endif
-
 #include <asm/uv/uv_hub.h>
 #include <asm/uv/uv_mmrs.h>
 
        char id[10];
        void *gru_start_vaddr;
 
-       if (!IS_UV())
+       if (!is_uv_system())
                return 0;
 
 #if defined CONFIG_IA64
        int order = get_order(sizeof(struct gru_state) *
                              GRU_CHIPLETS_PER_BLADE);
 
-       if (!IS_UV())
+       if (!is_uv_system())
                return;
 
        for (i = 0; i < GRU_CHIPLETS_PER_BLADE; i++)
 
 
 #include <linux/mutex.h>
 
+#if defined CONFIG_X86_UV || defined CONFIG_IA64_SGI_UV
 #include <asm/uv/uv.h>
+#define is_uv()                is_uv_system()
+#endif
+
+#ifndef is_uv
+#define is_uv()                0
+#endif
 
-#ifdef CONFIG_IA64
+#if defined CONFIG_IA64
 #include <asm/system.h>
 #include <asm/sn/arch.h>       /* defines is_shub1() and is_shub2() */
 #define is_shub()      ia64_platform_is("sn2")
-#ifdef CONFIG_IA64_SGI_UV
-#define is_uv()                ia64_platform_is("uv")
-#else
-#define is_uv()                0
-#endif
-#endif
-#ifdef CONFIG_X86_64
-#include <asm/genapic.h>
-#define is_uv()                is_uv_system()
 #endif
 
 #ifndef is_shub1
 #define is_shub()      0
 #endif
 
-#ifndef is_uv
-#define is_uv()                0
-#endif
-
 #ifdef USE_DBUG_ON
 #define DBUG_ON(condition)     BUG_ON(condition)
 #else