#/**@file
# Low leve IA32 specific debug support functions.
#
# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#**/
#------------------------------------------------------------------------------
# BOOLEAN
# FxStorSupport (
# void
# )
#
#
#
#
#------------------------------------------------------------------------------
# void
# Vect2Desc (
# DESCRIPTOR * DestDesc,
# void (*Vector) (void)
# )
#
#
#------------------------------------------------------------------------------
#
# vectors.
#
##
##
##
## ...
##
##
##
#
##
## typedef
## struct {
## UINT32 ExceptionData;
## } SYSTEM_CONTEXT_IA32; // 32 bit system context record
mov %eax,0x0
cmpl $0x8,0x0
jne ASM_PFX(CommonIdtEntry+0x20)
movl $0x1,0x0
jmp ASM_PFX(CommonIdtEntry+0xa8)
cmpl $0xa,0x0
jne ASM_PFX(CommonIdtEntry+0x35)
movl $0x1,0x0
jmp ASM_PFX(CommonIdtEntry+0xa8)
cmpl $0xb,0x0
jne ASM_PFX(CommonIdtEntry+0x4a)
movl $0x1,0x0
jmp ASM_PFX(CommonIdtEntry+0xa8)
cmpl $0xc,0x0
jne ASM_PFX(CommonIdtEntry+0x5f)
movl $0x1,0x0
jmp ASM_PFX(CommonIdtEntry+0xa8)
cmpl $0xd,0x0
jne ASM_PFX(CommonIdtEntry+0x74)
movl $0x1,0x0
jmp ASM_PFX(CommonIdtEntry+0xa8)
cmpl $0xe,0x0
jne ASM_PFX(CommonIdtEntry+0x89)
movl $0x1,0x0
jmp ASM_PFX(CommonIdtEntry+0xa8)
cmpl $0x11,0x0
jne ASM_PFX(CommonIdtEntry+0x9e)
movl $0x1,0x0
jmp ASM_PFX(CommonIdtEntry+0xa8)
movl $0x0,0x0
cmpl $0x1,0x0
jne ASM_PFX(CommonIdtEntry+0xc8)
mov 0x0,%eax
mov (%eax),%ebx
mov %ebx,0x0
add $0x4,%eax
mov %eax,0x0
jmp ASM_PFX(CommonIdtEntry+0xd2)
movl $0x0,0x0
mov 0xc(%esp),%eax
mov %eax,0x0
mov 0x0,%eax
add $0xc,%eax
# application stack has eflags, cs, & eip, so
# last actual application stack entry is
# 12 bytes into the application stack.
mov %eax,0xc(%esp)
## continue building context record
## UINT32 Gs, Fs, Es, Ds, Cs, Ss; insure high 16 bits of each is zero
mov %ss,%eax
push %eax
# CS from application is one entry back in application stack
mov 0x0,%eax
movzwl 0x4(%eax),%eax
push %eax
mov %ds,%eax
push %eax
mov %es,%eax
push %eax
mov %fs,%eax
push %eax
mov %gs,%eax
push %eax
## UINT32 Eip;
# Eip from application is on top of application stack
mov 0x0,%eax
pushl (%eax)
## UINT32 Gdtr[2], Idtr[2];
push $0x0
push $0x0
sidtl (%esp)
push $0x0
push $0x0
sgdtl (%esp)
## UINT32 Ldtr, Tr;
xor %eax,%eax
str %eax
push %eax
sldt %eax
push %eax
## UINT32 EFlags;
## Eflags from application is two entries back in application stack
mov 0x0,%eax
pushl 0x8(%eax)
## UINT32 Cr0, Cr1, Cr2, Cr3, Cr4;
push $0x0
## UINT32 ExceptionData;
## UINT32 ExceptionData;
##
##
push $0x0
jmp *0x0
## We're outa here...
iret