All of lore.kernel.org
 help / color / mirror / Atom feed
From: WANG Cong <xiyou.wangcong@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Jeff Dike <jdike@karaya.com>,
	user-mode-linux-devel@lists.sourceforge.net
Subject: [uml-devel] [git Patch] UML: a build error fix
Date: Thu, 31 Jan 2008 23:17:41 +0800	[thread overview]
Message-ID: <20080131151741.GE2471@hacking> (raw)


This patch fixed this error:

arch/um/kernel/skas/syscall.c: In function 'handle_syscall':
arch/um/kernel/skas/syscall.c:33: error: 'NR_syscalls' undeclared (first use in this function)
arch/um/kernel/skas/syscall.c:33: error: (Each undeclared identifier is reported only once
arch/um/kernel/skas/syscall.c:33: error: for each function it appears in.)
make[2]: *** [arch/um/kernel/skas/syscall.o] Error 1
make[1]: *** [arch/um/kernel/skas] Error 2
make: *** [arch/um/kernel] Error 2


Cc: Jeff Dike <jdike@karaya.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/um/include/sysdep-i386/kernel-offsets.h b/arch/um/include/sysdep-i386/kernel-offsets.h
index 5868526..da820d2 100644
--- a/arch/um/include/sysdep-i386/kernel-offsets.h
+++ b/arch/um/include/sysdep-i386/kernel-offsets.h
@@ -15,7 +15,11 @@
 #define OFFSET(sym, str, mem) \
 	DEFINE(sym, offsetof(struct str, mem));
 
+static char syscalls[] = {
+#include <asm/arch/unistd.h>
+};
 void foo(void)
 {
 #include <common-offsets.h>
+DEFINE(UM_NR_syscall_max, sizeof(syscalls) - 1);
 }
diff --git a/arch/um/include/sysdep-i386/syscalls.h b/arch/um/include/sysdep-i386/syscalls.h
index 57bd79e..fb1fd94 100644
--- a/arch/um/include/sysdep-i386/syscalls.h
+++ b/arch/um/include/sysdep-i386/syscalls.h
@@ -5,6 +5,7 @@
 
 #include "asm/unistd.h"
 #include "sysdep/ptrace.h"
+#include "kern_constants.h"
 
 typedef long syscall_handler_t(struct pt_regs);
 
@@ -23,3 +24,6 @@ extern syscall_handler_t *sys_call_table[];
 extern long sys_mmap2(unsigned long addr, unsigned long len,
 		      unsigned long prot, unsigned long flags,
 		      unsigned long fd, unsigned long pgoff);
+
+#define NR_syscalls (UM_NR_syscall_max + 1)
+

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

WARNING: multiple messages have this Message-ID (diff)
From: WANG Cong <xiyou.wangcong@gmail.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Jeff Dike <jdike@karaya.com>,
	user-mode-linux-devel@lists.sourceforge.net
Subject: [git Patch] UML: a build error fix
Date: Thu, 31 Jan 2008 23:17:41 +0800	[thread overview]
Message-ID: <20080131151741.GE2471@hacking> (raw)


This patch fixed this error:

arch/um/kernel/skas/syscall.c: In function 'handle_syscall':
arch/um/kernel/skas/syscall.c:33: error: 'NR_syscalls' undeclared (first use in this function)
arch/um/kernel/skas/syscall.c:33: error: (Each undeclared identifier is reported only once
arch/um/kernel/skas/syscall.c:33: error: for each function it appears in.)
make[2]: *** [arch/um/kernel/skas/syscall.o] Error 1
make[1]: *** [arch/um/kernel/skas] Error 2
make: *** [arch/um/kernel] Error 2


Cc: Jeff Dike <jdike@karaya.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/um/include/sysdep-i386/kernel-offsets.h b/arch/um/include/sysdep-i386/kernel-offsets.h
index 5868526..da820d2 100644
--- a/arch/um/include/sysdep-i386/kernel-offsets.h
+++ b/arch/um/include/sysdep-i386/kernel-offsets.h
@@ -15,7 +15,11 @@
 #define OFFSET(sym, str, mem) \
 	DEFINE(sym, offsetof(struct str, mem));
 
+static char syscalls[] = {
+#include <asm/arch/unistd.h>
+};
 void foo(void)
 {
 #include <common-offsets.h>
+DEFINE(UM_NR_syscall_max, sizeof(syscalls) - 1);
 }
diff --git a/arch/um/include/sysdep-i386/syscalls.h b/arch/um/include/sysdep-i386/syscalls.h
index 57bd79e..fb1fd94 100644
--- a/arch/um/include/sysdep-i386/syscalls.h
+++ b/arch/um/include/sysdep-i386/syscalls.h
@@ -5,6 +5,7 @@
 
 #include "asm/unistd.h"
 #include "sysdep/ptrace.h"
+#include "kern_constants.h"
 
 typedef long syscall_handler_t(struct pt_regs);
 
@@ -23,3 +24,6 @@ extern syscall_handler_t *sys_call_table[];
 extern long sys_mmap2(unsigned long addr, unsigned long len,
 		      unsigned long prot, unsigned long flags,
 		      unsigned long fd, unsigned long pgoff);
+
+#define NR_syscalls (UM_NR_syscall_max + 1)
+

             reply	other threads:[~2008-01-31 15:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-31 15:17 WANG Cong [this message]
2008-01-31 15:17 ` [git Patch] UML: a build error fix WANG Cong
2008-02-01 17:38 ` [uml-devel] " Jeff Dike
2008-02-01 17:38   ` Jeff Dike

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=20080131151741.GE2471@hacking \
    --to=xiyou.wangcong@gmail.com \
    --cc=jdike@karaya.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.