gonzui


Format: Advanced Search

tkernel_2/lib/libtk/src/chkspc.cbare 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 TRON Forum(http://www.tron.org/) at 2015/06/01.
   11:  *
   12:  *----------------------------------------------------------------------
   13:  */
   14: 
   15: /*
   16:  *      @(#)chkspc.c (libtk)
   17:  *
   18:  *      Address check
   19:  */
   20: 
   21: #include <basic.h>
   22: #include <tk/syslib.h>
   23: #include <sys/segment.h>
   24: 
   25: #if VIRTUAL_ADDRESS
   26: 
   27: #include "getsvcenv.h"
   28: 
   29: /*
   30:  * Check address space
   31:  *      Checks to see that the memory space from address to the
   32:  *      len byte is valid.
   33:  */
   34: EXPORT ER ChkSpaceR( CONST void *addr, INT len )
   35: {
   36:         return ChkSpace(addr, len, MA_READ, getsvcenv());
   37: }
   38: EXPORT ER ChkSpaceRW( CONST void *addr, INT len )
   39: {
   40:         return ChkSpace(addr, len, MA_READ|MA_WRITE, getsvcenv());
   41: }
   42: EXPORT ER ChkSpaceRE( CONST void *addr, INT len )
   43: {
   44:         return ChkSpace(addr, len, MA_READ|MA_EXECUTE, getsvcenv());
   45: }
   46: 
   47: #else /* VIRTUAL_ADDRESS */
   48: 
   49: EXPORT ER ChkSpaceR( CONST void *addr, INT len )
   50: {
   51:         return E_OK;
   52: }
   53: EXPORT ER ChkSpaceRW( CONST void *addr, INT len )
   54: {
   55:         return E_OK;
   56: }
   57: EXPORT ER ChkSpaceRE( CONST void *addr, INT len )
   58: {
   59:         return E_OK;
   60: }
   61: 
   62: #endif /* VIRTUAL_ADDRESS */