Commit 6e6a4932 authored by H. Peter Anvin's avatar H. Peter Anvin

x86, boot: Rename get_flags() and check_flags() to *_cpuflags()

When a function is used in more than one file it may not be possible
to immediately tell from context what the intended meaning is.  As
such, it is more important that the naming be self-evident.  Thus,
change get_flags() to get_cpuflags().

For consistency, change check_flags() to check_cpuflags() even though
it is only used in cpucheck.c.

Link: http://lkml.kernel.org/r/1381450698-28710-2-git-send-email-keescook@chromium.orgSigned-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
parent 6145cfe3
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
bool has_cpuflag(int flag) bool has_cpuflag(int flag)
{ {
get_flags(); get_cpuflags();
return test_bit(flag, cpu.flags); return test_bit(flag, cpu.flags);
} }
......
...@@ -68,7 +68,7 @@ static int is_transmeta(void) ...@@ -68,7 +68,7 @@ static int is_transmeta(void)
} }
/* Returns a bitmask of which words we have error bits in */ /* Returns a bitmask of which words we have error bits in */
static int check_flags(void) static int check_cpuflags(void)
{ {
u32 err; u32 err;
int i; int i;
...@@ -101,8 +101,8 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr) ...@@ -101,8 +101,8 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
if (has_eflag(X86_EFLAGS_AC)) if (has_eflag(X86_EFLAGS_AC))
cpu.level = 4; cpu.level = 4;
get_flags(); get_cpuflags();
err = check_flags(); err = check_cpuflags();
if (test_bit(X86_FEATURE_LM, cpu.flags)) if (test_bit(X86_FEATURE_LM, cpu.flags))
cpu.level = 64; cpu.level = 64;
...@@ -121,8 +121,8 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr) ...@@ -121,8 +121,8 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
eax &= ~(1 << 15); eax &= ~(1 << 15);
asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx)); asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx));
get_flags(); /* Make sure it really did something */ get_cpuflags(); /* Make sure it really did something */
err = check_flags(); err = check_cpuflags();
} else if (err == 0x01 && } else if (err == 0x01 &&
!(err_flags[0] & ~(1 << X86_FEATURE_CX8)) && !(err_flags[0] & ~(1 << X86_FEATURE_CX8)) &&
is_centaur() && cpu.model >= 6) { is_centaur() && cpu.model >= 6) {
...@@ -137,7 +137,7 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr) ...@@ -137,7 +137,7 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx)); asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx));
set_bit(X86_FEATURE_CX8, cpu.flags); set_bit(X86_FEATURE_CX8, cpu.flags);
err = check_flags(); err = check_cpuflags();
} else if (err == 0x01 && is_transmeta()) { } else if (err == 0x01 && is_transmeta()) {
/* Transmeta might have masked feature bits in word 0 */ /* Transmeta might have masked feature bits in word 0 */
...@@ -152,7 +152,7 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr) ...@@ -152,7 +152,7 @@ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr)
: : "ecx", "ebx"); : : "ecx", "ebx");
asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx)); asm("wrmsr" : : "a" (eax), "d" (edx), "c" (ecx));
err = check_flags(); err = check_cpuflags();
} }
if (err_flags_ptr) if (err_flags_ptr)
......
...@@ -65,7 +65,7 @@ static inline void cpuid(u32 id, u32 *a, u32 *b, u32 *c, u32 *d) ...@@ -65,7 +65,7 @@ static inline void cpuid(u32 id, u32 *a, u32 *b, u32 *c, u32 *d)
); );
} }
void get_flags(void) void get_cpuflags(void)
{ {
u32 max_intel_level, max_amd_level; u32 max_intel_level, max_amd_level;
u32 tfms; u32 tfms;
......
...@@ -14,6 +14,6 @@ extern struct cpu_features cpu; ...@@ -14,6 +14,6 @@ extern struct cpu_features cpu;
extern u32 cpu_vendor[3]; extern u32 cpu_vendor[3];
int has_eflag(unsigned long mask); int has_eflag(unsigned long mask);
void get_flags(void); void get_cpuflags(void);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment