From 1ead25a46d93cab4ef6b064c9092d957d4777488 Mon Sep 17 00:00:00 2001 From: Paul Clothier Date: Tue, 19 Mar 2013 12:04:43 +0000 Subject: [PATCH] --- yaml --- r: 367231 b: refs/heads/master c: 876d6dcdf26a2e860801ec61195e580d03f7b204 h: refs/heads/master i: 367229: efc72dd751c00f423001db15672af980e859fd6b 367227: 0727cda6823c769699ef239f4fa615b43cb860be 367223: 7506dbbaed7d23c08efa4eb4c48cf3226ae973de 367215: 3aa202103442a9ce487afe5431bdbf123f878686 367199: a8d4891eda4672282bb0f5b29000cfc5bd57fd79 367167: ced5d219b289bf89846b1132cabc3bc6b1312996 367103: ca901e4e507b99b6af1134d449bb4015924a1efb v: v3 --- [refs] | 2 +- trunk/arch/metag/kernel/ptrace.c | 34 ++++++++++++++++++++++++++++++++ trunk/include/uapi/linux/elf.h | 1 + 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index bee46122da14..f5b170482791 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 2b8660ed3bfe95523561e6d6a6f1ce91389006b1 +refs/heads/master: 876d6dcdf26a2e860801ec61195e580d03f7b204 diff --git a/trunk/arch/metag/kernel/ptrace.c b/trunk/arch/metag/kernel/ptrace.c index 47a8828615a5..7563628822bd 100644 --- a/trunk/arch/metag/kernel/ptrace.c +++ b/trunk/arch/metag/kernel/ptrace.c @@ -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 = { diff --git a/trunk/include/uapi/linux/elf.h b/trunk/include/uapi/linux/elf.h index 8072d352b98f..ef6103bf1f9b 100644 --- a/trunk/include/uapi/linux/elf.h +++ b/trunk/include/uapi/linux/elf.h @@ -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 */