minix/servers/vm/util.h
Ben Gras c78250332d let vm use physically fragmented memory for allocations.
map_copy_ph_block is replaced by map_clone_ph_block, which can
replace a single physical block by multiple physical blocks.

also,
 . merge map_mem.c with region.c, as they manipulate the same
   data structures
 . NOTRUNNABLE removed as sanity check
 . use direct functions for ALLOC_MEM and FREE_MEM again
 . add some checks to shared memory mapping code
 . fix for data structure integrity when using shared memory
 . fix sanity checks
2010-04-12 11:25:24 +00:00

24 lines
383 B
C

#ifndef _UTIL_H
#define _UTIL_H 1
#include "vm.h"
#include "glo.h"
#define ELEMENTS(a) (sizeof(a)/sizeof((a)[0]))
#if SANITYCHECKS
#define vm_assert(cond) { \
if(vm_sanitychecklevel > 0 && !(cond)) { \
printf("VM:%s:%d: vm_assert failed: %s\n", \
__FILE__, __LINE__, #cond); \
panic("vm_assert failed"); \
} \
}
#else
#define vm_assert(cond) ;
#endif
#endif