From: Jonas Bonn <jonas@southpole.se>
To: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org
Cc: Jonas Bonn <jonas@southpole.se>
Subject: [PATCH 4/6] openrisc: header file cleanups
Date: Tue, 8 May 2012 11:54:03 +0200 [thread overview]
Message-ID: <1336470845-13859-5-git-send-email-jonas@southpole.se> (raw)
In-Reply-To: <1336470845-13859-1-git-send-email-jonas@southpole.se>
elf.h: We can export some of these symbols to userspace. libc needs them
and we just as well provide them as asm/elf.h as copying them into separate
libc headers.
ptrace.h: Having padding in the user_regs_struct isn't of any particular
value and just confuses GDB. spr_defs isn't needed in userspace; libc
has its own copy anyway.
Signed-off-by: Jonas Bonn <jonas@southpole.se>
---
arch/openrisc/include/asm/Kbuild | 3 ++-
arch/openrisc/include/asm/elf.h | 12 ++++++++++--
arch/openrisc/include/asm/ptrace.h | 6 ++----
3 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/arch/openrisc/include/asm/Kbuild b/arch/openrisc/include/asm/Kbuild
index dcea5a0..c936483 100644
--- a/arch/openrisc/include/asm/Kbuild
+++ b/arch/openrisc/include/asm/Kbuild
@@ -1,6 +1,7 @@
include include/asm-generic/Kbuild.asm
-header-y += spr_defs.h
+header-y += elf.h
+header-y += ucontext.h
generic-y += atomic.h
generic-y += auxvec.h
diff --git a/arch/openrisc/include/asm/elf.h b/arch/openrisc/include/asm/elf.h
index 2ce603b..a8fe2c5 100644
--- a/arch/openrisc/include/asm/elf.h
+++ b/arch/openrisc/include/asm/elf.h
@@ -20,11 +20,17 @@
#define __ASM_OPENRISC_ELF_H
/*
+ * This files is partially exported to userspace. This allows us to keep
+ * the ELF bits in one place which should assist in keeping the kernel and
+ * userspace in sync.
+ */
+
+/*
* ELF register definitions..
*/
-#include <linux/types.h>
-#include <linux/ptrace.h>
+/* for struct user_regs_struct definition */
+#include <asm/ptrace.h>
/* The OR1K relocation types... not all relevant for module loader */
#define R_OR32_NONE 0
@@ -62,6 +68,8 @@ typedef unsigned long elf_fpregset_t;
#ifdef __KERNEL__
+#include <linux/types.h>
+
/*
* This is used to ensure we don't load something for the wrong architecture.
*/
diff --git a/arch/openrisc/include/asm/ptrace.h b/arch/openrisc/include/asm/ptrace.h
index 4651a73..8555c0c 100644
--- a/arch/openrisc/include/asm/ptrace.h
+++ b/arch/openrisc/include/asm/ptrace.h
@@ -19,8 +19,6 @@
#ifndef __ASM_OPENRISC_PTRACE_H
#define __ASM_OPENRISC_PTRACE_H
-#include <asm/spr_defs.h>
-
#ifndef __ASSEMBLY__
/*
* This is the layout of the regset returned by the GETREGSET ptrace call
@@ -30,13 +28,13 @@ struct user_regs_struct {
unsigned long gpr[32];
unsigned long pc;
unsigned long sr;
- unsigned long pad1;
- unsigned long pad2;
};
#endif
#ifdef __KERNEL__
+#include <asm/spr_defs.h>
+
/*
* Make kernel PTrace/register structures opaque to userspace... userspace can
* access thread state via the regset mechanism. This allows us a bit of
--
1.7.0.4
next prev parent reply other threads:[~2012-05-08 9:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-08 9:53 [PATCH 0/6] OpenRISC patches for review Jonas Bonn
2012-05-08 9:54 ` [PATCH 1/6] openrisc: implement irqdomains Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn
2012-05-08 9:54 ` [PATCH 2/6] openrisc: remove unnecessary includes Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn
2012-05-08 9:54 ` [PATCH 3/6] openrisc/mm/fault.c: Port OOM changes to do_page_fault Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn [this message]
2012-05-08 9:54 ` [PATCH 4/6] openrisc: header file cleanups Jonas Bonn
2012-05-08 9:54 ` [PATCH 5/6] openrisc: provide dma_map_ops Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn
2012-05-08 9:54 ` [PATCH 6/6] openrisc: use scratch regs in atomic syscall Jonas Bonn
2012-05-08 9:54 ` Jonas Bonn
2012-05-08 11:24 ` [PATCH 0/6] OpenRISC patches for review Arnd Bergmann
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=1336470845-13859-5-git-send-email-jonas@southpole.se \
--to=jonas@southpole.se \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).