欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

head.s分析(2):SYSCFG配置

系統 1774 0

快樂蝦

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

lights@hb165.com

本文適用于

ADI bf561 DSP

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

Visual DSP++ 5.0(update 5)

歡迎轉載,但請保留作者信息

/* Enable Cycle Counter and Nesting Of Interrupts */

#ifdef CONFIG_BFIN_SCRATCH_REG_CYCLES

R0 = SYSCFG_SNEN;

#else

R0 = SYSCFG_SNEN | SYSCFG_CCEN;

#endif

SYSCFG = R0;

這幾行代碼用于設置 SYSCFG 的值,關于 SYSCFG 這個寄存器, vdsp 文件這樣說:

The System Configuration Register (SYSCFG) shown in Figure 4-3 controls the configuration of the processor

對于 BF561 而言,只有 CCEN SSSTEP 兩位有效,在這里將 CCEN 位設置為 1 ,表示要啟用 64 位的 cycle counter 。而對 SNEN 的置位將被忽略。

System Configuration  Register

在啟用了 CCEN 之后, CYCLES CYCLES2 兩個寄存器將開始統計 CCLK 的個數。

下面是 vdsp 文檔中對 CYCLES CYCLES2 這兩個寄存器的一個說明:

The cycle counter counts CCLK cycles while the program is executing. All cycles, including execution, wait state, interrupts, and events, are counted while the processor is in User or Supervisor mode, but the cycle counter stops counting in Emulator mode.

The cycle counter is 64 bits wide and increments every cycle. The count value is stored in two 32-bit registers, CYCLES and CYCLES2 . The least significant 32 bits (LSBs) are stored in CYCLES. The most significant 32 bits (MSBs) are stored in CYCLES2 .

Note: To ensure read coherency, first read CYCLES , then CYCLES2 , and then CYCLES again, to detect if an overflow has occurred in the LSBs during the read operations.

In User mode, these two registers may be read, but not written. In Supervisor and Emulator modes, they are read/write registers.

To enable the cycle counters, set the CCEN bit in the SYSCFG register. The following example shows how to use the cycle counter:

R2 = 0;

CYCLES = R2;

CYCLES2 = R2;

R2 = SYSCFG;

BITSET(R2,1);

SYSCFG = R2;

/* Insert code to be benchmarked here. */

R2 = SYSCFG;

BITCLR(R2,1);

SYSCFG = R2;

通常這兩個寄存器可以用于性能統計。但是由于這兩個寄存器在幾種模式下均是可寫的,因此也可以將它們當成通用寄存器使用。在 uclinux 內核中,提供了一個叫 CONFIG_BFIN_SCRATCH_REG_CYCLES 的選項來控制 CYCLES 的用途:

config BFIN_SCRATCH_REG_CYCLES

bool "CYCLES"

help

Use the CYCLES register in the Blackfin exception handler

as a stack scratch register . This means you cannot

safely use the CYCLES performance registers on a Blackfin

board at anytime, but you can debug the system with a JTAG

ICE and use the NMI.

當設置了 CONFIG_BFIN_SCRATCH_REG_CYCLES 后,在 linux-2.6.x\arch\blackfin\mach-common\entry.S 文件中將 CYCLES 做為普通寄存器使用:

#if defined (CONFIG_BFIN_SCRATCH_REG_RETN)

# define EX_SCRATCH_REG RETN

#elif defined (CONFIG_BFIN_SCRATCH_REG_RETE)

# define EX_SCRATCH_REG RETE

#else

# define EX_SCRATCH_REG CYCLES

#endif

自然,在此時 CYCLES 是不應該自動計數的,因此 SYSCFG_CCEN 應該保持為 0

uclinux 內核代碼中搜索 CYCLES ,可以發現有以下幾個文件使用了它:

linux-2.6.x\drivers\char\bfin_timer_latency.c

linux-2.6.x\drivers\media\video\blackfin\blackfin_cam.c

linux-2.6.x\drivers\zaptel\bfsi-spi-framework.c

linux-2.6.x\drivers\zaptel\bfsi.c

當要使用這幾個驅動時,就一定需要使 SYSCFG_CCEN=1

1 參考資料

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

head.s分析(2):SYSCFG配置


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

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

【本文對您有幫助就好】

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

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 欧美一级毛片在线看视频 | 日韩不卡在线 | 日韩国产在线 | 亚州精品天堂中文字幕 | 国产精品人成福利视频 | 久草网在线 | 日韩精品在线一区 | 一级做a免费视频 | 美女污污视频网站 | 久久中文字幕美谷朱里 | 91精品视频在线播放 | 久久精品这里是免费国产 | 日本阿v无码观看dvd | 国产在线精品一区二区三区 | 丁香婷婷成人 | 欧美亚洲视频一区 | 一级毛片视频在线观看 | 久久国产免费福利永久 | 久草社区在线 | 国产精品久久av | 久久精品视频在线观看 | 黄色一级a毛片 | 国产成人精品在线观看 | 91免费国产 | 九九精品激情在线视频 | 波多野结衣免费观看视频 | 男女做www免费高清视频 | 亚洲综合色视频在线观看 | 一区二区三区四区在线观看视频 | 免费观看一级特黄欧美大片 | 欧美性色综合网 | 国产一区二区不卡 | 国产精品1页 | 日本黄色不卡视频 | 五月天婷婷综合 | 日本在线视频www鲁啊鲁 | 99伊人 | 国产99久 | 国产一区网址 | 2021国产精品自拍 | 君岛美绪一区二区三区在线视频 |