Index: kernel/generic/src/console/cmd.c
===================================================================
--- kernel/generic/src/console/cmd.c	(revision 516ff92eec3001ee20baaf6f01de87b1ffef0b48)
+++ kernel/generic/src/console/cmd.c	(revision 0f81ceb764d3f1f6da8afbeeb9de80a2e8226028)
@@ -617,12 +617,7 @@
 	uintptr_t symaddr;
 	char *symbol;
-	unative_t (*f)(void);
-#ifdef ia64
-	struct {
-		unative_t f;
-		unative_t gp;
-	} fptr;
-#endif
-
+	unative_t (*fnc)(void);
+	fncptr_t fptr;
+	
 	symaddr = get_symbol_addr((char *) argv->buffer);
 	if (!symaddr)
@@ -633,13 +628,7 @@
 	} else {
 		symbol = get_symtab_entry(symaddr);
+		fnc = (unative_t (*)(void)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call0);
 		printf("Calling %s() (%p)\n", symbol, symaddr);
-#ifdef ia64
-		fptr.f = symaddr;
-		fptr.gp = ((unative_t *)cmd_call2)[1];
-		f =  (unative_t (*)(void)) &fptr;
-#else
-		f =  (unative_t (*)(void)) symaddr;
-#endif
-		printf("Result: %#" PRIxn "\n", f());
+		printf("Result: %#" PRIxn "\n", fnc());
 	}
 	
@@ -681,13 +670,8 @@
 	uintptr_t symaddr;
 	char *symbol;
-	unative_t (*f)(unative_t,...);
+	unative_t (*fnc)(unative_t, ...);
 	unative_t arg1 = argv[1].intval;
-#ifdef ia64
-	struct {
-		unative_t f;
-		unative_t gp;
-	} fptr;
-#endif
-
+	fncptr_t fptr;
+	
 	symaddr = get_symbol_addr((char *) argv->buffer);
 	if (!symaddr)
@@ -698,14 +682,7 @@
 	} else {
 		symbol = get_symtab_entry(symaddr);
-
+		fnc = (unative_t (*)(unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call1);
 		printf("Calling f(%#" PRIxn "): %p: %s\n", arg1, symaddr, symbol);
-#ifdef ia64
-		fptr.f = symaddr;
-		fptr.gp = ((unative_t *)cmd_call2)[1];
-		f =  (unative_t (*)(unative_t,...)) &fptr;
-#else
-		f =  (unative_t (*)(unative_t,...)) symaddr;
-#endif
-		printf("Result: %#" PRIxn "\n", f(arg1));
+		printf("Result: %#" PRIxn "\n", fnc(arg1));
 	}
 	
@@ -718,14 +695,9 @@
 	uintptr_t symaddr;
 	char *symbol;
-	unative_t (*f)(unative_t,unative_t,...);
+	unative_t (*fnc)(unative_t, unative_t, ...);
 	unative_t arg1 = argv[1].intval;
 	unative_t arg2 = argv[2].intval;
-#ifdef ia64
-	struct {
-		unative_t f;
-		unative_t gp;
-	}fptr;
-#endif
-
+	fncptr_t fptr;
+	
 	symaddr = get_symbol_addr((char *) argv->buffer);
 	if (!symaddr)
@@ -736,14 +708,8 @@
 	} else {
 		symbol = get_symtab_entry(symaddr);
+		fnc = (unative_t (*)(unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call2);
 		printf("Calling f(%#" PRIxn ", %#" PRIxn "): %p: %s\n", 
 		       arg1, arg2, symaddr, symbol);
-#ifdef ia64
-		fptr.f = symaddr;
-		fptr.gp = ((unative_t *)cmd_call2)[1];
-		f =  (unative_t (*)(unative_t,unative_t,...)) &fptr;
-#else
-		f =  (unative_t (*)(unative_t,unative_t,...)) symaddr;
-#endif
-		printf("Result: %#" PRIxn "\n", f(arg1, arg2));
+		printf("Result: %#" PRIxn "\n", fnc(arg1, arg2));
 	}
 	
@@ -756,15 +722,10 @@
 	uintptr_t symaddr;
 	char *symbol;
-	unative_t (*f)(unative_t,unative_t,unative_t,...);
+	unative_t (*fnc)(unative_t, unative_t, unative_t, ...);
 	unative_t arg1 = argv[1].intval;
 	unative_t arg2 = argv[2].intval;
 	unative_t arg3 = argv[3].intval;
-#ifdef ia64
-	struct {
-		unative_t f;
-		unative_t gp;
-	}fptr;
-#endif
-
+	fncptr_t fptr;
+	
 	symaddr = get_symbol_addr((char *) argv->buffer);
 	if (!symaddr)
@@ -775,14 +736,8 @@
 	} else {
 		symbol = get_symtab_entry(symaddr);
+		fnc = (unative_t (*)(unative_t, unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call3);
 		printf("Calling f(%#" PRIxn ",%#" PRIxn ", %#" PRIxn "): %p: %s\n", 
 		       arg1, arg2, arg3, symaddr, symbol);
-#ifdef ia64
-		fptr.f = symaddr;
-		fptr.gp = ((unative_t *)cmd_call2)[1];
-		f =  (unative_t (*)(unative_t,unative_t,unative_t,...)) &fptr;
-#else
-		f =  (unative_t (*)(unative_t,unative_t,unative_t,...)) symaddr;
-#endif
-		printf("Result: %#" PRIxn "\n", f(arg1, arg2, arg3));
+		printf("Result: %#" PRIxn "\n", fnc(arg1, arg2, arg3));
 	}
 	
@@ -997,7 +952,7 @@
 	
 	for (test = tests; test->name != NULL; test++)
-		printf("%s\t\t%s%s\n", test->name, test->desc, (test->safe ? "" : " (unsafe)"));
-	
-	printf("*\t\tRun all safe tests\n");
+		printf("%-10s %s%s\n", test->name, test->desc, (test->safe ? "" : " (unsafe)"));
+	
+	printf("%-10s Run all safe tests\n", "*");
 	return 1;
 }
