9os

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 2aec0f02f26857f22c42b51a82dd49b2ef214dce
parent d7e4c85917c6e43fbc1ab25a3663c176c9605b56
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 15 Oct 2020 22:11:39 +0200

os9: Create allocb()

Allocb() is a buffer allocate which returns blocks of
page size that are correctly aligned. The fine grain
allocator (alloc()) is implemented using as base allocb().

Change-Id: Ibf0583a7e015e49b1c4bf2b1b0d1f7d82884ad2c

Diffstat:
Minclude/os9/os9.h | 2--
Msrc/os9/alloc.c | 3+--
2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/include/os9/os9.h b/include/os9/os9.h @@ -111,8 +111,6 @@ struct mach { phyaddr_t ktzero; phyaddr_t phytext; phyaddr_t ptable; - phyaddr_t tables; - long ntables; Map *maps; }; diff --git a/src/os9/alloc.c b/src/os9/alloc.c @@ -22,8 +22,7 @@ allocb(int n) lock(&m); if (npages + n>= NR_BUFFERS) panic("out of memory"); - else - addr= buffertab[npages]; + addr= buffertab[npages]; npages += n; unlock(&m);