From: Ralf Baechle <ralf@linux-mips.org>
To: Song Wang <wsonguci@yahoo.com>
Cc: linux-mips@linux-mips.org
Subject: Re: asm-mips/processor.h breaks compiling user applications such as iptables
Date: Fri, 16 Jul 2004 00:56:57 +0200 [thread overview]
Message-ID: <20040715225657.GA17585@linux-mips.org> (raw)
In-Reply-To: <20040715222234.16094.qmail@web40007.mail.yahoo.com>
On Thu, Jul 15, 2004 at 03:22:34PM -0700, Song Wang wrote:
> I think the error is due to the line 146
>
> typedef u64 fpureg_t;
>
> The type 'u64' is defined in asm-mips/types.h, but
> wrapped by #ifdef __KERNEL__, so when the compiler
> compiles the user-level application, it cannot
> recognize u64.
Correct. In general the policy is to avoid the use of kernel header
files in user space and copy it but there are still a few crucial tools
that don't follow this rule of Linus, so try below patch. It also
removes the __KERNEL__ things left.
Cleaning up the use of kernel header to make them more usable for
userspace is one of the things on the agenda for 2.7. It'll be alot of
hard and boring work but MIPS will be one of the architectures that will
greatly benefit from this.
Ralf
Index: include/asm-mips/processor.h
===================================================================
RCS file: /home/cvs/linux/include/asm-mips/processor.h,v
retrieving revision 1.94
diff -u -r1.94 processor.h
--- include/asm-mips/processor.h 28 Jun 2004 21:04:16 -0000 1.94
+++ include/asm-mips/processor.h 15 Jul 2004 22:42:29 -0000
@@ -143,7 +143,7 @@
#define NUM_FPU_REGS 32
-typedef u64 fpureg_t;
+typedef __u64 fpureg_t;
struct mips_fpu_hard_struct {
fpureg_t fpr[NUM_FPU_REGS];
@@ -235,8 +235,6 @@
MF_FIXADE, 0, 0 \
}
-#ifdef __KERNEL__
-
struct task_struct;
/* Free all resources held by a thread. */
@@ -264,8 +262,6 @@
#define cpu_relax() barrier()
-#endif /* __KERNEL__ */
-
/*
* Return_address is a replacement for __builtin_return_address(count)
* which on certain architectures cannot reasonably be implemented in GCC
next prev parent reply other threads:[~2004-07-15 22:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-15 22:22 asm-mips/processor.h breaks compiling user applications such as iptables Song Wang
2004-07-15 22:56 ` Ralf Baechle [this message]
2004-07-16 2:01 ` Song Wang
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=20040715225657.GA17585@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=linux-mips@linux-mips.org \
--cc=wsonguci@yahoo.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 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.