diff -Naru linux-hooks-resolve/arch/ia64/Kconfig.debug linux-hooks-ia64/arch/ia64/Kconfig.debug
--- linux-hooks-resolve/arch/ia64/Kconfig.debug	2004-11-19 20:41:14.107119640 +0900
+++ linux-hooks-ia64/arch/ia64/Kconfig.debug	2004-11-19 20:41:21.822946656 +0900
@@ -70,4 +70,9 @@
 	 calls out of the kernel to a kernel module routine - a hook exit routine.
 	 Read Documentation/hook/HOWTO for more details.
 
+config ASM_HOOK
+	bool
+	default y
+	depends on DEBUG_KERNEL && HOOK
+	
 endmenu
diff -Naru linux-hooks-resolve/include/asm-ia64/hook_private.h linux-hooks-ia64/include/asm-ia64/hook_private.h
--- linux-hooks-resolve/include/asm-ia64/hook_private.h	1970-01-01 09:00:00.000000000 +0900
+++ linux-hooks-ia64/include/asm-ia64/hook_private.h	2004-11-19 20:41:21.822946656 +0900
@@ -0,0 +1,86 @@
+/************************************************************
+ *
+ * COPYRIGHT (C) HITACHI,LTD. 2002
+ * WRITTEN BY HITACHI SYSTEMS DEVELOPMENT LABORATORY,
+ *            HITACHI CENTRAL RESEARCH LABORATORY.
+ *
+ * Created by M.Hiramatsu <hiramatu@sdl.hitachi.co.jp>
+ *
+ ************************************************************/
+
+#ifndef __ASM_IA64_HOOK_PRIVATE_H
+#define __ASM_IA64_HOOK_PRIVATE_H
+
+//#include <asm/cacheflush.h>
+
+static inline void deactivate_asm_hook(struct hook * hook)
+{
+	unsigned char *addr = (unsigned char *) (hook->hook_addr);
+	addr[4] = 0;
+//	flush_icache_range((unsigned long)addr + 4, (unsigned long)addr + 4);
+	
+	return;
+}
+
+/*
+ *  we activate a hook by changing the bypass jump offset to 0 - this atomic
+ *  under MP
+ */
+static inline void activate_asm_hook(struct hook * hook)
+{
+	unsigned char *addr = (unsigned char *) (hook->hook_addr);	
+	addr[4] = 2;
+//	flush_icache_range((unsigned long)addr + 4, (unsigned long)addr + 4);
+	
+	return;
+}
+
+#define OPCODE_MAJOR_OP			0x24
+#define OPCODE_MAJOR_OP_MASK		0x3c
+#define OPCODE_TEMPLATE_0		0x00
+#define OPCODE_TEMPLATE_1		0x01
+#define OPCODE_TEMPLATE_2		0x02
+#define OPCODE_TEMPLATE_a		0x0a
+#define OPCODE_TEMPLATE_b		0x0b
+#define OPCODE_TEMPLATE_MASK		0x1f
+#define OPCODE_IMM			0x00
+#define OPCODE_IMM_MASK1		0xfc
+#define OPCODE_IMM_MASK2		0x01
+#define OPCODE_IMM_MASK3		0x7f
+
+#define AVAILABLE_TEMPLATE(template)			\
+		( (template == OPCODE_TEMPLATE_0) ||	\
+		  (template == OPCODE_TEMPLATE_1) ||	\
+		  (template == OPCODE_TEMPLATE_2) ||	\
+		  (template == OPCODE_TEMPLATE_a) ||	\
+		  (template == OPCODE_TEMPLATE_b) )
+		
+static inline int is_asm_hook(unsigned char * addr)
+{
+	unsigned char template;
+	unsigned char major_op;
+	unsigned char imm1, imm2, imm3;
+
+	if(addr == NULL) {
+		return 0;
+	}
+
+	template = addr[0] & OPCODE_TEMPLATE_MASK;
+	major_op = addr[5] & OPCODE_MAJOR_OP_MASK;
+	imm1     = addr[2] & OPCODE_IMM_MASK1;
+	imm2     = addr[3] & OPCODE_IMM_MASK2;
+	imm3     = addr[4] & OPCODE_IMM_MASK3;
+
+	if(AVAILABLE_TEMPLATE(template)) {
+		if(major_op == OPCODE_MAJOR_OP) {
+			if((imm1 == OPCODE_IMM) && (imm2 == OPCODE_IMM) &&
+						   (imm3 == OPCODE_IMM)) {
+				return 1;
+			}
+		}
+	}
+
+	return 0;
+}
+
+#endif /* __ASM_IA64_HOOK_PRIVATE_H */
diff -Naru linux-hooks-resolve/include/asm-ia64/hook.h linux-hooks-ia64/include/asm-ia64/hook.h
--- linux-hooks-resolve/include/asm-ia64/hook.h	1970-01-01 09:00:00.000000000 +0900
+++ linux-hooks-ia64/include/asm-ia64/hook.h	2004-11-19 20:41:21.822946656 +0900
@@ -0,0 +1,24 @@
+/************************************************************
+ *
+ * COPYRIGHT (C) HITACHI,LTD. 2002
+ * WRITTEN BY HITACHI SYSTEMS DEVELOPMENT LABORATORY,
+ *            HITACHI CENTRAL RESEARCH LABORATORY.
+ *
+ * Created by M.Hiramatsu <hiramatu@sdl.hitachi.co.jp>
+ *
+ ************************************************************/
+
+#ifndef __ASM_IA64_HOOK_H
+#define __ASM_IA64_HOOK_H
+
+#if defined(CONFIG_HOOK) || defined(CONFIG_HOOK_MODULE)
+
+#define IF_HOOK_ENABLED(h, hk) _IF_HOOK_ENABLED(h, #hk)
+#define _IF_HOOK_ENABLED(h, hk) \
+	register int tmp; \
+	__asm__ __volatile__ (".global "hk"; "hk":addl %0=0,r0":"=r"(tmp)); \
+	if (unlikely(tmp))
+
+#endif /* CONFIG_HOOK || CONFIG_HOOK_MODULE */
+
+#endif /* __ASM_IA64_HOOK_H */
