server: Define a generic context structure instead of using the platform-specific version.
diff --git a/server/protocol.def b/server/protocol.def
index 0f7e7de..004f4c9 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -150,6 +150,63 @@
 };
 typedef int cpu_type_t;
 
+/* context data */
+typedef struct
+{
+    cpu_type_t       cpu;        /* cpu type */
+    unsigned int     flags;      /* SERVER_CTX_* flags */
+    union
+    {
+        struct { unsigned int eip, ebp, esp, eflags, cs, ss; } i386_regs;
+        struct { unsigned __int64 rip, rbp, rsp;
+                 unsigned int cs, ss, flags, mxcsr; } x86_64_regs;
+        struct { unsigned __int64 fir;
+                 unsigned int psr; } alpha_regs;
+        struct { unsigned int iar, msr, ctr, lr, dar, dsisr, trap; } powerpc_regs;
+        struct { unsigned int psr, pc, npc, y, wim, tbr; } sparc_regs;
+    } ctl;  /* selected by SERVER_CTX_CONTROL */
+    union
+    {
+        struct { unsigned int eax, ebx, ecx, edx, esi, edi; } i386_regs;
+        struct { unsigned __int64 rax,rbx, rcx, rdx, rsi, rdi,
+                                  r8, r9, r10, r11, r12, r13, r14, r15; } x86_64_regs;
+        struct { unsigned __int64 v0, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12,
+                                  s0, s1, s2, s3, s4, s5, s6, a0, a1, a2, a3, a4, a5, at; } alpha_regs;
+        struct { unsigned int gpr[32], cr, xer; } powerpc_regs;
+        struct { unsigned int g[8], o[8], l[8], i[8]; } sparc_regs;
+    } integer;  /* selected by SERVER_CTX_INTEGER */
+    union
+    {
+        struct { unsigned int ds, es, fs, gs; } i386_regs;
+        struct { unsigned int ds, es, fs, gs; } x86_64_regs;
+    } seg;  /* selected by SERVER_CTX_SEGMENTS */
+    union
+    {
+        struct { unsigned int ctrl, status, tag, err_off, err_sel, data_off, data_sel, cr0npx;
+                 unsigned char regs[80]; } i386_regs;
+        struct { struct { unsigned __int64 low, high; } fpregs[32]; } x86_64_regs;
+        struct { unsigned __int64 f[32], fpcr, softfpcr; } alpha_regs;
+        struct { double fpr[32], fpscr; } powerpc_regs;
+    } fp;  /* selected by SERVER_CTX_FLOATING_POINT */
+    union
+    {
+        struct { unsigned int dr0, dr1, dr2, dr3, dr6, dr7; } i386_regs;
+        struct { unsigned __int64 dr0, dr1, dr2, dr3, dr6, dr7; } x86_64_regs;
+        struct { unsigned int dr[8]; } powerpc_regs;
+    } debug;  /* selected by SERVER_CTX_DEBUG_REGISTERS */
+    union
+    {
+        unsigned char i386_regs[512];
+    } ext;                       /* selected by SERVER_CTX_EXTENDED_REGISTERS */
+} context_t;
+
+#define SERVER_CTX_CONTROL            0x01
+#define SERVER_CTX_INTEGER            0x02
+#define SERVER_CTX_SEGMENTS           0x04
+#define SERVER_CTX_FLOATING_POINT     0x08
+#define SERVER_CTX_DEBUG_REGISTERS    0x10
+#define SERVER_CTX_EXTENDED_REGISTERS 0x20
+
 /* structure used in sending an fd from client to server */
 struct send_fd
 {
@@ -1732,7 +1789,6 @@
 /* Set the current context of a thread */
 @REQ(set_thread_context)
     obj_handle_t handle;       /* thread handle */
-    unsigned int flags;        /* context flags */
     int          suspend;      /* if setting context during suspend */
     VARARG(context,context);   /* thread context */
 @REPLY