asmlinkage unsigned long ia64_create_module (const char *name_user, size_t size, long arg2, long arg3, long arg4, long arg5, long arg6, long arg7, long stack) { extern unsigned long sys_create_module (const char *, size_t); struct pt_regs *regs = (struct pt_regs *) &stack; unsigned long addr; addr = sys_create_module (name_user, size); if (!IS_ERR((void *) addr)) regs->r8 = 0; /* ensure large addresses are not mistaken as failures... */ return addr; }
/* * The Linux kernel isn't good at returning values that look * like negative longs (they are mistaken as error values). * Until that is fixed, we need this little workaround for * create_module() because it's one of the few system calls * that return kernel addresses (which are negative). */ asmlinkage unsigned long alpha_create_module (char * module_name, unsigned long size, int a3, int a4, int a5, int a6, struct pt_regs regs) { asmlinkage unsigned long sys_create_module (char *, unsigned long); long retval; retval = sys_create_module(module_name, size); /* * we get either a module address or an error number, * and we know the error number is a small negative * number, while the address is always negative but * much larger. */ if (retval + 1000 > 0) return retval; /* tell entry.S:syscall_error that this is NOT an error: */ regs.r0 = 0; return retval; }