diff options
author | Anton Kling <anton@kling.gg> | 2024-02-22 17:28:08 +0100 |
---|---|---|
committer | Anton Kling <anton@kling.gg> | 2024-02-22 17:28:55 +0100 |
commit | a18da25e7355979d0f26cfd39dc0032172e8b135 (patch) | |
tree | 2af66bedd0dff4bbccffc8d82cd06836d7f68e0d /userland/windowserver | |
parent | 9b475d3db3275d4c34f02161ae70ced5595a0fdb (diff) |
Kernel: Fix undefined behavior and cleanup functions.
The int_syscall caused crashes for higher level of optimizations. To fix
this I rewrote the function in assembly as I deemed it to be simpler.
Diffstat (limited to 'userland/windowserver')
-rw-r--r-- | userland/windowserver/Makefile | 5 | ||||
-rw-r--r-- | userland/windowserver/ws.c | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/userland/windowserver/Makefile b/userland/windowserver/Makefile index 7f80f2e..0adbdaa 100644 --- a/userland/windowserver/Makefile +++ b/userland/windowserver/Makefile @@ -1,5 +1,6 @@ CC="i686-sb-gcc" -CFLAGS = -ggdb -ffreestanding -O2 -Wall -Wextra -pedantic -mgeneral-regs-only -Wimplicit-fallthrough +#CFLAGS = -ggdb -ffreestanding -O2 -Wall -Wextra -pedantic -mgeneral-regs-only -Wimplicit-fallthrough +CFLAGS = -ggdb -ffreestanding -Ofast -Wall -Wextra -pedantic -mgeneral-regs-only -Wimplicit-fallthrough BIN=ws LIB=-lgcc INC=-I../libgui/ @@ -13,4 +14,4 @@ clean: rm $(OBJ) ws $(BIN): $(OBJ) - $(CC) -o $(BIN) $(CFLAGS) $(OBJ) $(LIB) + $(CC) -flto -o $(BIN) $(CFLAGS) $(OBJ) $(LIB) diff --git a/userland/windowserver/ws.c b/userland/windowserver/ws.c index a438566..a4f5a59 100644 --- a/userland/windowserver/ws.c +++ b/userland/windowserver/ws.c @@ -333,8 +333,8 @@ void parse_mouse_event(int fd) { x |= 0xFF00; if (ys) y |= 0xFF00; - xc += *(int16_t *)&x; - yc += *(int16_t *)&y; + xc += x; + yc += y; } } mouse_x += xc; |