From 3366a99b17847b58f2d8cc52cbb5d65deb824f8a Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 16 Jun 2015 14:55:06 +0000 Subject: switch sh port's __unmapself to generic version when running on sh2/nommu due to the way the interrupt and syscall trap mechanism works, userspace on sh2 must never set the stack pointer to an invalid value. thus, the approach used on most archs, where __unmapself executes with no stack for the interval between SYS_munmap and SYS_exit, is not viable on sh2. in order not to pessimize sh3/sh4, the sh asm version of __unmapself is not removed. instead it's renamed and redirected through code that calls either the generic (safe) __unmapself or the sh3/sh4 asm, depending on compile-time and run-time conditions. --- src/thread/sh/__unmapself.s | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/thread') diff --git a/src/thread/sh/__unmapself.s b/src/thread/sh/__unmapself.s index b34c3c80..cad91bf6 100644 --- a/src/thread/sh/__unmapself.s +++ b/src/thread/sh/__unmapself.s @@ -1,7 +1,7 @@ .text -.global __unmapself -.type __unmapself, @function -__unmapself: +.global __unmapself_sh_mmu +.type __unmapself_sh_mmu, @function +__unmapself_sh_mmu: mov #91, r3 ! SYS_munmap trapa #18 -- cgit v1.2.1