]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/dev/arm/table_inline.h
xnu-4570.1.46.tar.gz
[apple/xnu.git] / bsd / dev / arm / table_inline.h
diff --git a/bsd/dev/arm/table_inline.h b/bsd/dev/arm/table_inline.h
new file mode 100644 (file)
index 0000000..8f358e4
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2000-2007 Apple Inc. All rights reserved.
+ */
+/*
+ * Copyright (c) 1992 NeXT Computer, Inc.
+ *
+ * Intel386 Family:    Selector based access to descriptor tables.
+ *
+ * HISTORY
+ *
+ * 2 April 1992 ? at NeXT
+ *     Created.
+ */
+#include <architecture/i386/table.h>
+
+#include <machdep/i386/gdt.h>
+#include <machdep/i386/idt.h>
+
+static inline gdt_entry_t *
+sel_to_gdt_entry(sel_t sel)
+{
+       return (&gdt[sel.index]);
+}
+
+static inline idt_entry_t *
+sel_to_idt_entry(sel_t sel)
+{
+       return (&idt[sel.index]);
+}
+
+static inline ldt_entry_t *
+sel_to_ldt_entry(ldt_t *tbl, sel_t sel)
+{
+       return (&tbl[sel.index]);
+}