www.pudn.com > hpbios.rar > APM32.ASM


;	[]===========================================================[] 
; 
;	NOTICE: THIS PROGRAM BELONGS TO AWARD SOFTWARE INTERNATIONAL(R) 
;	        INC. IT IS CONSIDERED A TRADE SECRET AND IS NOT TO BE 	 
;	        DIVULGED OR USED BY PARTIES WHO HAVE NOT RECEIVED	 
;	        WRITTEN AUTHORIZATION FROM THE OWNER. 
; 
; 	[]===========================================================[] 
; 
 
;---------------------------------------------------------------------------- 
;Rev	Date	 Name	Description 
;---------------------------------------------------------------------------- 
;R00	04/30/97 KVN	Merge APM and APM32 into APM.ASM 
 
.386p 
		PAGE	60,132 
		TITLE	APM_32.ASM   --   APM 32 Bit Interface 
.XLIST 
		INCLUDE	BIOS.CFG 
		INCLUDE	COMMON.EQU 
 
ifdef	ADVANCE_POWER_MANAGEMENT 
		extrn	APM_16BIT_ENTRY:near 
 
PM_RAM		SEGMENT	USE16 AT 0 
		ORG	0 
		INCLUDE	PM_RAM.INC 
PM_RAM		ENDS 
endif	;ADVANCE_POWER_MANAGEMENT 
 
.LIST 
 
DGROUP		GROUP	FCODE 
FCODE		SEGMENT DWORD PUBLIC 'CODE' 
		ASSUME	CS:DGROUP 
 
ifdef	ADVANCE_POWER_MANAGEMENT 
 
		ASSUME	DS:PM_RAM 
;[]--------------------------------------------------------------------------[] 
; 
; Procedure Name: APM_32Bit_Entry 
; 
;	This is the main procedure that handles the APM 32 bit call. 
; 
; Saves: ALL 
; 
; Inputs: 
;	ah=53h 
;	al=04h : Interface disconnect 
;	  =05h : CPU idle 
;	  =06h : CPU busy 
;	  =07h : Set power state, standby,suspend 
;	  =08h : Enable/disable power management function 
;	  =09h : Restore power on defaults 
;	  =0ah : Get power status 
;	  =0bh : Get PM event 
;	bx,cx,dx dependent on the function requested 
; 
; Outputs: 
;	carry flag set if error 
; 
; [Notes]: 
;	1. This procedure should be called in 32-bit mode only. 
;	2. The caller should ensure the I/O privilege 
;[]==========================================================================[] 
		PUBLIC	APM_32BIT_ENTRY 
APM_32BIT_ENTRY: 
APM_32Bit_SERVICE PROC	FAR 
 
	push	ebp 
 
;Set up stack for return from 16 bit code to 32 bit code 
 
	mov	bp, cs 
	push	bp 
	mov	ebp,offset apm16To32Ret 
	push	bp 
 
;Set up stack for call to 16-bit code 
 
	mov	bp, cs 
	add	bp, 8 
	push	bp 
 
	mov	ebp,offset APM_16BIT_ENTRY 
	push	bp 
 
	mov	bp, APM_32BIT_MARK		;set APM 32 bits signature for function call 
	shl	ebp, 16				;store it to ebp high word 
 
	DB	66h				;Do 16 bit far return to 
	ret					; 16-bit entry point 
 
apm16To32Ret: 
 
	pop	ebp 
	ret 
 
APM_32Bit_SERVICE ENDP 
 
endif	;ADVANCE_POWER_MANAGEMENT 
 
FCODE		ENDS 
		END