Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions common/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ bool_cmd("apic_timer", opt_apic_timer);
bool opt_hpet = false;
bool_cmd("hpet", opt_hpet);

bool opt_fpu = false;
bool_cmd("fpu", opt_fpu);

io_port_t __data_rmode com_ports[2] = {COM1_PORT, COM2_PORT};

boot_flags_t boot_flags;
Expand Down Expand Up @@ -303,6 +306,11 @@ void __noreturn __text_init kernel_start(uint32_t multiboot_magic,
if (opt_keyboard)
init_keyboard(get_bsp_cpu_id());

if (opt_fpu) {
printk("Enabling FPU instructions support\n");
enable_fpu();
}

#ifdef KTF_PMU
printk("Initializing PFM library\n");

Expand Down
2 changes: 1 addition & 1 deletion include/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ static inline unsigned long ipow(int base, unsigned int exp) {
return result;
}

static inline void enable_sse(void) {
static inline void enable_fpu(void) {
write_cr0((read_cr0() & ~X86_CR0_EM) | X86_CR0_MP);
write_cr4(read_cr4() | X86_CR4_OSFXSR | X86_CR4_OSXMMEXCPT);
}
Expand Down