Skip to content
Snippets Groups Projects
Commit 69ad526e authored by Yuanzhe Zhou's avatar Yuanzhe Zhou
Browse files

Q9 done

parent 419e5e69
Branches
Tags
2 merge requests!10Tp1,!5WIP: Tp1
# Empty dependencies file for cpuid.
# This may be replaced when dependencies are built.
# CMAKE generated file: DO NOT EDIT!
# Generated by "Unix Makefiles" Generator, CMake Version 3.5
CMakeFiles/cpuid.dir/tests/cpuid.cpp.o: ../src/utils.hpp
CMakeFiles/cpuid.dir/tests/cpuid.cpp.o: ../tests/cpuid.cpp
......@@ -65,9 +65,15 @@ extern "C" long int cpuid(unsigned int CPUInfo[4], unsigned int InfoTypeEax, uns
__asm__(
".global cpuid \n"
"cpuid: \n"
// Save rbx, move %esi to %eax, and %edx to %ecx
"pushq %rbx \n"
"movl %esi, %eax \n"
"movl %edx, %ecx \n"
"cpuid;\n"
// Save %eax, %ebx, %ecx, %edx into CPUInfo, and restore rbx
"movl %ebx, 4(%rdi) \n"
"popq %rbx \n"
"movl %eax, (%rdi) \n"
"movl %ecx, 8(%rdi) \n"
"movl %edx, 12(%rdi) \n"
"ret;\n"
);
......
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