⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intmng.c

📁 最近在國外網站抓到的作業系統 以Arm為基礎去開發的
💻 C
字号:
//*************************************************************************
//
//  Copyright (C) SEIKO EPSON CORP. 1997
//  All Rights Reserved
//
//  Filename : intmng.c 
//  Function : Interrupt Management Functions
//  Revision :
//          1997/08/01  H.Matsuoka  start
//          1999/09/29  H.Matsuoka  interrupt mask by IL
//          2001/04/05  Y.Taka      Add debug trace
//
//*************************************************************************

#include "ros33.h"
#include "internal.h"
#include "M68328.h"


//****************************************************************************
//***    3.5 Interrupt Management Functions                                ***
//****************************************************************************

//********************************************************************
//  Lock CPU
//  [Parameters]
//      none
//  [Return Parameters]
//      ER      ercd    ErrorCode
//********************************************************************
ER loc_cpu
    (
    )
{
#ifdef DEBUG_TRACE
    asm("xcall ros_dbg_syscall_trace");
#endif

#ifndef NO_ERROR_CHECK    
    if(g_ubIntNestCnt != 0)    // issued from task-independent portions
    {   
        return E_CTX;
    }
#endif  

    g_ubSysStat |= TSS_LOC;

    /* disable interrupt */
    //asm("ld.w %r9, %psr\nand %r9, 0x2f\nld.w %psr, %r9");
	DISABLE_INT;


#ifndef NO_RETURN_VALUE
    return E_OK;
#endif
}


//********************************************************************
//  Unlock CPU
//  [Parameters]
//      none
//  [Return Parameters]
//      ER      ercd    ErrorCode
//********************************************************************
ER unl_cpu
    (
    )
{
#ifdef DEBUG_TRACE
    asm("xcall ros_dbg_syscall_trace");
#endif

#ifndef NO_ERROR_CHECK    
    if(g_ubIntNestCnt != 0)    // issued from task-independent portions
    {   
        return E_CTX;
    }
#endif  

    g_ubSysStat &= ~TSS_LOC;

    if(g_blDelay & 1)
    {
        int_dispatch();         // dispatch & disable interrupt
    }
    
    /* enable interrupt */      
//    asm("ld.w %r9, %psr\nor %r9, 0x10\nld.w %psr, %r9");
	ENABLE_INT;
    
#ifndef NO_RETURN_VALUE
    return E_OK;
#endif
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -