Skip to content

Commit b0e026f

Browse files
author
Jonas Bonn
committed
openrisc: header file cleanups
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>
1 parent 4971f2b commit b0e026f

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

‎arch/openrisc/include/asm/Kbuild‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include include/asm-generic/Kbuild.asm
22

3-
header-y += spr_defs.h
3+
header-y += elf.h
4+
header-y += ucontext.h
45

56
generic-y += atomic.h
67
generic-y += auxvec.h

‎arch/openrisc/include/asm/elf.h‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,18 @@
1919
#ifndef __ASM_OPENRISC_ELF_H
2020
#define __ASM_OPENRISC_ELF_H
2121

22+
/*
23+
* This files is partially exported to userspace. This allows us to keep
24+
* the ELF bits in one place which should assist in keeping the kernel and
25+
* userspace in sync.
26+
*/
27+
2228
/*
2329
* ELF register definitions..
2430
*/
25-
#include <linux/types.h>
26-
#include <linux/ptrace.h>
2731

32+
/* for struct user_regs_struct definition */
33+
#include <asm/ptrace.h>
2834

2935
/* The OR1K relocation types... not all relevant for module loader */
3036
#define R_OR32_NONE 0
@@ -62,6 +68,8 @@ typedef unsigned long elf_fpregset_t;
6268

6369
#ifdef __KERNEL__
6470

71+
#include <linux/types.h>
72+
6573
/*
6674
* This is used to ensure we don't load something for the wrong architecture.
6775
*/

‎arch/openrisc/include/asm/ptrace.h‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#ifndef __ASM_OPENRISC_PTRACE_H
2020
#define __ASM_OPENRISC_PTRACE_H
2121

22-
#include <asm/spr_defs.h>
23-
2422
#ifndef __ASSEMBLY__
2523
/*
2624
* This is the layout of the regset returned by the GETREGSET ptrace call
@@ -30,13 +28,13 @@ struct user_regs_struct {
3028
unsigned long gpr[32];
3129
unsigned long pc;
3230
unsigned long sr;
33-
unsigned long pad1;
34-
unsigned long pad2;
3531
};
3632
#endif
3733

3834
#ifdef __KERNEL__
3935

36+
#include <asm/spr_defs.h>
37+
4038
/*
4139
* Make kernel PTrace/register structures opaque to userspace... userspace can
4240
* access thread state via the regset mechanism. This allows us a bit of

0 commit comments

Comments
 (0)