亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

head.s分析(10):轉(zhuǎn)入中斷15

系統(tǒng) 2109 0

快樂蝦

http://blog.csdn.net/lights_joy/

lights@hb165.com

本文適用于

ADI bf561 DSP

uclinux-2008r1.5-rc3 ( 移植到 vdsp5)

Visual DSP++ 5.0(update 5)

歡迎轉(zhuǎn)載,但請保留作者信息

/* This section keeps the processor in supervisor mode

* during kernel boot. Switches to user mode at end of boot.

* See page 3-9 of Hardware Reference manual for documentation.

*/

/* EVT15 = _real_start */

p0.l = lo(EVT15);

p0.h = hi(EVT15);

p1.l = _real_start;

p1.h = _real_start;

[p0] = p1;

csync;

p0.l = lo(IMASK);

p0.h = hi(IMASK);

p1.l = IMASK_IVG15;

p1.h = 0x0;

[p0] = p1;

csync;

raise 15;

p0.l = .LWAIT_HERE;

p0.h = .LWAIT_HERE;

reti = p0;

#if ANOMALY_05000281

nop; nop; nop;

#endif

rti;

.LWAIT_HERE:

jump .LWAIT_HERE;

ENDPROC(__start)

這段代碼設(shè)置了 EVT15 的入口,打開中斷 15 的掩碼,然后直接使用一個軟中斷,這樣在 rti 之后將跳轉(zhuǎn)到 _real_start 開始執(zhí)行。這么做的原因在 Hardware Reference manual 中說明,看看到底是么回事:

For non-OS environments, application code should remain in Supervisor mode so that it can access all core and system resources. When RESET is de-asserted, the processor initiates operation by servicing the reset event. Emulation is the only event that can pre-empt this activity. Therefore, lower priority events cannot be processed.

One way of keeping the processor in Supervisor mode and still allowing lower priority events to be processed is to set up and force the lowest priority interrupt ( IVG15 ). Events and interrupts are described further in "Events and Sequencing" on another page . After the low priority interrupt has been forced using the RAISE15 instruction, RETI can be loaded with a return address that points to user code that can execute until IVG15 is issued. After RETI has been loaded, the RTI instruction can be issued to return from the reset event.

The interrupt handler for IVG15 can be set to jump to the application code starting address. An additional RTI is not required. As a result, the processor remains in Supervisor mode because IPEND[15] remains set. At this point, the processor is servicing the lowest priority interrupt. This ensures that higher priority interrupts can be processed.

要理解這段話,先得理解 561 內(nèi)核的幾種模式及其轉(zhuǎn)換:

bf561模式轉(zhuǎn)換圖

dsp 復(fù)位后,實際處于 RESET 的狀態(tài),所執(zhí)行的第一行代碼實際是做為 reset 中斷服務(wù)例程來運行的,因此在最后使用了一個 rti 語句結(jié)束此中斷服務(wù)程序,此時將進入 user 模式,由于在 rti 之前設(shè)置了 reti 寄存器的值, pc 將進入 .LWAIT_HERE 的這個死循環(huán)。又由于之前使用了 raise 15 觸發(fā)了一個軟中斷,因此進入中斷 15 的服務(wù)程序,即 _real_start

在使用 u-boot 引導(dǎo)的時候,由于同樣的原因, u-boot 的主循環(huán)一直是在中斷 15 的服務(wù)程序中的,引導(dǎo)內(nèi)核時同樣處于這種狀態(tài),此時 rti 退出的將是 u-boot 的那個中斷服務(wù)。

1 參考資料

head.s 分析 (1) :保存 u-boot 傳遞過來的指針 (2009-1-19)

head.s 分析 (2) SYSCFG 配置 (2009-1-19)

head.s 分析 (3) :數(shù)據(jù)及指針寄存器清 0 (2009-1-19)

head.s 分析 (4) :關(guān)閉 CACHE (2009-01-19)

head.s 分析 (5) :關(guān)閉串口 (2009-01-19)

head.s 分析 (6) :棧指針初始化 (2009-01-19)

head.s 分析 (7) init_early_exception_vectors (2009-1-19)

head.s 分析 (8) :配置 PLL SDRAM (2009-01-20)

head.s 分析 (9) EBIU 配置 (2009-01-20)

head.s分析(10):轉(zhuǎn)入中斷15


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 国产精品国产亚洲精品不卡 | 欧美一级毛片免费观看 | 欧美黄色a | 四虎成人精品在永久在线观看 | 久久精品国产精品亚洲毛片 | 天天拍天天干天天操 | 亚洲欧美视屏 | www.亚洲精品.com| 炮房五月| 国产成人亚洲综合欧美一部 | 7777成年大片免费播放器 | 久久精品亚洲精品国产色婷 | 极品福利在线 | 日本高清免费不卡视频 | 乱在线伦视频免费 | 不卡一二区 | 欧美一级黄色毛片 | 国产午夜不卡 | 久久影| 亚洲综合极品香蕉久久网 | 黄色免费看网站 | 国产精品国产高清国产专区 | 前田香织一区二区中文字幕 | 黄色录像日本 | 欧美jizzhd极品欧美 | 亚洲精品免费在线观看 | 国产一级毛片在线 | 中国jizz18免费 | 黄色午夜影院 | 国产一区日韩二区欧美三 | 激情五月色婷婷丁香伊人 | 曰本亚洲欧洲色a在线 | 99精品久久99久久久久 | 国产欧美国产精品第一区 | 97免费看 | 免费污视频在线观看 | 在线视频a | 日韩深夜视频 | 中文字幕综合网 | 久久九色综合九色99伊人 | 久久99国产精品久久欧美 |