summaryrefslogtreecommitdiffstats
path: root/private/crt32/misc/ppc/jmpuwind.s
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/crt32/misc/ppc/jmpuwind.s
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/crt32/misc/ppc/jmpuwind.s')
-rw-r--r--private/crt32/misc/ppc/jmpuwind.s162
1 files changed, 162 insertions, 0 deletions
diff --git a/private/crt32/misc/ppc/jmpuwind.s b/private/crt32/misc/ppc/jmpuwind.s
new file mode 100644
index 000000000..dcd129f29
--- /dev/null
+++ b/private/crt32/misc/ppc/jmpuwind.s
@@ -0,0 +1,162 @@
+//++
+//
+// Copyright (c) 1992 Microsoft Corporation
+//
+// Module Name:
+//
+// jmpuwind.s
+//
+// Abstract:
+//
+// This module implements the MIPS specific routine to jump to the runtime
+// time library unwind routine.
+//
+// Author:
+//
+// David N. Cutler (davec) 12-Sep-1990
+//
+// Environment:
+//
+// Any mode.
+//
+// Revision History:
+//
+// Tom Wood (twood) 1-Nov-1993
+// Added __C_ExecuteExceptionFilter and __C_ExecuteTerminationHandler
+// previously deleted from the MIPS version.
+//--
+
+//list(off)
+#include "ksppc.h"
+//list(on)
+ .extern ..RtlUnwind
+
+//
+// Define the call frame for calling the exception filter and termination
+// handler.
+//
+ .struct 0
+CfBackChain: .space 4 // chain to previous call frame
+CfSavedR31: .space 4 // glue-saved register
+CfSavedRtoc: .space 4 // glue-saved register
+ .space 3*4 // remaining part of the frame header
+//++
+//
+// ULONG
+// __C_ExecuteExceptionFilter (
+// PEXCEPTION_POINTERS ExceptionPointers,
+// EXCEPTION_FILTER ExceptionFilter,
+// ULONG EstablisherFrame
+// )
+//
+// Routine Description:
+//
+// This function calls the specified exception filter routine with the
+// establisher environment passed in the TOC register.
+//
+// Arguments:
+//
+// ExceptionPointers (r.3) - Supplies a pointer to the exception pointers
+// structure.
+//
+// ExceptionFilter (r.4) - Supplies the address of the exception filter
+// routine.
+//
+// EstablisherFrame (r.5) - Supplies the establisher frame pointer.
+//
+// Return Value:
+//
+// The value returned by the exception filter routine.
+//
+//--
+ SPECIAL_ENTRY(__C_ExecuteExceptionFilter)
+ stw r.31, CfSavedR31 (r.sp) // save r.31 before using it.
+ mtctr r.4 // get ready to call the filter.
+ mflr r.31 // save the link register in r.31.
+ stw r.toc, CfSavedRtoc (r.sp) // save r.toc
+ PROLOGUE_END(__C_ExecuteExceptionFilter)
+ or r.toc,r.5,r.5 // pass the establisher environment in r.toc
+ bctrl // branch and link to the filter.
+ mtlr r.31 // get ready to return
+ lwz r.31, CfSavedR31 (r.sp) // restore r.31
+ lwz r.toc, CfSavedRtoc (r.sp) // restore r.toc
+ SPECIAL_EXIT(__C_ExecuteExceptionFilter)
+
+//++
+//
+// VOID
+// __C_ExecuteTerminationHandler (
+// BOOLEAN AbnormalTermination,
+// TERMINATION_HANDLER TerminationHandler,
+// ULONG EstablisherFrame
+// )
+//
+// Routine Description:
+//
+// This function calls the specified termination handler routine with the
+// establisher environment passed in the TOC register.
+//
+// Arguments:
+//
+// AbnormalTermination (r.3) - Supplies a boolean value that determines
+// whether the termination is abnormal.
+//
+// TerminationHandler (r.4) - Supplies the address of the termination
+// handler routine.
+//
+// EstablisherFrame (r.5) - Supplies the establisher frame pointer.
+//
+// Return Value:
+//
+// None.
+//
+//--
+ SPECIAL_ENTRY(__C_ExecuteTerminationHandler)
+ stw r.31, CfSavedR31 (r.sp) // save r.31 before using it.
+ mtctr r.4 // get ready to call the filter.
+ mflr r.31 // save the link register in r.31.
+ stw r.toc, CfSavedRtoc (r.sp) // save r.toc
+ PROLOGUE_END(__C_ExecuteTerminationHandler)
+ or r.toc,r.5,r.5 // pass the establisher environment in r.toc
+ bctrl // branch and link to the filter.
+ mtlr r.31 // get ready to return
+ lwz r.31, CfSavedR31 (r.sp) // restore r.31
+ lwz r.toc, CfSavedRtoc (r.sp) // restore r.toc
+ SPECIAL_EXIT(__C_ExecuteTerminationHandler)
+
+//++
+//
+// VOID
+// __jump_unwind (
+// IN PVOID EstablishFrame,
+// IN PVOID TargetPc
+// )
+//
+// Routine Description:
+//
+// This function transfer control to unwind. It is used by the MIPS
+// compiler when a goto out of the body or a try statement occurs.
+//
+// Arguments:
+//
+// EstablishFrame (r.3) - Supplies the establisher frame pointer of the
+// target of the unwind.
+//
+// TargetPc (r.4) - Supplies the target instruction address where control
+// is to be transfered to after the unwind operation is complete.
+//
+// Return Value:
+//
+// None.
+//
+//--
+
+ NESTED_ENTRY (__jump_unwind, STK_MIN_FRAME+8, 0, 0)
+ PROLOGUE_END(__jump_unwind)
+
+ li r.5, 0 // set NULL exception record address
+ li r.6, 0 // set destination return value
+ bl ..RtlUnwind // unwind to specified target
+ .znop ..RtlUnwind
+
+ NESTED_EXIT (__jump_unwind, STK_MIN_FRAME+8, 0, 0)