summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-03-29 13:54:11 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-03-29 17:11:50 +0200
commit7d26734f9144243f1fa5a0dfbc57a21be4a59472 (patch)
treeb3fda95ab126baba4ae986b1912d3e6d56cbc3c6
parent00fe44e565d0ec292bb06a5677ee175cd0851a69 (diff)
Fix gate definition for 64bit.
* i386/i386/seg.h (real_gate): Add offset_ext and reserved fields. (fill_gate): Fill offset_ext and reserved fields.
-rw-r--r--i386/i386/ldt.h3
-rw-r--r--i386/i386/seg.h8
2 files changed, 11 insertions, 0 deletions
diff --git a/i386/i386/ldt.h b/i386/i386/ldt.h
index f196c74b..81c49782 100644
--- a/i386/i386/ldt.h
+++ b/i386/i386/ldt.h
@@ -43,6 +43,9 @@
* User descriptors for Mach - 32-bit flat address space
*/
#define USER_SCALL 0x07 /* system call gate */
+#ifdef __x86_64__
+/* Call gate needs two entries */
+#endif
#define USER_CS 0x17 /* user code segment */
#define USER_DS 0x1f /* user data segment */
diff --git a/i386/i386/seg.h b/i386/i386/seg.h
index 6f3d5af9..86e73c34 100644
--- a/i386/i386/seg.h
+++ b/i386/i386/seg.h
@@ -65,6 +65,10 @@ struct real_gate {
word_count:8,
access:8,
offset_high:16; /* offset 16..31 */
+#ifdef __x86_64__
+ unsigned int offset_ext:32, /* offset 32..63 */
+ reserved:32;
+#endif
};
#endif /* !__ASSEMBLER__ */
@@ -195,6 +199,10 @@ fill_gate(struct real_gate *gate, unsigned offset, unsigned short selector,
gate->word_count = word_count;
gate->access = access | ACC_P;
gate->offset_high = (offset >> 16) & 0xffff;
+#ifdef __x86_64__
+ gate->offset_ext = offset >> 32;
+ gate->reserved = 0;
+#endif
}
#endif /* !__ASSEMBLER__ */