bootsector2-common-traprec-template.mac revision cf22150eaeeb72431bf1cf65c309a431454fb22b
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; $Id$
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync;; @file
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; Boot sector 2 - Trap Records, Code Template.
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; Copyright (C) 2007-2014 Oracle Corporation
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; This file is part of VirtualBox Open Source Edition (OSE), as
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; available from http://www.virtualbox.org. This file is free software;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; you can redistribute it and/or modify it under the terms of the GNU
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; General Public License (GPL) as published by the Free Software
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; Foundation, in version 2 as it comes in the "COPYING" file of the
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; The contents of this file may alternatively be used under the terms
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; of the Common Development and Distribution License Version 1.0
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync; VirtualBox OSE distribution, in which case the provisions of the
667f741ffdced56a2059511ce99372ebdd62a115vboxsync; CDDL are applicable instead of those of the GPL.
667f741ffdced56a2059511ce99372ebdd62a115vboxsync;
667f741ffdced56a2059511ce99372ebdd62a115vboxsync; You may elect to license modified versions of this file under the
667f741ffdced56a2059511ce99372ebdd62a115vboxsync; terms and conditions of either the GPL or the CDDL or both.
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync;
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync%include "bootsector2-template-header.mac"
18470279db8a9fdd714617adbe1aa8b63cc80aeevboxsync
;;
; Internal worker for reporting a missing trap
;
; The callee cleans up the arguments on the stack.
;
; @param [xBP + xCB*2] bExpected Expected exception number.
; @param [xBP + xCB*2+1] szExpected The name of the exception (2 bytes + terminator).
; @uses None
;
BEGINPROC TMPL_NM_CMN(TestFailedMissingTrapInternal)
push xBP
mov xBP, xSP
pushf
push sAX
movzx eax, byte [xBP + xCB*2]
push xAX
lea sAX, [sBP + xCB*2+1]
%ifdef TMPL_16BIT
push ss
%endif
push xAX
%ifdef TMPL_16BIT
push cs
%endif
push .szFmt
call TMPL_NM_CMN(TestFailedF)
%ifdef TMPL_16BIT
add xSP, xCB*5
%else
add xSP, xCB*3
%endif
pop sAX
popf
leave
ret sCB
.szFmt: db 'Missing trap #%s (%RX8)', 13, 10, 0
ENDPROC TMPL_NM_CMN(TestFailedMissingTrapInternal)
%ifndef TestFailedMissingTrapTemplate_defined
;;
; Internal template.
%macro TestFailedMissingTrapTemplate 4
BEGINPROC TMPL_NM_CMN(TestFailedMissingTrap_%1)
push dword RT_MAKE_U32_FROM_U8(%1, %2, %3, %4)
call TMPL_NM_CMN(TestFailedMissingTrapInternal)
ret
ENDPROC TMPL_NM_CMN(TestFailedMissingTrap_%1)
%endmacro
%define TestFailedMissingTrapTemplate_defined
%endif
TestFailedMissingTrapTemplate X86_XCPT_DE, 'D', 'E', 0
TestFailedMissingTrapTemplate X86_XCPT_DB, 'D', 'B', 0
TestFailedMissingTrapTemplate X86_XCPT_NMI, 'N', 'M', 0
TestFailedMissingTrapTemplate X86_XCPT_BP, 'B', 'P', 0
TestFailedMissingTrapTemplate X86_XCPT_OF, 'O', 'F', 0
TestFailedMissingTrapTemplate X86_XCPT_BR, 'B', 'R', 0
TestFailedMissingTrapTemplate X86_XCPT_UD, 'U', 'D', 0
TestFailedMissingTrapTemplate X86_XCPT_NM, 'N', 'M', 0
;TestFailedMissingTrapTemplate X86_XCPT_DF, 'D', 'F', 0
;TestFailedMissingTrapTemplate X86_XCPT_CO_SEG_OVERRUN, 'C', 'O', 0
TestFailedMissingTrapTemplate X86_XCPT_TS, 'T', 'S', 0
TestFailedMissingTrapTemplate X86_XCPT_NP, 'N', 'P', 0
TestFailedMissingTrapTemplate X86_XCPT_SS, 'S', 'S', 0
TestFailedMissingTrapTemplate X86_XCPT_GP, 'G', 'P', 0
TestFailedMissingTrapTemplate X86_XCPT_PF, 'P', 'F', 0
TestFailedMissingTrapTemplate X86_XCPT_MF, 'M', 'F', 0
TestFailedMissingTrapTemplate X86_XCPT_AC, 'A', 'C', 0
;TestFailedMissingTrapTemplate X86_XCPT_MC, 'M', 'C', 0
TestFailedMissingTrapTemplate X86_XCPT_XF, 'X', 'F', 0
%include "bootsector2-template-footer.mac"