diff -Naur linux-2.6.12/arch/ia64/hp/sim/Makefile linux-2.6.12-XenPatch/arch/ia64/hp/sim/Makefile
--- linux-2.6.12/arch/ia64/hp/sim/Makefile	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/arch/ia64/hp/sim/Makefile	2005-07-05 13:27:34.000000000 -0600
@@ -14,3 +14,5 @@
 obj-$(CONFIG_HP_SIMSERIAL) += simserial.o
 obj-$(CONFIG_HP_SIMSERIAL_CONSOLE) += hpsim_console.o
 obj-$(CONFIG_HP_SIMSCSI) += simscsi.o
+obj-$(CONFIG_XEN) += simserial.o
+obj-$(CONFIG_XEN) += hpsim_console.o
diff -Naur linux-2.6.12/arch/ia64/ia32/ia32_support.c linux-2.6.12-XenPatch/arch/ia64/ia32/ia32_support.c
--- linux-2.6.12/arch/ia64/ia32/ia32_support.c	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/arch/ia64/ia32/ia32_support.c	2005-07-05 11:50:03.000000000 -0600
@@ -100,7 +100,7 @@
 void
 ia32_save_state (struct task_struct *t)
 {
-	t->thread.eflag = ia64_getreg(_IA64_REG_AR_EFLAG);
+	t->thread.eflag = ia64_get_eflag();
 	t->thread.fsr   = ia64_getreg(_IA64_REG_AR_FSR);
 	t->thread.fcr   = ia64_getreg(_IA64_REG_AR_FCR);
 	t->thread.fir   = ia64_getreg(_IA64_REG_AR_FIR);
@@ -122,7 +122,7 @@
 	fdr = t->thread.fdr;
 	tssd = load_desc(_TSS);					/* TSSD */
 
-	ia64_setreg(_IA64_REG_AR_EFLAG, eflag);
+	ia64_set_eflag(eflag);
 	ia64_setreg(_IA64_REG_AR_FSR, fsr);
 	ia64_setreg(_IA64_REG_AR_FCR, fcr);
 	ia64_setreg(_IA64_REG_AR_FIR, fir);
diff -Naur linux-2.6.12/arch/ia64/kernel/entry.S linux-2.6.12-XenPatch/arch/ia64/kernel/entry.S
--- linux-2.6.12/arch/ia64/kernel/entry.S	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/arch/ia64/kernel/entry.S	2005-07-05 13:25:27.000000000 -0600
@@ -181,7 +181,7 @@
  *	called.  The code starting at .map relies on this.  The rest of the code
  *	doesn't care about the interrupt masking status.
  */
-GLOBAL_ENTRY(ia64_switch_to)
+GLOBAL_ENTRY(__ia64_switch_to)
 	.prologue
 	alloc r16=ar.pfs,1,0,0,0
 	DO_SAVE_SWITCH_STACK
@@ -235,7 +235,7 @@
 	;;
 	itr.d dtr[r25]=r23		// wire in new mapping...
 	br.cond.sptk .done
-END(ia64_switch_to)
+END(__ia64_switch_to)
 
 /*
  * Note that interrupts are enabled during save_switch_stack and load_switch_stack.  This
@@ -376,7 +376,7 @@
  *	- b7 holds address to return to
  *	- must not touch r8-r11
  */
-ENTRY(load_switch_stack)
+GLOBAL_ENTRY(load_switch_stack)
 	.prologue
 	.altrp b7
 
@@ -586,7 +586,7 @@
 	nop.i 0
 	br.call.sptk.many rp=syscall_trace_leave // give parent a chance to catch return value
 }
-.ret4:	br.cond.sptk ia64_leave_kernel
+.ret4:	br.cond.sptk __ia64_leave_kernel
 END(ia64_strace_leave_kernel)
 
 GLOBAL_ENTRY(ia64_ret_from_clone)
@@ -785,7 +785,7 @@
 END(ia64_ret_from_ia32_execve)
 	// fall through
 #endif /* CONFIG_IA32_SUPPORT */
-GLOBAL_ENTRY(ia64_leave_kernel)
+GLOBAL_ENTRY(__ia64_leave_kernel)
 	PT_REGS_UNWIND_INFO(0)
 	/*
 	 * work.need_resched etc. mustn't get changed by this CPU before it returns to
@@ -1131,7 +1131,7 @@
 	ld8 r10=[r3]
 	br.cond.sptk.many .work_processed_syscall	// re-check
 
-END(ia64_leave_kernel)
+END(__ia64_leave_kernel)
 
 ENTRY(handle_syscall_error)
 	/*
@@ -1171,7 +1171,7 @@
 	 * be set up by the caller.  We declare 8 input registers so the system call
 	 * args get preserved, in case we need to restart a system call.
 	 */
-ENTRY(notify_resume_user)
+GLOBAL_ENTRY(notify_resume_user)
 	.prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(8)
 	alloc loc1=ar.pfs,8,2,3,0 // preserve all eight input regs in case of syscall restart!
 	mov r9=ar.unat
@@ -1259,7 +1259,7 @@
 	adds sp=16,sp
 	;;
 	ld8 r9=[sp]				// load new ar.unat
-	mov.sptk b7=r8,ia64_leave_kernel
+	mov.sptk b7=r8,__ia64_leave_kernel
 	;;
 	mov ar.unat=r9
 	br.many b7
diff -Naur linux-2.6.12/arch/ia64/kernel/head.S linux-2.6.12-XenPatch/arch/ia64/kernel/head.S
--- linux-2.6.12/arch/ia64/kernel/head.S	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/arch/ia64/kernel/head.S	2005-07-05 13:20:53.000000000 -0600
@@ -370,6 +370,9 @@
 
 	// This is executed by the bootstrap processor (bsp) only:
 
+#ifdef CONFIG_XEN
+	br.call.sptk.many rp=early_xen_setup
+#endif
 #ifdef CONFIG_IA64_FW_EMU
 	// initialize PAL & SAL emulator:
 	br.call.sptk.many rp=sys_fw_init
diff -Naur linux-2.6.12/arch/ia64/kernel/irq_ia64.c linux-2.6.12-XenPatch/arch/ia64/kernel/irq_ia64.c
--- linux-2.6.12/arch/ia64/kernel/irq_ia64.c	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/arch/ia64/kernel/irq_ia64.c	2005-07-05 11:42:38.000000000 -0600
@@ -151,11 +151,11 @@
 	 * to kernel stack overflows).
 	 */
 	irq_enter();
-	saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
+	saved_tpr = ia64_get_tpr();
 	ia64_srlz_d();
 	while (vector != IA64_SPURIOUS_INT_VECTOR) {
 		if (!IS_RESCHEDULE(vector)) {
-			ia64_setreg(_IA64_REG_CR_TPR, vector);
+			ia64_set_tpr(vector);
 			ia64_srlz_d();
 
 			__do_IRQ(local_vector_to_irq(vector), regs);
@@ -164,7 +164,7 @@
 			 * Disable interrupts and send EOI:
 			 */
 			local_irq_disable();
-			ia64_setreg(_IA64_REG_CR_TPR, saved_tpr);
+			ia64_set_tpr(saved_tpr);
 		}
 		ia64_eoi();
 		vector = ia64_get_ivr();
@@ -191,7 +191,7 @@
 	vector = ia64_get_ivr();
 
 	 irq_enter();
-	 saved_tpr = ia64_getreg(_IA64_REG_CR_TPR);
+	 saved_tpr = ia64_get_tpr();
 	 ia64_srlz_d();
 
 	 /*
@@ -199,7 +199,7 @@
 	  */
 	while (vector != IA64_SPURIOUS_INT_VECTOR) {
 		if (!IS_RESCHEDULE(vector)) {
-			ia64_setreg(_IA64_REG_CR_TPR, vector);
+			ia64_set_tpr(vector);
 			ia64_srlz_d();
 
 			/*
@@ -215,7 +215,7 @@
 			 * Disable interrupts and send EOI
 			 */
 			local_irq_disable();
-			ia64_setreg(_IA64_REG_CR_TPR, saved_tpr);
+			ia64_set_tpr(saved_tpr);
 		}
 		ia64_eoi();
 		vector = ia64_get_ivr();
diff -Naur linux-2.6.12/arch/ia64/kernel/pal.S linux-2.6.12-XenPatch/arch/ia64/kernel/pal.S
--- linux-2.6.12/arch/ia64/kernel/pal.S	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/arch/ia64/kernel/pal.S	2005-07-05 13:21:33.000000000 -0600
@@ -16,6 +16,7 @@
 #include <asm/processor.h>
 
 	.data
+	.globl pal_entry_point
 pal_entry_point:
 	data8 ia64_pal_default_handler
 	.text
diff -Naur linux-2.6.12/arch/ia64/kernel/setup.c linux-2.6.12-XenPatch/arch/ia64/kernel/setup.c
--- linux-2.6.12/arch/ia64/kernel/setup.c	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/arch/ia64/kernel/setup.c	2005-07-05 13:17:01.000000000 -0600
@@ -273,6 +273,9 @@
 static inline int __init
 early_console_setup (char *cmdline)
 {
+#ifdef CONFIG_XEN
+	early_xen_console_setup(cmdline);
+#endif
 #ifdef CONFIG_SERIAL_SGI_L1_CONSOLE
 	{
 		extern int sn_serial_console_early_setup(void);
diff -Naur linux-2.6.12/arch/ia64/Makefile linux-2.6.12-XenPatch/arch/ia64/Makefile
--- linux-2.6.12/arch/ia64/Makefile	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/arch/ia64/Makefile	2005-07-05 13:30:58.000000000 -0600
@@ -57,6 +57,7 @@
 core-$(CONFIG_IA64_HP_ZX1)	+= arch/ia64/dig/
 core-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/dig/
 core-$(CONFIG_IA64_SGI_SN2)	+= arch/ia64/sn/
+core-$(CONFIG_XEN)		+= arch/ia64/xen/ arch/ia64/hp/sim/
 
 drivers-$(CONFIG_PCI)		+= arch/ia64/pci/
 drivers-$(CONFIG_IA64_HP_SIM)	+= arch/ia64/hp/sim/
diff -Naur linux-2.6.12/include/asm-ia64/delay.h linux-2.6.12-XenPatch/include/asm-ia64/delay.h
--- linux-2.6.12/include/asm-ia64/delay.h	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/include/asm-ia64/delay.h	2005-07-05 10:56:19.000000000 -0600
@@ -20,59 +20,6 @@
 #include <asm/intrinsics.h>
 #include <asm/processor.h>
 
-static __inline__ void
-ia64_set_itm (unsigned long val)
-{
-	ia64_setreg(_IA64_REG_CR_ITM, val);
-	ia64_srlz_d();
-}
-
-static __inline__ unsigned long
-ia64_get_itm (void)
-{
-	unsigned long result;
-
-	result = ia64_getreg(_IA64_REG_CR_ITM);
-	ia64_srlz_d();
-	return result;
-}
-
-static __inline__ void
-ia64_set_itv (unsigned long val)
-{
-	ia64_setreg(_IA64_REG_CR_ITV, val);
-	ia64_srlz_d();
-}
-
-static __inline__ unsigned long
-ia64_get_itv (void)
-{
-	return ia64_getreg(_IA64_REG_CR_ITV);
-}
-
-static __inline__ void
-ia64_set_itc (unsigned long val)
-{
-	ia64_setreg(_IA64_REG_AR_ITC, val);
-	ia64_srlz_d();
-}
-
-static __inline__ unsigned long
-ia64_get_itc (void)
-{
-	unsigned long result;
-
-	result = ia64_getreg(_IA64_REG_AR_ITC);
-	ia64_barrier();
-#ifdef CONFIG_ITANIUM
-	while (unlikely((__s32) result == -1)) {
-		result = ia64_getreg(_IA64_REG_AR_ITC);
-		ia64_barrier();
-	}
-#endif
-	return result;
-}
-
 extern void ia64_delay_loop (unsigned long loops);
 
 static __inline__ void
diff -Naur linux-2.6.12/include/asm-ia64/privop.h linux-2.6.12-XenPatch/include/asm-ia64/privop.h
--- linux-2.6.12/include/asm-ia64/privop.h	1969-12-31 17:00:00.000000000 -0700
+++ linux-2.6.12-XenPatch/include/asm-ia64/privop.h	2005-07-05 13:23:31.000000000 -0600
@@ -0,0 +1,159 @@
+#ifndef _ASM_IA64_PRIVOP_H
+#define _ASM_IA64_PRIVOP_H
+
+/*
+ * Copyright (C) 2005 Hewlett-Packard Co
+ *	Dan Magenheimer <dan.magenheimer@hp.com>
+ * Reorganization from asm-ia64/processor.h
+ *
+ */
+
+#include <linux/config.h>
+
+#include <asm/intrinsics.h>
+
+#ifndef __ASSEMBLY__
+extern void ia64_getreg_unknown_kr (void);
+extern void ia64_setreg_unknown_kr (void);
+
+#define __ia64_get_kr(regnum)					\
+({								\
+	unsigned long r = 0;					\
+								\
+	switch (regnum) {					\
+	    case 0: r = ia64_getreg(_IA64_REG_AR_KR0); break;	\
+	    case 1: r = ia64_getreg(_IA64_REG_AR_KR1); break;	\
+	    case 2: r = ia64_getreg(_IA64_REG_AR_KR2); break;	\
+	    case 3: r = ia64_getreg(_IA64_REG_AR_KR3); break;	\
+	    case 4: r = ia64_getreg(_IA64_REG_AR_KR4); break;	\
+	    case 5: r = ia64_getreg(_IA64_REG_AR_KR5); break;	\
+	    case 6: r = ia64_getreg(_IA64_REG_AR_KR6); break;	\
+	    case 7: r = ia64_getreg(_IA64_REG_AR_KR7); break;	\
+	    default: ia64_getreg_unknown_kr(); break;		\
+	}							\
+	r;							\
+})
+
+#define __ia64_set_kr(regnum, r) 					\
+({								\
+	switch (regnum) {					\
+	    case 0: ia64_setreg(_IA64_REG_AR_KR0, r); break;	\
+	    case 1: ia64_setreg(_IA64_REG_AR_KR1, r); break;	\
+	    case 2: ia64_setreg(_IA64_REG_AR_KR2, r); break;	\
+	    case 3: ia64_setreg(_IA64_REG_AR_KR3, r); break;	\
+	    case 4: ia64_setreg(_IA64_REG_AR_KR4, r); break;	\
+	    case 5: ia64_setreg(_IA64_REG_AR_KR5, r); break;	\
+	    case 6: ia64_setreg(_IA64_REG_AR_KR6, r); break;	\
+	    case 7: ia64_setreg(_IA64_REG_AR_KR7, r); break;	\
+	    default: ia64_setreg_unknown_kr(); break;		\
+	}							\
+})
+
+static inline unsigned long
+__ia64_get_ivr (void)
+{
+	unsigned long r;
+	ia64_srlz_d();
+	r = ia64_getreg(_IA64_REG_CR_IVR);
+	ia64_srlz_d();
+	return r;
+}
+
+static inline void
+__ia64_eoi (void)
+{
+	ia64_setreg(_IA64_REG_CR_EOI, 0);
+	ia64_srlz_d();
+}
+
+#define __cpu_relax()	ia64_hint(ia64_hint_pause)
+
+#define __ia64_get_tpr(vector)	ia64_getreg(_IA64_REG_CR_TPR)
+#define __ia64_set_tpr(vector)	ia64_setreg(_IA64_REG_CR_TPR,vector)
+
+#define __ia64_get_eflag()	ia64_getreg(_IA64_REG_AR_EFLAG)
+#define __ia64_set_eflag(eflag)	ia64_setreg(_IA64_REG_AR_EFLAG,eflag)
+
+#define	__ia64_get_psr_i()	ia64_getreg(_IA64_REG_PSR)
+#define __ia64_rsm_i()		ia64_rsm(IA64_PSR_I)
+#define __ia64_ssm_i()		ia64_ssm(IA64_PSR_I)
+#define	__ia64_local_irq_restore(x)	ia64_intrin_local_irq_restore(x)
+
+static __inline__ void
+__ia64_set_itm (unsigned long val)
+{
+	ia64_setreg(_IA64_REG_CR_ITM, val);
+	ia64_srlz_d();
+}
+
+static __inline__ unsigned long
+ia64_get_itm (void)
+{
+	unsigned long result;
+
+	result = ia64_getreg(_IA64_REG_CR_ITM);
+	ia64_srlz_d();
+	return result;
+}
+
+static __inline__ void
+ia64_set_itv (unsigned long val)
+{
+	ia64_setreg(_IA64_REG_CR_ITV, val);
+	ia64_srlz_d();
+}
+
+static __inline__ unsigned long
+ia64_get_itv (void)
+{
+	return ia64_getreg(_IA64_REG_CR_ITV);
+}
+
+static __inline__ void
+ia64_set_itc (unsigned long val)
+{
+	ia64_setreg(_IA64_REG_AR_ITC, val);
+	ia64_srlz_d();
+}
+
+static __inline__ unsigned long
+ia64_get_itc (void)
+{
+	unsigned long result;
+
+	result = ia64_getreg(_IA64_REG_AR_ITC);
+	ia64_barrier();
+#ifdef CONFIG_ITANIUM
+	while (unlikely((__s32) result == -1)) {
+		result = ia64_getreg(_IA64_REG_AR_ITC);
+		ia64_barrier();
+	}
+#endif
+	return result;
+}
+#endif /* !__ASSEMBLY__ */
+
+#ifdef CONFIG_XEN
+#include <asm/xen/privop.h>
+#else
+#define ia64_get_kr(regnum)		__ia64_get_kr(regnum)
+#define ia64_set_kr(regnum, r)		__ia64_set_kr(regnum,r)
+#define ia64_get_ivr			__ia64_get_ivr
+#define ia64_eoi			__ia64_eoi
+#define ia64_set_itm(val)		__ia64_set_itm(val)
+#define cpu_relax			__cpu_relax
+#define ia64_get_tpr			__ia64_get_tpr
+#define ia64_set_tpr(vector)		__ia64_set_tpr(vector)
+#define ia64_get_eflag			__ia64_get_eflag
+#define ia64_set_eflag(eflag)		__ia64_set_eflag(eflag)
+#define ia64_pal_halt_light		__ia64_pal_halt_light
+#define	ia64_get_psr_i			__ia64_get_psr_i
+#define ia64_rsm_i			__ia64_rsm_i
+#define ia64_ssm_i			__ia64_ssm_i
+#define	ia64_local_irq_restore(x)	__ia64_local_irq_restore(x)
+#define	ia64_leave_kernel		__ia64_leave_kernel
+#define	ia64_switch_to			__ia64_switch_to
+#define	ia64_pal_call_static		__ia64_pal_call_static
+#endif
+
+#endif /* _ASM_IA64_PRIVOP_H */
diff -Naur linux-2.6.12/include/asm-ia64/processor.h linux-2.6.12-XenPatch/include/asm-ia64/processor.h
--- linux-2.6.12/include/asm-ia64/processor.h	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/include/asm-ia64/processor.h	2005-07-05 11:51:07.000000000 -0600
@@ -19,6 +19,7 @@
 #include <asm/kregs.h>
 #include <asm/ptrace.h>
 #include <asm/ustack.h>
+#include <asm/privop.h>
 
 /* Our arch specific arch_init_sched_domain is in arch/ia64/kernel/domain.c */
 #define ARCH_HAS_SCHED_DOMAIN
@@ -362,42 +363,6 @@
 /* Return stack pointer of blocked task TSK.  */
 #define KSTK_ESP(tsk)  ((tsk)->thread.ksp)
 
-extern void ia64_getreg_unknown_kr (void);
-extern void ia64_setreg_unknown_kr (void);
-
-#define ia64_get_kr(regnum)					\
-({								\
-	unsigned long r = 0;					\
-								\
-	switch (regnum) {					\
-	    case 0: r = ia64_getreg(_IA64_REG_AR_KR0); break;	\
-	    case 1: r = ia64_getreg(_IA64_REG_AR_KR1); break;	\
-	    case 2: r = ia64_getreg(_IA64_REG_AR_KR2); break;	\
-	    case 3: r = ia64_getreg(_IA64_REG_AR_KR3); break;	\
-	    case 4: r = ia64_getreg(_IA64_REG_AR_KR4); break;	\
-	    case 5: r = ia64_getreg(_IA64_REG_AR_KR5); break;	\
-	    case 6: r = ia64_getreg(_IA64_REG_AR_KR6); break;	\
-	    case 7: r = ia64_getreg(_IA64_REG_AR_KR7); break;	\
-	    default: ia64_getreg_unknown_kr(); break;		\
-	}							\
-	r;							\
-})
-
-#define ia64_set_kr(regnum, r) 					\
-({								\
-	switch (regnum) {					\
-	    case 0: ia64_setreg(_IA64_REG_AR_KR0, r); break;	\
-	    case 1: ia64_setreg(_IA64_REG_AR_KR1, r); break;	\
-	    case 2: ia64_setreg(_IA64_REG_AR_KR2, r); break;	\
-	    case 3: ia64_setreg(_IA64_REG_AR_KR3, r); break;	\
-	    case 4: ia64_setreg(_IA64_REG_AR_KR4, r); break;	\
-	    case 5: ia64_setreg(_IA64_REG_AR_KR5, r); break;	\
-	    case 6: ia64_setreg(_IA64_REG_AR_KR6, r); break;	\
-	    case 7: ia64_setreg(_IA64_REG_AR_KR7, r); break;	\
-	    default: ia64_setreg_unknown_kr(); break;		\
-	}							\
-})
-
 /*
  * The following three macros can't be inline functions because we don't have struct
  * task_struct at this point.
@@ -554,15 +519,6 @@
 }
 
 static inline void
-ia64_eoi (void)
-{
-	ia64_setreg(_IA64_REG_CR_EOI, 0);
-	ia64_srlz_d();
-}
-
-#define cpu_relax()	ia64_hint(ia64_hint_pause)
-
-static inline void
 ia64_set_lrr0 (unsigned long val)
 {
 	ia64_setreg(_IA64_REG_CR_LRR0, val);
@@ -623,16 +579,6 @@
 #define current_text_addr() \
 	({ void *_pc; _pc = (void *)ia64_getreg(_IA64_REG_IP); _pc; })
 
-static inline __u64
-ia64_get_ivr (void)
-{
-	__u64 r;
-	ia64_srlz_d();
-	r = ia64_getreg(_IA64_REG_CR_IVR);
-	ia64_srlz_d();
-	return r;
-}
-
 static inline void
 ia64_set_dbr (__u64 regnum, __u64 value)
 {
diff -Naur linux-2.6.12/include/asm-ia64/system.h linux-2.6.12-XenPatch/include/asm-ia64/system.h
--- linux-2.6.12/include/asm-ia64/system.h	2005-06-17 13:48:29.000000000 -0600
+++ linux-2.6.12-XenPatch/include/asm-ia64/system.h	2005-07-05 12:44:19.000000000 -0600
@@ -124,18 +124,18 @@
 #define __local_irq_save(x)			\
 do {						\
 	ia64_stop();				\
-	(x) = ia64_getreg(_IA64_REG_PSR);	\
+	(x) = ia64_get_psr_i();			\
 	ia64_stop();				\
-	ia64_rsm(IA64_PSR_I);			\
+	ia64_rsm_i();				\
 } while (0)
 
 #define __local_irq_disable()			\
 do {						\
 	ia64_stop();				\
-	ia64_rsm(IA64_PSR_I);			\
+	ia64_rsm_i();				\
 } while (0)
 
-#define __local_irq_restore(x)	ia64_intrin_local_irq_restore((x) & IA64_PSR_I)
+#define __local_irq_restore(x)	ia64_local_irq_restore((x) & IA64_PSR_I)
 
 #ifdef CONFIG_IA64_DEBUG_IRQ
 
@@ -171,8 +171,8 @@
 # define local_irq_restore(x)	__local_irq_restore(x)
 #endif /* !CONFIG_IA64_DEBUG_IRQ */
 
-#define local_irq_enable()	({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); })
-#define local_save_flags(flags)	({ ia64_stop(); (flags) = ia64_getreg(_IA64_REG_PSR); })
+#define local_irq_enable()	({ ia64_stop(); ia64_ssm_i(); ia64_srlz_d(); })
+#define local_save_flags(flags)	({ ia64_stop(); (flags) = ia64_get_psr_i(); })
 
 #define irqs_disabled()				\
 ({						\
