Commit df8d907f authored by Alexandre Julliard's avatar Alexandre Julliard

ntdll/tests: Don't use x86-64 assembly on ARM64EC.

parent de492f9a
...@@ -3303,7 +3303,6 @@ static DWORD WINAPI handler( EXCEPTION_RECORD *rec, ULONG64 frame, ...@@ -3303,7 +3303,6 @@ static DWORD WINAPI handler( EXCEPTION_RECORD *rec, ULONG64 frame,
{ {
const struct exception *except = *(const struct exception **)(dispatcher->HandlerData); const struct exception *except = *(const struct exception **)(dispatcher->HandlerData);
unsigned int i, parameter_count, entry = except - exceptions; unsigned int i, parameter_count, entry = except - exceptions;
USHORT ds, es, fs, gs, ss;
got_exception++; got_exception++;
winetest_push_context( "%u: %lx", entry, rec->ExceptionCode ); winetest_push_context( "%u: %lx", entry, rec->ExceptionCode );
...@@ -3317,24 +3316,29 @@ static DWORD WINAPI handler( EXCEPTION_RECORD *rec, ULONG64 frame, ...@@ -3317,24 +3316,29 @@ static DWORD WINAPI handler( EXCEPTION_RECORD *rec, ULONG64 frame,
(rec->ExceptionCode == STATUS_BREAKPOINT && rec->ExceptionAddress == (char*)context->Rip + 1), (rec->ExceptionCode == STATUS_BREAKPOINT && rec->ExceptionAddress == (char*)context->Rip + 1),
"Unexpected exception address %p/%p\n", rec->ExceptionAddress, (char*)context->Rip ); "Unexpected exception address %p/%p\n", rec->ExceptionAddress, (char*)context->Rip );
__asm__ volatile( "movw %%ds,%0" : "=g" (ds) ); #ifndef __arm64ec__
__asm__ volatile( "movw %%es,%0" : "=g" (es) ); {
__asm__ volatile( "movw %%fs,%0" : "=g" (fs) ); USHORT ds, es, fs, gs, ss;
__asm__ volatile( "movw %%gs,%0" : "=g" (gs) ); __asm__ volatile( "movw %%ds,%0" : "=g" (ds) );
__asm__ volatile( "movw %%ss,%0" : "=g" (ss) ); __asm__ volatile( "movw %%es,%0" : "=g" (es) );
ok( context->SegDs == ds || !ds, "ds %#x does not match %#x\n", context->SegDs, ds ); __asm__ volatile( "movw %%fs,%0" : "=g" (fs) );
ok( context->SegEs == es || !es, "es %#x does not match %#x\n", context->SegEs, es ); __asm__ volatile( "movw %%gs,%0" : "=g" (gs) );
ok( context->SegFs == fs || !fs, "fs %#x does not match %#x\n", context->SegFs, fs ); __asm__ volatile( "movw %%ss,%0" : "=g" (ss) );
ok( context->SegGs == gs || !gs, "gs %#x does not match %#x\n", context->SegGs, gs ); ok( context->SegDs == ds || !ds, "ds %#x does not match %#x\n", context->SegDs, ds );
ok( context->SegSs == ss, "ss %#x does not match %#x\n", context->SegSs, ss ); ok( context->SegEs == es || !es, "es %#x does not match %#x\n", context->SegEs, es );
ok( context->SegDs == context->SegSs, ok( context->SegFs == fs || !fs, "fs %#x does not match %#x\n", context->SegFs, fs );
"ds %#x does not match ss %#x\n", context->SegDs, context->SegSs ); ok( context->SegGs == gs || !gs, "gs %#x does not match %#x\n", context->SegGs, gs );
ok( context->SegEs == context->SegSs, ok( context->SegSs == ss, "ss %#x does not match %#x\n", context->SegSs, ss );
"es %#x does not match ss %#x\n", context->SegEs, context->SegSs ); ok( context->SegDs == context->SegSs,
ok( context->SegGs == context->SegSs, "ds %#x does not match ss %#x\n", context->SegDs, context->SegSs );
"gs %#x does not match ss %#x\n", context->SegGs, context->SegSs ); ok( context->SegEs == context->SegSs,
todo_wine ok( context->SegFs && context->SegFs != context->SegSs, "es %#x does not match ss %#x\n", context->SegEs, context->SegSs );
"got fs %#x\n", context->SegFs ); ok( context->SegGs == context->SegSs,
"gs %#x does not match ss %#x\n", context->SegGs, context->SegSs );
todo_wine ok( context->SegFs && context->SegFs != context->SegSs,
"got fs %#x\n", context->SegFs );
}
#endif
if (except->status == STATUS_BREAKPOINT && is_wow64) if (except->status == STATUS_BREAKPOINT && is_wow64)
parameter_count = 1; parameter_count = 1;
...@@ -3604,7 +3608,6 @@ static void test_exceptions(void) ...@@ -3604,7 +3608,6 @@ static void test_exceptions(void)
{ {
CONTEXT ctx; CONTEXT ctx;
NTSTATUS res; NTSTATUS res;
USHORT ds, es, fs, gs, ss;
struct dbgreg_test dreg_test; struct dbgreg_test dreg_test;
/* test handling of debug registers */ /* test handling of debug registers */
...@@ -3657,45 +3660,50 @@ static void test_exceptions(void) ...@@ -3657,45 +3660,50 @@ static void test_exceptions(void)
/* test int3 handling */ /* test int3 handling */
run_exception_test(int3_handler, NULL, int3_code, sizeof(int3_code), 0); run_exception_test(int3_handler, NULL, int3_code, sizeof(int3_code), 0);
/* test segment registers */ #ifndef __arm64ec__
ctx.ContextFlags = CONTEXT_CONTROL | CONTEXT_SEGMENTS; {
res = pNtGetContextThread( GetCurrentThread(), &ctx ); USHORT ds, es, fs, gs, ss;
ok( res == STATUS_SUCCESS, "NtGetContextThread failed with %lx\n", res ); /* test segment registers */
__asm__ volatile( "movw %%ds,%0" : "=g" (ds) ); ctx.ContextFlags = CONTEXT_CONTROL | CONTEXT_SEGMENTS;
__asm__ volatile( "movw %%es,%0" : "=g" (es) ); res = pNtGetContextThread( GetCurrentThread(), &ctx );
__asm__ volatile( "movw %%fs,%0" : "=g" (fs) ); ok( res == STATUS_SUCCESS, "NtGetContextThread failed with %lx\n", res );
__asm__ volatile( "movw %%gs,%0" : "=g" (gs) ); __asm__ volatile( "movw %%ds,%0" : "=g" (ds) );
__asm__ volatile( "movw %%ss,%0" : "=g" (ss) ); __asm__ volatile( "movw %%es,%0" : "=g" (es) );
ok( ctx.SegDs == ds, "wrong ds %04x / %04x\n", ctx.SegDs, ds ); __asm__ volatile( "movw %%fs,%0" : "=g" (fs) );
ok( ctx.SegEs == es, "wrong es %04x / %04x\n", ctx.SegEs, es ); __asm__ volatile( "movw %%gs,%0" : "=g" (gs) );
ok( ctx.SegFs == fs, "wrong fs %04x / %04x\n", ctx.SegFs, fs ); __asm__ volatile( "movw %%ss,%0" : "=g" (ss) );
ok( ctx.SegGs == gs || !gs, "wrong gs %04x / %04x\n", ctx.SegGs, gs ); ok( ctx.SegDs == ds, "wrong ds %04x / %04x\n", ctx.SegDs, ds );
ok( ctx.SegSs == ss, "wrong ss %04x / %04x\n", ctx.SegSs, ss ); ok( ctx.SegEs == es, "wrong es %04x / %04x\n", ctx.SegEs, es );
ok( ctx.SegDs == ctx.SegSs, "wrong ds %04x / %04x\n", ctx.SegDs, ctx.SegSs ); ok( ctx.SegFs == fs, "wrong fs %04x / %04x\n", ctx.SegFs, fs );
ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs ); ok( ctx.SegGs == gs || !gs, "wrong gs %04x / %04x\n", ctx.SegGs, gs );
ok( ctx.SegFs != ctx.SegSs, "wrong fs %04x / %04x\n", ctx.SegFs, ctx.SegSs ); ok( ctx.SegSs == ss, "wrong ss %04x / %04x\n", ctx.SegSs, ss );
ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs ); ok( ctx.SegDs == ctx.SegSs, "wrong ds %04x / %04x\n", ctx.SegDs, ctx.SegSs );
ctx.SegDs = 0; ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs );
ctx.SegEs = ctx.SegFs; ok( ctx.SegFs != ctx.SegSs, "wrong fs %04x / %04x\n", ctx.SegFs, ctx.SegSs );
ctx.SegFs = ctx.SegSs; ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs );
res = pNtSetContextThread( GetCurrentThread(), &ctx ); ctx.SegDs = 0;
ok( res == STATUS_SUCCESS, "NtGetContextThread failed with %lx\n", res ); ctx.SegEs = ctx.SegFs;
__asm__ volatile( "movw %%ds,%0" : "=g" (ds) ); ctx.SegFs = ctx.SegSs;
__asm__ volatile( "movw %%es,%0" : "=g" (es) ); res = pNtSetContextThread( GetCurrentThread(), &ctx );
__asm__ volatile( "movw %%fs,%0" : "=g" (fs) ); ok( res == STATUS_SUCCESS, "NtGetContextThread failed with %lx\n", res );
__asm__ volatile( "movw %%gs,%0" : "=g" (gs) ); __asm__ volatile( "movw %%ds,%0" : "=g" (ds) );
__asm__ volatile( "movw %%ss,%0" : "=g" (ss) ); __asm__ volatile( "movw %%es,%0" : "=g" (es) );
res = pNtGetContextThread( GetCurrentThread(), &ctx ); __asm__ volatile( "movw %%fs,%0" : "=g" (fs) );
ok( res == STATUS_SUCCESS, "NtGetContextThread failed with %lx\n", res ); __asm__ volatile( "movw %%gs,%0" : "=g" (gs) );
ok( ctx.SegDs == ds, "wrong ds %04x / %04x\n", ctx.SegDs, ds ); __asm__ volatile( "movw %%ss,%0" : "=g" (ss) );
ok( ctx.SegEs == es, "wrong es %04x / %04x\n", ctx.SegEs, es ); res = pNtGetContextThread( GetCurrentThread(), &ctx );
ok( ctx.SegFs == fs, "wrong fs %04x / %04x\n", ctx.SegFs, fs ); ok( res == STATUS_SUCCESS, "NtGetContextThread failed with %lx\n", res );
ok( ctx.SegGs == gs || !gs, "wrong gs %04x / %04x\n", ctx.SegGs, gs ); ok( ctx.SegDs == ds, "wrong ds %04x / %04x\n", ctx.SegDs, ds );
ok( ctx.SegSs == ss, "wrong ss %04x / %04x\n", ctx.SegSs, ss ); ok( ctx.SegEs == es, "wrong es %04x / %04x\n", ctx.SegEs, es );
ok( ctx.SegDs == ctx.SegSs, "wrong ds %04x / %04x\n", ctx.SegDs, ctx.SegSs ); ok( ctx.SegFs == fs, "wrong fs %04x / %04x\n", ctx.SegFs, fs );
ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs ); ok( ctx.SegGs == gs || !gs, "wrong gs %04x / %04x\n", ctx.SegGs, gs );
ok( ctx.SegFs != ctx.SegSs, "wrong fs %04x / %04x\n", ctx.SegFs, ctx.SegSs ); ok( ctx.SegSs == ss, "wrong ss %04x / %04x\n", ctx.SegSs, ss );
ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs ); ok( ctx.SegDs == ctx.SegSs, "wrong ds %04x / %04x\n", ctx.SegDs, ctx.SegSs );
ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs );
ok( ctx.SegFs != ctx.SegSs, "wrong fs %04x / %04x\n", ctx.SegFs, ctx.SegSs );
ok( ctx.SegGs == ctx.SegSs, "wrong gs %04x / %04x\n", ctx.SegGs, ctx.SegSs );
}
#endif
} }
static DWORD WINAPI simd_fault_handler( EXCEPTION_RECORD *rec, ULONG64 frame, static DWORD WINAPI simd_fault_handler( EXCEPTION_RECORD *rec, ULONG64 frame,
...@@ -4218,8 +4226,12 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx) ...@@ -4218,8 +4226,12 @@ static void test_debugger(DWORD cont_status, BOOL with_WaitForDebugEventEx)
} }
else if (stage == STAGE_SEGMENTS) else if (stage == STAGE_SEGMENTS)
{ {
#ifdef __arm64ec__
USHORT ss = 0x2b;
#else
USHORT ss; USHORT ss;
__asm__( "movw %%ss,%0" : "=r" (ss) ); __asm__( "movw %%ss,%0" : "=r" (ss) );
#endif
ok( ctx.SegSs == ss, "wrong ss %04x / %04x\n", ctx.SegSs, ss ); ok( ctx.SegSs == ss, "wrong ss %04x / %04x\n", ctx.SegSs, ss );
ok( ctx.SegDs == ctx.SegSs, "wrong ds %04x / %04x\n", ctx.SegDs, ctx.SegSs ); ok( ctx.SegDs == ctx.SegSs, "wrong ds %04x / %04x\n", ctx.SegDs, ctx.SegSs );
ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs ); ok( ctx.SegEs == ctx.SegSs, "wrong es %04x / %04x\n", ctx.SegEs, ctx.SegSs );
...@@ -11519,6 +11531,7 @@ static void test_extended_context(void) ...@@ -11519,6 +11531,7 @@ static void test_extended_context(void)
enabled_features = pRtlGetEnabledExtendedFeatures(~(ULONG64)0); enabled_features = pRtlGetEnabledExtendedFeatures(~(ULONG64)0);
#ifndef __arm64ec__
if (enabled_features) if (enabled_features)
{ {
int regs[4]; int regs[4];
...@@ -11527,6 +11540,7 @@ static void test_extended_context(void) ...@@ -11527,6 +11540,7 @@ static void test_extended_context(void)
xsaveopt_enabled = regs[0] & 1; xsaveopt_enabled = regs[0] & 1;
compaction_enabled = regs[0] & 2; compaction_enabled = regs[0] & 2;
} }
#endif
/* Test context manipulation functions. */ /* Test context manipulation functions. */
length = 0xdeadbeef; length = 0xdeadbeef;
......
...@@ -125,7 +125,7 @@ static void test_NtQueryPerformanceCounter(void) ...@@ -125,7 +125,7 @@ static void test_NtQueryPerformanceCounter(void)
ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08lx\n", status); ok(status == STATUS_SUCCESS, "expected STATUS_SUCCESS, got %08lx\n", status);
} }
#if defined(__i386__) || defined(__x86_64__) #if (defined(__i386__) || defined(__x86_64__)) && !defined(__arm64ec__)
struct hypervisor_shared_data struct hypervisor_shared_data
{ {
...@@ -494,7 +494,7 @@ START_TEST(time) ...@@ -494,7 +494,7 @@ START_TEST(time)
test_NtQueryPerformanceCounter(); test_NtQueryPerformanceCounter();
test_RtlQueryTimeZoneInformation(); test_RtlQueryTimeZoneInformation();
test_user_shared_data_time(); test_user_shared_data_time();
#if defined(__i386__) || defined(__x86_64__) #if (defined(__i386__) || defined(__x86_64__)) && !defined(__arm64ec__)
test_RtlQueryPerformanceCounter(); test_RtlQueryPerformanceCounter();
#endif #endif
test_TimerResolution(); test_TimerResolution();
......
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