projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] i386: inline assembler: cleanup and encapsulate descriptor and task register...
[firefly-linux-kernel-4.4.55.git]
/
arch
/
i386
/
kernel
/
cpu
/
common.c
diff --git
a/arch/i386/kernel/cpu/common.c
b/arch/i386/kernel/cpu/common.c
index 2203a9d2021251a59776109064d10d558b898574..46ce9b248f5510088ca7fd1765fcfdd86ea44bd9 100644
(file)
--- a/
arch/i386/kernel/cpu/common.c
+++ b/
arch/i386/kernel/cpu/common.c
@@
-435,6
+435,11
@@
void __devinit identify_cpu(struct cpuinfo_x86 *c)
if (c == &boot_cpu_data)
sysenter_setup();
enable_sep_cpu();
if (c == &boot_cpu_data)
sysenter_setup();
enable_sep_cpu();
+
+ if (c == &boot_cpu_data)
+ mtrr_bp_init();
+ else
+ mtrr_ap_init();
}
#ifdef CONFIG_X86_HT
}
#ifdef CONFIG_X86_HT
@@
-608,8
+613,8
@@
void __devinit cpu_init(void)
memcpy(thread->tls_array, &per_cpu(cpu_gdt_table, cpu),
GDT_ENTRY_TLS_ENTRIES * 8);
memcpy(thread->tls_array, &per_cpu(cpu_gdt_table, cpu),
GDT_ENTRY_TLS_ENTRIES * 8);
-
__asm__ __volatile__("lgdt %0" : : "m" (cpu_gdt_descr[cpu])
);
-
__asm__ __volatile__("lidt %0" : : "m" (idt_descr)
);
+
load_gdt(&cpu_gdt_descr[cpu]
);
+
load_idt(&idt_descr
);
/*
* Delete NT
/*
* Delete NT
@@
-637,12
+642,12
@@
void __devinit cpu_init(void)
asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs");
/* Clear all 6 debug registers: */
asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs");
/* Clear all 6 debug registers: */
-
-#define CD(register) set_debugreg(0, register)
-
-
CD(0); CD(1); CD(2); CD(3); /* no db4 and db5 */; CD(6); CD(7
);
-
-#undef CD
+ set_debugreg(0, 0);
+ set_debugreg(0, 1);
+ set_debugreg(0, 2);
+
set_debugreg(0, 3
);
+ set_debugreg(0, 6);
+ set_debugreg(0, 7);
/*
* Force FPU initialization:
/*
* Force FPU initialization: