📄 aslbuild.mak
字号:
// OpReg are going to be used. Or hardwire the address(es) of OpRegion(s)
////////////////////////////////////////////////////////////////////////////
!endif
// PM controller IO space
OperationRegion(PWRG, SystemIO, PMBS, 0x40)
!if $(A_SMBUS)
// SMBus controller IO space
OperationRegion(SMRG, SystemIO, SMBS, 0x10)
!endif
}
!endif
!if $(A_OEM_PCI_DEV)
// OEM PCI device
Include("$(ACPI_ASL_PATH)cust_pci.oem")
!endif
!if $(A_IDE_PM)
Device(IDE0) { // IDE controller
Name(_ADR, 0x$(A_IDE_DEV_FUN_Adr))
// add custom PM control code for PS0, PS3
Include("$(ACPI_ASL_PATH)pci-ide0.asl")
} // end IDE
!endif
!if $(A_USB_ALL)
Device(USB) { // Device USB
Name(_ADR, 0x$(A_USB_DEV_FUN_Adr))
!if $(A_USB_WAKE_UP) || $(A_PME_WAKE_UP)
//---------Power Resources for USB -------------------------
/*
PowerResource(USBP, 3, 0) // SystemLevel Parameter=0,
{ // which means Dev. can be turned off
// in S3 or deeper sleep state
Name(STA, 0)
Method(_STA, 0) {
Return(STA)
}
Method(_ON) {
Store(1, STA)
} // end of _ON
Method(_OFF){
Store(0, STA)
} // end of _OFF
}
// Power resources & Wake - up capabilities
Name(_PR0, Package(){USBP})
Name(_PSC,0) // Return power state
Method(_PS0,0){ // D0
Store(0, _PSC)
}
Method(_PS3,0){ // D3
Store(3, _PSC)
}
*/
// Wake up on USB event
! if $(A_USB_WAKE_UP)
Name(_PRW, Package(){0x$(A_USB_GPE), 0x$(A_USB_WAK_SYST)})
! else
Name(_PRW, Package(){0x$(A_USB_GPE), 0x$(A_PME_WAK_SYST)})
! endif
!endif
} // end USB
!endif
!if $(A_LAN_WAKE_UP)
! if "$(A_PCI_SLOT1)" != ""
// Slot 1
Device(SLT1) {
Name(_ADR, 0x$(A_PCI_SLOT1)FFFF)
// Wake up on LAN event
Name(_PRW, Package(){0x$(A_LAN_GPE), 0x$(A_LAN_WAK_SYST)})
}
! endif
! if "$(A_PCI_SLOT2)" != ""
// Slot 2
Device(SLT2) {
Name(_ADR, 0x$(A_PCI_SLOT2)FFFF)
// Wake up on LAN event
Name(_PRW, Package(){0x$(A_LAN_GPE), 0x$(A_LAN_WAK_SYST)})
}
! endif
! if "$(A_PCI_SLOT3)" != ""
// Slot 3
Device(SLT3) {
Name(_ADR, 0x$(A_PCI_SLOT3)FFFF)
// Wake up on LAN event
Name(_PRW, Package(){0x$(A_LAN_GPE), 0x$(A_LAN_WAK_SYST)})
}
! endif
! if "$(A_PCI_SLOT4)" != ""
// Slot 4
Device(SLT4) {
Name(_ADR, 0x$(A_PCI_SLOT4)FFFF)
// Wake up on LAN event
Name(_PRW, Package(){0x$(A_LAN_GPE), 0x$(A_LAN_WAK_SYST)})
}
! endif
! if "$(A_PCI_SLOT5)" != ""
// Slot 5
Device(SLT5) {
Name(_ADR, 0x$(A_PCI_SLOT5)FFFF)
// Wake up on LAN event
Name(_PRW, Package(){0x$(A_LAN_GPE), 0x$(A_LAN_WAK_SYST)})
}
! endif
! if "$(A_PCI_SLOT6)" != ""
// Slot 6
Device(SLT6) {
Name(_ADR, 0x$(A_PCI_SLOT6)FFFF)
// Wake up on LAN event
Name(_PRW, Package(){0x$(A_LAN_GPE), 0x$(A_LAN_WAK_SYST)})
}
! endif
!endif
!if $(A_PME_WAKE_UP)
// Wake up on PCI PME event
Name(_PRW, Package(){0x$(A_PME_GPE), 0x$(A_PME_WAK_SYST)})
!endif
} // End of PCI0 Root Bus
!if $(A_SLEEP_BUTTON_GENERIC)
// Control method Sleep Button
! if "$(A_SB_IO_Adr)" != ""
! if $(A_S_PIIX4)
OperationRegion(SB01, SystemIO, 0x$(A_SB_IO_Adr), 10)
! else
OperationRegion(SB01, SystemIO, 0x$(A_SB_IO_Adr), 4)
! endif
! if "$(A_SB_ENBL_Offset)" != ""
Field(SB01, ByteAcc, NoLock, Preserve)
{
,$(A_SB_ENBL_Offset),
SBEN,1,
}
! endif
! if "$(A_SB_STA_Offset)" != ""
Field(SB01, ByteAcc, NoLock, Preserve)
{
,$(A_SB_STA_Offset),
SLPS,1,
}
! else
Name(SLPS, 0)
! endif
!else
Name(SLPS, 0)
!endif
Device(SLPB) // Device Sleep Button
{
Name(_HID,EISAID("PNP0C0E"))
Method(SBEV, 0) { // SBEVent handler
// Serve Sleep button event
If (SLPS) {
Store(0, SLPS)
Notify (SLPB, 0x02) } // Wake-Up
Else {
Store(1, SLPS)
Notify (SLPB, 0x80) } // Sleep
} // end SBEVent handler
!if "$(A_SB_IO_Adr)" != ""
! if "$(A_SB_ENBL_Offset)" != ""
Method(_PSW, 1)
{
// Store(Arg0, SBEN)
Store(1, SBEN)
}
! endif
!else
! if "$(A_SB_GPE)" != ""
Scope(\_GPE)
{
Method(_L$(A_SB_GPE), 0) { // Are we sure this is a LEVEL ?
\_SB.SLPB.SBEV() // Sleep Button event handler
} // end of GPE_SB
} // end GPE
Name(_PRW, Package(){0x$(A_SB_GPE), $(A_SB_WAK_SYST)})
! endif
! endif
} // End Device Sleep Button
!endif
!if $(A_POWER_BUTTON_GENERIC)
// Control method Power Button
!if "$(A_PB_IO_Adr)" != ""
OperationRegion(PB01, SystemIO, 0x$(A_PB_IO_Adr), 4)
! if "$(A_PB_ENBL_Offset)" != ""
Field($(A_PB_PATH), ByteAcc, NoLock, Preserve)
{
,$(A_PB_ENBL_Offset),
PBEN,1,
}
! endif
! if "$(A_PB_STA_Offset)" != ""
Field($(A_PB_PATH), ByteAcc, NoLock, Preserve)
{
,$(A_PB_STA_Offset),
PBST,1,
}
! else
Name(PBST, 0)
! endif
!else
Name(PBST, 0)
!endif
Device(PWRB) // Device Power Button
{
Name(_HID,EISAID("PNP0C0C"))
Method(PBEV, 0) { // PBEVent handler
// Serve power button event
If (PBST) {
Store(0, PBST)
Notify (PWRB, 0x02) } // Wake-Up
Else {
Store(1, PBST)
Notify (PWRB, 0x80) } // Sleep
} // end PBEVent handler
!if "$(A_PB_IO_Adr)" != ""
! if "$(A_PB_ENBL_Offset)" != ""
Method(_PSW, 1)
{
Store(Arg0, PBEN)
}
! endif
! if "$(A_PB_STA_Offset)" != ""
Scope(\_GPE)
{
Method(_L$(A_PB_GPE), 0){ // Are we sure this is a LEVEL ?
\_SB.PWRB.PBEV() // Power Button event handler
} // end of GPE_PB
} // end GPE
! endif
! endif
Name(_PRW, Package(){0x$(A_PB_GPE), 0x05})
} // End Device Power Button
!endif
} // End of _SB scope
//----------------------------------------------------------------------
// SYSTEM MANAGEMENT DEVICES
//----------------------------------------------------------------------
!if $(A_SMBUS)
// SMBus interface over PIIX4 SMBus host controller
Include("$(ACPI_ASL_PATH)smb_host.asl")
!endif
!if "$(A_FAN_ISA_IO_Adr)" != ""
OperationRegion(FNOR, SystemIO, 0x$(A_FAN_ISA_IO_Adr), 0x04)
!elseif "$(A_FAN_INDEX_DATA_IO_Adr)" != ""
OperationRegion(FNOR, SystemIO, 0x$(A_FAN_INDEX_DATA_IO_Adr), 0x02)
Field ( FNOR, ByteAcc, NoLock, Preserve)
{
FIND,8, //field named INDX is 8 bits wide
FDTA,8 //field DATA is 8 bits wide
}
!endif
!if $(A_FAN_MODEL_1)
//-----------------------------------------------------------------------
// FAN block 1
//-----------------------------------------------------------------------
$(A_FAN_FIELD)
{
,$(A_FAN_1_GPO_Offset),
FAN1,1,
}
Name(F1ON, $(A_FAN_1_1_ON)) // FAN 1 On
!if "$(A_FAN_2_GPO_Offset)" != ""
$(A_FAN_FIELD)
{
,$(A_FAN_2_GPO_Offset),
FAN2,1,
}
Name(NFAN, 2)
Name(F2ON, $(A_FAN_1_2_ON)) // FAN 2 On
!else
Name(NFAN, 1)
Name(FAN2, 1) // FAN 2
Name(F2ON, 1) // FAN 2 On
!endif
! elseif $(A_FAN_MODEL_2)
//-----------------------------------------------------------------------
// FAN block 2
//-----------------------------------------------------------------------
$(A_FAN_FIELD)
{
,$(A_FAN_1_0_GPO_Offset),
FN10,1, // System (Case) FAN0
}
$(A_FAN_FIELD)
{
,$(A_FAN_1_1_GPO_Offset),
FN11,1, // System (Case) FAN1
}
$(A_FAN_FIELD)
{
,$(A_FAN_2_0_GPO_Offset),
FN20,1, // PS FAN 0
}
$(A_FAN_FIELD)
{
,$(A_FAN_2_1_GPO_Offset),
FN21,1, // PS FAN 1
}
// Name(FNON, $(A_FAN_2_ON))
! elseif $(A_FAN_MODEL_3)
//-----------------------------------------------------------------------
// FAN block 3
//-----------------------------------------------------------------------
$(A_FAN_FIELD)
{
,$(A_FAN_1_ON_GPO_Offset),
SFNO,1, // System FAN On/Off
}
$(A_FAN_FIELD)
{
,$(A_FAN_1_LOW_GPO_Offset),
SFNL,1, // System (Case) FAN_LOW
}
$(A_FAN_FIELD)
{
,$(A_FAN_1_MID_GPO_Offset),
SFNM,1, // System FAN_MIDIUM
}
$(A_FAN_FIELD)
{
,$(A_FAN_2_ON_GPO_Offset),
PFNO,1, // PS FAN On/Off
}
$(A_FAN_FIELD)
{
,$(A_FAN_2_LOW_GPO_Offset),
PFNL,1, // Power Supply FAN_LOW
}
$(A_FAN_FIELD)
{
,$(A_FAN_2_MID_GPO_Offset),
PFNM,1, // PS FAN_MIDIUM
}
Name(F1ON, $(A_FAN_3_1_ON))
Name(F2ON, $(A_FAN_3_2_ON))
! endif
!if $(A_FAN_OEM)
Include("$(ACPI_ASL_PATH)cust_fan.oem")
! elseif "$(A_FAN_PATH)" != ""
Include("$(ACPI_ASL_PATH)fan.asl")
!endif
!if $(A_THERMAL)
//---------------------------------------------------------------------------
// Generic ThermalZone objects
//---------------------------------------------------------------------------
// Note: Do not require any changes unless system has more then
// one Active cooling FAN device and/or more then one CPU
//---------------------------------------------------------------------------
Scope(\_TZ){
// Global variables (presently for Thermal)
Name(THBF, Buffer(){ 0, 0 ,0 ,0})
// Converts temperature in Celcius to Kelvin in format xxx.y (2732 => 273.2k)
Method(KELV, 1) {
And(Arg0, 0xff, Local0) // Leave only Low byte temperarure
Multiply( Local0, 10, Local0 ) // x 10
Add( Local0, 2732, Local0 ) // convert to Kelvin x 10
Return(Local0)
}
! if $(A_FAN_MODEL_1)
Device(FANC){ // CPU FAN
Name(_HID, EISAID("PNP0C0B")) // PnP ID for Fan Device
Name(_PR0, Package(){GFAN})
} // End of FAN
! elseif $(A_FAN_MODEL_2) || $(A_FAN_MODEL_3)
Device(FN00) // High-Midium
{
Name(_HID,EISAID("PNP0C0B"))
Name(_PR0,Package() {
PFN0,
SFN0,
})
}
Device(FN01) // Midium-Low
{
Name(_HID,EISAID("PNP0C0B"))
Name(_PR0,Package() {
PFN1,
SFN1,
})
}
Device(FN02) // Low-Off
{
Name(_HID,EISAID("PNP0C0B"))
Name(_PR0,Package() {
PFN2,
SFN2,
})
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -