Skip to content

Commit

Permalink
x86, ptrace: PEBS support, warning fix
Browse files Browse the repository at this point in the history
arch/x86/kernel/process_32.c:566: warning: unused variable 'ds_next'
arch/x86/kernel/process_32.c:566: warning: unused variable 'ds_prev'

Cc: Markus Metzger <markus.t.metzger@intel.com>
Cc: Andi Kleen <ak@suse.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Siddha, Suresh B" <suresh.b.siddha@intel.com>
Cc: Roland McGrath <roland@redhat.com>
Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
Cc: <juan.villacis@intel.com>
Cc: stephane eranian <eranian@googlemail.com>
Cc: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Andrew Morton authored and Ingo Molnar committed May 12, 2008
1 parent 93fa763 commit 970e725
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions arch/x86/kernel/process_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,20 +484,13 @@ int set_tsc_mode(unsigned int val)
return 0;
}

static noinline void
__switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
struct tss_struct *tss)
#ifdef CONFIG_X86_DS
static int update_debugctl(struct thread_struct *prev,
struct thread_struct *next, unsigned long debugctl)
{
struct thread_struct *prev, *next;
unsigned long debugctl;
unsigned long ds_prev = 0, ds_next = 0;
unsigned long ds_prev = 0;
unsigned long ds_next = 0;

prev = &prev_p->thread;
next = &next_p->thread;

debugctl = prev->debugctlmsr;

#ifdef CONFIG_X86_DS
if (prev->ds_ctx)
ds_prev = (unsigned long)prev->ds_ctx->ds;
if (next->ds_ctx)
Expand All @@ -510,8 +503,28 @@ __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
update_debugctlmsr(0);
wrmsr(MSR_IA32_DS_AREA, ds_next, 0);
}
return debugctl;
}
#else
static int update_debugctl(struct thread_struct *prev,
struct thread_struct *next, unsigned long debugctl)
{
return debugctl;
}
#endif /* CONFIG_X86_DS */

static noinline void
__switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
struct tss_struct *tss)
{
struct thread_struct *prev, *next;
unsigned long debugctl;

prev = &prev_p->thread;
next = &next_p->thread;

debugctl = update_debugctl(prev, next, prev->debugctlmsr);

if (next->debugctlmsr != debugctl)
update_debugctlmsr(next->debugctlmsr);

Expand Down

0 comments on commit 970e725

Please sign in to comment.