NT4/private/ntos/boot/lib/alpha/stubs.c
2020-09-30 17:12:29 +02:00

245 lines
3.7 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Module Name:
stubs.c
Abstract:
This module implements stub routines for the boot code.
Author:
David N. Cutler (davec) 7-Nov-1990
Environment:
Kernel mode only.
Revision History:
8-July-1992 John DeRosa [DEC]
Modified for Alpha/Jensen.
--*/
#include "ntos.h"
#include "arc.h"
#include "stdio.h"
extern ULONG BlConsoleOutDeviceId;
VOID
KeBugCheck (
IN ULONG BugCheckCode
)
/*++
Routine Description:
This function crashes the system in a controlled manner.
Alpha/Jensen firmware will try to run the Monitor instead of the
kernel debugger.
Arguments:
BugCheckCode - Supplies the reason for the bug check.
Return Value:
None.
--*/
{
ULONG Count;
UCHAR Buffer[512];
//
// Print out the bug check code and break.
//
sprintf( Buffer, "\n*** BugCheck (%lx) ***\n\n", BugCheckCode );
ArcWrite(BlConsoleOutDeviceId,
Buffer,
strlen(Buffer),
&Count);
while(TRUE) {
DbgBreakPoint();
};
return;
}
BOOLEAN
KeFreezeExecution (
IN PKTRAP_FRAME TrapFrame,
IN PKEXCEPTION_FRAME ExceptionFrame
)
/*++
Routine Description:
This function freezes the execution of all other processors in the host
configuration and then returns to the caller. It is intended for use by
the kernel debugger.
Arguments:
None.
Return Value:
Previous IRQL.
--*/
{
return HIGH_LEVEL;
}
VOID
KeThawExecution (
IN KIRQL Irql
)
/*++
Routine Description:
This function unfreezes the execution of all other processors in the host
configuration and then returns to the caller. It is intended for use by
the kernel debugger.
Arguments:
Irql - Supplies the level that the IRQL is to be lowered to after having
unfrozen the execution of all other processors.
Return Value:
None.
--*/
{
return;
}
PVOID
MmDbgReadCheck (
IN PVOID VirtualAddress
)
/*++
Routine Description:
This routine returns the phyiscal address for a virtual address
which is valid (mapped) for read access.
Arguments:
VirtualAddress - Supplies the virtual address to check.
Return Value:
Returns NULL if the address is not valid or readable, otherwise
returns the physical address of the corresponding virtual address.
--*/
{
return VirtualAddress;
}
PVOID
MmDbgTranslatePhysicalAddress (
IN PHYSICAL_ADDRESS PhysicalAddress
)
/*++
Routine Description:
This routine returns the phyiscal address for a physical address
which is valid (mapped).
Arguments:
PhysicalAddress - Supplies the physical address to check.
Return Value:
Returns NULL if the address is not valid or readable, otherwise
returns the physical address of the corresponding virtual address.
--*/
{
return (PVOID)PhysicalAddress.LowPart;
}
PVOID
MmDbgWriteCheck (
IN PVOID VirtualAddress
)
/*++
Routine Description:
This routine returns the phyiscal address for a virtual address
which is valid (mapped) for write access.
Arguments:
VirtualAddress - Supplies the virtual address to check.
Return Value:
Returns NULL if the address is not valid or readable, otherwise
returns the physical address of the corresponding virtual address.
--*/
{
return VirtualAddress;
}
VOID
RtlAssert(
IN PVOID FailedAssertion,
IN PVOID FileName,
IN ULONG LineNumber,
IN PCHAR Message OPTIONAL
)
{
ULONG Count;
UCHAR Buffer[512];
sprintf( Buffer, "\n*** Assertion failed\n");
ArcWrite(BlConsoleOutDeviceId,
Buffer,
strlen(Buffer),
&Count);
while (TRUE) {
DbgBreakPoint();
}
}