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

📄 arm.h

📁 瑞星微公司RK27XX系列芯片的SDK开发包
💻 H
字号:
/* Copyright (C) 2006 ROCK-CHIPS FUZHOU . All Rights Reserved. */
/*
File : base\system\cpu.h
Desc : 定义 与处理器 相关 的基本数据类型 以及寄存器,地址映射,
    以及一些常用的工具。


Author : huangsl
Date : 206-04-03
Notes :


$Log: arm.h,v $
Revision 1.3  2007/10/25 11:13:31  Huangshilin
修改 支持 TOUCH_MOVE 消息以及GUI BUG.

Revision 1.2  2007/10/08 02:45:16  Lingzhaojun
添加版本自动注释脚本

* huangsl     2006/04/03 建立此文件,用于定义 处理器相关的数据类型以及操作
*

*/

#ifndef  _ARM_CPU_DEFINE_H_
#define  _ARM_CPU_DEFINE_H_
/*********************************************************************************************/
#define _CPU_DEFINED
#define ASM                            __asm
#define PACKED                      __packed        //use as PACKED struct {};
#define WEAK                         __weak //use as WEAK int; WEAK void f(void);
#define INLINED                     __inline    //use as __inline int f(int x) {return x*5+1;}
#define ALIGN( nBytes )         __align( nBytes ) //1--8, __align(8) is a storage class modifier.

//#pragma arm section [sort_type[[=]"name"]] [,sort_type="name"]
//for example:#pragma arm section rwdata = "foo", rodata = "bar", #pragma arm section rodata

//#define PRAGMA_ARM(SectionName)
//#pragma arm section code="SNAME",rodata="SNAME",rwdata="SNAME",zidata="SNAME"
//#pragma arm section

//用于返回值大于 32 位的情况.
#define RETURN_REGISTER     __value_in_regs //use like __value_in_regs extern int64_struct mul64(unsigned a, unsigned b);
#define SWI( v )                      __swi( v )
//用于产生一次 SWI 中断,可带多个参数.
/*
__swi(0) void my_swi(int);
__swi(0) int multiply_two(int, int);
__swi(1) int add_two(int, int);
__swi(2) int add_multiply_two(int, int, int, int);
__swi(3) __value_in_regs struct four_results
many_operations(int, int, int, int);

*/
#define IRQ                         __irq

#define STATIC                  static
// n: 1--8
//#define REGISTER( n )                __global_reg( n ) char *  //声明寄存器变量 ,临时变量, v1-v8

/***************************************************************************/
// CPU MODE , FOR SOURCE CODE.
#define     USR32Mode               0x10                /*  用户模式                    */
#define     SYS32Mode               0x1f                /*  系统模式                    */
#define     SVC32Mode               0x13
#define     NoFiq                  0x40
#define     NoIrq                  0x80
#define     NoInt                  (NoIrq|NoFiq)

/***************************************************************************/
typedef unsigned int            STACK;
typedef unsigned int            CPU_STATUS;

/***************************************************************************/
#define     DECLARE_CUP_SR                              CPU_STATUS  cpu_sr
#define     ENTER_CRITICAL()                            {cpu_sr =OSDisableInt();}
#define     EXIT_CRITICAL()                             OSEnableInt(cpu_sr)

/***************************************************************************/
CPU_STATUS OSDisableInt(void);                /*  关中断                      */
void OSEnableInt(CPU_STATUS cpu_sr);                   /*  开中断                      */

/*********************************************************************************************************
**                            End Of File
********************************************************************************************************/

/******************************************************************************************************/
#endif /* not _ARM_CPU_DEFINE_H_ */
/*--------------------------------end of file ------------------------------------------*/

⌨️ 快捷键说明

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