📄 gapm12.inc
字号:
int_15_ah53_al07_24:
jmp apm_err_code_0b ; interface not engaged
int_15_ah53_al07_09:
jmp apm_err_code_09 ; unrecognized device ID
int_15_ah53_al07_10:
mov ah,unable_to_enter_req_state ; unable to enter requested state
jmp apm_error_exit ;
int_15_ah53_al07_05:
jmp apm_err_code_0a ; parameter value out of range
int_15_ah53_al07 endp
;---------------------------------------------------------------;
; FN# 08H ... ENABLE/DISABLE POWER MANAGEMENT ;
;---------------------------------------------------------------;
; Input : As specified in function ;
; (DS) PM bios data segment ;
; (AL) APM_CONNECTION_INFO ;
; Output: (CY) 00 for no error ;
; (CY) 01 for error ;
; Required returned registers are updated in stack;
; Register destroyed : ALL GENERAL PURPOSE except (EBP) ;
;---------------------------------------------------------------;
int_15_ah53_al08 proc near
test al,[ebp+off_bp_apm] ; is proper APM connection done ?
jz short int_15_ah53_al08_00 ; no...
;-----------------------------------------------;
test al,apm_bios_power_management_disabled; APM BIOS power management disabled ?
jnz short int_15_ah53_al08_01 ; yes...
cmp bx,all_pm_device_id_v10 ; all power managed device ID for v1.0 ?
jnz short int_15_ah53_al08_02 ; no...
mov bx,all_power_managed_device_id ; convert it to v1.1 ID
int_15_ah53_al08_02:
cmp bx,all_power_managed_device_id ; system ID ?
jnz short int_15_ah53_al08_03 ; no...invalid device ID
jmp int_15_ah53_al080d ; execute like func 0Dh
;-----------------------------------------------;
int_15_ah53_al08_03:
int_15_ah53_al09_03::
int_15_ah53_al0a_03::
jmp apm_err_code_09 ; unrecognized device ID
int_15_ah53_al08_01:
jmp apm_err_code_01 ; power management functionality disabled
int_15_ah53_al08_00:
jmp apm_err_code_03 ; interface not connected
int_15_ah53_al08 endp
;---------------------------------------------------------------;
; FN# 09H ... RESTORE POWER ON DEFAULTS ;
;---------------------------------------------------------------;
; Input : As specified in function ;
; (DS) PM bios data segment ;
; (AL) APM_CONNECTION_INFO ;
; Output: (CY) 00 for no error ;
; (CY) 01 for error ;
; Required returned registers are updated in stack;
; Register destroyed : ALL GENERAL PURPOSE except (EBP) ;
;---------------------------------------------------------------;
int_15_ah53_al09 proc near
call check_apm_connection ; is proper APM connection done ?
jc short int_15_ah53_al09_00 ; no...
cmp bx,all_pm_device_id_v10 ; all power managed device ID for v1.0 ?
jnz short int_15_ah53_al09_02 ; no...
mov bx,all_power_managed_device_id ; convert it to v1.1 ID
int_15_ah53_al09_02:
cmp bx,all_power_managed_device_id ; system ID ?
jnz short int_15_ah53_al09_03 ; no...invalid device ID
mov al,set_power_on_defaults ; set power on defaults for power management
call css_entry_std ; execute in chipset specific module
call set_dev_state ; set device states to power on default
mov al,ds:apm_state ;
call set_rom_apm_state ; update ROM_APM_STATE
clc ; set (cy) = 00 for no error
int_15_ah53_al09_00:
ret
int_15_ah53_al09 endp
;---------------------------------------------------------------;
; FN# 0AH ... GET POWER STATUS ;
;---------------------------------------------------------------;
; Input : As specified in function ;
; (DS) PM bios data segment ;
; (AL) APM_CONNECTION_INFO ;
; Output: (CY) 00 for no error ;
; (CY) 01 for error ;
; Required returned registers are updated in stack;
; Register destroyed : ALL GENERAL PURPOSE except (EBP) ;
;---------------------------------------------------------------;
int_15_ah53_al0a proc near
cmp bx,all_power_managed_device_id ; valid device ID ?
jz short int_15_ah53_al0a_07 ; yes...
test al,apm_bios_active_ver_v12 ; APM BIOS v1.2 active ?
jz short int_15_ah53_al0a_03 ; no...
push bx ;
and bx,0ff00h ; clear unit #
cmp bx,8000h ; valid ?
pop bx ;
jnz short int_15_ah53_al0a_03 ; no...
and bx,00ffh ; get unit #
jz short int_15_ah53_al0a_03 ; invalid unit#
cmp bl,ds:apm_no_of_battery_units ; valid unit# ?
ja short int_15_ah53_al0a_03 ; invalid unit#
call get_ac_battery_status_v12 ; OEM HOOK HOOK HOOK...returns AC line status &
; battery status in (bx),(cx),(dx) & (si)
mov [ebp+off_si_apm],si ; return (si)
jmp short int_15_ah53_al0a_02 ;
int_15_ah53_al0a_07:
call get_ac_battery_status ; CHIPSET HOOK HOOK HOOK...returns AC line status &
; battery status in (bx),(cx) & (dx)
test byte ptr ds:apm_connection_info,apm_bios_active_ver_above_v10; acive APM v1.0 ?
jnz short int_15_ah53_al0a_02 ; no...v1.1
cmp bh,02h ; AC line status is 'On backup power' ?
jnz short int_15_ah53_al0a_00 ; no...
mov bh,00h ; set AC line status as 'Off-line'
jmp short int_15_ah53_al0a_00 ;
int_15_ah53_al0a_02:
mov [ebp+off_dx_apm],dx ; return (dx)
mov [ebp+off_ch_apm],ch ; return (ch)
int_15_ah53_al0a_00:
mov [ebp+off_bx_apm],bx ; return (bx)
mov [ebp+off_cl_apm],cl ; return (cl)
clc ; (CY) = 00 for no error
ret
int_15_ah53_al0a endp
;---------------------------------------------------------------;
; FN# 0BH ... GET PM EVENT ;
;---------------------------------------------------------------;
; Input : As specified in function ;
; (DS) PM bios data segment ;
; (AL) APM_CONNECTION_INFO ;
; Output: (CY) 00 for no error ;
; (CY) 01 for error ;
; Required returned registers are updated in stack;
; Register destroyed : ALL GENERAL PURPOSE except (EBP) ;
;---------------------------------------------------------------;
int_15_ah53_al0b proc near
call check_apm_connection ; is proper APM connection done ?
jc short int_15_ah53_al0b_00 ; no...
mov bx,valid_v10_event_mask ; consider APM v1.0 APM events only
test al,apm_bios_active_ver_above_v10; APM BIOS v1.0 ?
jz short int_15_ah53_al0b_07 ; yes
mov bx,valid_v11_event_mask ; consider APM v1.1 APM events only
test al,apm_bios_active_ver_v12 ; active APM v1.2 ?
jz short int_15_ah53_al0b_07 ; no...
mov bx,valid_v12_event_mask ; consider APM v1.2 APM events only
int_15_ah53_al0b_07:
mov ax,ds:pending_apm_event ;
and ax,bx ; consider valid APM events
bsr bx,ax ; any event pending ?
jz short int_15_ah53_al0b_02 ; no...
xor dx,dx ;
bts dx,bx ; set event to be posted bit in (dx)
btr ax,bx ; clear pending APM event
inc bx ; translated APM event
push ax ;
mov al,notify_pm_event_posted ; notify chipset specific module about PM event posted to OS
call css_entry_std ;
;; or al,al ; OK to post event ?
pop ax ;
;; jz short int_15_ah53_al0b_02 ; no...do not post event...post later
mov ds:pending_apm_event,ax ; update PENDING_APM_EVENT
call set_rom_pending_apm_event ; update ROM_PENDING_APM_EVENT
mov [ebp+off_bx_apm],bx ; return (bx)
test byte ptr ds:apm_connection_info,apm_bios_active_ver_v12; active APM v1.2 ?
jz short int_15_ah53_al0b_10 ; no...
test dx,normal_resume_sys_bit or critical_resume_sys_bit ; normal resume system notification or critical resume system notification ?
jz short int_15_ah53_al0b_10 ; no...
call get_pcmcia_socket_power_down_info; OEM HOOK HOOK HOOK...return (cx) = PCMCIA socket power on/off info
; while posting normal resume system notification (0003h) or crtical resume system notification (0004h)
mov [ebp+off_cx_apm],cx ; return (cx)
int_15_ah53_al0b_10:
clc ; (CY) = 00 for no error
int_15_ah53_al0b_00:
ret
;-----------------------------------------------;
int_15_ah53_al0b_02:
mov ah,no_pm_event_pending ; no power management event pending
jmp apm_error_exit ;
int_15_ah53_al0b endp
;---------------------------------------------------------------;
; FN# 0CH ... GET POWER STATE ;
;---------------------------------------------------------------;
; Input : As specified in function ;
; (DS) PM bios data segment ;
; (AL) APM_CONNECTION_INFO ;
; Output: (CY) 00 for no error ;
; (CY) 01 for error ;
; Required returned registers are updated in stack;
; Register destroyed : ALL GENERAL PURPOSE except (EBP) ;
;---------------------------------------------------------------;
int_15_ah53_al0c proc near
call check_apm_dev_fn0c ; check validity of device
jc short int_15_ah53_al0c_50 ; error...(ah) already has error code updated in stack
;-----------------------------------------------;
mov al,off_get_power_state ; execute get power state
call exec_apm_common ; execute the function
jc short int_15_ah53_al0c_50 ; error...(ah) already has error code updated in stack
mov [ebp+off_cx_apm],ax ; return the state
int_15_ah53_al0c_50:
ret
int_15_ah53_al0c endp
;---------------------------------------------------------------;
; FN# 0DH ... ENABLE/DISABLE DEVICE POWER MANAGEMENT ;
;---------------------------------------------------------------;
; Input : As specified in function ;
; (DS) PM bios data segment ;
; (AL) APM_CONNECTION_INFO ;
; Output: (CY) 00 for no error ;
; (CY) 01 for error ;
; Required returned registers are updated in stack;
; Register destroyed : ALL GENERAL PURPOSE except (EBP) ;
;---------------------------------------------------------------;
int_15_ah53_al0d proc near
call check_apm_dev ; check validity of device and interface
jnc short int_15_ah53_al080d ; no error
ret ; error...(ah) already has error code
;-----------------------------------------------;
; DUMMY PROCEDURE TO SUBSTITUTE '::' ;
;-----------------------------------------------;
int_15_ah53_al080d proc near
mov dl,not pm_enabled_by_apm ; clear pm enabled by APM bit
mov dh,pm_enabled_by_apm ; set pm enabled by APM bit
mov al,off_enable_dev_pm_fn ; execute enable power management
cmp cx,enable_power_management ; enable power management ?
jz short int_15_ah53_al0d_08 ; yes...
cmp cx,disable_power_management ; disable power management ?
jnz short int_15_ah53_al0d_05 ; no...error
;-----------------------------------------------;
; FOLLOWING CODE IN BLOCK IS ADDED TO ;
; PASS INTEL APM TEST SUITE ;
;-----------------------------------------------;
test byte ptr ds:apm_state,pm_enabled_by_apm ; power management enabled by APM ?
jz short int_15_ah53_al0d_06 ; no...
;-----------------------------------------------;
mov dh,00000000b ; disable power management
mov al,off_disable_dev_pm_fn ; execute disable power management
int_15_ah53_al0d_08:
jmp exec_apm_common ; execute the function
;-----------------------------------------------;
int_15_ah53_al0d_06:
jmp apm_err_code_01 ; power management functionality disabled
int_15_ah53_al0d_05:
int_15_ah53_al0f_05::
jmp apm_err_code_0a ; parameter value out of range
int_15_ah53_al080d endp
int_15_ah53_al0d endp
;---------------------------------------------------------------;
; FN# 0EH ... APM DRIVER VERSION ;
;---------------------------------------------------------------;
; Input : As specified in function ;
; (DS) PM bios data segment ;
; (AL) APM_CONNECTION_INFO ;
; Output: (CY) 00 for no error ;
; (CY) 01 for error ;
; Required returned registers are updated in stack;
; Register destroyed : ALL GENERAL PURPOSE except (EBP) ;
;---------------------------------------------------------------;
int_15_ah53_al0e proc near
call check_apm_connection ; is proper APM connection done ?
jc short int_15_ah53_al0e_00 ; no...
cmp bx,system_bios_device_id ; device ID for APM BIOS ?
jnz short int_15_ah53_al0e_01 ; no...
and al,not (apm_bios_active_ver_above_v10 or apm_bios_active_ver_v12); set to APM BIOS active version v1.0
cmp cx,0100h ; APM drive v1.0 ?
jz short int_15_ah53_al0e_02 ; yes...
or al,apm_bios_active_ver_above_v10; set it to above v1.0
cmp cx,0101h ; APM drive v1.1 ?
jz short int_15_ah53_al0e_02 ; yes...
or al,apm_bios_active_ver_v12 ; set it to v1.2
int_15_ah53_al0e_02:
mov ds:apm_connection_info,al ; set APM_CONNECTION_INFO
call set_rom_apm_connection_info ; set ROM_APM_CONNECTION_INFO
mov [ebp+off_ax_apm],cx ; return APM connection major/minor version no.
call add_del_v11_apm_dev ; add/delete v1.1 APM devices according to driver version no.
clc ; set (CY) = 00 for no error
int_15_ah53_al0e_00:
ret
;-----------------------------------------------;
int_15_ah53_al0e_01:
jmp apm_err_code_09 ; invalid device ID
int_15_ah53_al0e endp
;---------------------------------------------------------------;
; FN# 0FH ... ENGAGE/DISENGAGE POWER MANAGEMENT ;
;---------------------------------------------------------------;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -