Example: 移除0120的前置0
@for /f "tokens=* delims=0" %%a in ("%var%") do @set var=%%a
@if "%var%"=="" set var=0
@echo %var%
Output:
| Field   | Byte Length   | Byte Offset   | Description   |
| Signature   | 4   | 0   | 'FACP'   |
| ......   | ......   | ......   | ......   |
| GPE0_BLK   | 4   | 80   |
GPE 0 Register Block 的 port address。 若不support,則值為0。 |
| GPE1_BLK   | 4   | 84   |
GPE 1 Register Block 的 port address。 若不support,則值為0。 |
| ......   | ......   | ......   | ......   |
| GPE0_BLK_LEN   | 1   | 92   |
GPE 0 Register Block 所decode 的bytes 長度。 其值必為2的正指數冪。 |
| GPE1_BLK_LEN   | 1   | 93   |
GPE 1 Register Block 所decode 的bytes 長度。 其值必為2的正指數冪。 |
| GPE1_BASE   | 1   | 94   |
GPE1 events在ACPI general-purpose event中 的offset。GPE0 events 的offset為0。 |
| ......   | ......   | ......   | ......   |
ACPI spec在 FADT table定義了兩組 GPE register blocks:GPE 0與 GPE 1。register block包含 enable 與 status register (ex:GPE0_EN與 GPE0_STS),這兩個 register長度各佔 register block長度的 一半,所以 FADT中 register block的長度 GPE0_BLK_LEN與 GPE1_BLK_LEN必為 2的冪次。
與 Intel PCH spec對照,可從 PMC Controller (D31:F2)的 Offset 40-43h讀出 ACPI Base Address,用 RW讀出其值為 0x1801,bit 1代表為 IO space,所以其 IO address為 0x1800。
與 Spec中的 PMC I/O Based Register 對照,Offset 0x80為 GPE0 block register起始位置,跟 FADT table位置為0x1880 (0x1800 + 0x80) 符合。
再用RW 讀取IO address 0x1880,就可得出GPE0 Register Block位置。若要知道GPE register 每 個bit實際上對應的 GPIO pin,則需參考chipset的相關設定。
要將 GPIO配置成 GPE的 source,要先將 GPIO配置成可以產生 SCI。需先將 GPI General Purpose Event Enable設起來。
還要配置 Pad Configuration中的 GPIROUTSCI bit。
為ACPI predefined 的namespace,用以處理GPE register block中的General events。
以我所使用的主機板為例,\_GPE中定義了_E02 的Method,表示其為 handle GPE0_STS bit2 edge event的method。
| Categories | Package | Description |
| Devel | gcc-core | GNU Compiler Collection (C, OpenMP) |
| Devel | gcc-g++ | GNU Compiler Collection (C++) |
| Devel | make | The GNU version of the 'make' utility |
| Devel | binutils | GNU assembler, linker and similar utility |
| Devel | gdb | The GNU debugger |
| Memory Type and Mnemonic | Encoding in MTRR |
| Uncacheable (UC) | 00H |
| Write Combining (WC) | 01H |
| Reserved | 02H |
| Reserved | 03H |
| Write-through (WT) | 04H |
| Write-protected (WP) | 05H |
| Write-back (WB) | 06H |
| Reserved | 07H-FFH |