-#define USER_SCALL 0x07 /* system call gate */
-#define USER_RPC 0x0f /* mach rpc call gate */
-#define USER_CS 0x17 /* user code segment */
-#define USER_DS 0x1f /* user data segment */
-#define USER_CTHREAD 0x27 /* user cthread area */
-#define USER_SETTABLE 0x2f /* start of user settable ldt entries */
+#define SYSENTER_CS 0x07 /* sysenter kernel code segment */
+#define SYSENTER_DS 0x0f /* sysenter kernel data segment */
+#define USER_CS 0x17 /* user code segment
+ Must be SYSENTER_CS+16 for sysexit */
+/* Special case: sysenter with EFL_TF (trace bit) set - use iret not sysexit */
+#define SYSENTER_TF_CS (USER_CS|0x10000)
+#define USER_DS 0x1f /* user data segment
+ Must be SYSENTER_CS+24 for sysexit */
+#define USER64_CS 0x27 /* 64-bit user code segment
+ Must be USER_CS+16 for sysret */
+#define USER64_DS USER_DS /* 64-bit user data segment == 32-bit */
+#define SYSCALL_CS 0x2f /* 64-bit syscall pseudo-segment */
+#define USER_CTHREAD 0x37 /* user cthread area */
+#define USER_SETTABLE 0x3f /* start of user settable ldt entries */