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

📄 irq.h

📁 Bycore是一个嵌入式操作系统内核。Bycore包括内存管理、任务管理、中断管理、任务互斥、同步与通信管理等功能。Bycore全部由C语言完成
💻 H
字号:
/** *  irq.h - Interruption management. * *  Copyright (C) 2008  ZhangHu *  All rights reserved. *  E-MAIL: anmnmnly@gmail.com * *  This program is free software: you can redistribute it and/or modify *  it under the terms of the GNU General Public License as published by *  the Free Software Foundation, either version 3 of the License, or *  (at your option) any later version. * *  This program is distributed in the hope that it will be useful, *  but WITHOUT ANY WARRANTY; without even the implied warranty of *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the *  GNU General Public License for more details. * *  You should have received a copy of the GNU General Public License *  along with this program.  If not, see <http://www.gnu.org/licenses/>. */#ifndef __IRQ_H__#define __IRQ_H__#include "include/types.h"#include "include/list.h"#include "include/core.h"#include "hw_irq.h" /* An array store all interruption service handle */extern list_t israrry[ISR_NUM];/* 'isr_t' describles a ISR of a interruption */typedef struct isr_desc {    void(*pisr)(void);  /* The entry of ISR */    list_t link;        /* All ISR will linked by this member */    uword_t irq_no;     /* ISR Serial number for a interruption */}isr_t;#define mac_disable_irq() DisableInt()#define mac_enable_irq() EnableInt()void initirq(void); /* Initialize interruption management */void isr_install(uword_t IntNum,     /* Serial number of interruption                                        that vary from architecture. */                 char_t IrqNo,       /* ISR Serial number for a interruption */                 void(*phdl)(void)); /* Pointer to the entry of ISR *//* 'isrInstall' has the same function as 'isr_install'. * The difference is that 'isr_install' executes in a unprotected context. */#define isrInstall(IntNum, IrqNo, phdl) \do{\    mac_disable_irq();\    isr_install(IntNum,IrqNo,phdl);\    mac_enable_irq();\}while(0);void isr_uninstall(uword_t IntNum, char_t IrqNo);#define isrUnInstall(IntNum, IrqNo) \do{\    mac_disable_irq();\    isr_uninstall(IntNum,IrqNo);\    mac_enable_irq();\}while(0);void isrHandler(void);  /* Handle all interruptions *//* isr_after_handle - this rountine should be called after leaving *                    'isrHandler', so that some CPU registers can be clear. *                    It should be rewrite when port Bycore to another CPU. */void isr_after_handle(uword_t isr_num);#endif

⌨️ 快捷键说明

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