Skip to content

Commit 280ac17

Browse files
hutharndb
authored andcommitted
hexagon: Remove CONFIG_HEXAGON_ARCH_VERSION from uapi header
uapi headers should not expose CONFIG switches since they are not available in userspace. Fix it in arch/hexagon/include/uapi/asm/user.h by always defining the cs0 and cs1 entries instead of pad values. Suggested-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1 parent b85ea95 commit 280ac17

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

arch/hexagon/include/uapi/asm/user.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,10 @@ struct user_regs_struct {
5656
unsigned long pc;
5757
unsigned long cause;
5858
unsigned long badva;
59-
#if CONFIG_HEXAGON_ARCH_VERSION < 4
60-
unsigned long pad1; /* pad out to 48 words total */
61-
unsigned long pad2; /* pad out to 48 words total */
62-
unsigned long pad3; /* pad out to 48 words total */
63-
#else
59+
/* cs0 and cs1 are only available with HEXAGON_ARCH_VERSION >= 4 */
6460
unsigned long cs0;
6561
unsigned long cs1;
6662
unsigned long pad1; /* pad out to 48 words total */
67-
#endif
6863
};
6964

7065
#endif

arch/hexagon/kernel/ptrace.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ static int genregs_set(struct task_struct *target,
7474
unsigned int pos, unsigned int count,
7575
const void *kbuf, const void __user *ubuf)
7676
{
77-
int ret;
77+
int ret, ignore_offset;
7878
unsigned long bucket;
7979
struct pt_regs *regs = task_pt_regs(target);
8080

@@ -111,12 +111,15 @@ static int genregs_set(struct task_struct *target,
111111
#if CONFIG_HEXAGON_ARCH_VERSION >=4
112112
INEXT(&regs->cs0, cs0);
113113
INEXT(&regs->cs1, cs1);
114+
ignore_offset = offsetof(struct user_regs_struct, pad1);
115+
#else
116+
ignore_offset = offsetof(struct user_regs_struct, cs0);
114117
#endif
115118

116119
/* Ignore the rest, if needed */
117120
if (!ret)
118121
user_regset_copyin_ignore(&pos, &count, &kbuf, &ubuf,
119-
offsetof(struct user_regs_struct, pad1), -1);
122+
ignore_offset, -1);
120123
else
121124
return ret;
122125

scripts/headers_install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_16K
7474
arch/arc/include/uapi/asm/page.h:CONFIG_ARC_PAGE_SIZE_4K
7575
arch/arc/include/uapi/asm/swab.h:CONFIG_ARC_HAS_SWAPE
7676
arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8
77-
arch/hexagon/include/uapi/asm/user.h:CONFIG_HEXAGON_ARCH_VERSION
7877
arch/m68k/include/uapi/asm/ptrace.h:CONFIG_COLDFIRE
7978
arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO
8079
arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT

0 commit comments

Comments
 (0)