]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/i386/gdt.c
xnu-4570.41.2.tar.gz
[apple/xnu.git] / osfmk / i386 / gdt.c
index c3502e06be2f392ae91a86f075e907d2c32b8aed..04937648bcc8379c536aec23ba00b1d5984e31bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2009 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2013 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
  */
 #include <i386/seg.h>
 
-struct real_descriptor master_gdt[GDTSZ] __attribute__ ((section("__INITGDT,__data")))= {
-       [SEL_TO_INDEX(KERNEL32_CS)] MAKE_REAL_DESCRIPTOR(       /* kernel 32-bit code */ 
+struct real_descriptor master_gdt[GDTSZ]
+       __attribute__((section("__HIB,__desc")))
+       __attribute__((aligned(PAGE_SIZE))) = {
+       [SEL_TO_INDEX(KERNEL32_CS)] = MAKE_REAL_DESCRIPTOR(     /* kernel 32-bit code */ 
                0,
                0xfffff,
                SZ_32|SZ_G,
                ACC_P|ACC_PL_K|ACC_CODE_R
        ),
-       [SEL_TO_INDEX(KERNEL_DS)] MAKE_REAL_DESCRIPTOR( /* kernel data */
+       [SEL_TO_INDEX(KERNEL_DS)] = MAKE_REAL_DESCRIPTOR(       /* kernel data */
                0,
                0xfffff,
                SZ_32|SZ_G,
                ACC_P|ACC_PL_K|ACC_DATA_W
        ),
-       [SEL_TO_INDEX(KERNEL64_CS)] MAKE_REAL_DESCRIPTOR(       /* kernel 64-bit code */ 
+       [SEL_TO_INDEX(KERNEL64_CS)] = MAKE_REAL_DESCRIPTOR(     /* kernel 64-bit code */ 
                0,
                0xfffff,
                SZ_64|SZ_G,
                ACC_P|ACC_PL_K|ACC_CODE_R
        ),
-       [SEL_TO_INDEX(KERNEL64_SS)] MAKE_REAL_DESCRIPTOR(       /* kernel 64-bit syscall stack */ 
+       [SEL_TO_INDEX(KERNEL64_SS)] = MAKE_REAL_DESCRIPTOR(     /* kernel 64-bit syscall stack */ 
                0,
                0xfffff,
                SZ_32|SZ_G,
                ACC_P|ACC_PL_K|ACC_DATA_W
        ),
-#ifdef __x86_64__
-       [SEL_TO_INDEX(USER_CS)] MAKE_REAL_DESCRIPTOR(   /* 32-bit user code segment */
+       [SEL_TO_INDEX(USER_CS)] = MAKE_REAL_DESCRIPTOR( /* 32-bit user code segment */
                0,
                0xfffff,
                SZ_32|SZ_G,
                ACC_P|ACC_PL_U|ACC_CODE_R
        ),
-       [SEL_TO_INDEX(USER_DS)] MAKE_REAL_DESCRIPTOR(   /* 32-bit user data segment */
+       [SEL_TO_INDEX(USER_DS)] = MAKE_REAL_DESCRIPTOR( /* 32-bit user data segment */
                0,
                0xfffff,
                SZ_32|SZ_G,
                ACC_P|ACC_PL_U|ACC_DATA_W
        ),
-       [SEL_TO_INDEX(USER64_CS)] MAKE_REAL_DESCRIPTOR( /* user 64-bit code segment */
+       [SEL_TO_INDEX(USER64_CS)] = MAKE_REAL_DESCRIPTOR(       /* user 64-bit code segment */
                0,
                0xfffff,
                SZ_64|SZ_G,
                ACC_P|ACC_PL_U|ACC_CODE_R
        ),
-#endif
 };