mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

Refactor the CPU flags handling out of the cpucheck routines so that they can be reused by the future ASLR routines (in order to detect CPU features like RDRAND and RDTSC). This reworks has_eflag() and has_fpu() to be used on both 32-bit and 64-bit, and refactors the calls to cpuid to make them PIC-safe on 32-bit. Signed-off-by: Kees Cook <keescook@chromium.org> Link: http://lkml.kernel.org/r/1381450698-28710-2-git-send-email-keescook@chromium.org Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 lines
145 B
C
12 lines
145 B
C
#ifdef CONFIG_RANDOMIZE_BASE
|
|
|
|
#include "../cpuflags.c"
|
|
|
|
bool has_cpuflag(int flag)
|
|
{
|
|
get_flags();
|
|
|
|
return test_bit(flag, cpu.flags);
|
|
}
|
|
|
|
#endif
|