Index: generic/src/console/cmd.c
===================================================================
--- generic/src/console/cmd.c	(revision f49f16c955824b1944b9c6df94195e51b67db084)
+++ generic/src/console/cmd.c	(revision 6eb96fce19234c743567c0879eed45e27596e2b2)
@@ -478,4 +478,10 @@
 	char *symbol;
 	__native (*f)(void);
+#ifdef ia64
+	struct {
+		__native f;
+		__native gp;
+	}fptr;
+#endif
 
 	symaddr = get_symbol_addr(argv->buffer);
@@ -488,5 +494,11 @@
 		symbol = get_symtab_entry(symaddr);
 		printf("Calling f(): %.*p: %s\n", sizeof(__address) * 2, symaddr, symbol);
+#ifdef ia64
+		fptr.f = symaddr;
+		fptr.gp = ((__native *)cmd_call2)[1];
+		f =  (__native (*)(void)) &fptr;
+#else
 		f =  (__native (*)(void)) symaddr;
+#endif
 		printf("Result: %#zx\n", f());
 	}
@@ -502,4 +514,10 @@
 	__native (*f)(__native,...);
 	__native arg1 = argv[1].intval;
+#ifdef ia64
+	struct {
+		__native f;
+		__native gp;
+	}fptr;
+#endif
 
 	symaddr = get_symbol_addr(argv->buffer);
@@ -511,6 +529,13 @@
 	} else {
 		symbol = get_symtab_entry(symaddr);
+
 		printf("Calling f(0x%zX): %.*p: %s\n", arg1, sizeof(__address) * 2, symaddr, symbol);
+#ifdef ia64
+		fptr.f = symaddr;
+		fptr.gp = ((__native *)cmd_call2)[1];
+		f =  (__native (*)(__native,...)) &fptr;
+#else
 		f =  (__native (*)(__native,...)) symaddr;
+#endif
 		printf("Result: %#zx\n", f(arg1));
 	}
@@ -527,4 +552,10 @@
 	__native arg1 = argv[1].intval;
 	__native arg2 = argv[2].intval;
+#ifdef ia64
+	struct {
+		__native f;
+		__native gp;
+	}fptr;
+#endif
 
 	symaddr = get_symbol_addr(argv->buffer);
@@ -538,5 +569,11 @@
 		printf("Calling f(0x%zx,0x%zx): %.*p: %s\n", 
 		       arg1, arg2, sizeof(__address) * 2, symaddr, symbol);
+#ifdef ia64
+		fptr.f = symaddr;
+		fptr.gp = ((__native *)cmd_call2)[1];
+		f =  (__native (*)(__native,__native,...)) &fptr;
+#else
 		f =  (__native (*)(__native,__native,...)) symaddr;
+#endif
 		printf("Result: %#zx\n", f(arg1, arg2));
 	}
@@ -554,4 +591,10 @@
 	__native arg2 = argv[2].intval;
 	__native arg3 = argv[3].intval;
+#ifdef ia64
+	struct {
+		__native f;
+		__native gp;
+	}fptr;
+#endif
 
 	symaddr = get_symbol_addr(argv->buffer);
@@ -565,5 +608,11 @@
 		printf("Calling f(0x%zx,0x%zx, 0x%zx): %.*p: %s\n", 
 		       arg1, arg2, arg3, sizeof(__address) * 2, symaddr, symbol);
+#ifdef ia64
+		fptr.f = symaddr;
+		fptr.gp = ((__native *)cmd_call2)[1];
+		f =  (__native (*)(__native,__native,__native,...)) &fptr;
+#else
 		f =  (__native (*)(__native,__native,__native,...)) symaddr;
+#endif
 		printf("Result: %#zx\n", f(arg1, arg2, arg3));
 	}
