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