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