summaryrefslogtreecommitdiffstats
path: root/private/ntos/nthals/halalpha/haltsup.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/ntos/nthals/halalpha/haltsup.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/ntos/nthals/halalpha/haltsup.s')
-rw-r--r--private/ntos/nthals/halalpha/haltsup.s110
1 files changed, 110 insertions, 0 deletions
diff --git a/private/ntos/nthals/halalpha/haltsup.s b/private/ntos/nthals/halalpha/haltsup.s
new file mode 100644
index 000000000..0fa6c8d0e
--- /dev/null
+++ b/private/ntos/nthals/halalpha/haltsup.s
@@ -0,0 +1,110 @@
+// TITLE("Halt Interrupt Support")
+//++
+//
+// Copyright (c) 1992 Digital Equipment Corporation
+// Copyright (c) 1993 Digital Equipment Corporation
+//
+// Module Name:
+//
+// haltsup.s
+//
+// Abstract:
+//
+// This module implements the code necessary to field halt button
+// interrupts.
+//
+// Author:
+//
+// Joe Notarangelo 18-Dec-1992
+//
+// Environment:
+//
+// Kernel mode only, IRQL halt synchronization level.
+//
+// Revision History:
+//
+//--
+
+#if !(DBG)
+
+//
+// Boolean value that controls whether to break or not for a halt button
+// interrupt on a free build. The default value is zero and must be set
+// in the debugger to a non-zero value to trigger the breakpoint action
+// when the halt button is pressed.
+//
+
+ .data
+
+ .globl HalpHaltButtonBreak
+HalpHaltButtonBreak:
+ .long 0 : 1
+
+#endif //!DBG
+
+
+#include "halalpha.h"
+
+ SBTTL("Halt Interrupt Support")
+//++
+//
+// Routine Description:
+//
+// This routine is entered as the result of a halt interrupt caused by
+// a human pushing the halt switch on the system box. This routine is
+// connected directly into the IDT. The halt interrupt is mechanical and
+// does not require an interrupt acknowledge.
+//
+// Arguments:
+//
+// s6/fp - Supplies a pointer to a trap frame.
+//
+// Return Value:
+//
+// None.
+//
+//--
+
+ .struct 0
+HaltRa: .space 8 // saved return address
+ .space 8 // fill for alignment
+HaltFrameLength:
+
+ NESTED_ENTRY(HalpHaltInterrupt, ExceptionFrameLength, zero)
+
+ lda sp, -HaltFrameLength(sp) // allocate stack frame
+ stq ra, HaltRa(sp) // save ra
+
+ PROLOGUE_END
+
+
+#if DBG
+
+//
+// Always stop in the debugger if this is a checked build.
+//
+
+ BREAK_DEBUG_STOP // stop in the debugger
+
+#else
+
+//
+// If this is a free build then check the variable HalpHaltButtonBreak,
+// if it is non-zero then take the breakpoint, otherwise ignore it.
+//
+
+ lda t0, HalpHaltButtonBreak // get the address of the boolean
+ ldl t0, 0(t0) // read the boolean
+ beq t0, 10f // if eq, don't stop
+
+ BREAK_DEBUG_STOP // stop in the debugger
+
+10:
+
+#endif //DBG
+
+ ldq ra, HaltRa(sp) // save ra
+ lda sp, HaltFrameLength(sp) // deallocate stack frame
+ ret zero, (ra) // interrupt is dismissed
+
+ .end HalpHaltInterrupt