Author: tkreuzer
Date: Wed Nov 19 16:03:29 2008
New Revision: 37474
URL:
http://svn.reactos.org/svn/reactos?rev=37474&view=rev
Log:
make use of the new macros in ke/trap.S
Modified:
branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S
Modified: branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/ntosk…
==============================================================================
--- branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/ntoskrnl/ke/amd64/trap.S [iso-8859-1] Wed Nov 19
16:03:29 2008
@@ -9,13 +9,15 @@
/* INCLUDES ******************************************************************/
//#include <asm.h>
-//#include <internal/amd64/asmmacro.S>
-.intel_syntax noprefix
-.code64
+#include <ndk/amd64/asmmacro.S>
/* GLOBALS *******************************************************************/
.data
+
+.global _MsgUnimplemented
+_MsgUnimplemented:
+.asciz "WARNING: %s at %s:%d is UNIMPLEMENTED!\n"
_MsgPageFault:
.ascii "Page fault 0x%x at %p!\n\0"
@@ -34,157 +36,275 @@
.text
.code64
-.global _KiDivideErrorFault
-_KiDivideErrorFault:
- /* Push pseudo error code */
- push 0
-
-
-.global _KiDebugTrapOrFault
-_KiDebugTrapOrFault:
- /* Push pseudo error code */
- push 0
-
-.global _KiNmiInterrupt
-_KiNmiInterrupt:
- /* Push pseudo error code */
- push 0
-
-jmp $
-
-.global _KiBreakpointTrap
-_KiBreakpointTrap:
- /* Push pseudo error code */
- push 0
+.proc KiDivideErrorFault
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x8
+
+ UNIMPLEMENTED KiDivideErrorFault
+
+ jmp $
+.endproc
+
+.proc KiDebugTrapOrFault
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x8
+
+ UNIMPLEMENTED KiDebugTrapOrFault
+
+ jmp $
+.endproc
+
+.proc KiNmiInterrupt
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x8
+
+ UNIMPLEMENTED KiNmiInterrupt
+
+ jmp $
+.endproc
+
+.proc KiBreakpointTrap
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x8
push rax
+ .pushreg rax
push rcx
+ .pushreg rcx
push rdx
-
sub rsp, 0x10
- movabs rcx, offset _MsgBreakpointTrap
+ .allocstack 0x10
+ .endprolog
+
+ lea rcx, _MsgBreakpointTrap[rip]
mov rdx, [rsp + 0x10 + 24 + 8]
- movabs rax, offset _FrLdrDbgPrint
+ lea rax, _FrLdrDbgPrint[rip]
call [rax]
+
+ /* Return */
add rsp, 0x10
-
pop rdx
pop rcx
pop rax
add rsp, 8
iretq
-
-.global _KiOverflowTrap
-_KiOverflowTrap:
- /* Push pseudo error code */
- push 0
-
-.global _KiBoundFault
-_KiBoundFault:
- /* Push pseudo error code */
- push 0
-
-.global _KiInvalidOpcodeFault
-_KiInvalidOpcodeFault:
- /* Push pseudo error code */
- push 0
-
-.global _KiNpxNotAvailableFault
-_KiNpxNotAvailableFault:
- /* Push pseudo error code */
- push 0
-
-.global _KiDoubleFaultAbort
-_KiDoubleFaultAbort:
- /* Push pseudo error code */
- push 0
-
-.global _KiNpxSegmentOverrunAbort
-_KiNpxSegmentOverrunAbort:
- /* Push pseudo error code */
- push 0
-
-.global _KiInvalidTssFault
-_KiInvalidTssFault:
- /* We have an error code */
-
-
-.global _KiSegmentNotPresentFault
-_KiSegmentNotPresentFault:
- /* We have an error code */
-
-
-.global _KiStackFault
-_KiStackFault:
- /* We have an error code */
-
-jmp $
-
-
-.global _KiGeneralProtectionFault
-_KiGeneralProtectionFault:
+.endproc
+
+.proc KiOverflowTrap
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x8
+
+ UNIMPLEMENTED KiOverflowTrap
+ jmp $
+.endproc
+
+.proc KiBoundFault
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 8
+
+ sub rsp, 0x20
+ .allocstack 0x20
+
+ mov [rsp + 8], rbx
+ .savereg rbx, 8
+
+ UNIMPLEMENTED KiBoundFault
+
+ jmp $
+.endproc
+
+.proc KiInvalidOpcodeFault
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x8
+
+ UNIMPLEMENTED KiInvalidOpcodeFault
+
+ jmp $
+.endproc
+
+.proc KiNpxNotAvailableFault
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x8
+
+ UNIMPLEMENTED KiNpxNotAvailableFault
+
+ jmp $
+.endproc
+
+.proc KiDoubleFaultAbort
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x8
+
+ UNIMPLEMENTED KiDoubleFaultAbort
+
+ jmp $
+.endproc
+
+.proc KiNpxSegmentOverrunAbort
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x8
+
+ UNIMPLEMENTED KiNpxSegmentOverrunAbort
+
+ jmp $
+.endproc
+
+.proc KiInvalidTssFault
+ .pushframe 1
+ /* We have an error code */
+
+ UNIMPLEMENTED KiInvalidTssFault
+
+ jmp $
+.endproc
+
+
+.proc KiSegmentNotPresentFault
+ .pushframe 1
+ /* We have an error code */
+
+ UNIMPLEMENTED KiSegmentNotPresentFault
+
+ jmp $
+.endproc
+
+.proc KiStackFault
+ .pushframe 1
+ /* We have an error code */
+
+ UNIMPLEMENTED KiStackFault
+
+ jmp $
+.endproc
+
+
+.proc KiGeneralProtectionFault
+ .pushframe 1
/* We have an error code */
mov rdx, 0
mov dx, ss
- movabs rcx, offset _MsgGeneralProtFault
- movabs rax, offset _FrLdrDbgPrint
+ lea rcx, _MsgGeneralProtFault[rip]
+ lea rax, _FrLdrDbgPrint[rip]
call [rax]
- jmp $
-
-
-.global _KiPageFault
-_KiPageFault:
- /* We have an error code */
- movabs rcx, offset _MsgPageFault
+
+ jmp $
+.endproc
+
+
+.proc KiPageFault
+ .pushframe 1
+ /* We have an error code */
+
+ lea rcx, _MsgPageFault[rip]
mov rdx, [rsp]
mov r8, [rsp+8]
mov r9, rsp
- movabs rax, offset _FrLdrDbgPrint
+ lea rax, _FrLdrDbgPrint[rip]
call [rax]
- jmp $
-
-
-.global _KiFloatingErrorFault
-_KiFloatingErrorFault:
- /* Push pseudo error code */
- push 0
-
-.global _KiAlignmentFault
-_KiAlignmentFault:
- /* We have an error code */
-
-.global _KiMcheckAbort
-_KiMcheckAbort:
- /* Push pseudo error code */
- push 0
-
-.global _KiXmmException
-_KiXmmException:
- /* Push pseudo error code */
- push 0
-
-.global _KiApcInterrupt
-_KiApcInterrupt:
-
-
-.global _KiRaiseAssertion
-_KiRaiseAssertion:
-jmp $
-
-.global _KiDebugServiceTrap
-_KiDebugServiceTrap:
- /* Push pseudo error code */
- push 0
+
+ jmp $
+.endproc
+
+
+.proc KiFloatingErrorFault
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x8
+
+ UNIMPLEMENTED KiFloatingErrorFault
+
+ jmp $
+.endproc
+
+.proc KiAlignmentFault
+ .pushframe 1
+ /* We have an error code */
+
+ UNIMPLEMENTED KiAlignmentFault
+
+ jmp $
+.endproc
+
+.proc KiMcheckAbort
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x08
+
+ UNIMPLEMENTED KiMcheckAbort
+
+ jmp $
+.endproc
+
+.proc KiXmmException
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x08
+
+ UNIMPLEMENTED KiXmmException
+
+ jmp $
+.endproc
+
+.proc KiApcInterrupt
+ .pushframe 1
+
+ UNIMPLEMENTED KiApcInterrupt
+
+ jmp $
+.endproc
+
+.proc KiRaiseAssertion
+ .pushframe 1
+
+ UNIMPLEMENTED KiRaiseAssertion
+
+ jmp $
+.endproc
+
+.proc KiDebugServiceTrap
+ .pushframe 0
+ /* Push pseudo error code */
+ push 0
+ .allocstack 0x08
push rax
+ .pushreg rax
push rcx
+ .pushreg rcx
push rdx
+ .pushreg rdx
push r8
+ .pushreg r8
push r9
+ .pushreg r9
/* Create stack space for parameters */
sub rsp, 0x18
+ .allocstack 0x18
/* just forward first 3 parameters */
call _KdpServiceDispatcher
@@ -203,20 +323,32 @@
add rsp, 8
iretq
-
-
-.global _KiDpcInterrupt
-_KiDpcInterrupt:
-
-
-.global _KiIpiInterrupt
-_KiIpiInterrupt:
-jmp $
-
-
-.global _KiUnexpectedInterrupt
-_KiUnexpectedInterrupt:
- movabs rcx, offset _MsgUnexpectedInterrupt
- movabs rax, offset _FrLdrDbgPrint
+.endproc
+
+
+.proc KiDpcInterrupt
+ .pushframe 1
+ jmp $
+.endproc
+
+
+.proc KiIpiInterrupt
+ .pushframe 1
+ jmp $
+.endproc
+
+
+.proc KiUnexpectedInterrupt
+ .pushframe 0
+ push 0
+ .allocstack 0x8
+
+ lea rcx, _MsgUnexpectedInterrupt[rip]
+ lea rax, _FrLdrDbgPrint[rip]
call [rax]
- jmp $
+
+ jmp $
+.endproc
+
+
+