
GCC C
文章平均质量分 74
Decisiveness
这个作者很懒,什么都没留下…
展开
-
Compound Literals
ISO C99 supports compound literals. A compound literal looks like a cast containing an initializer. Its value is an object of the type specified in the cast, containing the elements specified in the i翻译 2015-04-01 00:42:31 · 590 阅读 · 0 评论 -
Gcc的内建函数 __builtin_constant_p
Gcc的内建函数 __builtin_constant_p 用于判断一个值是否为编译时常数,如果参数EXP 的值是常数,函数返回 1,否则返回 0。例如: ++++ include/asm-i386/bitops.h 249: #define test_bit(nr,addr) / 250: (__builtin_constant_p(nr) ? / 251: constant_t转载 2015-04-14 00:26:19 · 733 阅读 · 0 评论 -
ARM嵌入式开发中的GCC内联汇编简介
ARM嵌入式开发中的GCC内联汇编简介嵌入式开发交流群280352802,欢迎加入!在针对ARM体系结构的编程中,一般很难直接使用C语言产生操作协处理器的相关代码,因此使用汇编语言来实现就成为了唯一的选择。但如果完全通过汇编代码实现,又会过于复杂、难以调试。因此,C语言内嵌汇编的方式倒是一个不错的选择。然而,使用内联汇编的一个主要问题是,内联汇编的语法格式与使用的编译器直接转载 2015-05-10 12:22:34 · 524 阅读 · 0 评论 -
简略方法---结构数组所有元素赋相同值
struct irq_desc irq_desc[NR_IRQS] __cacheline_aligned = { [0 ... NR_IRQS-1] = { .status = IRQ_DISABLED, .chip = &no_irq_chip, .handle_irq =转载 2015-06-01 22:33:10 · 811 阅读 · 0 评论 -
FAQ/LikelyUnlikely __builtin_expect
FAQ/LikelyUnlikelylikely() and unlikely()What are they ?In Linux kernel code, one often find calls to likely() and unlikely(), in conditions, like :bvl = bvec_alloc(gfp_mask, nr_转载 2015-04-04 14:56:55 · 539 阅读 · 0 评论