📄 pmupost.asm
字号:
;Procedure: Clear_PM_RAM
;
;Function : Clear power management data area (PM_RAM segment)
; This routine is used to clear extended BIOS data area
; in order to provide a clean environment for power
; management code
;
;Input : ES : PM_RAM
;Output : None
;
;Registers: all registers preserved except FLAGS
;
;[Note] : called from PM_INIT
;[]==================================================================[]
Public Clear_PM_RAM
Clear_PM_RAM Proc Near
ASSUME ES:PM_RAM
pusha
mov di,offset PM_RAM:PM_RAM_START
mov cx,PM_RAM_LEN
xor ax,ax
cld
rep stosb
popa
ret
Clear_PM_RAM Endp
;[]========================================================================[]
;Procedure: Ct_PMRAM_Use_SYSRAM
;
;Function : To tell the BIOS kernel that if you are using the SYSRAM
; for PM_RAM
;
;Input : None
;
;Output : AL = Size of PM_RAM that you want to reserved from SYSRAM.
; 0=None, 1=1K, 2=2k etc.
;
;Save : All registers except AL & FLAGS
;
;Note : 1. called before PM_INIT (POST 79)
; 2. simply return AL=0 if PM_RAM is located at shadow RAM
; or SMRAM
; 4. stack available
;[]========================================================================[]
Public Ct_PMRAM_Use_SYSRAM
Ct_PMRAM_Use_SYSRAM Proc Near
xor al,al
ret
Ct_PMRAM_Use_SYSRAM Endp
;[]========================================================================[]
;Procedure: Ct_Early_PM_Init
;
;Function : Early PM chip initializations
;
;Input : None
;
;Output : None
;
;Preserve : All
;
;Note : 1. Call from POST 9
; 2. Stack available
; 3. You can initialize any PM function which is needed
; to be done earlier!
;[]========================================================================[]
Public Ct_Early_PM_Init
Ct_Early_PM_Init Proc Near
ifndef MP_SUPPORT
Post_Func_Call E000_Ct_Early_PM_Init
endif; MP_SUPPORT
ret
Ct_Early_PM_Init Endp
ifndef New_Superio_Led_Function
ifdef PM_LED_USE_GPIO
F000_Set_PM_LED Proc Far
call Set_PM_LED
retf
F000_Set_PM_LED Endp
endif; PM_LED_USE_GPIO
ifdef LED_Blinking_at_PM
F000_Set_PM_LED_Blinking Proc Far
call Set_PM_LED_Blinking
retf
F000_Set_PM_LED_Blinking Endp
endif; LED_Blinking_at_PM
ifdef POWER_LED_USE
F000_Set_POWER_LED Proc Far
call Set_POWER_LED
retf
F000_Set_POWER_LED Endp
endif; POWER_LED_USE
else ;New_Superio_Led_Function
ifdef LED_Blinking_at_PM
F000_LED_Flash Proc Far
call Set_POWER_LED
retf
F000_LED_Flash Endp
endif; LED_Blinking_at_PM
endif ;New_Superio_Led_Function
;[]========================================================================[]
;Input : None
;Output : AL = 0 --> Currently MODEM Ring cannot
; wake up system
; AL = RING_WAKEUP_ENABLED --> Currently MODEM Ring can
; wake up system
;[]========================================================================[]
Public CT_RING_WAKEUP_STATUS
CT_RING_WAKEUP_STATUS Proc Near
mov cx, VT586_ACPI + 44h
call Get_PMU
mov bl,al
mov [WAKE_MODEM0],al
mov cx,VT586_ACPI + 45h
call Get_PMU
mov bh,al
mov [WAKE_MODEM1],al
mov cx, VT586_ACPI + 46h
call Get_PMU
or bl,al
mov cx, VT586_ACPI + 47h
call Get_PMU
mov bh,al
mov word ptr PM_RAM:[DEASSERT_STPCLK_IRQS],bx
extrn Modem_IRQ_Item:near
mov si, offset Modem_IRQ_Item
call GetItem_Value
mov word ptr [APM_Modem_IRQ], 0
or al, al
jz short @F
mov bx, 1
mov cl, al
shl bx, cl
mov word ptr [APM_Modem_IRQ], bx
or word ptr PM_RAM:[DEASSERT_STPCLK_IRQS],bx
or byte ptr [WAKE_MODEM0],bl
or byte ptr [WAKE_MODEM1],bh
test ax,bx
mov al, RING_WAKEUP_ENABLED ;current ON
jnz short @F
xor al, al ;current OFF
@@:
ret
CT_RING_WAKEUP_STATUS Endp
;[]========================================================================[]
;Input : None
;Output : AL = 0 --> PM Timer is currently disabled
; AL = PMU_TIMER_ENABLED --> PM Timer is currently Enabled
;[]========================================================================[]
Public CT_PMU_TIMER_STATUS
CT_PMU_TIMER_STATUS Proc Near
mov al, PMU_TIMER_ENABLED ;assume enabled
mov cx,VT586_ACPI+50h
call Get_PMU
test al,80h
jnz short @F ;No
xor al, al ;all mode disable
@@:
ret
CT_PMU_TIMER_STATUS Endp
;[]========================================================================[]
;Procedure: Ct_PM_Final_Init
;
;Function : PM initialization before boot
;
;Input : None
;
;Output : None
;
;Registers: Please preserve all registers
;
;Note : 1. Call from POST 82
; 2. Stack available
;[]========================================================================[]
Public Ct_PM_Final_Init
Ct_PM_Final_Init Proc Near
Post_Func_Call E000_Ct_PM_Final_Init
ret
Ct_PM_Final_Init Endp
;[]========================================================================[]
;Procedure: Ct_PM_Init
;
;Function : Special PM init which the standard code can't do
;
;Input : DS = DGROUP
; ES = PM_RAM
;
;Output : None
;
;Note : 1. Call from POST 79S (PM initialization)
; 2. Stack available
; 3. Don't destroy any SEGMENT registers!
;[]========================================================================[]
ASSUME ES:PM_RAM
ASSUME DS:DGROUP
Public Ct_PM_Init
Ct_PM_Init Proc Near
Post_Func_Call E000_Ct_Pm_Init
ret
Ct_PM_Init Endp
;[]========================================================================[]
;Procedure: Ct_LCD_Init
;
;Function : Set the LCD power down timer which initial method
; varies from chip to chip
;
;Input : DS = DGROUP
; ES = PM_RAM
;
;Output : None
;
;Note : 1. Call from POST 79S (PM initialization)
; 2. Stack available
; 3. Don't destroy any SEGMENT registers!
;[]========================================================================[]
ASSUME ES:PM_RAM
ASSUME DS:DGROUP
Public Ct_LCD_Init
Ct_LCD_Init Proc Near
ret
Ct_LCD_Init Endp
;[]========================================================================[]
;Procedure: HDD_Standby_Offset
;
;Function : Tell BIOS kernal the offset of the setup item
; "HDD Power Down Timer"
;
;Input : DS = DGROUP
; ES = PM_RAM
;
;Output : NC: HDD Power Down Item exist
; SI = Item offset
; CF: HDD Power Down Item absent
; SI Don't care
;
;Note : 1. Call from POST 79S (PM initialization)
; 2. Stack available
; 3. Don't destroy any SEGMENT registers!
; 4. If you don't have such a item in SETUP,
; just set carry flag & return!
;[]========================================================================[]
ASSUME ES:PM_RAM
ASSUME DS:DGROUP
Public HDD_Standby_Offset
HDD_Standby_Offset Proc Near
extrn HDD_Timer_Item:Near
mov si,offset HDD_Timer_Item
clc
ret
HDD_Standby_Offset Endp
;[]========================================================================[]
;Procedure: Get_IRQ15_Offset
;
;Input : DS = G_RAM
;
;Output : NC:
; AX = Segment location of the IRQ15
; PMI service routine
; SI = offset of the IRQ15 PMI service routine
;
; i.e. AX:SI
;
; CF:
; IRQ 15 is not supported!
;
;Registers: Please preserve all registers except AX & SI
;
;[Note] : 1. called from PM_INIT
; NC: AX:SI will be placed interrupt table located
; in segment 0
; CF: IRQ15 vector will be masked off
;[]========================================================================[]
ASSUME DS:G_RAM
Public Get_IRQ15_Offset
Get_IRQ15_Offset Proc Near
stc
ret
Get_IRQ15_Offset Endp
;[]========================================================================[]
;Procedure: Ct_Resume_Handle
;
;Function : Ct_Resume_Handle
;
;Input : None
;
;Output : None
;[]========================================================================[]
Public Ct_Resume_Handle
Ct_Resume_Handle Proc Near
mov ax,G_RAM
mov ds,ax
ASSUME DS:G_RAM
mov ss,G_RAM:[ROM_MODULE_SEG]
mov sp,G_RAM:[ROM_MODULE_OFFSET]
iret
Ct_Resume_Handle Endp
;[]-------------------------------------------------------------------[]
;
; PPPPPPPP AA RRRRRRRR TTTTTTTTTTT 33333
; PPPPPPPPP AAAA RRRRRRRRR TTTTTTTTTTT *** 333 333
; PPP PPP AAAAAA RRR RRR TTT *** 333
; PPPPPPPPP AAA AAA RRRRRRRRR TTT 33333
; PPPPPPPP AAAAAAAAAA RRRRRRRR TTT *** 333
; PPP AAAAAAAAAAAA RRR RRR TTT *** 333 333
; PPP AAA AAA RRR RRR TTT 33333
;
; Hooks to the real mode APM functions
;
;[]-------------------------------------------------------------------[]
;[]-------------------------------------------------------------------[]
;
; PPPPPPPP AA RRRRRRRR TTTTTTTTTTT 44444
; PPPPPPPPP AAAA RRRRRRRRR TTTTTTTTTTT *** 444444
; PPP PPP AAAAAA RRR RRR TTT *** 444 444
; PPPPPPPPP AAA AAA RRRRRRRRR TTT 4444444444
; PPPPPPPP AAAAAAAAAA RRRRRRRR TTT *** 44444444444
; PPP AAAAAAAAAAAA RRR RRR TTT *** 444
; PPP AAA AAA RRR RRR TTT 444
;
;
;
; OEM specific subroutines
;
; Normally, this part will be placed with the PMI handler
; (IRQ15 or SMI or NMI)
;
;[]-------------------------------------------------------------------[]
;[]========================================================================[]
;Function : Routine to handle the power management interrupt (PMI).
;
;Input : None
;
;Output : if PM using IRQ --- no output!
; if PM using NMI --- NC: BIOS has handle this NMI for
; PM chip!
; CF: NMI is not issue by PM chip
;
;Destroy: if PM using IRQ --- destroy None
; if PM using NMI --- destroy FLAG
;[]========================================================================[]
Public APM_R31_Added
APM_R31_Added:
;[]========================================================================[]
;Procedure: Get_PMI_Source
;
;Function : To get the corresponding PMI routine according
; to what kind of PMI it is
;
;Input : DS = PM_RAM
;
;Output : SI = point to appropriate PMI handler
; e.g. if it is a suspend request
; SI = offset Suspend_Handler
;
;Note : 1. Called from PM_Handler
; 2. stack available
; 3. The BIOS PM kernal will issue:
; "call si" after calling this routine!
;[]========================================================================[]
;[]========================================================================[]
;
;Function : Service routine to handle PMI source 0Fh (reg. 35h bit 4-0)
;
;[]========================================================================[]
;[]========================================================================[]
;
;Function : Service routine to handle PMI source
;
;[]========================================================================[]
;[]========================================================================[]
;
;Function : Service routine to handle PMI source
;
;[]========================================================================[]
;[]========================================================================[]
;
;Function : Service routine to handle EXT SMI1 source
;
;[]========================================================================[]
;[]========================================================================[]
;
;Function : Service routine to handle PMI source
;
;[]========================================================================[]
;[]========================================================================[]
;
;Function : Service routine to handle PMI source
;
;[]========================================================================[]
;[]========================================================================[]
;
;Function : Service routine to handle PMI source
;
;[]========================================================================[]
ASSUME DS:PM_RAM
ifndef CRT_Control_Not_In_F000
F000_Enable_CRT Proc Far
call Enable_CRT
retf
F000_Enable_CRT Endp
F000_Disable_CRT Proc Far
call Disable_CRT
retf
F000_Disable_CRT Endp
endif ;CRT_Control_Not_In_F000
ifndef V_ALARM_IN_E000
F000_Virtual_Resume_Timer Proc Far
call Virtual_Resume_Timer
retf
F000_Virtual_Resume_Timer Endp
;-----------------------------------------------------------
;Function : 1. reg.30h bit 1,0 --> 00b (Full-On Mode)
; 2. set PM_RAM:[PM_MODE]=FULL_ON
; 3. Enable CRT display
; 4. set CPU to its full speed
;
;Input : DS = PM_RAM
;
;Output : None
;-----------------------------------------------------------
;[]========================================================================[]
;input : DS = PM_RAM
;[]========================================================================[]
include v_alarm.inc
Low_Power_Throttling Proc Near
ret
Low_Power_Throttling Endp
endif ;V_ALARM_IN_E000
ALIGN 4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -