Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 367231
b: refs/heads/master
c: 876d6dc
h: refs/heads/master
i:
  367229: efc72dd
  367227: 0727cda
  367223: 7506dbb
  367215: 3aa2021
  367199: a8d4891
  367167: ced5d21
  367103: ca901e4
v: v3
  • Loading branch information
Paul Clothier authored and James Hogan committed Mar 27, 2013
1 parent fcc34f5 commit 1ead25a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2b8660ed3bfe95523561e6d6a6f1ce91389006b1
refs/heads/master: 876d6dcdf26a2e860801ec61195e580d03f7b204
34 changes: 34 additions & 0 deletions trunk/arch/metag/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions trunk/include/uapi/linux/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 1ead25a

Please sign in to comment.