Bug#349765: linux-2.6.14-2-alpha-generic: please support the prctl syscall
On Tue, Jan 24, 2006 at 07:06:00PM -0800, Steve Langasek wrote:
> So please make it work; knowing this exists and should be supported, I'm not
> willing to hack up prctl's source to use __NR_osf_setsysinfo instead. :)
>
Bleh.
Untested, as I don't have an alpha. arch/alpha/kernel/traps.c already
contained jazz to check if the various TIF_ were set, they were just
lacking a convenient way to set things. You probably need to make prctl()
know which bits to twiddle.
diff --git a/include/asm-alpha/thread_info.h b/include/asm-alpha/thread_info.h
index 69ffd93..011daaf 100644
--- a/include/asm-alpha/thread_info.h
+++ b/include/asm-alpha/thread_info.h
@@ -92,5 +92,20 @@ register struct thread_info *__current_t
#define _TIF_ALLWORK_MASK (_TIF_WORK_MASK \
| _TIF_SYSCALL_TRACE)
+#define ALPHA_UAC_SHIFT 6
+#define ALPHA_UAC_MASK (TIF_UAC_NOPRINT | TIF_UAC_NOFIX | \
+ TIF_UAC_SIGBUS)
+
+#define SET_UNALIGN_CTL(task,value) ({ \
+ (task)->thread_info->flags = (((task)->thread_info->flags & \
+ ~ALPHA_UAC_MASK) | (((value) << ALPHA_UAC_SHIFT) & \
+ ALPHA_UAC_MASK)); \
+ 0; })
+
+#define GET_UNALIGN_CTL(task,value) ({ \
+ put_user(((task)->thread_info->flags & ALPHA_UAC_MASK) >> \
+ ALPHA_UAC_SHIFT, (int __user *)(addr)); \
+ })
+
#endif /* __KERNEL__ */
#endif /* _ALPHA_THREAD_INFO_H */
Reply to: