The cregister Keyword
来源:互联网 发布:中银淘宝校园卡有效期 编辑:程序博客网 时间:2024/05/18 03:37
6.5.2 The cregister Keyword
The compiler extends the C/C++ language by adding the cregister keyword to allow high level language access to control registers.
When you use the cregister keyword on an object, the compiler compares the name of the object to a list of standard control registers for the C6000 (see Table 6-3). If the name matches, the compiler generates the code to reference the control register. If the name does not match, the compiler issues an error.
==================Table 6-3. Valid Control Registers===================
Register Description
AMR Addressing mode register
CSR Control status register
DESR (C6700+ only) dMAX event status register
DETR (C6700+ only) dMAX event trigger register
DNUM (C6400+ only) DSP core number register
ECR (C6400+ only) Exception clear register
EFR (C6400+ only) Exception flag register
FADCR (C6700 only) Floating-point adder configuration register
FAUCR (C6700 only) Floating-point auxiliary configuration register
FMCR (C6700 only) Floating-point multiplier configuration register
GFPGFR (C6400 only) Galois field polynomial generator function register
GPLYA (C6400+ only) GMPY A-side polynomial register
CPLYB (C6400+ only) GMPY B-side polynomial register
ICR Interrupt clear register
IER Interrupt enable register
IERR (C6400+ only) Internal exception report register
IFR Interrupt flag register. (IFR is read only.)
ILC (C6400+ only) Inner loop count register
IRP Interrupt return pointer
ISR Interrupt set register
ISTP Interrupt service table pointer
ITSR (C6400+ only) Interrupt task state register
NRP Nonmaskable interrupt return pointer
NTSR (C6400+ only) NMI/exception task state register
REP (C6400+ only) Restricted entry point address register
RILC (C6400+ only) Reload inner loop count register
SSR (C6400+ only) Saturation status register
TSCH (C6400+ only) Time-stamp counter (high 32) register
TSCL (C6400+ only) Time-stamp counter (low 32) register
TSR (C6400+ only) Task state register
===============================================================
The cregister keyword can be used only in file scope. The cregister keyword is not allowed on any declaration within the boundaries of a function. It can only be used on objects of type integer or pointer.The cregister keyword is not allowed on objects of any floating-point type or on any structure or union objects.
The cregister keyword does not imply that the object is volatile. If the control register being referenced is volatile (that is, can be modified by some external control), then the object must be declared with the volatile keyword also.
To use the control registers in Table 6-3, you must declare each register as follows. The c6x.h include file defines all the control registers through this syntax:
extern cregister volatile unsigned int register ;
Once you have declared the register, you can use the register name directly. See the TMS320C62x DSP CPU and Instruction Set Reference Guide, TMS320C64x/C64x+ DSP CPU and Instruction Set Reference Guide, the TMS320C67x/C67x+ DSP CPU and Instruction Set Reference Guide, or TMS320C66x+ DSP CPU and Instruction Set Reference Guide for detailed information on the control registers.See Example 6-1 for an example that declares and uses control registers.
extern cregister volatile unsigned int AMR;
extern cregister volatile unsigned int CSR;
extern cregister volatile unsigned int IFR;
extern cregister volatile unsigned int ISR;
extern cregister volatile unsigned int ICR;
extern cregister volatile unsigned int IER;
extern cregister volatile unsigned int FADCR;
extern cregister volatile unsigned int FAUCR;
extern cregister volatile unsigned int FMCR;
main()
{
printf("AMR = %x\n", AMR);
}
- The cregister Keyword
- cregister
- The explicit Keyword
- About the keyword Synchronized
- The const keyword
- The 'this' keyword
- The Java synchronized keyword
- The instanceof Keyword
- The instance of keyword
- The coproc keyword
- native, The Keyword Of Java
- the this keyword in javascript
- Using the C "volatile" Keyword
- the usage of keyword const
- The volatile keyword in Java
- Introduction to the Volatile Keyword
- Day3-10.The static keyword
- Day14-47.The this keyword
- WordPress最近加载缓慢的原因及解决方案
- POJ 2386 Lake Counting
- Spring MVC 教程,快速入门,深入分析
- 编程语言思想
- 六、触摸响应(2)
- The cregister Keyword
- [人工智能]北美18名校的数据挖掘,数据分析,人工智能及机器学习课程汇总
- centos下svn版本控制服务器安装及配置
- Git常用操作命令
- 结构体变量之间的比较和赋值原理
- Web_PHP_MySQL_XAMPP下MYSQL中文乱码问题的解决
- 数据结构C语言实现——顺序线性表SqList
- ETL调度开发(2)——配置表说明
- linux C复习:与gcc相关的环境变量