/** * \file */ #include "cpu/arch_consts.h" #include #include #include #define KMALLOC_BMAP_SZ (((KMALLOC_SZ*1024)/4)/8) //!< The size of the kmalloc bitmap static char bitmap[KMALLOC_BMAP_SZ]; //!< Bitmap of used areas of the heap static void* data=(void*)KMALLOC_START; //!< Start of the kmalloc heap /** * Get a bit in the heap bitmap * \param index The bit to get * \return the bit */ static char get_bmap_bit(size_t index) { size_t byte=index/8; size_t bit=index%8; char entry=bitmap[byte]; return (entry&(1<0; } /** * Set a bit in the heap bitmap * \param index The bit to set */ static void set_bmap_bit(size_t index) { size_t byte=index/8; size_t bit=index%8; bitmap[byte]=bitmap[byte]|(1<