There are times when you want to transition into a ``kernel mode'' state as if an interrupt had occured, but you don't want to have to wait for one. Most processors have a ``trap'' or ``int'' instruction which will manually cause this processor state. These functions wrap that functionality.
Sets the ``return value'' for context to value. If a user performed a syscall, then the target routine might call this function to set the value that the program will think it was returned.
This generally just pokes a value into one of the registers in the context, but it's platform dependent.
Macro that sets a return value for the named thread. This is just a wrapper for syscall_set_return.
Like SET_RETURN, but it sets the value on the ``current'' thread, which would generally be the one who invoked the syscall target.
Sets the return value on the current thread and then causes a thread schedule.
Use this macro to insert the platform-dependent code for invoking a syscall at the given address. routine is generally a function pointer.