Commit 4e76f91f authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

Get rid of CPU id when copying context

parent 74c6321a
...@@ -528,6 +528,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context ) ...@@ -528,6 +528,7 @@ NTSTATUS WINAPI NtSetContextThread( HANDLE handle, const CONTEXT *context )
static inline void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags ) static inline void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags )
{ {
#ifdef __i386__ #ifdef __i386__
flags &= ~CONTEXT_i386; /* get rid of CPU id */
if (flags & CONTEXT_INTEGER) if (flags & CONTEXT_INTEGER)
{ {
to->Eax = from->Eax; to->Eax = from->Eax;
...@@ -567,6 +568,7 @@ static inline void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags ) ...@@ -567,6 +568,7 @@ static inline void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags )
to->FloatSave = from->FloatSave; to->FloatSave = from->FloatSave;
} }
#elif defined(__x86_64__) #elif defined(__x86_64__)
flags &= ~CONTEXT_AMD64; /* get rid of CPU id */
if (flags & CONTEXT_CONTROL) if (flags & CONTEXT_CONTROL)
{ {
to->Rbp = from->Rbp; to->Rbp = from->Rbp;
...@@ -615,6 +617,7 @@ static inline void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags ) ...@@ -615,6 +617,7 @@ static inline void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags )
to->Dr7 = from->Dr7; to->Dr7 = from->Dr7;
} }
#elif defined(__sparc__) #elif defined(__sparc__)
flags &= ~CONTEXT_SPARC; /* get rid of CPU id */
if (flags & CONTEXT_CONTROL) if (flags & CONTEXT_CONTROL)
{ {
to->psr = from->psr; to->psr = from->psr;
...@@ -664,6 +667,7 @@ static inline void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags ) ...@@ -664,6 +667,7 @@ static inline void copy_context( CONTEXT *to, const CONTEXT *from, DWORD flags )
/* FIXME */ /* FIXME */
} }
#elif defined(__powerpc__) #elif defined(__powerpc__)
/* Has no CPU id */
if (flags & CONTEXT_CONTROL) if (flags & CONTEXT_CONTROL)
{ {
to->Msr = from->Msr; to->Msr = from->Msr;
......
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