Commit cbaa3d08 authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll: Add a stub ARM64EC CPU backend.

parent dd77c32f
...@@ -37,6 +37,7 @@ SOURCES = \ ...@@ -37,6 +37,7 @@ SOURCES = \
sec.c \ sec.c \
signal_arm.c \ signal_arm.c \
signal_arm64.c \ signal_arm64.c \
signal_arm64ec.c \
signal_i386.c \ signal_i386.c \
signal_x86_64.c \ signal_x86_64.c \
string.c \ string.c \
......
/*
* ARM64EC signal handling routines
*
* Copyright 1999, 2005, 2023 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifdef __arm64ec__
#include <stdlib.h>
#include <stdarg.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
#include "wine/exception.h"
#include "wine/list.h"
#include "ntdll_misc.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(unwind);
WINE_DECLARE_DEBUG_CHANNEL(relay);
/*******************************************************************
* KiUserExceptionDispatcher (NTDLL.@)
*/
NTSTATUS WINAPI KiUserExceptionDispatcher( EXCEPTION_RECORD *rec, CONTEXT *context )
{
FIXME( "not implemented\n" );
return STATUS_INVALID_DISPOSITION;
}
/*******************************************************************
* KiUserApcDispatcher (NTDLL.@)
*/
void WINAPI KiUserApcDispatcher( CONTEXT *context, ULONG_PTR arg1, ULONG_PTR arg2, ULONG_PTR arg3,
PNTAPCFUNC apc )
{
FIXME( "not implemented\n" );
}
/*******************************************************************
* KiUserCallbackDispatcher (NTDLL.@)
*/
void WINAPI KiUserCallbackDispatcher( ULONG id, void *args, ULONG len )
{
FIXME( "not implemented\n" );
}
/**************************************************************************
* RtlIsEcCode (NTDLL.@)
*/
BOOLEAN WINAPI RtlIsEcCode( const void *ptr )
{
const UINT64 *map = (const UINT64 *)NtCurrentTeb()->Peb->EcCodeBitMap;
ULONG_PTR page = (ULONG_PTR)ptr / page_size;
return (map[page / 64] >> (page & 63)) & 1;
}
/***********************************************************************
* RtlCaptureContext (NTDLL.@)
*/
void WINAPI RtlCaptureContext( CONTEXT *context )
{
FIXME( "not implemented\n" );
}
/*******************************************************************
* RtlRestoreContext (NTDLL.@)
*/
void CDECL RtlRestoreContext( CONTEXT *context, EXCEPTION_RECORD *rec )
{
FIXME( "not implemented\n" );
}
/**********************************************************************
* RtlVirtualUnwind (NTDLL.@)
*/
PVOID WINAPI RtlVirtualUnwind( ULONG type, ULONG64 base, ULONG64 pc,
RUNTIME_FUNCTION *function, CONTEXT *context,
PVOID *data, ULONG64 *frame_ret,
KNONVOLATILE_CONTEXT_POINTERS *ctx_ptr )
{
FIXME( "not implemented\n" );
return NULL;
}
/*******************************************************************
* RtlUnwindEx (NTDLL.@)
*/
void WINAPI RtlUnwindEx( PVOID end_frame, PVOID target_ip, EXCEPTION_RECORD *rec,
PVOID retval, CONTEXT *context, UNWIND_HISTORY_TABLE *table )
{
FIXME( "not implemented\n" );
}
/*******************************************************************
* RtlUnwind (NTDLL.@)
*/
void WINAPI RtlUnwind( void *frame, void *target_ip, EXCEPTION_RECORD *rec, void *retval )
{
FIXME( "not implemented\n" );
}
/*******************************************************************
* _local_unwind (NTDLL.@)
*/
void WINAPI _local_unwind( void *frame, void *target_ip )
{
CONTEXT context;
RtlUnwindEx( frame, target_ip, NULL, NULL, &context, NULL );
}
/*******************************************************************
* __C_specific_handler (NTDLL.@)
*/
EXCEPTION_DISPOSITION WINAPI __C_specific_handler( EXCEPTION_RECORD *rec,
void *frame,
CONTEXT *context,
struct _DISPATCHER_CONTEXT *dispatch )
{
FIXME( "not implemented\n" );
return ExceptionContinueSearch;
}
/*************************************************************************
* RtlCaptureStackBackTrace (NTDLL.@)
*/
USHORT WINAPI RtlCaptureStackBackTrace( ULONG skip, ULONG count, PVOID *buffer, ULONG *hash )
{
FIXME( "not implemented\n" );
return 0;
}
/**************************************************************************
* __chkstk (NTDLL.@)
*
* Supposed to touch all the stack pages, but we shouldn't need that.
*/
void __attribute__((naked)) __chkstk(void)
{
asm( "ret" );
}
/***********************************************************************
* RtlRaiseException (NTDLL.@)
*/
void WINAPI RtlRaiseException( struct _EXCEPTION_RECORD * rec)
{
FIXME( "not implemented\n" );
}
/***********************************************************************
* RtlUserThreadStart (NTDLL.@)
*/
void WINAPI RtlUserThreadStart( PRTL_THREAD_START_ROUTINE entry, void *arg )
{
__TRY
{
pBaseThreadInitThunk( 0, (LPTHREAD_START_ROUTINE)entry, arg );
}
__EXCEPT(call_unhandled_exception_filter)
{
NtTerminateProcess( GetCurrentProcess(), GetExceptionCode() );
}
__ENDTRY
}
/******************************************************************
* LdrInitializeThunk (NTDLL.@)
*/
void WINAPI LdrInitializeThunk( CONTEXT *context, ULONG_PTR unk2, ULONG_PTR unk3, ULONG_PTR unk4 )
{
loader_init( context, (void **)&context->Rcx );
TRACE_(relay)( "\1Starting thread proc %p (arg=%p)\n", (void *)context->Rcx, (void *)context->Rdx );
NtContinue( context, TRUE );
}
/**********************************************************************
* DbgBreakPoint (NTDLL.@)
*/
void __attribute__((naked)) DbgBreakPoint(void)
{
asm( "brk #0xf000; ret" );
}
/**********************************************************************
* DbgUserBreakPoint (NTDLL.@)
*/
void __attribute__((naked)) DbgUserBreakPoint(void)
{
asm( "brk #0xf000; ret" );
}
#endif /* __arm64ec__ */
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifdef __x86_64__ #if defined(__x86_64__) && !defined(__arm64ec__)
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -711,10 +711,7 @@ void WINAPI KiUserCallbackDispatcher( ULONG id, void *args, ULONG len ) ...@@ -711,10 +711,7 @@ void WINAPI KiUserCallbackDispatcher( ULONG id, void *args, ULONG len )
*/ */
BOOLEAN WINAPI RtlIsEcCode( const void *ptr ) BOOLEAN WINAPI RtlIsEcCode( const void *ptr )
{ {
const UINT64 *map = (const UINT64 *)NtCurrentTeb()->Peb->EcCodeBitMap; return FALSE;
ULONG_PTR page = (ULONG_PTR)ptr / page_size;
if (!map) return FALSE;
return (map[page / 64] >> (page & 63)) & 1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment