From: Andreas Gruenbacher <agruen@suse.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Andrew Morton <akpm@osdl.org>,
lkml <linux-kernel@vger.kernel.org>, Chris Mason <mason@suse.com>
Subject: [FIX] CONFIG_REGPARM breaks non-asmlinkage syscalls
Date: Tue, 24 Feb 2004 21:05:56 +0100 [thread overview]
Message-ID: <1077653156.3101.327.camel@nb.suse.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
Hello,
with CONFIG_REGPARM=y, syscalls must be declared asmlinkage or else
calling them will fail. Current gcc unfortunately does not warn about
this. (I have already told one of our compiler developers.) Attached is
a fix that adds a few missing declarations.
Regards,
--
Andreas Gruenbacher <agruen@suse.de>
SUSE Labs, SUSE LINUX AG
[-- Attachment #2: regparm-fix.diff --]
[-- Type: text/x-patch, Size: 3552 bytes --]
Index: linux-2.6.3/arch/ia64/ia32/sys_ia32.c
===================================================================
--- linux-2.6.3.orig/arch/ia64/ia32/sys_ia32.c
+++ linux-2.6.3/arch/ia64/ia32/sys_ia32.c
@@ -2990,7 +2990,7 @@ sys32_timer_create(u32 clock, struct sig
return err;
}
-extern long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
+extern asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high,
__u32 len_low, __u32 len_high, int advice)
Index: linux-2.6.3/arch/x86_64/ia32/sys_ia32.c
===================================================================
--- linux-2.6.3.orig/arch/x86_64/ia32/sys_ia32.c
+++ linux-2.6.3/arch/x86_64/ia32/sys_ia32.c
@@ -1895,7 +1895,7 @@ sys32_timer_create(u32 clock, struct sig
return err;
}
-extern long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
+extern asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
long sys32_fadvise64_64(int fd, __u32 offset_low, __u32 offset_high,
__u32 len_low, __u32 len_high, int advice)
Index: linux-2.6.3/include/linux/mm.h
===================================================================
--- linux-2.6.3.orig/include/linux/mm.h
+++ linux-2.6.3/include/linux/mm.h
@@ -455,8 +455,8 @@ extern int install_file_pte(struct mm_st
extern int handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access);
extern int make_pages_present(unsigned long addr, unsigned long end);
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
-extern long sys_remap_file_pages(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long nonblock);
-extern long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
+extern asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, unsigned long prot, unsigned long pgoff, unsigned long nonblock);
+extern asmlinkage long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice);
void put_dirty_page(struct task_struct *tsk, struct page *page,
unsigned long address, pgprot_t prot);
Index: linux-2.6.3/include/linux/shm.h
===================================================================
--- linux-2.6.3.orig/include/linux/shm.h
+++ linux-2.6.3/include/linux/shm.h
@@ -90,7 +90,7 @@ struct shmid_kernel /* private to the ke
#define SHM_LOCKED 02000 /* segment will not be swapped */
#define SHM_HUGETLB 04000 /* segment will use huge TLB pages */
-long sys_shmat (int shmid, char __user *shmaddr, int shmflg, unsigned long *addr);
+asmlinkage long sys_shmat (int shmid, char __user *shmaddr, int shmflg, unsigned long *addr);
asmlinkage long sys_shmget (key_t key, size_t size, int flag);
asmlinkage long sys_shmdt (char __user *shmaddr);
asmlinkage long sys_shmctl (int shmid, int cmd, struct shmid_ds __user *buf);
Index: linux-2.6.3/mm/fremap.c
===================================================================
--- linux-2.6.3.orig/mm/fremap.c
+++ linux-2.6.3/mm/fremap.c
@@ -155,7 +155,7 @@ err_unlock:
* protection is used. Arbitrary protections might be implemented in the
* future.
*/
-long sys_remap_file_pages(unsigned long start, unsigned long size,
+asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,
unsigned long __prot, unsigned long pgoff, unsigned long flags)
{
struct mm_struct *mm = current->mm;
next reply other threads:[~2004-02-24 20:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-24 20:05 Andreas Gruenbacher [this message]
2004-02-24 21:07 ` [FIX] CONFIG_REGPARM breaks non-asmlinkage syscalls Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2004-02-24 20:08 Andreas Gruenbacher
2004-02-25 2:44 ` Andreas Gruenbacher
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=1077653156.3101.327.camel@nb.suse.de \
--to=agruen@suse.de \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mason@suse.com \
--cc=torvalds@transmeta.com \
/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