mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:17:34 +00:00
Kernel: Move sys$sigaction() implementation inside ARCH(i386)
This commit is contained in:
parent
3c9cebea6e
commit
c11511a0ab
1 changed files with 6 additions and 1 deletions
|
@ -24,6 +24,7 @@
|
||||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <Kernel/Panic.h>
|
||||||
#include <Kernel/Process.h>
|
#include <Kernel/Process.h>
|
||||||
|
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
@ -87,11 +88,12 @@ int Process::sys$sigaction(int signum, const sigaction* act, sigaction* old_act)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Process::sys$sigreturn(RegisterState& registers)
|
int Process::sys$sigreturn([[maybe_unused]] RegisterState& registers)
|
||||||
{
|
{
|
||||||
REQUIRE_PROMISE(stdio);
|
REQUIRE_PROMISE(stdio);
|
||||||
SmapDisabler disabler;
|
SmapDisabler disabler;
|
||||||
|
|
||||||
|
#if ARCH(I386)
|
||||||
//Here, we restore the state pushed by dispatch signal and asm_signal_trampoline.
|
//Here, we restore the state pushed by dispatch signal and asm_signal_trampoline.
|
||||||
u32* stack_ptr = (u32*)registers.userspace_esp;
|
u32* stack_ptr = (u32*)registers.userspace_esp;
|
||||||
u32 smuggled_eax = *stack_ptr;
|
u32 smuggled_eax = *stack_ptr;
|
||||||
|
@ -114,6 +116,9 @@ int Process::sys$sigreturn(RegisterState& registers)
|
||||||
|
|
||||||
registers.userspace_esp = registers.esp;
|
registers.userspace_esp = registers.esp;
|
||||||
return smuggled_eax;
|
return smuggled_eax;
|
||||||
|
#else
|
||||||
|
PANIC("sys$sigreturn() not implemented.");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue