IAR EWARM __iar_program_start, __iar_data_init3, __iar_copy_init3, __iar_zero_init3
2015-06-22 18:47
417 查看
#include <stdint.h> // The type of a pointer into the init table. typedef void const * table_ptr_t; // The type of an initialization routine. It takes a pointer to the start of // its entry (after the function pointer) in the init table and returns a // pointer to after its entry. typedef table_ptr_t init_fun_t( table_ptr_t ); typedef struct { int32_t mOff; } FAddr; __no_init uint32_t __iar_SB @ r9; uint32_t const * __iar_zero_init3( uint32_t const * p ) { uint32_t size; while ( ( size = *p++ ) != 0 ) { uint32_t d = *p++; uint32_t * dest; if ( d & 1 ) { d -= 1; d += __iar_SB; } dest = (uint32_t*) d; do { *dest++ = 0; size -= 4; }while ( size != 0 ); } return p; } uint32_t const * __iar_copy_init3( uint32_t const * p ) { uint32_t size; while ( ( size = *p++ ) != 0 ) { uint32_t const * src; uint32_t d; uint32_t * dest; src = (uint32_t *) ( (char const *) p + *(int32_t *) p ); p++; d = *p++; if ( d & 1 ) { d -= 1; d += __iar_SB; } dest = (uint32_t *) d; do { *dest++ = *src++; size -= 4; }while ( size != 0 ); } return p; } #pragma section = "Region$$Table" void __iar_data_init3( void ) { FAddr const * pi = __section_begin("Region$$Table"); table_ptr_t pe = __section_end ("Region$$Table"); while ( pi != pe ) { init_fun_t * fun = (init_fun_t *) ( (uint32_t) pi + pi->mOff ); ++pi; pi = fun( pi ); } }
Mode_USR EQU 0x10 Mode_FIQ EQU 0x11 Mode_IRQ EQU 0x12 Mode_SVC EQU 0x13 Mode_ABT EQU 0x17 Mode_UND EQU 0x1B Mode_SYS EQU 0x1F ; available on ARM Arch 4 and later I_Bit EQU 0x80 ; when I bit is set, IRQ is disabled F_Bit EQU 0x40 ; when F bit is set, FIQ is disabled __iar_program_start MSR CPSR_c, #Mode_SYS|F_Bit|I_Bit ldr sp,=SFE(CSTACK) ; End of CSTACK(user) BL __iar_data_init3 BL main B .
相关文章推荐
- Unable to load configuration. - bean - jar:file:/E:/tomcat/lib/struts...
- 用nohup命令让Linux下程序永远在后台执行
- H264 编解码器架构简单
- linux sun/awt/X11GraphicsEnvironment
- Tips & Tricks:Apache log4j简明教程(一)
- 解决使用GOOGLE字体网站访问慢的问题
- centos 6.5 安装桌面环境
- 搬移网站程序到不同服务器的操作流程
- Linux C和MySQL数据库写的一个“电话本管理程序”
- Linux的inode的理解
- setsockopt角色
- 改变了Tomcat路径后无法卸载和重装的解决办法
- 每天收获一点点------Hadoop概述
- 尽量使用translate而不是改变top/left进行动画(翻译)
- 网站搭建之html
- 如何在 CentOS 7 上安装 Percona服务器
- adb shell 命令详解
- 解决Nginx的connect() to 127.0.0.1:8080 failed (13: Permission denied) while connect
- linux中的/ect/group和/ect/passwd文件格式
- 利用dropbox建立私有Repo