From: Arnd Bergmann <arnd@arndb.de>
To: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org, Jeff Dike <jdike@addtoit.com>,
Bjoern Steinbrink <B.Steinbrink@gmx.de>,
Arjan van de Ven <arjan@infradead.org>,
Chase Venters <chase.venters@clientec.com>,
Andrew Morton <akpm@osdl.org>,
Russell King <rmk+lkml@arm.linux.org.uk>,
rusty@rustcorp.com.au, linuxsh-shmedia-dev@lists.sourceforge.net,
lethal@linux-sh.org, rc@rc0.org.uk
Subject: [PATCH 5/7] sh64: remove the use of kernel syscalls
Date: Mon, 28 Aug 2006 00:00:49 +0200 [thread overview]
Message-ID: <200608280000.50961.arnd@arndb.de> (raw)
In-Reply-To: 20060827214734.252316000@klappe.arndb.de
sh64 is using system call macros to call some functions
from the kernel. Remove those so we can get rid of
kernel syscalls.
This is probably not the best implementation and may
need to be redone.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Index: linux-cg/arch/sh64/kernel/process.c
===================================================================
--- linux-cg.orig/arch/sh64/kernel/process.c 2006-08-27 23:36:34.000000000 +0200
+++ linux-cg/arch/sh64/kernel/process.c 2006-08-27 23:40:13.000000000 +0200
@@ -32,7 +32,6 @@
#undef IDLE_TRACE
/* Temporary flags/tests. All to be removed/undefined. END */
-#define __KERNEL_SYSCALLS__
#include <stdarg.h>
#include <linux/kernel.h>
@@ -230,13 +229,10 @@
void idle_trace(void)
{
- _syscall0(int, getpid)
- _syscall1(int, getpgid, int, pid)
-
if (!once) {
/* VM allocation/deallocation simple test */
test_VM();
- pid = getpid();
+ pid = sys_getpid();
printk("Got all through to Idle !!\n");
printk("I'm now going to loop forever ...\n");
@@ -268,7 +264,7 @@
}
old_jiffies = jiffies;
}
- pgid = getpgid(pid);
+ pgid = sys_getpgid(pid);
printk(".");
}
#else
@@ -628,18 +624,23 @@
* a system call from a "real" process, but the process memory space will
* not be free'd until both the parent and the child have exited.
*/
+#error please implement a working kernel_thread function like the other architectures
+/* _syscallN() does not work any more. this probably needs to call
+ * do_fork directly */
int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
{
- /* A bit less processor dependent than older sh ... */
- unsigned int reply;
-
-static __inline__ _syscall2(int,clone,unsigned long,flags,unsigned long,newsp)
-static __inline__ _syscall1(int,exit,int,ret)
+ register unsigned long reply asm ("r9") = ((0x13 << 16) | __NR_clone);
+ register unsigned long __flags asm ("r2") = flags | CLONE_VM;
+ register unsigned long __newsp asm ("r3") = 0;
+
+ __asm__ __volatile__ ("trapa %1 !\t\t\t clone(%2,%3)"
+ : "=r" (__sc0) : "r" (__sc0), "r" (__sc2), "r" (__sc3));
+ __asm__ __volatile__ ("!dummy %0 %1"
+ : : "r" (__sc0), "r" (__sc2), "r" (__sc3) : "memory");
- reply = clone(flags | CLONE_VM, 0);
if (!reply) {
/* Child */
- reply = exit(fn(arg));
+ reply = sys_exit(fn(arg));
}
return reply;
--
next prev parent reply other threads:[~2006-08-27 23:58 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-27 21:47 [PATCH 0/7] kill __KERNEL_SYSCALLS__ Arnd Bergmann
2006-08-27 21:47 ` [PATCH 2/7] rename the provided execve functions to kernel_execve Arnd Bergmann
2006-08-28 2:20 ` Randy.Dunlap
2006-08-28 7:44 ` Arnd Bergmann
2006-08-27 21:47 ` [PATCH 3/7] provide kernel_execve on all architectures Arnd Bergmann
2006-08-29 2:22 ` Ralf Baechle
2006-08-29 17:21 ` David Howells
2006-08-27 21:47 ` [PATCH 4/7] Remove the use of _syscallX macros in UML Arnd Bergmann
2006-08-28 9:25 ` Andreas Schwab
2006-08-30 5:41 ` H. Peter Anvin
2006-08-30 12:38 ` Arnd Bergmann
2006-08-27 21:47 ` [PATCH 6/7] remove all remaining _syscallX macros Arnd Bergmann
2006-08-28 7:35 ` Andi Kleen
2006-08-28 7:41 ` Arnd Bergmann
2006-08-28 7:46 ` Arjan van de Ven
2006-08-28 8:09 ` Arnd Bergmann
2006-08-28 7:50 ` Andi Kleen
2006-08-28 8:01 ` Arnd Bergmann
2006-08-28 8:03 ` Andi Kleen
2006-08-28 8:09 ` David Miller
2006-08-28 8:15 ` Andi Kleen
2006-08-28 8:19 ` David Miller
2006-08-28 8:28 ` Andi Kleen
2006-08-28 8:40 ` David Woodhouse
2006-08-28 8:53 ` Andi Kleen
2006-08-28 10:00 ` David Woodhouse
2006-08-28 10:37 ` Arjan van de Ven
2006-08-28 10:58 ` Andi Kleen
2006-08-28 14:05 ` Arnd Bergmann
2006-08-28 14:42 ` Andi Kleen
2006-08-28 15:46 ` Adrian Bunk
2006-08-28 17:00 ` Andi Kleen
2006-08-30 17:45 ` Adrian Bunk
2006-08-28 20:20 ` Horst H. von Brand
2006-08-28 21:23 ` Arnd Bergmann
2006-08-30 5:44 ` H. Peter Anvin
2006-08-30 7:22 ` Andi Kleen
2006-08-27 21:47 ` [PATCH 7/7] remove the global errno from the kernel Arnd Bergmann
2006-08-29 17:23 ` David Howells
2006-08-27 22:00 ` Arnd Bergmann [this message]
2006-08-28 8:05 ` [PATCH 5/7] sh64: remove the use of kernel syscalls Paul Mundt
2006-08-27 22:01 ` [PATCH 1/7] introduce kernel_execve Arnd Bergmann
2006-08-29 9:12 ` [PATCH 0/7] kill __KERNEL_SYSCALLS__ David Howells
2006-08-29 9:37 ` Arnd Bergmann
2006-08-29 9:38 ` Haavard Skinnemoen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200608280000.50961.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=B.Steinbrink@gmx.de \
--cc=akpm@osdl.org \
--cc=arjan@infradead.org \
--cc=chase.venters@clientec.com \
--cc=jdike@addtoit.com \
--cc=lethal@linux-sh.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxsh-shmedia-dev@lists.sourceforge.net \
--cc=rc@rc0.org.uk \
--cc=rmk+lkml@arm.linux.org.uk \
--cc=rusty@rustcorp.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox