diff options
Diffstat (limited to 'arch/x86/include/asm/processor.h')
-rw-r--r-- | arch/x86/include/asm/processor.h | 99 |
1 files changed, 32 insertions, 67 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index aa9088c26931..4fa7dcceb6c0 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
@@ -14,13 +14,13 @@ struct mm_struct; | |||
14 | #include <asm/sigcontext.h> | 14 | #include <asm/sigcontext.h> |
15 | #include <asm/current.h> | 15 | #include <asm/current.h> |
16 | #include <asm/cpufeature.h> | 16 | #include <asm/cpufeature.h> |
17 | #include <asm/system.h> | ||
18 | #include <asm/page.h> | 17 | #include <asm/page.h> |
19 | #include <asm/pgtable_types.h> | 18 | #include <asm/pgtable_types.h> |
20 | #include <asm/percpu.h> | 19 | #include <asm/percpu.h> |
21 | #include <asm/msr.h> | 20 | #include <asm/msr.h> |
22 | #include <asm/desc_defs.h> | 21 | #include <asm/desc_defs.h> |
23 | #include <asm/nops.h> | 22 | #include <asm/nops.h> |
23 | #include <asm/special_insns.h> | ||
24 | 24 | ||
25 | #include <linux/personality.h> | 25 | #include <linux/personality.h> |
26 | #include <linux/cpumask.h> | 26 | #include <linux/cpumask.h> |
@@ -29,6 +29,15 @@ struct mm_struct; | |||
29 | #include <linux/math64.h> | 29 | #include <linux/math64.h> |
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/err.h> | 31 | #include <linux/err.h> |
32 | #include <linux/irqflags.h> | ||
33 | |||
34 | /* | ||
35 | * We handle most unaligned accesses in hardware. On the other hand | ||
36 | * unaligned DMA can be quite expensive on some Nehalem processors. | ||
37 | * | ||
38 | * Based on this we disable the IP header alignment in network drivers. | ||
39 | */ | ||
40 | #define NET_IP_ALIGN 0 | ||
32 | 41 | ||
33 | #define HBP_NUM 4 | 42 | #define HBP_NUM 4 |
34 | /* | 43 | /* |
@@ -162,6 +171,7 @@ extern void early_cpu_init(void); | |||
162 | extern void identify_boot_cpu(void); | 171 | extern void identify_boot_cpu(void); |
163 | extern void identify_secondary_cpu(struct cpuinfo_x86 *); | 172 | extern void identify_secondary_cpu(struct cpuinfo_x86 *); |
164 | extern void print_cpu_info(struct cpuinfo_x86 *); | 173 | extern void print_cpu_info(struct cpuinfo_x86 *); |
174 | void print_cpu_msr(struct cpuinfo_x86 *); | ||
165 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); | 175 | extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); |
166 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); | 176 | extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); |
167 | extern unsigned short num_cache_leaves; | 177 | extern unsigned short num_cache_leaves; |
@@ -374,6 +384,8 @@ union thread_xstate { | |||
374 | }; | 384 | }; |
375 | 385 | ||
376 | struct fpu { | 386 | struct fpu { |
387 | unsigned int last_cpu; | ||
388 | unsigned int has_fpu; | ||
377 | union thread_xstate *state; | 389 | union thread_xstate *state; |
378 | }; | 390 | }; |
379 | 391 | ||
@@ -451,7 +463,7 @@ struct thread_struct { | |||
451 | unsigned long ptrace_dr7; | 463 | unsigned long ptrace_dr7; |
452 | /* Fault info: */ | 464 | /* Fault info: */ |
453 | unsigned long cr2; | 465 | unsigned long cr2; |
454 | unsigned long trap_no; | 466 | unsigned long trap_nr; |
455 | unsigned long error_code; | 467 | unsigned long error_code; |
456 | /* floating point and extended processor state */ | 468 | /* floating point and extended processor state */ |
457 | struct fpu fpu; | 469 | struct fpu fpu; |
@@ -472,61 +484,6 @@ struct thread_struct { | |||
472 | unsigned io_bitmap_max; | 484 | unsigned io_bitmap_max; |
473 | }; | 485 | }; |
474 | 486 | ||
475 | static inline unsigned long native_get_debugreg(int regno) | ||
476 | { | ||
477 | unsigned long val = 0; /* Damn you, gcc! */ | ||
478 | |||
479 | switch (regno) { | ||
480 | case 0: | ||
481 | asm("mov %%db0, %0" :"=r" (val)); | ||
482 | break; | ||
483 | case 1: | ||
484 | asm("mov %%db1, %0" :"=r" (val)); | ||
485 | break; | ||
486 | case 2: | ||
487 | asm("mov %%db2, %0" :"=r" (val)); | ||
488 | break; | ||
489 | case 3: | ||
490 | asm("mov %%db3, %0" :"=r" (val)); | ||
491 | break; | ||
492 | case 6: | ||
493 | asm("mov %%db6, %0" :"=r" (val)); | ||
494 | break; | ||
495 | case 7: | ||
496 | asm("mov %%db7, %0" :"=r" (val)); | ||
497 | break; | ||
498 | default: | ||
499 | BUG(); | ||
500 | } | ||
501 | return val; | ||
502 | } | ||
503 | |||
504 | static inline void native_set_debugreg(int regno, unsigned long value) | ||
505 | { | ||
506 | switch (regno) { | ||
507 | case 0: | ||
508 | asm("mov %0, %%db0" ::"r" (value)); | ||
509 | break; | ||
510 | case 1: | ||
511 | asm("mov %0, %%db1" ::"r" (value)); | ||
512 | break; | ||
513 | case 2: | ||
514 | asm("mov %0, %%db2" ::"r" (value)); | ||
515 | break; | ||
516 | case 3: | ||
517 | asm("mov %0, %%db3" ::"r" (value)); | ||
518 | break; | ||
519 | case 6: | ||
520 | asm("mov %0, %%db6" ::"r" (value)); | ||
521 | break; | ||
522 | case 7: | ||
523 | asm("mov %0, %%db7" ::"r" (value)); | ||
524 | break; | ||
525 | default: | ||
526 | BUG(); | ||
527 | } | ||
528 | } | ||
529 | |||
530 | /* | 487 | /* |
531 | * Set IOPL bits in EFLAGS from given mask | 488 | * Set IOPL bits in EFLAGS from given mask |
532 | */ | 489 | */ |
@@ -572,14 +529,6 @@ static inline void native_swapgs(void) | |||
572 | #define __cpuid native_cpuid | 529 | #define __cpuid native_cpuid |
573 | #define paravirt_enabled() 0 | 530 | #define paravirt_enabled() 0 |
574 | 531 | ||
575 | /* | ||
576 | * These special macros can be used to get or set a debugging register | ||
577 | */ | ||
578 | #define get_debugreg(var, register) \ | ||
579 | (var) = native_get_debugreg(register) | ||
580 | #define set_debugreg(value, register) \ | ||
581 | native_set_debugreg(register, value) | ||
582 | |||
583 | static inline void load_sp0(struct tss_struct *tss, | 532 | static inline void load_sp0(struct tss_struct *tss, |
584 | struct thread_struct *thread) | 533 | struct thread_struct *thread) |
585 | { | 534 | { |
@@ -924,9 +873,9 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); | |||
924 | #define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? \ | 873 | #define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? \ |
925 | 0xc0000000 : 0xFFFFe000) | 874 | 0xc0000000 : 0xFFFFe000) |
926 | 875 | ||
927 | #define TASK_SIZE (test_thread_flag(TIF_IA32) ? \ | 876 | #define TASK_SIZE (test_thread_flag(TIF_ADDR32) ? \ |
928 | IA32_PAGE_OFFSET : TASK_SIZE_MAX) | 877 | IA32_PAGE_OFFSET : TASK_SIZE_MAX) |
929 | #define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? \ | 878 | #define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_ADDR32)) ? \ |
930 | IA32_PAGE_OFFSET : TASK_SIZE_MAX) | 879 | IA32_PAGE_OFFSET : TASK_SIZE_MAX) |
931 | 880 | ||
932 | #define STACK_TOP TASK_SIZE | 881 | #define STACK_TOP TASK_SIZE |
@@ -948,6 +897,12 @@ extern unsigned long thread_saved_pc(struct task_struct *tsk); | |||
948 | 897 | ||
949 | #define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.sp0 - 1) | 898 | #define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.sp0 - 1) |
950 | extern unsigned long KSTK_ESP(struct task_struct *task); | 899 | extern unsigned long KSTK_ESP(struct task_struct *task); |
900 | |||
901 | /* | ||
902 | * User space RSP while inside the SYSCALL fast path | ||
903 | */ | ||
904 | DECLARE_PER_CPU(unsigned long, old_rsp); | ||
905 | |||
951 | #endif /* CONFIG_X86_64 */ | 906 | #endif /* CONFIG_X86_64 */ |
952 | 907 | ||
953 | extern void start_thread(struct pt_regs *regs, unsigned long new_ip, | 908 | extern void start_thread(struct pt_regs *regs, unsigned long new_ip, |
@@ -1019,4 +974,14 @@ extern bool cpu_has_amd_erratum(const int *); | |||
1019 | #define cpu_has_amd_erratum(x) (false) | 974 | #define cpu_has_amd_erratum(x) (false) |
1020 | #endif /* CONFIG_CPU_SUP_AMD */ | 975 | #endif /* CONFIG_CPU_SUP_AMD */ |
1021 | 976 | ||
977 | void cpu_idle_wait(void); | ||
978 | |||
979 | extern unsigned long arch_align_stack(unsigned long sp); | ||
980 | extern void free_init_pages(char *what, unsigned long begin, unsigned long end); | ||
981 | |||
982 | void default_idle(void); | ||
983 | bool set_pm_idle_to_default(void); | ||
984 | |||
985 | void stop_this_cpu(void *dummy); | ||
986 | |||
1022 | #endif /* _ASM_X86_PROCESSOR_H */ | 987 | #endif /* _ASM_X86_PROCESSOR_H */ |