gonzui


Format: Advanced Search

tkernel_2/include/sys/segment.hbare sourcepermlink (0.02 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 T-Engine Forum at 2013/03/07.
   11:  *    Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   12:  *
   13:  *----------------------------------------------------------------------
   14:  */
   15: 
   16: /*
   17:  *      @(#)segment.h (sys)
   18:  *
   19:  *      Segment management
   20:  */
   21: 
   22: #ifndef __SYS_SEGMENT_H__
   23: #define __SYS_SEGMENT_H__
   24: 
   25: #include <tk/sysext.h>
   26: 
   27: #ifdef __cplusplus
   28: extern "C" {
   29: #endif
   30: 
   31: #define INVADR                  ((void*)-1)    /* Invalid address */
   32: 
   33: /*
   34:  * CheckSpace(),CheckStrSpace() mode
   35:  */
   36: #define MA_READ         0x04U  /* Read */
   37: #define MA_WRITE        0x02U  /* Write */
   38: #define MA_EXECUTE      0x01U        /* Execute */
   39: 
   40: 
   41: /*
   42:  * Definitions for interface library auto generate (mkiflib)
   43:  */
   44: /*** DEFINE_IFLIB
   45: [INCLUDE FILE]
   46: <sys/segment.h>
   47: 
   48: [PREFIX]
   49: SEG
   50: ***/
   51: 
   52: /* [BEGIN SYSCALLS] */
   53: 
   54: /* ALIGN_NO 0x100 */
   55: #ifndef LockSpace
   56: IMPORT ER  LockSpace( CONST void *laddr, INT len );
   57: IMPORT ER  UnlockSpace( CONST void *laddr, INT len );
   58: #endif
   59: IMPORT INT CnvPhysicalAddr( CONST void *laddr, INT len, void **paddr );
   60: IMPORT ER  ChkSpace( CONST void *laddr, INT len, UINT mode, UINT env );
   61: IMPORT INT ChkSpaceTstr( CONST TC *str, INT max, UINT mode, UINT env );
   62: IMPORT INT ChkSpaceBstr( CONST UB *str, INT max, UINT mode, UINT env );
   63: IMPORT INT ChkSpaceLen( CONST void *laddr, INT len, UINT mode, UINT env, INT lsid );
   64: IMPORT INT ReadMemSpace( void *laddr, void *buf, INT len, INT lsid );
   65: IMPORT INT WriteMemSpace( void *laddr, void *buf, INT len, INT lsid );
   66: IMPORT INT SetMemSpaceB( void *laddr, INT len, UB data, INT lsid );
   67: IMPORT ER  FlushMemCache( void *laddr, INT len, UINT mode );
   68: IMPORT INT SetCacheMode( void *addr, INT len, UINT mode );
   69: IMPORT INT ControlCache( void *addr, INT len, UINT mode );
   70: IMPORT ER  GetSpaceInfo( CONST void *addr, INT len, T_SPINFO *pk_spinfo );
   71: IMPORT INT SetMemoryAccess( CONST void *addr, INT len, UINT mode );
   72: 
   73: /* ALIGN_NO 0x100 */
   74: IMPORT ER MapMemory( CONST void *paddr, INT len, UINT attr, void **laddr );
   75: IMPORT ER UnmapMemory( CONST void *laddr );
   76: 
   77: /* ALIGN_NO 0x1000 */
   78: IMPORT ER MakeSpace( void *laddr, INT npage, INT lsid, UINT pte );
   79: IMPORT ER UnmakeSpace( void *laddr, INT npage, INT lsid );
   80: IMPORT ER ChangeSpace( void *laddr, INT npage, INT lsid, UINT pte );
   81: /* [END SYSCALLS] */
   82: 
   83: #ifdef __cplusplus
   84: }
   85: #endif
   86: #endif /* __SYS_SEGMENT_H__ */