gonzui


Format: Advanced Search

tkernel_2/lib/libtk/src/libtk.hbare sourcepermlink (0.01 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    T-Kernel 2.0 Software Package
    4:  *
    5:  *    Copyright 2011 by Ken Sakamura.
    6:  *    This software is distributed under the latest version of T-License 2.x.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
   10:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   11:  *
   12:  *----------------------------------------------------------------------
   13:  */
   14: 
   15: /*
   16:  *      @(#)libtk.h (libtk)
   17:  *
   18:  *      T-Kernel library common definitions
   19:  */
   20: 
   21: #include <basic.h>
   22: #include <tk/tkernel.h>
   23: #include <tk/sysmgr.h>
   24: #include <sys/libs.h>
   25: #include <sys/memalloc.h>
   26: 
   27: /*
   28:  * Initialization and deletion of library internal shared exclusive
   29:  * control lock
   30:  */
   31: IMPORT ER  _init_liblock( void );
   32: IMPORT void _delete_liblock( void );
   33: 
   34: /* ------------------------------------------------------------------------ */
   35: 
   36: IMPORT  MACB     _Kmacb;             /* Kmalloc control block */
   37: IMPORT  MACB     _Vmacb;             /* Vmalloc control block */
   38: IMPORT  MACB     _Smacb;             /* Smalloc control block */
   39: 
   40: /*
   41:  * Memory allocation exclusion control
   42:  */
   43: #define MEMLOCK(ERR_RET) {                                              \
   44:                 if ( _lib_lock(_LL_MEMALLOC, TRUE) < E_OK ) {         \
   45:                         ERR_RET;                                     \
   46:                 }                                                     \
   47:         }
   48: 
   49: #define MEMUNLOCK() {                                                   \
   50:                 _lib_unlock(_LL_MEMALLOC);                            \
   51:         }
   52: 
   53: /* ------------------------------------------------------------------------ */