📄 os_cpu.h
字号:
/*
*********************************************************************************************************
* uC/OS-II
* The Real-Time Kernel
*
* (c) Copyright 1992-2002, Jean J. Labrosse, Weston, FL
* All Rights Reserved
*
* File : OS_CPU.H
* By : Jean J. Labrosse
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* MIPS Port
*
* Target : MIPS (Includes 4Kc)
* Ported by : Michael Anburaj
* URL : http://geocities.com/michaelanburaj/ Email : michaelanburaj@hotmail.com
*
*********************************************************************************************************
*/
#include "config.h"
#ifdef OS_CPU_GLOBALS
#define OS_CPU_EXT
#else
#define OS_CPU_EXT extern
#endif
/*
*********************************************************************************************************
* DATA TYPES
* (Compiler Specific)
*********************************************************************************************************
*/
typedef unsigned char BOOLEAN;
typedef unsigned char INT8U; /* Unsigned 8 bit quantity */
typedef signed char INT8S; /* Signed 8 bit quantity */
typedef unsigned int INT16U; /* Unsigned 16 bit quantity */
typedef signed int INT16S; /* Signed 16 bit quantity */
typedef unsigned long INT32U; /* Unsigned 32 bit quantity */
typedef signed long INT32S; /* Signed 32 bit quantity */
typedef long long INT64U; /* Signed 64 bit quantity */
typedef float FP32; /* Single precision floating point */
typedef double FP64; /* Double precision floating point */
#define BYTE INT8U /* Define data types for backward compatibility ... */
#define HWORD INT16U
#define WORD INT32U /* ... uC/OS-II. */
typedef unsigned int OS_STK; /* Each stack entry is 16-bit wide */
typedef unsigned int OS_CPU_SR; /* Define size of CPU status register (PSR = 32 bits) */
/* Don't modify these lines. This port can only support OS_CRITICAL_METHOD 3. */
#define OS_CRITICAL_METHOD 3
#if OS_CRITICAL_METHOD == 3
#define OS_ENTER_CRITICAL() (cpu_sr = SOCDisableInt()) /* Disable interrupts */
#define OS_EXIT_CRITICAL() (SOCEnableInt(cpu_sr)) /* Restore interrupts */
#endif
/*
*********************************************************************************************************
* ARM Miscellaneous
*********************************************************************************************************
*/
#define OS_STK_GROWTH 1 /* Stack grows from HIGH to LOW memory on 80x86 */
#define OS_TASK_SW() OSCtxSw()
/*
*********************************************************************************************************
* GLOBAL VARIABLES
*********************************************************************************************************
*/
/*
*********************************************************************************************************
* PROTOTYPES
*********************************************************************************************************
*/
extern void OSCtxSw(void);
extern void OSIntCtxSw(void);
extern void SOC_INTHandler(void);
#if OS_CRITICAL_METHOD == 3 // Allocate storage for CPU status register
OS_CPU_SR SOCDisableInt(void);
void SOCEnableInt(OS_CPU_SR cpu_sr);
#endif
/*GET CPU STATUS */
extern unsigned long CP0_wGetSR(void);
extern unsigned long CP0_GetCAUSE(void);
extern unsigned long CP0_GetEPC(void);
/*
*********************************************************************************************************
* SOC
*********************************************************************************************************
*/
/*
extern void SOCDisableInt(void);
extern void SOCEnableInt(void);
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -