mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
x86 asm: CPUID mov in from x86-assembly-cheat
This commit is contained in:
33
userland/arch/x86_64/cpuid.S
Normal file
33
userland/arch/x86_64/cpuid.S
Normal file
@@ -0,0 +1,33 @@
|
||||
/* https://github.com/cirosantilli/linux-kernel-module-cheat#x86-cpuid-instruction */
|
||||
|
||||
#include <lkmc.h>
|
||||
|
||||
LKMC_PROLOGUE
|
||||
mov $0, %eax
|
||||
cpuid
|
||||
|
||||
/* Save the other registers. */
|
||||
mov %ebx, %r12d
|
||||
mov %ecx, %r13d
|
||||
mov %edx, %r14d
|
||||
|
||||
/* eax */
|
||||
mov %eax, %edi
|
||||
call lkmc_print_hex_32
|
||||
call lkmc_print_newline
|
||||
|
||||
/* ebx */
|
||||
mov %r12d, %edi
|
||||
call lkmc_print_hex_32
|
||||
call lkmc_print_newline
|
||||
|
||||
/* ecx */
|
||||
mov %r13d, %edi
|
||||
call lkmc_print_hex_32
|
||||
call lkmc_print_newline
|
||||
|
||||
/* edx */
|
||||
mov %r14d, %edi
|
||||
call lkmc_print_hex_32
|
||||
call lkmc_print_newline
|
||||
LKMC_EPILOGUE
|
||||
Reference in New Issue
Block a user