gonzui


Format: Advanced Search

mtkernel_3/kernel/sysdepend/cpu/core/armv7m/sysdepend.hbare sourcepermlink (0.00 seconds)

Search this content:

    1: /*
    2:  *----------------------------------------------------------------------
    3:  *    micro T-Kernel 3.00.03
    4:  *
    5:  *    Copyright (C) 2006-2021 by Ken Sakamura.
    6:  *    This software is distributed under the T-License 2.2.
    7:  *----------------------------------------------------------------------
    8:  *
    9:  *    Released by TRON Forum(http://www.tron.org) at 2021/03/31.
   10:  *
   11:  *----------------------------------------------------------------------
   12:  */
   13: 
   14: /*
   15:  *      sysdepend.h (ARMv7-M)
   16:  *      System-Dependent local defined
   17:  */
   18: 
   19: #ifndef _SYSDEPEND_CPU_CORE_SYSDEPEND_
   20: #define _SYSDEPEND_CPU_CORE_SYSDEPEND_
   21: 
   22: /*
   23:  *    Reset Handler (vector_tbl.c/reset_hdl.c)
   24:  */
   25: IMPORT void Reset_Handler(void);                /* Reset Handler */
   26: 
   27: /*
   28:  *    Exception Handler (vector_tbl.c/exc_hdr.c)
   29:  */
   30: IMPORT void NMI_Handler(void);                  /* NMI Handler */
   31: IMPORT void HardFault_Handler(void);            /* Hard Fault Handler */
   32: IMPORT void MemManage_Handler(void);            /* MPU Fault Handler */
   33: IMPORT void BusFault_Handler(void);             /* Bus Fault Handler */
   34: IMPORT void UsageFault_Handler(void);           /* Usage Fault Handler */
   35: IMPORT void Svcall_Handler(void);               /* Svcall */
   36: IMPORT void DebugMon_Handler(void);             /* Debug Monitor Handler */
   37: 
   38: IMPORT void Default_Handler(void);              /* Default Handler (Undefine Interrupt) */
   39: 
   40: /*
   41:  * Dispatcher (dispatch.S)
   42:  */
   43: IMPORT void knl_dispatch_entry(void);           /* dispatch entry */
   44: IMPORT void knl_dispatch_to_schedtsk(void);     /* force dispatch */
   45: 
   46: /*
   47:  * Interrupt Control (interrupt.c)
   48:  */
   49: IMPORT  UW exchdr_tbl[];                 /* Exception handler table (RAM) */
   50: 
   51: IMPORT void knl_systim_inthdr(void);            /* System-timer Interrupt handler */
   52: 
   53: 
   54: /*
   55:  * Task context block
   56:  */
   57: typedef struct {
   58:         void   *ssp;             /* System stack pointer */
   59: } CTXB;
   60: 
   61: /*
   62:  *      Control register operation
   63:  */
   64: 
   65: Inline UW knl_get_ipsr(void)
   66: {
   67:         UW     ipsr;
   68:         Asm("mrs %0, ipsr": "=r"(ipsr));
   69:         return ipsr;
   70: }
   71: 
   72: Inline UW knl_get_xpsr(void)
   73: {
   74:         UW     xpsr;
   75:         Asm("mrs %0, psr": "=r"(xpsr));
   76:         return xpsr;
   77: }
   78: 
   79: Inline UW knl_get_primask(void)
   80: {
   81:         UW     primask;
   82:         Asm("mrs %0, primask": "=r"(primask));
   83:         return primask;
   84: }
   85: 
   86: 
   87: #endif /* _SYSDEPEND_CPU_CORE_SYSDEPEND_ */