Compare commits
No commits in common. "3b7543064d2a6087e4c00e619b4a40545d5db5d3" and "f64bbd9d9015467647f82e9049ebca848fd15365" have entirely different histories.
3b7543064d
...
f64bbd9d90
2
Makefile
2
Makefile
|
@ -20,7 +20,7 @@ cobj=$(csrc:%.c=%.o) arch/$(ARCH)/cpu_context_switch.o arch/$(ARCH)/irq_pit.o
|
|||
deps = $(csrc:%.c=%.d)
|
||||
|
||||
kernel:$(asmobj) $(cobj) linker.ld
|
||||
$(CC) -m32 -ffreestanding -nostdlib $(cobj) $(asmobj) -o $@ -T linker.ld -lgcc
|
||||
$(CC) -m32 -ffreestanding -nostdlib $(cobj) $(asmobj) -o $@ -T linker.ld -lgcc -no-pie
|
||||
objcopy --only-keep-debug $@ $@.sym
|
||||
objcopy --strip-debug $@
|
||||
|
||||
|
|
10
core/alloc.c
10
core/alloc.c
|
@ -217,8 +217,9 @@ static void *allocFromSlab(struct slabEntry *slab)
|
|||
if (*next == (vaddr_t)NULL) {
|
||||
pr_devel("Slab @%d is now full\n", slab);
|
||||
slab->full = 1;
|
||||
} else {
|
||||
slab->freeEl = (void *)(*next);
|
||||
}
|
||||
slab->freeEl = (void *)(*next);
|
||||
|
||||
return (void *)next;
|
||||
}
|
||||
|
@ -288,7 +289,12 @@ static int freeFromSlab(void *ptr, struct slabEntry *slab)
|
|||
if ((slabEntry->page <= (vaddr_t)ptr) &&
|
||||
((vaddr_t)ptr < (slabEntry->page + slabEntry->size))) {
|
||||
|
||||
*((vaddr_t *)ptr) = (vaddr_t)slabEntry->freeEl;
|
||||
if (slabEntry->full) {
|
||||
*((vaddr_t *)ptr) = (vaddr_t)NULL;
|
||||
} else {
|
||||
*((vaddr_t *)ptr) = (vaddr_t)slabEntry->freeEl;
|
||||
}
|
||||
|
||||
slabEntry->freeEl = ptr;
|
||||
slabEntry->full = 0;
|
||||
return 1;
|
||||
|
|
Loading…
Reference in New Issue