public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruen@suse.de>
To: Andrew Morton <akpm@osdl.org>
Cc: lkml <linux-kernel@vger.kernel.org>, Linus Torvalds <torvalds@osdl.org>
Subject: Re: [FIX] CONFIG_REGPARM breaks non-asmlinkage syscalls
Date: Wed, 25 Feb 2004 03:44:10 +0100	[thread overview]
Message-ID: <1077677050.3177.34.camel@nb.suse.de> (raw)
In-Reply-To: <1077653339.6776.329.camel@nb.suse.de>

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]

Hello,

> with CONFIG_REGPARM=y, syscalls must be declared asmlinkage or else
> calling them will fail. [...]

here are a couple more cases where the prototypes and definitions don't
match. I found them with a fixed gcc.

Regards,
-- 
Andreas Gruenbacher <agruen@suse.de>
SUSE Labs, SUSE LINUX AG

[-- Attachment #2: regparm-fix2.diff --]
[-- Type: text/x-patch, Size: 3194 bytes --]

Index: linux-2.6.3/arch/i386/kernel/semaphore.c
===================================================================
--- linux-2.6.3.orig/arch/i386/kernel/semaphore.c
+++ linux-2.6.3/arch/i386/kernel/semaphore.c
@@ -48,12 +48,14 @@
  *    we cannot lose wakeup events.
  */
 
-void __up(struct semaphore *sem)
+asmlinkage void
+__up(struct semaphore *sem)
 {
 	wake_up(&sem->wait);
 }
 
-void __down(struct semaphore * sem)
+asmlinkage void
+__down(struct semaphore * sem)
 {
 	struct task_struct *tsk = current;
 	DECLARE_WAITQUEUE(wait, tsk);
@@ -90,7 +92,8 @@ void __down(struct semaphore * sem)
 	tsk->state = TASK_RUNNING;
 }
 
-int __down_interruptible(struct semaphore * sem)
+asmlinkage int
+__down_interruptible(struct semaphore * sem)
 {
 	int retval = 0;
 	struct task_struct *tsk = current;
@@ -153,7 +156,8 @@ int __down_interruptible(struct semaphor
  * single "cmpxchg" without failure cases,
  * but then it wouldn't work on a 386.
  */
-int __down_trylock(struct semaphore * sem)
+asmlinkage int
+__down_trylock(struct semaphore * sem)
 {
 	int sleepers;
 	unsigned long flags;
Index: linux-2.6.3/drivers/isdn/hysdn/hysdn_defs.h
===================================================================
--- linux-2.6.3.orig/drivers/isdn/hysdn/hysdn_defs.h
+++ linux-2.6.3/drivers/isdn/hysdn/hysdn_defs.h
@@ -235,7 +235,6 @@ extern hysdn_card *card_root;	/* pointer
 /*************************/
 /* im/exported functions */
 /*************************/
-extern int printk(const char *fmt,...);
 extern char *hysdn_getrev(const char *);
 
 /* hysdn_procconf.c */
Index: linux-2.6.3/kernel/exit.c
===================================================================
--- linux-2.6.3.orig/kernel/exit.c
+++ linux-2.6.3/kernel/exit.c
@@ -748,7 +748,7 @@ static void exit_notify(struct task_stru
 
 }
 
-NORET_TYPE void do_exit(long code)
+asmlinkage NORET_TYPE void do_exit(long code)
 {
 	struct task_struct *tsk = current;
 
Index: linux-2.6.3/kernel/power/swsusp.c
===================================================================
--- linux-2.6.3.orig/kernel/power/swsusp.c
+++ linux-2.6.3/kernel/power/swsusp.c
@@ -72,7 +72,7 @@ extern long sys_sync(void);
 
 unsigned char software_suspend_enabled = 0;
 
-extern void do_magic(int resume);
+asmlinkage extern void do_magic(int resume);
 
 #define NORESUME		1
 #define RESUME_SPECIFIED	2
@@ -584,7 +584,7 @@ static void suspend_power_down(void)
  * Magic happens here
  */
 
-void do_magic_resume_1(void)
+asmlinkage void do_magic_resume_1(void)
 {
 	barrier();
 	mb();
@@ -597,7 +597,7 @@ void do_magic_resume_1(void)
 			   driver scheduled DMA, we have good chance for DMA to finish ;-). */
 }
 
-void do_magic_resume_2(void)
+asmlinkage void do_magic_resume_2(void)
 {
 	BUG_ON (nr_copy_pages_check != nr_copy_pages);
 	BUG_ON (pagedir_order_check != pagedir_order);
@@ -641,7 +641,7 @@ void do_magic_resume_2(void)
 
  */
 
-void do_magic_suspend_1(void)
+asmlinkage void do_magic_suspend_1(void)
 {
 	mb();
 	barrier();
@@ -649,7 +649,7 @@ void do_magic_suspend_1(void)
 	spin_lock_irq(&suspend_pagedir_lock);
 }
 
-void do_magic_suspend_2(void)
+asmlinkage void do_magic_suspend_2(void)
 {
 	int is_problem;
 	read_swapfiles();

  reply	other threads:[~2004-02-25  2:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-24 20:08 [FIX] CONFIG_REGPARM breaks non-asmlinkage syscalls Andreas Gruenbacher
2004-02-25  2:44 ` Andreas Gruenbacher [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-02-24 20:05 Andreas Gruenbacher
2004-02-24 21:07 ` Andrew Morton

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=1077677050.3177.34.camel@nb.suse.de \
    --to=agruen@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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