U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(12):第二阶段的程序入口
来源:互联网 发布:淘宝特产店名大全 编辑:程序博客网 时间:2024/06/05 15:40
在start.s的最后,CPU初始化已经完成,需要进入第二阶段的执行:
/* Now lower ourselves from the highest interrupt level to
* the lowest. We do this by masking all interrupts but 15,
* setting the 15 handler to "board_init_f", raising the 15
* interrupt, and then returning from the highest interrupt
* level to the dummy "jump" until the interrupt controller
* services the pending 15 interrupt.
*/
serial_early_puts("Lower to 15")
r0 = r7;
r1 = r6;
p0.l = LO(EVT15);
p0.h = HI(EVT15);
//p1.l = _cpu_init_f;
//p1.h = _cpu_init_f;
p1.l = _main;
p1.h = _main;
[p0] = p1;
p2.l = LO(IMASK);
p2.h = HI(IMASK);
p3.l = LO(EVT_IVG15);
p3.h = HI(EVT_IVG15);
[p2] = p3;
raise 15;
p4.l = .LWAIT_HERE;
p4.h = .LWAIT_HERE;
reti = p4;
rti;
在这段代码中,将_cpu_init_f写入到INT15的向量表中,然后用raise 15进入下一阶段的运行,这是因为CPU复位之后处于RESET中断的状态,这是优先级很高的一个中断,在这种情况下,虽然可以对CPU进行完全的操作(Supervisor mode),但是却无法响应其它的中断请求。因此上述代码将自身跳到中断15再运行,这样同时可以响应其它的中断,CPU也仍然处在Supervisor mode,可以进行完整的控制。
不过在此处,为了使用main,我将原来跳转的cpu_init_f函数替换为main,这样每次下载u-boot之后,VDSP都会自动在main中中断下来,否则它会犯傻的,呵呵!
经过修改的main变成了:
__attribute__ ((__noreturn__))
void main(ulong bootflag, ulong loaded_from_ldr)
{
/* The default startup code does not include any functionality to allow core
A to enable core B. A convenient way to enable core B is to use the
'adi_core_b_enable()' function. */
//adi_core_b_enable();
cpu_init_f(bootflag, loaded_from_ldr);
}
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(12):第二阶段的程序入口
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(4):提示信息
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(5):ENDPROC
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(10):__xchg
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(11):bsz
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(13):使用L1
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(15):DECLARE_GLOBAL_DATA_PTR
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(16):*cplb_add
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(17): Entry.h
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(18):const
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(19):分号惹祸
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(21):收工
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(6):使用u-boot的crt代码
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(7):改造u-boot.lds.s
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录:#if
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(2): .macro
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(3): 汇编空语句
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录:全文
- NET 连接池救生员
- The C Programming Language 读书笔记(Chapter 1)
- sqlhelper使用指南
- eclipse无法新建java project
- PostgreSQL
- U-boot-1.1.6-2008R1到vdsp5(bf561)的移植记录(12):第二阶段的程序入口
- LCC-win32与C编程简介
- javax.servlet.ServletException: BeanUtils.populate
- vs2003 asp.net服务端压缩文件并下载
- Symbian中的iScanCode和iCode
- 比较年龄8岁+SQL
- 在ASP下用JavaScript 和 XML开发聊天室
- 取得行数为0-10之间的数
- request属性 request.getAttribute()