;Inclusion guard ifndef _mbiosmac_mac_ _mbiosmac_mac_ equ 1 .xlist ;*****************************************************************; ;*****************************************************************; ;** **; ;** (C)Copyright 1985-2000, American Megatrends, Inc. **; ;** **; ;** All Rights Reserved. **; ;** **; ;** 6145-F Northbelt Pkwy, Norcross, GA 30071 **; ;** **; ;** Phone (770)-246-8600 **; ;** **; ;*****************************************************************; ;*****************************************************************; ;*****************************************************************; ; $Header: /Alaska/SOURCE/Modules/CSM/Generic/OEM Hooks/MBIOSMAC.MAC 1 5/16/06 2:39p Olegi $ ; ; $Revision: 1 $ ; ; $Date: 5/16/06 2:39p $ ;*****************************************************************; ;*****************************************************************; ; Revision History ; ---------------- ; $Log: /Alaska/SOURCE/Modules/CSM/Generic/OEM Hooks/MBIOSMAC.MAC $ ; ; 1 5/16/06 2:39p Olegi ; ; 3 9/27/02 5:49p Anandj ; Added SET_ORG_PLUS macro ; ; 2 8/06/02 3:46p Dickh ; Surrounded RT_CHECK_POINT and check_point_ini macros with ; indef statements so that they can be overridden. ; ; 4 7/24/01 9:30a Anandj ; Macro eK_PROC is moved to mbiosmac.mac. ; ; 3 7/24/01 9:01a Anandj ; Macros IO_DELAY and IO_DELAY_BB are moved to mbiosmac.mac. ; ; 2 5/31/01 3:22p Anandj ; Deleted IO_DELAY macro ; ; 1 5/25/01 2:34p Anandj ; ; 1 5/25/01 1:38p Anandj ; First Check in on CORE database ; ; 3 5/10/01 4:51p Sudhakaro ; Updated to use the macro SET_ORG instead of ORG directive, so that ; MAPGUARD can detect the code overlap problems. ; ; 2 3/28/01 12:42p Sudhakaro ; Updated for TBLv1.1 integration ; ; 1 3/26/01 4:36p Vivekc ; ; 1 3/22/01 1:49p Vivekc ; ; 3 3/01/01 5:01p Juand ; Removed unused macros. ; ; 2 11/21/00 1:50p Juand ; BigBIOS changes. ; ; 1 4/28/00 10:53a Olegi ; ; 2 1/31/00 7:04p Juand ; Added Inclusion guard. ; ; 1 11/29/99 11:48a Debkumar ; Initial CheckIn for Core 7.00. ; ; 2 3/16/99 6:27p Robertj ; Added initial ADM code (beta version) ; ; 1 6/05/97 12:33p Debkumar ; ; 1 1/31/97 11:30a Debkumar ; New files for 62700. ; ; 1 1/02/97 10:50a Debkumar ; Started with 6.26.02 files. ; ; 6 9/03/96 5:18p Mandal ; 6.26 for USA ; ; 1 6/17/96 2:39p Mandal ; ; 5 3/21/96 6:44p Mandal ; AMI address changed. ; ; 4 3/21/96 6:09p Mandal ; (c)1996 and phone no changed. ; ; 3 2/19/96 6:49p Mandal ; IO_DELAY macro modified. ; ;*****************************************************************; ;---------------------------------------; ; RET_SP ; ;---------------------------------------; ret_sp macro dummy ; call routine without stack local llll, lll ; local label even mov sp, offset cs:lll ; return address jmp dummy lll: dw offset cs:llll ; return address llll: endm ;---------------------------------------; ; JMP_SP ; ;---------------------------------------; jmp_sp macro dummy ; goto routine & back (via SP) local llll ; local label mov sp, offset cs:llll ; return address jmp dummy llll: endm ;---------------------------------------; ; JMP_BP ; ;---------------------------------------; jmp_bp macro dummy ; goto routine & back (via SI) local llll ; local label mov bp, offset cs:llll ; return address jmp dummy llll: endm ;---------------------------------------; ; JMP_CX ; ;---------------------------------------; jmp_cx macro dummy ; goto routine & back (via SI) local llll ; local label mov cx, offset cs:llll ; return address jmp dummy llll: endm ;---------------------------------------; ; JMP_SI ; ;---------------------------------------; jmp_si macro dummy ; goto routine & back (via SI) local llll ; local label mov si, offset cs:llll ; return address jmp dummy llll: endm ;---------------------------------------; ; JMP_DI ; ;---------------------------------------; jmp_di macro dummy ; goto routine & back (via DI) local llll ; local label mov di, offset cs:llll ; return address jmp dummy llll: endm ;---------------------------------------; ; DES_TAB ; ;---------------------------------------; des_tab macro v_mode_seg_size,seg_low_word,seg_high_byte,access_right dw v_mode_seg_size dw seg_low_word ; low word for descriptor db seg_high_byte ; descriptor high byte db access_right ; access right byte dw 0000h ; reserved word endm ;---------------------------------------; ; CHECK_POINT_INI ; ;---------------------------------------; ifndef check_point_ini check_point_ini macro xx mov al,xx out 80h,al endm endif ifndef RT_CHECK_POINT RT_CHECK_POINT MACRO CP mov al, CP out 80h, al ENDM endif ; ;---------------------------------------------------------------------------- ; Name: IO_DELAY ; ; Description: This macro can be used to introduced a delay of one IO ; read operation. Use this macro only when the stack is ; availabel. ; ; Input: ;---------------------------------------------------------------------------- ; IO_DELAY MACRO push ax in al, refresh_port pop ax ENDM ; ;---------------------------------------------------------------------------- ; Name: IO_DELAY_BB ; ; Description: This macro can be used to introduced a delay two jumps. ; The idea is, the jump will cause CPU to flush its instruction ; cache and will introduce some delay. In the newer CPUs this macro ; will introduce hardly any delay. ; This macro can be used without stack. ; ; Input: ;---------------------------------------------------------------------------- ; IO_DELAY_bb MACRO jcxz $+2 jcxz $+2 ENDM ; ;---------------------------------------------------------------------------- ; Name: SET_ORG ; ; Description: This macro can be used as a replacement to "ORG" directive ; in source files. The advantage in using this macro instead ; of "ORG" directive is that it generates necessary labels for ; for mapgaurd utility, so that any possible code overlaps ; betweens ORGs can be detected during build time itself. ; ; Input: OrgValue - Value for ORG. ; GuardTag - Tag name for mapgaurd utility. ;---------------------------------------------------------------------------- ; SET_ORG MACRO OrgValue, GuardTag PUBLIC orgguard_&GuardTag&_&OrgValue&_start orgguard_&GuardTag&_&OrgValue&_start LABEL BYTE ORG OrgValue PUBLIC orgguard_&GuardTag&_&OrgValue&_end orgguard_&GuardTag&_&OrgValue&_end LABEL BYTE ENDM ; ;---------------------------------------------------------------------------- ; Name: SET_ORG_PLUS ; ; Description: This macro can be used as a replacement to "ORG" directive ; in source files. The advantage in using this macro instead ; of "ORG" directive is that it generates necessary labels for ; for mapgaurd utility, so that any possible code overlaps ; betweens ORGs can be detected during build time itself. ; ; Input: OrgBase - Value for ORG base ; OrgPlus - Offset from the OrgBase. ; GuardTag - Tag name for mapgaurd utility. ;---------------------------------------------------------------------------- ; SET_ORG_Plus MACRO OrgBase, OrgPlus, GuardTag PUBLIC orgguard_&GuardTag&_&OrgPlus&_&OrgBase&_start orgguard_&GuardTag&_&OrgPlus&_&OrgBase&_start LABEL BYTE ORG OrgBase + OrgPlus PUBLIC orgguard_&GuardTag&_&OrgPlus&_&OrgBase&_end orgguard_&GuardTag&_&OrgPlus&_&OrgBase&_end LABEL BYTE ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mEXTERN_NEAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mEXTERN_NEAR MACRO LabelName EXTERN LabelName:NEAR ; Define the label as a NEAR EXTERN. ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mEXTERN_FAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mEXTERN_FAR MACRO LabelName EXTERN LabelName:FAR ; Define the label as a FAR EXTERN. ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mSTART_PROC_NEAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mSTART_PROC_NEAR MACRO LabelName LabelName PROC NEAR PUBLIC ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mBODY_CALL_PROC_NEAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mBODY_CALL_PROC_NEAR MACRO LabelID, LabelName call LabelName ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mBODY_JMP_PROC_NEAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mBODY_JMP_PROC_NEAR MACRO LabelID, LabelName jmp LabelName PUBLIC LabelName&End LabelName&End:: ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mEND_PROC_NEAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mEND_PROC_NEAR MACRO LabelName ret LabelName ENDP ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mEND_PROC_WITH_JMP_NEAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mEND_PROC_WITH_JMP_NEAR MACRO LabelName EXTERN LabelName&End:NEAR jmp LabelName&End LabelName ENDP ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mSTART_PROC_FAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mSTART_PROC_FAR MACRO LabelName LabelName PROC FAR PUBLIC ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mBODY_CALL_PROC_FAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mBODY_CALL_PROC_FAR MACRO LabelID, LabelName call LabelName ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mBODY_JMP_PROC_FAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mBODY_JMP_PROC_FAR MACRO LabelID, LabelName jmp LabelName PUBLIC LabelName&End LabelName&End:: ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mEND_PROC_FAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mEND_PROC_FAR MACRO LabelName ret LabelName ENDP ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mEND_PROC_WITH_JMP_FAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mEND_PROC_WITH_JMP_FAR MACRO LabelName EXTERN LabelName&End:FAR jmp LabelName&End LabelName ENDP ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mSTART_TBL ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mSTART_TBL MACRO LabelName PUBLIC LabelName LabelName LABEL BYTE ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mBODY_TBL_ENTRY_NEAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mBODY_TBL_ENTRY_NEAR MACRO LabelID, LabelName stTblEntryNEAR ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mBODY_ID_AND_TBL_ENTRY_NEAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mBODY_ID_AND_TBL_ENTRY_NEAR MACRO LabelID, LabelName stIDAndTblEntryNEAR ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mBODY_ID_AND_TBL_CSM_ENTRY_NEAR ; ; Description: This macro is used to declare a function entry with an ID and ; a NEAR function. The EXTERN declaration is done WITHIN the 16 bit segment. ; This is useful if the macro is used to create a binary using EXE2BIN; ; if EXTRERN is declared outside the segment, then EXE2BIN will not work. ; ; Notes: EXTERN definition only for functions (Prog. Guide pg 253) ; ;---------------------------------------------------------------------------- ; mBODY_ID_AND_TBL_CSM_ENTRY_NEAR MACRO LabelID, LabelName EXTERN LabelName:NEAR stIDAndTblEntryNEAR ENDM mEND_TBL_CSM MACRO LabelName stIDAndTblEntryNEAR <0FFFFh, 0> LabelName&End LABEL BYTE ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mBODY_TBL_ENTRY_FAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mBODY_TBL_ENTRY_FAR MACRO LabelID, LabelName stTblEntryFAR ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mBODY_ID_AND_TBL_ENTRY_FAR ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mBODY_ID_AND_TBL_ENTRY_FAR MACRO LabelID, LabelName stIDAndTblEntryFAR ENDM ; ;---------------------------------------------------------------------------- ; ; Name: mEND_TBL ; ; Description: ; ; Input: ; ;---------------------------------------------------------------------------- ; mEND_TBL MACRO LabelName PUBLIC LabelName&End LabelName&End LABEL BYTE ENDM ;*****************************************************************; ;*****************************************************************; ;** **; ;** (C)Copyright 1985-2000, American Megatrends, Inc. **; ;** **; ;** All Rights Reserved. **; ;** **; ;** 6145-F Northbelt Pkwy, Norcross, GA 30071 **; ;** **; ;** Phone (770)-246-8600 **; ;** **; ;*****************************************************************; ;*****************************************************************; ;---------------------------------------; .list ;End of Inclusion guard endif ;_mbiosmac_mac_