gonzui


Format: Advanced Search

mtkernel_3/include/tk/errno.hbare sourcepermlink (0.01 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    micro T-Kernel 3.00.00
    4:  *
    5:  *    Copyright (C) 2006-2019 by Ken Sakamura.
    6:  *    This software is distributed under the T-License 2.1.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by TRON Forum(http://www.tron.org) at 2019/12/11.
   10:  *
   11:  *----------------------------------------------------------------------
   12:  */
   13: 
   14: /*
   15:  *      errno.h
   16:  *
   17:  *      micro T-Kernel Error Code
   18:  */
   19: 
   20: #ifndef __TK_ERRNO_H__
   21: #define __TK_ERRNO_H__
   22: 
   23: #if     TK_SUPPORT_SERCD == TRUE
   24: /*
   25:  * To port a program using macros concerning error codes from T-Kernel
   26:  * into micro T-Kernel, you may modify and use following macros (ERCD, 
   27:  * MERCD, SERCD).
   28:  */
   29: #ifndef _in_asm_source_
   30: #include "typedef.h"
   31: 
   32: #define MERCD(er)       ( (ER)(er) >> 16 )    /* Main error code */
   33: #define SERCD(er)       ( (H)(er) )           /* Sub-error code */
   34: #define ERCD(mer, ser)  ( (ER)(((UW)(mer) << 16) | ((UW)(ser) & 0x0000FFFF)) )
   35: #else
   36: #define ERCD(mer, ser)  ( ((mer) << 16) | ((ser) & 0xffff) )
   37: #endif /* _in_asm_source_ */
   38: 
   39: #define E_OK            (0)       /* Completed successfully */
   40: 
   41: #define E_SYS           ERCD(-5, 0)      /* System error */
   42: #define E_NOCOP         ERCD(-6, 0)    /* Coprocessor disable */
   43: #define E_NOSPT         ERCD(-9, 0)    /* Unsupported function */
   44: #define E_RSFN          ERCD(-10, 0)    /* Reserved function code number */
   45: #define E_RSATR         ERCD(-11, 0)   /* Reserved attribute */
   46: #define E_PAR           ERCD(-17, 0)     /* Parameter error */
   47: #define E_ID            ERCD(-18, 0)      /* Incorrect ID number */
   48: #define E_CTX           ERCD(-25, 0)     /* Context error */
   49: #define E_MACV          ERCD(-26, 0)    /* Inaccessible memory/access violation */
   50: #define E_OACV          ERCD(-27, 0)    /* Object access violation */
   51: #define E_ILUSE         ERCD(-28, 0)   /* Incorrect system call use */
   52: #define E_NOMEM         ERCD(-33, 0)   /* Insufficient memory */
   53: #define E_LIMIT         ERCD(-34, 0)   /* Exceed system limits */
   54: #define E_OBJ           ERCD(-41, 0)     /* Incorrect object state */
   55: #define E_NOEXS         ERCD(-42, 0)   /* Object does not exist */
   56: #define E_QOVR          ERCD(-43, 0)    /* Queuing overflow */
   57: #define E_RLWAI         ERCD(-49, 0)   /* Forcibly release wait state */
   58: #define E_TMOUT         ERCD(-50, 0)   /* Polling fail/time out */
   59: #define E_DLT           ERCD(-51, 0)     /* Waited object was deleted */
   60: #define E_DISWAI        ERCD(-52, 0)   /* Release wait caused by wait disable */
   61: 
   62: #define E_IO            ERCD(-57, 0)      /* Output/input error */
   63: #define E_NOMDA         ERCD(-58, 0)   /* No media */
   64: #define E_BUSY          ERCD(-65, 0)    /* Busy state */
   65: #define E_ABORT         ERCD(-66, 0)   /* Aborted */
   66: #define E_RONLY         ERCD(-67, 0)   /* Write protected */
   67: 
   68: #else   /* TK_SUPPORT_SERCD */
   69: 
   70: #ifndef _in_asm_source_
   71: #include "tk/typedef.h"
   72: 
   73: #define MERCD(er)       ( (ER)(er) )  /* Main error code */
   74: #endif /* _in_asm_source_ */
   75: 
   76: #define E_OK            (0)       /* Completed successfully */
   77: 
   78: #define E_SYS           (-5)     /* System error */
   79: #define E_NOCOP         (-6)   /* Coprocessor disable */
   80: #define E_NOSPT         (-9)   /* Unsupported function */
   81: #define E_RSFN          (-10)   /* Reserved function code number */
   82: #define E_RSATR         (-11)  /* Reserved attribute */
   83: #define E_PAR           (-17)    /* Parameter error */
   84: #define E_ID            (-18)     /* Incorrect ID number */
   85: #define E_CTX           (-25)    /* Context error */
   86: #define E_MACV          (-26)   /* Inaccessible memory/access violation */
   87: #define E_OACV          (-27)   /* Object access violation */
   88: #define E_ILUSE         (-28)  /* Incorrect system call use */
   89: #define E_NOMEM         (-33)  /* Insufficient memory */
   90: #define E_LIMIT         (-34)  /* Exceed system limits */
   91: #define E_OBJ           (-41)    /* Incorrect object state */
   92: #define E_NOEXS         (-42)  /* Object does not exist */
   93: #define E_QOVR          (-43)   /* Queuing overflow */
   94: #define E_RLWAI         (-49)  /* Forcibly release wait state */
   95: #define E_TMOUT         (-50)  /* Polling fail/time out */
   96: #define E_DLT           (-51)    /* Waited object was deleted */
   97: #define E_DISWAI        (-52)  /* Release wait caused by wait disable */
   98: 
   99: #define E_IO            (-57)     /* Output/input error */
  100: #define E_NOMDA         (-58)  /* No media */
  101: #define E_BUSY          (-65)   /* Busy state */
  102: #define E_ABORT         (-66)  /* Aborted */
  103: #define E_RONLY         (-67)  /* Write protected */
  104: 
  105: #endif  /* TK_SUPPORT_SERCD */
  106: 
  107: 
  108: #endif /* __TK_ERRNO_H__ */