日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

[architecture]-Generic Timer

發布時間:2025/3/21 编程问答 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 [architecture]-Generic Timer 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

快速鏈接:
.
👉👉👉 個人博客筆記導讀目錄(全部) 👈👈👈

前言:
什么是arch timer? 什么是apb timer? 什么generic timer?
自己悟去吧😁😁😁

文章目錄

        • 1、architecture
        • 2、processor中有哪些timer?
        • 3、寄存器介紹
          • (1)、Count and frequency
          • (2)、Timer registers
          • (3)、Accessing the timers
        • 4、Configuring a timer
        • 4、中斷
        • 5、Timer virtualization

1、architecture

generic Timer由System Counter和per-core timer組成.
System Counter提供固定頻率的counter,56-64bits寬度,1MHZ-50MHZ

2、processor中有哪些timer?

3、寄存器介紹

(1)、Count and frequency

CNTPCT_EL0:reports the current system count value
CNTFRQ_EL0:reports the frequency of the system count

(2)、Timer registers

主要有三個寄存器:

前綴是:

(3)、Accessing the timers

? EL1 Physical and Virtual Timers
EL0 access to these timers is controlled by CNTKCTL_EL1.
? EL2 Physical and Virtual Timers
When HCR_EL2.{TGE,E2H}=={1,1}, EL0 access to these timers is controlled by CNTKCTL_EL2:. These timers were added as part of the support for the Armv8.1-A Virtualization Host Extension, which is beyond the scope of this
guide
? EL3 physical timer
S.EL1 and S.EL2 access to this timer is controlled by SCR_EL3.ST.

4、Configuring a timer

使用timer有兩種方式:

  • 使用CVAL, CVAL是64位的寄存器;
    Timer Condition Met: CVAL <= System Count
  • 使用TVAL, TVAL是32位的寄存器, TVAL隨著system conter值的增加而減小.
    CVAL = TVAL + System Counter
    Timer Condition Met: CVAL <= System Count

4、中斷

timer產生的中斷,只可以routing到當前core

timer中斷的控制,在CTL寄存器中
? ENABLE – Enables the timer.
? IMASK – Interrupt mask. Enables or disables interrupt generation.
? ISTATUS – When ENABLE==1, reports whether the timer is firing (CVAL <= System Count).
Must set ENABLE to 1 and clear IMASK to 0

The interrupt ID (INTID)由SBSA文檔定義推薦的值, 注:Server Base System Architecture (SBSA)

中斷產生之后,會持續輸出中斷,直到如下條件發生:
? IMASK is set to one, which masks the interrupt.
? ENABLE is cleared to 0, which disables the timer.
? TVAL or CVAL is written, so that firing condition is no longer met.

所以在產生一個timer中斷后,軟件需要在該中斷變為deactivating之前,清除該中斷。

5、Timer virtualization

Virtual Count = Physical Count -
CNTVOFF_EL2配置offset,CNTVOFF_EL2只可以在EL3或EL2中訪問


如果EL2沒有使用,那么offset為0,此時虛擬counter和物理conter值相等

總結

以上是生活随笔為你收集整理的[architecture]-Generic Timer的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。