mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
ARC: Syscall support (no-legacy-syscall ABI)
This includes support for generic clone/for/vfork/execve Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Al Viro <viro@ZenIV.linux.org.uk> Acked-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
parent
054419ed84
commit
4adeefe161
8 changed files with 228 additions and 0 deletions
42
arch/arc/kernel/process.c
Normal file
42
arch/arc/kernel/process.c
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* Amit Bhor, Kanika Nema: Codito Technologies 2004
|
||||
*/
|
||||
|
||||
#include <linux/errno.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/elf.h>
|
||||
#include <linux/tick.h>
|
||||
|
||||
SYSCALL_DEFINE1(arc_settls, void *, user_tls_data_ptr)
|
||||
{
|
||||
task_thread_info(current)->thr_ptr = (unsigned int)user_tls_data_ptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* We return the user space TLS data ptr as sys-call return code
|
||||
* Ideally it should be copy to user.
|
||||
* However we can cheat by the fact that some sys-calls do return
|
||||
* absurdly high values
|
||||
* Since the tls dat aptr is not going to be in range of 0xFFFF_xxxx
|
||||
* it won't be considered a sys-call error
|
||||
* and it will be loads better than copy-to-user, which is a definite
|
||||
* D-TLB Miss
|
||||
*/
|
||||
SYSCALL_DEFINE0(arc_gettls)
|
||||
{
|
||||
return task_thread_info(current)->thr_ptr;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue