X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=misc%2Ftest_vm%2Fsrc%2Fgeekos%2Fmalloc.c;fp=misc%2Ftest_vm%2Fsrc%2Fgeekos%2Fmalloc.c;h=0000000000000000000000000000000000000000;hp=ea76959f9455ba6cf47000cf471d35244a51fcd4;hb=a70930549d1b741704dd7af4e6bb0e89f6f8a519;hpb=afb634a80f946634454a5d067a92aa600227bd93 diff --git a/misc/test_vm/src/geekos/malloc.c b/misc/test_vm/src/geekos/malloc.c deleted file mode 100644 index ea76959..0000000 --- a/misc/test_vm/src/geekos/malloc.c +++ /dev/null @@ -1,55 +0,0 @@ -/* - * GeekOS memory allocation API - * Copyright (c) 2001, David H. Hovemeyer - * $Revision: 1.1 $ - * - * This is free software. You are permitted to use, - * redistribute, and modify it as specified in the file "COPYING". - */ - -#include -#include -#include -#include -#include - -/* - * Initialize the heap starting at given address and occupying - * specified number of bytes. - */ -void Init_Heap(ulong_t start, ulong_t size) -{ - /*Print("Creating kernel heap: start=%lx, size=%ld\n", start, size);*/ - bpool((void*) start, size); -} - -/* - * Dynamically allocate a buffer of given size. - * Returns null if there is not enough memory to satisfy the - * allocation. - */ -void* Malloc(ulong_t size) -{ - void *result; - bool iflag; - - KASSERT(size > 0); - - iflag = Begin_Int_Atomic(); - result = bget(size); - End_Int_Atomic(iflag); - - return result; -} - -/* - * Free a buffer allocated with Malloc() or Malloc(). - */ -void Free(void* buf) -{ - bool iflag; - - iflag = Begin_Int_Atomic(); - brel(buf); - End_Int_Atomic(iflag); -}