diff --git a/hermit/arch/x86/include/asm/tasks_types.h b/hermit/arch/x86/include/asm/tasks_types.h index 555c740b2..7287e1eeb 100644 --- a/hermit/arch/x86/include/asm/tasks_types.h +++ b/hermit/arch/x86/include/asm/tasks_types.h @@ -82,10 +82,14 @@ typedef struct { uint64_t reserved[6]; } xsave_header_t; +typedef struct { + uint32_t ymmh_space[64]; +} ymmh_t; + typedef struct { i387_fxsave_t fxsave; xsave_header_t hdr; - uint32_t ymmh[64]; + ymmh_t ymmh; } xsave_t __attribute__ ((aligned (64))); union fpu_state { diff --git a/hermit/arch/x86/kernel/entry.asm b/hermit/arch/x86/kernel/entry.asm index 4fd1fe550..e0c1e3d3f 100644 --- a/hermit/arch/x86/kernel/entry.asm +++ b/hermit/arch/x86/kernel/entry.asm @@ -407,7 +407,7 @@ gdt_flush: ; NASM macro which pushs also an pseudo error code %macro isrstub_pseudo_error 1 global isr%1 - align 8 + align 16 isr%1: push byte 0 ; pseudo error code push byte %1 @@ -419,7 +419,7 @@ gdt_flush: ; on the stack. %macro isrstub 1 global isr%1 - align 8 + align 16 isr%1: push byte %1 jmp common_stub @@ -472,7 +472,7 @@ isrstub_pseudo_error 9 ; NASM macro for asynchronous interrupts (no exceptions) %macro irqstub 1 global irq%1 - align 8 + align 16 irq%1: push byte 0 ; pseudo error code push byte 32+%1 @@ -487,35 +487,35 @@ isrstub_pseudo_error 9 %endrep global apic_timer -align 8 +align 16 apic_timer: push byte 0 ; pseudo error code push byte 123 jmp common_stub global apic_lint0 -align 8 +align 16 apic_lint0: push byte 0 ; pseudo error code push byte 124 jmp common_stub global apic_lint1 -align 8 +align 16 apic_lint1: push byte 0 ; pseudo error code push byte 125 jmp common_stub global apic_error -align 8 +align 16 apic_error: push byte 0 ; pseudo error code push byte 126 jmp common_stub global apic_svr -align 8 +align 16 apic_svr: push byte 0 ; pseudo error code push byte 127 @@ -528,7 +528,7 @@ extern syscall_handler extern kernel_stack global isrsyscall -align 8 +align 16 ; used to realize system calls isrsyscall: ; IF flag is already cleared @@ -586,7 +586,7 @@ isrsyscall: o64 sysret global switch_context -align 8 +align 16 switch_context: ; create on the stack a pseudo interrupt ; afterwards, we switch to the task with iret @@ -618,11 +618,11 @@ switch_context: jmp common_switch -align 8 +align 16 rollback: ret -align 8 +align 16 common_stub: ; do we interrupt user-level code? cmp QWORD [rsp+24], 0x08 @@ -695,7 +695,7 @@ kernel_space2: SECTION .data global mb_info: -align 8 +align 16 mb_info: DQ 0 diff --git a/hermit/arch/x86/kernel/processor.c b/hermit/arch/x86/kernel/processor.c index 24c0a666f..838492e07 100644 --- a/hermit/arch/x86/kernel/processor.c +++ b/hermit/arch/x86/kernel/processor.c @@ -114,11 +114,11 @@ static void restore_fpu_state_xsave(union fpu_state* state) static void fpu_init_xsave(union fpu_state* fpu) { - i387_fsave_t* fp = &fpu->fsave; xsave_t* xs = &fpu->xsave; memset(xs, 0x00, sizeof(xsave_t)); - fp->twd = 0xffffu; + //xs->fxsave.twd = 0xffffu; + xs->fxsave.mxcsr = 0x1f80; } uint32_t detect_cpu_frequency(void) diff --git a/hermit/arch/x86/kernel/tasks.c b/hermit/arch/x86/kernel/tasks.c index 8fdcc4e2b..43d0137ca 100644 --- a/hermit/arch/x86/kernel/tasks.c +++ b/hermit/arch/x86/kernel/tasks.c @@ -38,7 +38,7 @@ #include #include -extern tss_t task_state_segments[MAX_CORES] __attribute__ ((aligned (PAGE_SIZE))); +extern tss_t task_state_segments[MAX_CORES]; size_t* get_current_stack(void) { diff --git a/hermit/newlib/Makefile b/hermit/newlib/Makefile index 75f12e32e..be3b2a85f 100644 --- a/hermit/newlib/Makefile +++ b/hermit/newlib/Makefile @@ -17,8 +17,8 @@ ifeq ($V,0) endif default: $(ARCH) - $Q$(MAKE) ARCH=$(ARCH) TARGET=$(TARGET) CFLAGS+="-ffreestanding -O3 -Wall -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples depend - $Q$(MAKE) ARCH=$(ARCH) TARGET=$(TARGET) CFLAGS+="-ffreestanding -O3 -Wall -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples + $Q$(MAKE) ARCH=$(ARCH) TARGET=$(TARGET) CFLAGS+="-DSTREAM_ARRAY_SIZE=100000 -ffreestanding -O3 -Wall -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples depend + $Q$(MAKE) ARCH=$(ARCH) TARGET=$(TARGET) CFLAGS+="-DSTREAM_ARRAY_SIZE=100000 -ffreestanding -O3 -Wall -I$(NEWLIB)/include -I../../include -I../../arch/$(ARCH)/include" LDFLAGS+="-nostdlib -L$(NEWLIB)/lib" -C examples $(ARCH): @echo Build newlib diff --git a/hermit/newlib/examples/jacobi.c b/hermit/newlib/examples/jacobi.c index 9b57e95e3..335978fa6 100644 --- a/hermit/newlib/examples/jacobi.c +++ b/hermit/newlib/examples/jacobi.c @@ -34,7 +34,7 @@ #include #define MATRIX_SIZE 128 -#define MAXVALUE 1337 +#define MAXVALUE 17 #define PAGE_SIZE 4096 #define CACHE_SIZE (256*1024) #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))