ENDFUNC(exec_user_param)
-ENTRY(exec_user)
- /*
- * 1*4(%esp) ulong (*fn)(ulong)
- * 0*4(%esp) return address
- */
- push $0xdead0000 /* Poison unused p1. */
- push (1+1)*4(%esp) /* Re-push fn for exec_user_param()'s call frame. */
- call exec_user_param
- add $2*4, %esp /* Pop fn/p1. */
- ret
-ENDFUNC(exec_user)
-
/*
* Local variables:
* tab-width: 8
int (*compar)(const void *, const void *),
void (*swap)(void *, void *));
+/**
+ * Execute fn(p1) at user privilege, passing its return value back.
+ */
+unsigned long exec_user_param(unsigned long (*fn)(unsigned long),
+ unsigned long p1);
+
/*
- * Execute fn() at user privilege on the current stack, passing its return
- * value back.
+ * Wrapper around exec_user_param(), calling a function which takes no
+ * parameters. p1 is poisioned to catch misuses.
*/
-unsigned long exec_user(unsigned long (*fn)(void));
+static inline unsigned long exec_user(unsigned long (*fn)(void))
+{
+ return exec_user_param((void *)fn, 0xdead0000);
+}
/*
* Wrapper around exec_user() which calls a void function.
exec_user((void *)fn);
}
-/* Execute fn(p1) at user privilege. */
-unsigned long exec_user_param(unsigned long (*fn)(unsigned long),
- unsigned long p1);
-
/**
* Probe for the SYSCTL_INTERFACE_VERSION in use by the hypervisor
* @returns version, or -1 on failure.