user_space #4

Merged
mathieu merged 40 commits from user_space into master 2021-11-04 16:17:36 +01:00
2 changed files with 4 additions and 7 deletions
Showing only changes of commit 55e709adb5 - Show all commits

View File

@ -49,7 +49,6 @@ int allocSetup(size_t sizeOfArea, vaddr_t *areaAddr, vaddr_t *descAddr, vaddr_t
*descAddr = (vaddr_t)allocGetSlab(sizeof(struct slabDesc)); *descAddr = (vaddr_t)allocGetSlab(sizeof(struct slabDesc));
assert(allocBookSlab(sizeof(struct slabEntry), PAGE_SIZE, TRUE, FALSE) == 0); assert(allocBookSlab(sizeof(struct slabEntry), PAGE_SIZE, TRUE, FALSE) == 0);
*entryAddr = (vaddr_t)allocGetSlab(sizeof(struct slabEntry)); *entryAddr = (vaddr_t)allocGetSlab(sizeof(struct slabEntry));
printf("allocSetup for sizeOfArea %d\n", sizeOfArea);
assert(allocBookSlab(sizeOfArea, PAGE_SIZE, TRUE, TRUE) == 0); assert(allocBookSlab(sizeOfArea, PAGE_SIZE, TRUE, TRUE) == 0);
*areaAddr = (vaddr_t)allocGetSlab(sizeOfArea); *areaAddr = (vaddr_t)allocGetSlab(sizeOfArea);
allocInitialized = TRUE; allocInitialized = TRUE;

View File

@ -112,10 +112,9 @@ vaddr_t areaBook(unsigned int nbPages, uint32_t flags)
} }
} }
if (page == (paddr_t)NULL) { if (page == (paddr_t)NULL) {
printf("Ooops\n"); areaFree(allocated);
// TODO
// assert(0);
restore_IRQs(irqFlags); restore_IRQs(irqFlags);
return (vaddr_t)NULL; return (vaddr_t)NULL;
} }
} }
@ -175,10 +174,9 @@ vaddr_t areaAlloc(unsigned int nbPages, uint32_t flags)
} }
} }
if (page == (paddr_t)NULL) { if (page == (paddr_t)NULL) {
printf("Ooops\n"); areaFree(allocated->startAddr);
// TODO
// assert(0);
restore_IRQs(irqFlags); restore_IRQs(irqFlags);
return (vaddr_t)NULL; return (vaddr_t)NULL;
} }
} }