diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-01-20 16:24:09 -0500 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2012-02-28 17:48:04 -0500 |
commit | f649e9388cd46ad1634164e56f96ae092ca59e4a (patch) | |
tree | 5c5273e46c268a4cfe1cd7ba0ed9419142239ca1 /arch/x86/include/asm/processor.h | |
parent | 6b21d18ed50c7d145220b0724ea7f2613abf0f95 (diff) |
x86: relocate get/set debugreg fcns to include/asm/debugreg.
Since we already have a debugreg.h header file, move the
assoc. get/set functions to it. In addition to it being the
logical home for them, it has a secondary advantage. The
functions that are moved use BUG(). So we really need to
have linux/bug.h in scope. But asm/processor.h is used about
600 times, vs. only about 15 for debugreg.h -- so adding bug.h
to the latter reduces the amount of time we'll be processing
it during a compile.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: "H. Peter Anvin" <hpa@zytor.com>
Diffstat (limited to 'arch/x86/include/asm/processor.h')
-rw-r--r-- | arch/x86/include/asm/processor.h | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 58545c97d071..30aa6e95f814 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -474,61 +474,6 @@ struct thread_struct { | |||
474 | unsigned io_bitmap_max; | 474 | unsigned io_bitmap_max; |
475 | }; | 475 | }; |
476 | 476 | ||
477 | static inline unsigned long native_get_debugreg(int regno) | ||
478 | { | ||
479 | unsigned long val = 0; /* Damn you, gcc! */ | ||
480 | |||
481 | switch (regno) { | ||
482 | case 0: | ||
483 | asm("mov %%db0, %0" :"=r" (val)); | ||
484 | break; | ||
485 | case 1: | ||
486 | asm("mov %%db1, %0" :"=r" (val)); | ||
487 | break; | ||
488 | case 2: | ||
489 | asm("mov %%db2, %0" :"=r" (val)); | ||
490 | break; | ||
491 | case 3: | ||
492 | asm("mov %%db3, %0" :"=r" (val)); | ||
493 | break; | ||
494 | case 6: | ||
495 | asm("mov %%db6, %0" :"=r" (val)); | ||
496 | break; | ||
497 | case 7: | ||
498 | asm("mov %%db7, %0" :"=r" (val)); | ||
499 | break; | ||
500 | default: | ||
501 | BUG(); | ||
502 | } | ||
503 | return val; | ||
504 | } | ||
505 | |||
506 | static inline void native_set_debugreg(int regno, unsigned long value) | ||
507 | { | ||
508 | switch (regno) { | ||
509 | case 0: | ||
510 | asm("mov %0, %%db0" ::"r" (value)); | ||
511 | break; | ||
512 | case 1: | ||
513 | asm("mov %0, %%db1" ::"r" (value)); | ||
514 | break; | ||
515 | case 2: | ||
516 | asm("mov %0, %%db2" ::"r" (value)); | ||
517 | break; | ||
518 | case 3: | ||
519 | asm("mov %0, %%db3" ::"r" (value)); | ||
520 | break; | ||
521 | case 6: | ||
522 | asm("mov %0, %%db6" ::"r" (value)); | ||
523 | break; | ||
524 | case 7: | ||
525 | asm("mov %0, %%db7" ::"r" (value)); | ||
526 | break; | ||
527 | default: | ||
528 | BUG(); | ||
529 | } | ||
530 | } | ||
531 | |||
532 | /* | 477 | /* |
533 | * Set IOPL bits in EFLAGS from given mask | 478 | * Set IOPL bits in EFLAGS from given mask |
534 | */ | 479 | */ |
@@ -574,14 +519,6 @@ static inline void native_swapgs(void) | |||
574 | #define __cpuid native_cpuid | 519 | #define __cpuid native_cpuid |
575 | #define paravirt_enabled() 0 | 520 | #define paravirt_enabled() 0 |
576 | 521 | ||
577 | /* | ||
578 | * These special macros can be used to get or set a debugging register | ||
579 | */ | ||
580 | #define get_debugreg(var, register) \ | ||
581 | (var) = native_get_debugreg(register) | ||
582 | #define set_debugreg(value, register) \ | ||
583 | native_set_debugreg(register, value) | ||
584 | |||
585 | static inline void load_sp0(struct tss_struct *tss, | 522 | static inline void load_sp0(struct tss_struct *tss, |
586 | struct thread_struct *thread) | 523 | struct thread_struct *thread) |
587 | { | 524 | { |