#include "kamui.h"
#include "kamuix.h"
#include "kmgeo.h"


static unsigned char *pCurrentPos;
static unsigned char *pEndPos;

void *
kmmalloc32( unsigned long Size)
{
	void *pVoid;
	pVoid = (void *)pCurrentPos;
	pCurrentPos += (Size + 0x1F) & ~0x1F; /* 32Byte Alignment */
	if(pCurrentPos >= pEndPos) pVoid = (void *)NULL;

	return pVoid;
}


void kmSetWorkArea( void *pStartAddr, unsigned long WorkSize)
{
	pCurrentPos = (unsigned char *)(((unsigned long)pStartAddr + 0x1F) & ~0x1F); 	/* 32Byte Alignment */
	pEndPos		= pCurrentPos + WorkSize;
}

