metag: misc improvements
Subsystems (2)
cover metag: misc improvements
A few more misc arch/metag/ improvements for v3.10.
James Hogan (2):
metag: export _metag_da_present and cpu_2_hwthread_id
metag: add exported <asm/ech.h> for extended context handling
Paul Clothier (1):
metag: ptrace: Implement NT_METAG_TLS
arch/metag/include/uapi/asm/Kbuild | 1 + arch/metag/include/uapi/asm/ech.h | 15 +++++++++++++++ arch/metag/kernel/da.c | 2 ++ arch/metag/kernel/ptrace.c | 34 ++++++++++++++++++++++++++++++++++ arch/metag/kernel/setup.c | 1 + include/uapi/linux/elf.h | 1 + 6 files changed, 54 insertions(+) create mode 100644 arch/metag/include/uapi/asm/ech.h
Signature · 1 line
1.8.1.2
PATCH 1/3 metag: ptrace: Implement NT_METAG_TLS
From: Paul Clothier <[email protected]>
Implement functionality to get the TLS pointer for the metag architecture using regsets.
This provides multi-threaded debug support for GDB.
--- arch/metag/kernel/ptrace.c | 34 ++++++++++++++++++++++++++++++++++ include/uapi/linux/elf.h | 1 + 2 files changed, 35 insertions(+)
arch/metag/kernel/ptrace.c +34 -0
@@ -288,10 +288,36 @@ static int metag_rp_state_set(struct task_struct *target,return metag_rp_state_copyin (regs, pos, count, kbuf, ubuf); } +static int metag_tls_get (struct task_struct *target, +const struct user_regset *regset, +unsigned int pos,unsigned int count, +void *kbuf,void __user *ubuf) +{ +void __user *tls = target->thread.tls_ptr; +return user_regset_copyout (&pos, &count, &kbuf, &ubuf, &tls,0 ,-1 ); +} + +static int metag_tls_set (struct task_struct *target, +const struct user_regset *regset, +unsigned int pos,unsigned int count, +const void *kbuf,const void __user *ubuf) +{ +int ret; +void __user *tls; + + ret =user_regset_copyin (&pos, &count, &kbuf, &ubuf, &tls,0 ,-1 ); +if (ret) +return ret; + + target->thread.tls_ptr = tls; +return ret; +} +enum metag_regset {REGSET_GENERAL ,REGSET_CBUF ,REGSET_READPIPE , +REGSET_TLS , };static const struct user_regset metag_regsets[] = {
@@ -319,6 +345,14 @@ static const struct user_regset metag_regsets[] = { .get = metag_rp_state_get, .set = metag_rp_state_set, }, + [REGSET_TLS] = { + .core_note_type = NT_METAG_TLS, + .n = 1, + .size = sizeof(void *), + .align = sizeof(void *), + .get = metag_tls_get, + .set = metag_tls_set, + }, }; static const struct user_regset_view user_metag_view = {
include/uapi/linux/elf.h +1 -0
@@ -397,6 +397,7 @@ typedef struct elf64_shdr {#define NT_ARM_HW_WATCH 0x403/* ARM hardware watchpoint registers */ #define NT_METAG_CBUF 0x500/* Metag catch buffer registers */ #define NT_METAG_RPIPE 0x501/* Metag read pipeline state */ +#define NT_METAG_TLS 0x502/* Metag TLS pointer */ /* Note header in a PT_NOTE section */
Signature · 1 line
1.8.1.2
PATCH 2/3 metag: export _metag_da_present and cpu_2_hwthread_id
In reply to James HoganExport the symbols _metag_da_present and cpu_2_hwthread_id to modules (GPL only) to allow the imgdafs file system to be built as a module.
--- arch/metag/kernel/da.c | 2 ++ arch/metag/kernel/setup.c | 1 + 2 files changed, 3 insertions(+)
arch/metag/kernel/da.c +2 -0
@@ -5,12 +5,14 @@*/ +#include <linux/export.h> #include <linux/io.h> #include <linux/kernel.h> #include <asm/da.h> #include <asm/metag_mem.h> bool _metag_da_present; +EXPORT_SYMBOL_GPL (_metag_da_present);int __init metag_da_probe (void ) {
arch/metag/kernel/setup.c +1 -0
@@ -124,6 +124,7 @@ struct machine_desc *machine_desc __initdata;u8 cpu_2_hwthread_id[NR_CPUS ]__read_mostly = { [0 ...NR_CPUS -1 ] =BAD_HWTHREAD_ID }; +EXPORT_SYMBOL_GPL (cpu_2_hwthread_id);/* * Map a hardware thread ID to a Linux CPU number
Signature · 1 line
1.8.1.2
PATCH 3/3 metag: add exported <asm/ech.h> for extended context handling
In reply to James HoganAdd an exported header file <asm/ech.h> containing the definitions of some bits which can be set in D0.8 to indicate to the kernel that certain DSP state should be preserved. The definitions have the same names and values as the ones in the kernel-internal <asm/tbx.h>, to make it easier for DSP assembly code to be compatible between Linux and non-Linux operating systems.
--- arch/metag/include/uapi/asm/Kbuild | 1 + arch/metag/include/uapi/asm/ech.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 arch/metag/include/uapi/asm/ech.h
arch/metag/include/uapi/asm/Kbuild +1 -0
@@ -2,6 +2,7 @@ include include/uapi/asm-generic/Kbuild.asm header-y += byteorder.h +header-y += ech.h header-y += ptrace.h header-y += resource.h header-y += sigcontext.h
arch/metag/include/uapi/asm/ech.h new file +15 -0
@@ -0,0 +1,15 @@ +#ifndef _UAPI_METAG_ECH_H +#define _UAPI_METAG_ECH_H + +/* +* These bits can be set in the top half of the D0.8 register when DSP context +* switching is enabled, in order to support partial DSP context save/restore. +*/ + +#define TBICTX_XEXT_BIT 0x1000/* Enable extended context save */ +#define TBICTX_XTDP_BIT 0x0800/* DSP accumulators/RAM/templates */ +#define TBICTX_XHL2_BIT 0x0400/* Hardware loops */ +#define TBICTX_XAXX_BIT 0x0200/* Extended AX registers (A*.4-7) */ +#define TBICTX_XDX8_BIT 0x0100/* Extended DX registers (D*.8-15) */ + +#endif /* _UAPI_METAG_ECH_H */
Signature · 1 line
1.8.1.2