[英]What is the equivalent of Keil _at_ in gcc
Does gcc have any keyword exactly equivalent to _at_
in Keil ? gcc 是否有任何与Keil 中的_at_
完全等效的关键字?
struct Location
{
uint_32 x;
uint_32 y;
uint_32 z;
char protocol[10];
};
struct link idata list _at_ 0x40; /* list at idata 0x40 */
Note: I do not want to define a pointer at all.注意:我根本不想定义指针。 I want an exactly the same variable.我想要一个完全相同的变量。
Note: the idata
here can be ignored.注意:这里的idata
可以忽略。
No, it doesn't.不,它没有。 This Keil support page on the topic also suggests there is no direct equivalent of CARM's __at__
and armcc's __attribute__(at)
in gcc:关于该主题的这个 Keil 支持页面还表明,在 gcc 中没有与 CARM 的__at__
和 armcc 的__attribute__(at)
直接等效的内容:
GNU GCC Compiler
Use only pointer definitions to access absolute memory locations. For example:
/* General Purpose Input/Output (GPIO) */
#define IOPIN0 (*((volatile unsigned long *) 0xE0028000))
.
.
.
IOPIN0 = 0x4;
As an alternative to that, you can also define your own sections using an ld
script.作为替代方案,您还可以使用ld
脚本定义自己的部分。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.