gonzui


Format: Advanced Search

tkernel_2/include/tk/sysmgr.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:  *      @(#)sysmgr.h (T-Kernel)
   17:  *
   18:  *      T-Kernel/SM
   19:  */
   20: 
   21: #ifndef __TK_SYSMGR_H__
   22: #define __TK_SYSMGR_H__
   23: 
   24: #include <basic.h>
   25: 
   26: #ifdef __cplusplus
   27: extern "C" {
   28: #endif
   29: 
   30: /*
   31:  * Memory attribute             tk_get_smb
   32:  */
   33: #define TA_NORESIDENT   0x00000010U       /* Non-resident */
   34: #define TA_RNG0         0x00000000U    /* Protection level 0 */
   35: #define TA_RNG1         0x00000100U    /* Protection level 1 */
   36: #define TA_RNG2         0x00000200U    /* Protection level 2 */
   37: #define TA_RNG3         0x00000300U    /* Protection level 3 */
   38: #define TA_NOCACHE      0x00010000U  /* Non-cache area specify */
   39: 
   40: /*
   41:  * System memory state information
   42:  */
   43: typedef struct t_rsmb {
   44:         INT    blksz;             /* Block size (byte) */
   45:         INT    total;             /* Number of all blocks */
   46:         INT    free;              /* Number of remaining blocks */
   47: } T_RSMB;
   48: 
   49: /*
   50:  * Subsystem event
   51:  */
   52: #define TSEVT_SUSPEND_BEGIN     1   /* Before device suspend starts */
   53: #define TSEVT_SUSPEND_DONE      2    /* After device suspend completes */
   54: #define TSEVT_RESUME_BEGIN      3    /* Before device resume starts */
   55: #define TSEVT_RESUME_DONE       4     /* After device resume completes */
   56: #define TSEVT_DEVICE_REGIST     5   /* Device registration notification */
   57: #define TSEVT_DEVICE_DELETE     6   /* Device unregistration notification */
   58: 
   59: /* ------------------------------------------------------------------------ */
   60: 
   61: /*
   62:  * Non-resident system memory allocation
   63:  */
   64: IMPORT void* Vmalloc( size_t size );
   65: IMPORT void* Vcalloc( size_t nmemb, size_t size );
   66: IMPORT void* Vrealloc( void *ptr, size_t size );
   67: IMPORT void  Vfree( void *ptr );
   68: 
   69: /*
   70:  * Resident system memory allocation
   71:  */
   72: IMPORT void* Kmalloc( size_t size );
   73: IMPORT void* Kcalloc( size_t nmemb, size_t size );
   74: IMPORT void* Krealloc( void *ptr, size_t size );
   75: IMPORT void  Kfree( void *ptr );
   76: 
   77: /* ------------------------------------------------------------------------ */
   78: 
   79: #ifndef __commarea__
   80: #define __commarea__
   81: typedef struct CommArea CommArea;       /* sys/commarea.h */
   82: #endif
   83: 
   84: /*
   85:  * Definition for interface library automatic generation (mkiflib)
   86:  */
   87: /*** DEFINE_IFLIB
   88: [INCLUDE FILE]
   89: <tk/sysmgr.h>
   90: 
   91: [PREFIX]
   92: SYSTEM
   93: ***/
   94: 
   95: /* [BEGIN SYSCALLS] */
   96: /* System information management function */
   97: /* ALIGN_NO 1 */
   98: IMPORT INT tk_get_cfn( CONST UB *name, INT *val, INT max );
   99: IMPORT INT tk_get_cfs( CONST UB *name, UB *buf, INT max );
  100: 
  101: /* System memory management function */
  102: /* ALIGN_NO 0x100 */
  103: IMPORT ER tk_get_smb( void **addr, INT nblk, UINT attr );
  104: IMPORT ER tk_rel_smb( void *addr );
  105: IMPORT ER tk_ref_smb( T_RSMB *pk_rsmb );
  106: 
  107: /* System internal use */
  108: /* ALIGN_NO 0x1000 */
  109: IMPORT ER  _GetKernelCommonArea( CommArea **area );
  110: IMPORT int _syslog_send( const char *string, int len );
  111: /* [END SYSCALLS] */
  112: 
  113: #ifdef __cplusplus
  114: }
  115: #endif
  116: #endif /* __TK_SYSMGR_H__ */