Stuff
This commit is contained in:
parent
6675f7eb78
commit
9cca8f9ef6
|
@ -8,9 +8,9 @@
|
||||||
#----------------------------------------------------------------------------#
|
#----------------------------------------------------------------------------#
|
||||||
|
|
||||||
CCNAME="/opt/cross-cc/bin/x86_64-elf-gcc"
|
CCNAME="/opt/cross-cc/bin/x86_64-elf-gcc"
|
||||||
CC2NAME=gcc # compiler for testing
|
CC2NAME=gcc
|
||||||
|
COPTIM=-O2
|
||||||
CLDSCR=-T kernel.ld
|
CLDSCR=-T kernel.ld
|
||||||
COPTIM=-O2 #-fbuiltin-memset
|
|
||||||
CWARNS=-pedantic -Wall -Wextra -Werror
|
CWARNS=-pedantic -Wall -Wextra -Werror
|
||||||
CFLAGS=-nostdlib -ffreestanding -mcmodel=large -mno-red-zone -mno-mmx -mno-sse -mno-sse2
|
CFLAGS=-nostdlib -ffreestanding -mcmodel=large -mno-red-zone -mno-mmx -mno-sse -mno-sse2
|
||||||
CINCLUDES=-I./kaleid
|
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/memory.c -o $(COBJDIR)/lib/memory.o
|
||||||
$(KCC) -c $(COMMDIR)/lib/convert.c -o $(COBJDIR)/lib/convert.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:
|
common-test:
|
||||||
$(CCC) -c $(COMMDIR)/lib/string.c -o $(COBJDIR)/lib/string.o
|
$(CCC) -c $(COMMDIR)/lib/string.c -o $(COBJDIR)/lib/string.o
|
||||||
|
|
|
@ -35,9 +35,9 @@ static inline void *memsetq(void *ptr, ullong uval, size_t qwords)
|
||||||
// Alignment stuff barely matters on modern processors
|
// Alignment stuff barely matters on modern processors
|
||||||
// This may actually be slower than the naive way
|
// 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;
|
const size_t qwords = bytes/QWORD_SIZE;
|
||||||
|
|
||||||
// get rid of everything after the first byte
|
// get rid of everything after the first byte
|
||||||
|
|
Loading…
Reference in New Issue