Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9716951e authored by Ingo Molnar's avatar Ingo Molnar
Browse files

x86: clean up cpu capabilities accesses, generic



Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 0f8d2b92
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -374,7 +374,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
#else
#else
			c->apicid = (ebx >> 24) & 0xFF;
			c->apicid = (ebx >> 24) & 0xFF;
#endif
#endif
			if (c->x86_capability[0] & (1<<19))
			if (test_cpu_cap(c, X86_FEATURE_CLFLSH))
				c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
				c->x86_clflush_size = ((ebx >> 8) & 0xff) * 8;
		} else {
		} else {
			/* Have CPUID level 0 only - unheard of */
			/* Have CPUID level 0 only - unheard of */
+3 −3
Original line number Original line Diff line number Diff line
@@ -687,7 +687,7 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c)


	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
	/* Bit 31 in normal CPUID used for nonstandard 3DNow ID;
	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
	   3DNow is IDd by bit 31 in extended CPUID (1*32+31) anyway */
	clear_bit(0*32+31, (unsigned long *)&c->x86_capability);
	clear_cpu_cap(c, 0*32+31);


	/* On C+ stepping K8 rep microcode works well for copy/memset */
	/* On C+ stepping K8 rep microcode works well for copy/memset */
	level = cpuid_eax(1);
	level = cpuid_eax(1);
@@ -823,7 +823,7 @@ static void __cpuinit early_init_intel(struct cpuinfo_x86 *c)
{
{
	if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
	if ((c->x86 == 0xf && c->x86_model >= 0x03) ||
	    (c->x86 == 0x6 && c->x86_model >= 0x0e))
	    (c->x86 == 0x6 && c->x86_model >= 0x0e))
		set_bit(X86_FEATURE_CONSTANT_TSC, &c->x86_capability);
		set_cpu_cap(c, X86_FEATURE_CONSTANT_TSC);
}
}


static void __cpuinit init_intel(struct cpuinfo_x86 *c)
static void __cpuinit init_intel(struct cpuinfo_x86 *c)
@@ -929,7 +929,7 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c)
			c->x86 += (tfms >> 20) & 0xff;
			c->x86 += (tfms >> 20) & 0xff;
		if (c->x86 >= 0x6)
		if (c->x86 >= 0x6)
			c->x86_model += ((tfms >> 16) & 0xF) << 4;
			c->x86_model += ((tfms >> 16) & 0xF) << 4;
		if (c->x86_capability[0] & (1<<19))
		if (test_cpu_cap(c, X86_FEATURE_CLFLSH))
			c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
			c->x86_clflush_size = ((misc >> 8) & 0xff) * 8;
	} else {
	} else {
		/* Have CPUID level 0 only - unheard of */
		/* Have CPUID level 0 only - unheard of */