Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86781
b: refs/heads/master
c: d31472b
h: refs/heads/master
i:
  86779: ea60867
v: v3
  • Loading branch information
Roland McGrath authored and Linus Torvalds committed Mar 5, 2008
1 parent 8fd0db2 commit 09cf52e
Show file tree
Hide file tree
Showing 2 changed files with 16 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: 938a9204e0df070bfbaac71f6403cebed76763ad
refs/heads/master: d31472b6d4f799a68d877f69b2f843eec5875472
15 changes: 15 additions & 0 deletions trunk/fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,18 @@ struct elf_note_info {
int thread_notes;
};

/*
* When a regset has a writeback hook, we call it on each thread before
* dumping user memory. On register window machines, this makes sure the
* user memory backing the register data is up to date before we read it.
*/
static void do_thread_regset_writeback(struct task_struct *task,
const struct user_regset *regset)
{
if (regset->writeback)
regset->writeback(task, regset, 1);
}

static int fill_thread_core_info(struct elf_thread_core_info *t,
const struct user_regset_view *view,
long signr, size_t *total)
Expand All @@ -1445,13 +1457,16 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
sizeof(t->prstatus), &t->prstatus);
*total += notesize(&t->notes[0]);

do_thread_regset_writeback(t->task, &view->regsets[0]);

/*
* Each other regset might generate a note too. For each regset
* that has no core_note_type or is inactive, we leave t->notes[i]
* all zero and we'll know to skip writing it later.
*/
for (i = 1; i < view->n; ++i) {
const struct user_regset *regset = &view->regsets[i];
do_thread_regset_writeback(t->task, regset);
if (regset->core_note_type &&
(!regset->active || regset->active(t->task, regset))) {
int ret;
Expand Down

0 comments on commit 09cf52e

Please sign in to comment.