mirror of
https://github.com/reactos/reactos.git
synced 2024-07-05 12:15:46 +00:00
Implement ARM version of DbgBreakPoint in the RTL. We do a bkpt with a special value of 3 (to be as close as possible to x86 int 3).
Fix NtCurrentTeb definition for ARM. We will expose the KPCR to user-mode much like KUSER_SHARED_DATA on x86 (this is how ARM-CE and NT-MIPS do it) and link the TEB there. svn path=/trunk/; revision=32134
This commit is contained in:
parent
d796fed021
commit
81cd907fc7
|
@ -66,7 +66,9 @@ Author:
|
|||
// FIXME: mmtypes.h?
|
||||
//
|
||||
#define KIPCR 0xFFFFF000
|
||||
#define PCR ((volatile KPCR * const)KIPCR)
|
||||
#define USPCR 0x7FFF0000
|
||||
#define PCR ((volatile KPCR * const)USPCR)
|
||||
#define USERPCR ((volatile KPCR * const)KIPCR)
|
||||
|
||||
//
|
||||
// Synchronization-level IRQL
|
||||
|
@ -104,34 +106,13 @@ typedef struct _KTRAP_FRAME
|
|||
ULONG FpExtra[8];
|
||||
} KTRAP_FRAME, *PKTRAP_FRAME;
|
||||
|
||||
#ifndef NTOS_MODE_USER
|
||||
//
|
||||
// Stub
|
||||
//
|
||||
typedef struct _KFLOATING_SAVE
|
||||
{
|
||||
ULONG Reserved;
|
||||
} KFLOATING_SAVE, *PKFLOATING_SAVE;
|
||||
|
||||
//
|
||||
// Processor Region Control Block
|
||||
//
|
||||
typedef struct _KPRCB
|
||||
{
|
||||
USHORT MinorVersion;
|
||||
USHORT MajorVersion;
|
||||
struct _KTHREAD *CurrentThread;
|
||||
struct _KTHREAD *NextThread;
|
||||
struct _KTHREAD *IdleThread;
|
||||
UCHAR Number;
|
||||
//
|
||||
// TODO
|
||||
//
|
||||
} KPRCB, *PKPRCB;
|
||||
|
||||
//
|
||||
// Processor Control Region
|
||||
// On ARM, it's actually readable from user-mode, much like KUSER_SHARED_DATA
|
||||
//
|
||||
#ifdef NTOS_MODE_USER
|
||||
#define PKINTERRUPT_ROUTINE PVOID // Hack!
|
||||
#endif
|
||||
typedef struct _KPCR
|
||||
{
|
||||
ULONG MinorVersion;
|
||||
|
@ -186,6 +167,31 @@ typedef struct _KPCR
|
|||
ULONG QuantumEnd;
|
||||
} KPCR, *PKPCR;
|
||||
|
||||
#ifndef NTOS_MODE_USER
|
||||
//
|
||||
// Stub
|
||||
//
|
||||
typedef struct _KFLOATING_SAVE
|
||||
{
|
||||
ULONG Reserved;
|
||||
} KFLOATING_SAVE, *PKFLOATING_SAVE;
|
||||
|
||||
//
|
||||
// Processor Region Control Block
|
||||
//
|
||||
typedef struct _KPRCB
|
||||
{
|
||||
USHORT MinorVersion;
|
||||
USHORT MajorVersion;
|
||||
struct _KTHREAD *CurrentThread;
|
||||
struct _KTHREAD *NextThread;
|
||||
struct _KTHREAD *IdleThread;
|
||||
UCHAR Number;
|
||||
//
|
||||
// TODO
|
||||
//
|
||||
} KPRCB, *PKPRCB;
|
||||
|
||||
//
|
||||
// Macro to get current KPRCB
|
||||
//
|
||||
|
|
|
@ -4104,7 +4104,23 @@ static __inline__ struct _TEB * NtCurrentTeb(void)
|
|||
return ret;
|
||||
}
|
||||
#elif _M_ARM
|
||||
struct _TEB* WINAPI NtCurrentTeb(VOID);
|
||||
|
||||
//
|
||||
// NT-ARM is not documented, need NDK
|
||||
//
|
||||
#define NTOS_MODE_USER
|
||||
#include <arm/ketypes.h>
|
||||
|
||||
//
|
||||
// FIXME: Move _M_ARM stuff away from here
|
||||
// *** AND NOT IN THE NDK! NDK IS ONLY FOR OFFICIALLY OBTAINABLE/EXISTING NT
|
||||
//
|
||||
FORCEINLINE
|
||||
struct _TEB* NtCurrentTeb(VOID)
|
||||
{
|
||||
return (struct _TEB*)USERPCR->Teb;
|
||||
}
|
||||
|
||||
#else
|
||||
static __inline__ struct _TEB * NtCurrentTeb(void)
|
||||
{
|
||||
|
|
18
reactos/lib/rtl/arm/debug_asm.S
Normal file
18
reactos/lib/rtl/arm/debug_asm.S
Normal file
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS Run-Time Library
|
||||
* PURPOSE: Debug Routines
|
||||
* FILE: lib/rtl/arm/debug_asm.S
|
||||
*/
|
||||
|
||||
/* GLOBALS ********************************************************************/
|
||||
|
||||
.globl DbgBreakPoint
|
||||
|
||||
/* FUNCTIONS ******************************************************************/
|
||||
|
||||
.func DbgBreakPoint
|
||||
DbgBreakPoint:
|
||||
bkpt 3
|
||||
bx lr
|
||||
.endfunc
|
|
@ -28,6 +28,11 @@
|
|||
<file>rtlswap.s</file>
|
||||
<file>thread.c</file>
|
||||
</directory>
|
||||
</if>
|
||||
<if property="ARCH" value="arm">
|
||||
<directory name="arm">
|
||||
<file>debug_asm.S</file>
|
||||
</directory>
|
||||
</if>
|
||||
<directory name="austin">
|
||||
<file>avl.c</file>
|
||||
|
|
Loading…
Reference in a new issue