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