From 9cca8f9ef6c41d65dac781788db5c5e3a43a8fe1 Mon Sep 17 00:00:00 2001 From: Julian Barathieu Date: Fri, 28 Dec 2018 19:15:22 +0100 Subject: [PATCH] Stuff --- src/Makefile | 6 +++--- src/kaleid/common/lib/memory.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index cf8c31f..eaa9884 100644 --- a/src/Makefile +++ b/src/Makefile @@ -8,9 +8,9 @@ #----------------------------------------------------------------------------# CCNAME="/opt/cross-cc/bin/x86_64-elf-gcc" -CC2NAME=gcc # compiler for testing +CC2NAME=gcc +COPTIM=-O2 CLDSCR=-T kernel.ld -COPTIM=-O2 #-fbuiltin-memset CWARNS=-pedantic -Wall -Wextra -Werror CFLAGS=-nostdlib -ffreestanding -mcmodel=large -mno-red-zone -mno-mmx -mno-sse -mno-sse2 CINCLUDES=-I./kaleid @@ -70,7 +70,7 @@ common: $(COMMDEPS) $(COMMDIR)/lib/string.c $(COMMDIR)/lib/status.c $(KCC) -c $(COMMDIR)/lib/memory.c -o $(COBJDIR)/lib/memory.o $(KCC) -c $(COMMDIR)/lib/convert.c -o $(COBJDIR)/lib/convert.o -CCC=$(CC2NAME) $(COPTIM) $(CWARNS) $(CDEFINES) $(CINCLUDES) +CCC=$(CC2NAME) $(COPTIM) $(CWARNS) $(CINCLUDES) common-test: $(CCC) -c $(COMMDIR)/lib/string.c -o $(COBJDIR)/lib/string.o diff --git a/src/kaleid/common/lib/memory.c b/src/kaleid/common/lib/memory.c index 547ab79..70c4dbd 100644 --- a/src/kaleid/common/lib/memory.c +++ b/src/kaleid/common/lib/memory.c @@ -35,9 +35,9 @@ static inline void *memsetq(void *ptr, ullong uval, size_t qwords) // Alignment stuff barely matters on modern processors // This may actually be slower than the naive way // -void *memset(void *ptr, int val, size_t bytes) +void *memset(void *ptr, register int val, register size_t bytes) { - uchar *uptr = (uchar *)ptr; + register uchar *uptr = (uchar *)ptr; const size_t qwords = bytes/QWORD_SIZE; // get rid of everything after the first byte