怎麼讓系統支持S1

        前兩天,一位前輩問我,怎麼樣讓系統支持S1呢?一時無語。
平時我接觸的都是筆記本,只支持S3,S4和S5,也沒有仔細看是怎麼支持的。
做了一個支持S1的試驗,進入S1後看起來和進入S3差別是:Power燈不是閃而是一直亮的,進入和退出時間要短得多。
那麼怎麼樣讓OS知道我們支持S1呢?OS怎麼樣進入S1呢?

在ACPI spec中有說到,System /_Sx states
All system states supported by the system must provide a package containing the DWORD value of the following format in the static

Definition Block. The system states, known as S0–S5, are referenced in the namespace as /_S0–/_S5 and for clarity the short Sx

names are used unless specifically referring to the named /_Sx object. For each Sx state, there is a defined system behavior.

System State Package

Byte    Byte     Length Offset Description
1       0            Value for PM1a_CNT.SLP_TYP register to enter this system state.
1       1            Value for PM1b_CNT.SLP_TYP register to enter this system state. To enter any given state, OSPM must write the PM1a_CNT.SLP_TYP register before the PM1b_CNT.SLP_TYP register.
2       2           Reserved

例如:Name(/_S1, Package(4){0x1,0x0,0,0}),就申明瞭_S1這個system state,用於告訴OS,系統支持S1!
S0,S3,S4和S5都是這樣的(當然,S0和S5是每個都支持的)。並且這個Package也說明了進入S1的方法:
 將0x1寫如到PM1a_CNT.SLP_TYP,0x0寫入到PM1b_CNT.SLP_TYP,設置SLP_EN位。
其中PM1a_CNT和PM1b_CNT在Fixed ACPI Description Table (FADT)中有回報,
SLP_TYP和SLP_EN是PM1 Control Registers中的的bit12~10和bit13,在ACPI spec中都有定義。
這裏也體現了ACPI架構的優點:OS只要得到ACPI Tables和AML code就幾乎得到了他想得到的一切,底層的都不用去管。 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章