+typedef enum {
+ TASK_MAP_32BIT, /* 32-bit, compatibility mode */
+ TASK_MAP_64BIT, /* 64-bit, separate address space */
+ TASK_MAP_64BIT_SHARED /* 64-bit, kernel-shared addr space */
+} task_map_t;
+
+#elif defined(__x86_64__)
+
+
+typedef struct {
+ struct x86_64_tss *cdi_ktss;
+#if MACH_KDB
+ struct x86_64_tss *cdi_dbtss;
+#endif /* MACH_KDB */
+ struct __attribute__((packed)) {
+ uint16_t size;
+ void *ptr;
+ } cdi_gdt, cdi_idt;
+ struct fake_descriptor *cdi_ldt;
+ vm_offset_t cdi_sstk;
+} cpu_desc_index_t;
+
+typedef enum {
+ TASK_MAP_32BIT, /* 32-bit user, compatibility mode */
+ TASK_MAP_64BIT, /* 64-bit user thread, shared space */
+} task_map_t;
+
+#else
+#error Unsupported architecture
+#endif
+
+/*
+ * This structure is used on entry into the (uber-)kernel on syscall from
+ * a 64-bit user. It contains the address of the machine state save area
+ * for the current thread and a temporary place to save the user's rsp
+ * before loading this address into rsp.
+ */
+typedef struct {
+ addr64_t cu_isf; /* thread->pcb->iss.isf */
+ uint64_t cu_tmp; /* temporary scratch */
+ addr64_t cu_user_gs_base;
+} cpu_uber_t;
+