T-Engine源代码
基于ARM9平台
源代码在线查看: libtk.h
/* *---------------------------------------------------------------------- * T-Kernel * * Copyright (C) 2004-2008 by Ken Sakamura. All rights reserved. * T-Kernel is distributed under the T-License. *---------------------------------------------------------------------- * * Version: 1.02.04 * Released by T-Engine Forum(http://www.t-engine.org) at 2008/02/29. * *---------------------------------------------------------------------- */ /* * @(#)libtk.h (libtk) * * T-Kernel library common definitions */ #include #include #include #include #include /* * Initialization and deletion of library internal shared exclusive * control lock */ IMPORT ER _init_liblock( void ); IMPORT void _delete_liblock( void ); /* ------------------------------------------------------------------------ */ IMPORT MACB _Kmacb; /* Kmalloc control block */ IMPORT MACB _Vmacb; /* Vmalloc control block */ IMPORT MACB _Smacb; /* Smalloc control block */ /* * Memory allocation exclusion control */ #define MEMLOCK(ERR_RET) { \ if ( _lib_lock(_LL_MEMALLOC, TRUE) < E_OK ) { \ ERR_RET; \ } \ } #define MEMUNLOCK() { \ _lib_unlock(_LL_MEMALLOC); \ } /* ------------------------------------------------------------------------ */