📄 intr.h
字号:
/*
===============================================================================
| COPYRIGHT (C) 2003-2007 Haishen Ruan, All rights reserved.
| SUMMARY:
| Interrupt and clock support.
|
|
| LICENSE INFORMATION
| RS-RTOS is free software; you can redistribute it and/or modify it under
| terms of the GNU General Public License as published by the
| Free Software Foundation; either version 2, or (at your option) any
| later version.
|
| RS-RTOS 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 RS-RTOS; see file COPYING. If not, write to the Free Software
| Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
| As a special exception, including RS-RTOS header files in a file,
| instantiating RS-RTOS generics or templates, or linking other files
| with RS-RTOS objects to produce an executable application, does not
| by itself cause the resulting executable application to be covered
| by the GNU General Public License. This exception does not
| however invalidate any other reasons why the executable file might be
| covered by the GNU Public License.
|
|
| DESCRIPTION:
| See http://www.RS-RTOS.org for documentation, latest information, license
| and contact details.
| email:ruanhaishen@gmail.com
=============================================================================*/
#ifndef __ARCH_INTR_H__
#define __ARCH_INTR_H__
#ifdef __cplusplus
extern "C" {
#endif
/*===========================================================================*/
typedef union _union_simuFL
{
int32u B;
struct
{
int8u IF;
int8u IE;
int8u IRQ;
} b;
} simuFL_t;
#define SIMUF_IF 0x00000001
#define SIMUF_IE 0x00000002
#define irq_disable() \
do { \
simuFL.b.IE = 0; \
} while (0)
#define irq_enable() \
do { \
simuFL.b.IE = 1; \
} while (0)
#define IRQ_SAVEAREA int8u _intsave
#define irq_lock() \
do { \
_intsave = simuFL.b.IE; \
simuFL.b.IE = 0; \
} while (0)
#define irq_unlock() \
do { \
simuFL.b.IE = _intsave; \
} while (0)
/* The frequency of system tick. */
#define RS_TICK_FREQ 50
#define HOOK_KERNEL_ENTRY() simulator_initialize()
#define HOOK_KERNEL_IDLE() simulator_idle()
/*== context.c ==========================================*/
__fun_ void __switch_to(sp_t __p_*, sp_t) __ef_;
__fun_ void __timer_handle(void) __ef_;
__fun_ void __interrupt_handle(void) __ef_;
/*== simulator.c ========================================*/
void simulator_initialize(void);
void simulator_destroy(void);
void simulator_postirq(int irq);
void simulator_idle(void);
extern simuFL_t simuFL;
/*===========================================================================*/
#ifdef __cplusplus
} /* end of extern "C" */
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -