gonzui


Format: Advanced Search

tkernel_2/kernel/sysdepend/cpu/em1d/chkplv.cbare 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:  *      chkplv.c (EM1-D512)
   17:  *      Check Call Protected Level
   18:  */
   19: 
   20: #include "sysmgr.h"
   21: #include <sys/sysinfo.h>
   22: 
   23: IMPORT INT      svc_call_limit;      /* SVC protected level (T-Kernel/OS) */
   24: 
   25: Inline INT PPL( void )
   26: {
   27:         return (SCInfo.taskmode >> 16) & 3;
   28: }
   29: 
   30: /*
   31:  * Check protected level of extended SVC caller
   32:  */
   33: EXPORT ER ChkCallPLevel( void )
   34: {
   35:         return ( PPL() > svc_call_limit )? E_OACV: E_OK;
   36: }