mirror of
https://github.com/limine-bootloader/limine
synced 2024-12-11 17:24:08 +03:00
Fix bug with clobbers of cpuid function
This commit is contained in:
parent
155362570e
commit
2150daaf9a
@ -1,4 +1,5 @@
|
||||
CC = ../toolchain/bin/i386-elf-gcc
|
||||
LD = ../toolchain/bin/i386-elf-gcc
|
||||
|
||||
CFLAGS = -Os -pipe -Wall -Wextra
|
||||
|
||||
@ -31,7 +32,7 @@ OBJ := $(C_FILES:.c=.o)
|
||||
all: qloader2.bin
|
||||
|
||||
qloader2.bin: $(OBJ)
|
||||
$(CC) $(OBJ) $(LDFLAGS) $(INTERNAL_LDFLAGS) -o stage2.bin
|
||||
$(LD) $(OBJ) $(LDFLAGS) $(INTERNAL_LDFLAGS) -o stage2.bin
|
||||
cd bootsect && nasm bootsect.asm -fbin -o ../qloader2.bin
|
||||
|
||||
%.o: %.c
|
||||
|
@ -20,7 +20,7 @@ int cpuid(uint32_t leaf, uint32_t subleaf,
|
||||
uint32_t cpuid_max;
|
||||
ASM("cpuid\n\t", "=a" (cpuid_max)
|
||||
: "a" (leaf & 0x80000000)
|
||||
: "rbx", "rcx", "rdx");
|
||||
: "ebx", "ecx", "edx");
|
||||
if (leaf > cpuid_max)
|
||||
return 1;
|
||||
ASM("cpuid\n\t", "=a" (*eax), "=b" (*ebx), "=c" (*ecx), "=d" (*edx)
|
||||
|
Loading…
Reference in New Issue
Block a user