git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[pandora-kernel.git]
/
arch
/
i386
/
kernel
/
cpu
/
common.c
diff --git
a/arch/i386/kernel/cpu/common.c
b/arch/i386/kernel/cpu/common.c
index
1b34c56
..
dcbbd0a
100644
(file)
--- a/
arch/i386/kernel/cpu/common.c
+++ b/
arch/i386/kernel/cpu/common.c
@@
-54,7
+54,7
@@
static struct cpu_dev __cpuinitdata default_cpu = {
.c_init = default_init,
.c_vendor = "Unknown",
};
.c_init = default_init,
.c_vendor = "Unknown",
};
-static struct cpu_dev * this_cpu = &default_cpu;
+static struct cpu_dev * this_cpu
__cpuinitdata
= &default_cpu;
static int __init cachesize_setup(char *str)
{
static int __init cachesize_setup(char *str)
{
@@
-605,7
+605,7
@@
void __init early_cpu_init(void)
struct pt_regs * __devinit idle_regs(struct pt_regs *regs)
{
memset(regs, 0, sizeof(struct pt_regs));
struct pt_regs * __devinit idle_regs(struct pt_regs *regs)
{
memset(regs, 0, sizeof(struct pt_regs));
- regs->x
g
s = __KERNEL_PDA;
+ regs->x
f
s = __KERNEL_PDA;
return regs;
}
return regs;
}
@@
-662,12
+662,12
@@
struct i386_pda boot_pda = {
.pcurrent = &init_task,
};
.pcurrent = &init_task,
};
-static inline void set_kernel_
g
s(void)
+static inline void set_kernel_
f
s(void)
{
{
- /* Set %
g
s for this CPU's PDA. Memory clobber is to create a
+ /* Set %
f
s for this CPU's PDA. Memory clobber is to create a
barrier with respect to any PDA operations, so the compiler
doesn't move any before here. */
barrier with respect to any PDA operations, so the compiler
doesn't move any before here. */
- asm volatile ("mov %0, %%
g
s" : : "r" (__KERNEL_PDA) : "memory");
+ asm volatile ("mov %0, %%
f
s" : : "r" (__KERNEL_PDA) : "memory");
}
/* Initialize the CPU's GDT and PDA. The boot CPU does this for
}
/* Initialize the CPU's GDT and PDA. The boot CPU does this for
@@
-710,18
+710,22
@@
__cpuinit int init_gdt(int cpu, struct task_struct *idle)
return 1;
}
return 1;
}
-/* Common CPU init for both boot and secondary CPUs */
-static void __cpuinit _cpu_init(int cpu, struct task_struct *curr)
+void __cpuinit cpu_set_gdt(int cpu)
{
{
- struct tss_struct * t = &per_cpu(init_tss, cpu);
- struct thread_struct *thread = &curr->thread;
struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, cpu);
/* Reinit these anyway, even if they've already been done (on
the boot CPU, this will transition from the boot gdt+pda to
the real ones). */
load_gdt(cpu_gdt_descr);
struct Xgt_desc_struct *cpu_gdt_descr = &per_cpu(cpu_gdt_descr, cpu);
/* Reinit these anyway, even if they've already been done (on
the boot CPU, this will transition from the boot gdt+pda to
the real ones). */
load_gdt(cpu_gdt_descr);
- set_kernel_gs();
+ set_kernel_fs();
+}
+
+/* Common CPU init for both boot and secondary CPUs */
+static void __cpuinit _cpu_init(int cpu, struct task_struct *curr)
+{
+ struct tss_struct * t = &per_cpu(init_tss, cpu);
+ struct thread_struct *thread = &curr->thread;
if (cpu_test_and_set(cpu, cpu_initialized)) {
printk(KERN_WARNING "CPU#%d already initialized!\n", cpu);
if (cpu_test_and_set(cpu, cpu_initialized)) {
printk(KERN_WARNING "CPU#%d already initialized!\n", cpu);
@@
-760,8
+764,8
@@
static void __cpuinit _cpu_init(int cpu, struct task_struct *curr)
__set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss);
#endif
__set_tss_desc(cpu, GDT_ENTRY_DOUBLEFAULT_TSS, &doublefault_tss);
#endif
- /* Clear %
f
s. */
- asm volatile ("mov %0, %%
f
s" : : "r" (0));
+ /* Clear %
g
s. */
+ asm volatile ("mov %0, %%
g
s" : : "r" (0));
/* Clear all 6 debug registers: */
set_debugreg(0, 0);
/* Clear all 6 debug registers: */
set_debugreg(0, 0);
@@
-807,6
+811,7
@@
void __cpuinit cpu_init(void)
local_irq_enable();
}
local_irq_enable();
}
+ cpu_set_gdt(cpu);
_cpu_init(cpu, curr);
}
_cpu_init(cpu, curr);
}