intr.h

来自「公开源代码的嵌入式操作系统r&s!建议学习!」· C头文件 代码 · 共 37 行

H
37
字号
/*
===============================================================================
| Copyright (C) 2004 RuanHaiShen, All rights reserved.
| SUMMARY: 
|   Interrupt and clock support.
|
| DESCRIPTION:
|   See http://www.01s.org for documentation, latest information, license 
|   and contact details.
|   email:ruanhaishen@01s.org
=============================================================================*/
#ifndef __arch_intr_h__
#define __arch_intr_h__
/*===========================================================================*/

#define disable_irq()           asm     { cli } 
#define CRITICAL_ENTER          asm     { pushf; cli } 
#define CRITICAL_EXIT           asm     { popf }

#define TICKS_PER_SEC           200

#define __dos_tick()            asm  int   0x81

#define __eoi_to_8259a() \
do { \
    asm { \
        mov     al, 0x20; \
        mov     dx, 0x20; \
        out     dx, al; \
    } \
} while (0)


/*===========================================================================*/
#endif

⌨️ 快捷键说明

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