Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2903
b: refs/heads/master
c: e9129e5
h: refs/heads/master
i:
  2901: d1f015e
  2899: 68b8fba
  2895: 6f96a27
v: v3
  • Loading branch information
Vincent Hanquez authored and Linus Torvalds committed Jun 23, 2005
1 parent 2876341 commit 1e50078
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 717b594a415bfaf2dbd5e8266636488f2564c689
refs/heads/master: e9129e56e9ec50c0689eb4cf7a3ca132f1e776db
2 changes: 1 addition & 1 deletion trunk/arch/x86_64/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
* inside the kernel.
*/
if (current->thread.debugreg7)
asm volatile("movq %0,%%db7" : : "r" (current->thread.debugreg7));
set_debugreg(current->thread.debugreg7, 7);

/* Whee! Actually deliver the signal. */
return handle_signal(signr, &info, &ka, oldset, regs);
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/x86_64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ asmlinkage void do_debug(struct pt_regs * regs, unsigned long error_code)
}
#endif

asm("movq %%db6,%0" : "=r" (condition));
get_debugreg(condition, 6);

if (notify_die(DIE_DEBUG, "debug", regs, condition, error_code,
SIGTRAP) == NOTIFY_STOP)
Expand Down Expand Up @@ -721,7 +721,7 @@ asmlinkage void do_debug(struct pt_regs * regs, unsigned long error_code)
info.si_addr = (void __user *)regs->rip;
force_sig_info(SIGTRAP, &info, tsk);
clear_dr7:
asm volatile("movq %0,%%db7"::"r"(0UL));
set_debugreg(0UL, 7);
return;

clear_TF_reenable:
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/asm-x86_64/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,14 @@ struct thread_struct {
set_fs(USER_DS); \
} while(0)

#define get_debugreg(var, register) \
__asm__("movq %%db" #register ", %0" \
:"=r" (var))
#define set_debugreg(value, register) \
__asm__("movq %0,%%db" #register \
: /* no output */ \
:"r" (value))

struct task_struct;
struct mm_struct;

Expand Down

0 comments on commit 1e50078

Please sign in to comment.