diff options
Diffstat (limited to 'i386/include/mach')
-rw-r--r-- | i386/include/mach/i386/mach_i386.defs | 13 | ||||
-rw-r--r-- | i386/include/mach/i386/mach_i386_types.h | 49 |
2 files changed, 49 insertions, 13 deletions
diff --git a/i386/include/mach/i386/mach_i386.defs b/i386/include/mach/i386/mach_i386.defs index e110c899..4694522b 100644 --- a/i386/include/mach/i386/mach_i386.defs +++ b/i386/include/mach/i386/mach_i386.defs @@ -40,9 +40,12 @@ subsystem MACH_I386_IMPORTS #endif -type descriptor_t = struct[2] of int; +type descriptor_t = struct[2] of uint32_t; type descriptor_list_t = array[*] of descriptor_t; +type real_descriptor_t = descriptor_t; +type real_descriptor_list_t = array[*] of real_descriptor_t; + import <mach/machine/mach_i386_types.h>; #if KERNEL_SERVER @@ -66,13 +69,13 @@ skip; /* i386_io_port_list */ routine i386_set_ldt( target_thread : thread_t; first_selector : int; - desc_list : descriptor_list_t, serverCopy); + desc_list : real_descriptor_list_t, serverCopy); routine i386_get_ldt( target_thread : thread_t; first_selector : int; selector_count : int; - out desc_list : descriptor_list_t); + out desc_list : real_descriptor_list_t); /* Request a new port IO_PERM that represents the capability to access the I/O ports [FROM; TO] directly. MASTER_PORT is the master device port. @@ -104,10 +107,10 @@ routine i386_io_perm_modify( routine i386_set_gdt( target_thread : thread_t; inout selector : int; - desc : descriptor_t); + desc : real_descriptor_t); /* Fetch a segment descriptor set with a prior i386_set_gdt call. */ routine i386_get_gdt( target_thread : thread_t; selector : int; - out desc : descriptor_t); + out desc : real_descriptor_t); diff --git a/i386/include/mach/i386/mach_i386_types.h b/i386/include/mach/i386/mach_i386_types.h index f003636d..bfa91ca0 100644 --- a/i386/include/mach/i386/mach_i386_types.h +++ b/i386/include/mach/i386/mach_i386_types.h @@ -30,27 +30,60 @@ #ifndef _MACH_MACH_I386_TYPES_H_ #define _MACH_MACH_I386_TYPES_H_ +#ifndef __ASSEMBLER__ /* * i386 segment descriptor. */ -struct descriptor { +struct segment_descriptor { unsigned int low_word; unsigned int high_word; }; -typedef struct descriptor descriptor_t; -typedef struct descriptor *descriptor_list_t; -typedef const struct descriptor *const_descriptor_list_t; +typedef struct segment_descriptor descriptor_t; +typedef struct segment_descriptor *descriptor_list_t; +typedef const struct descriptor *const_segment_descriptor_list_t; + +/* + * Real segment descriptor. + */ +struct real_descriptor { + unsigned int limit_low:16, /* limit 0..15 */ + base_low:16, /* base 0..15 */ + base_med:8, /* base 16..23 */ + access:8, /* access byte */ + limit_high:4, /* limit 16..19 */ + granularity:4, /* granularity */ + base_high:8; /* base 24..31 */ +}; +typedef struct real_descriptor real_descriptor_t; +typedef real_descriptor_t *real_descriptor_list_t; +typedef const real_descriptor_list_t const_real_descriptor_list_t; + +#ifdef __x86_64__ +struct real_descriptor64 { + unsigned int limit_low:16, /* limit 0..15 */ + base_low:16, /* base 0..15 */ + base_med:8, /* base 16..23 */ + access:8, /* access byte */ + limit_high:4, /* limit 16..19 */ + granularity:4, /* granularity */ + base_high:8, /* base 24..31 */ + base_ext:32, /* base 32..63 */ + reserved1:8, + zero:5, + reserved2:19; +}; +#endif + +#endif /* !__ASSEMBLER__ */ /* * i386 I/O port */ -#ifdef MACH_KERNEL -#include <i386/io_perm.h> -#else /* MACH_KERNEL */ +#ifndef MACH_KERNEL typedef unsigned short io_port_t; typedef mach_port_t io_perm_t; -#endif /* MACH_KERNEL */ +#endif /* !MACH_KERNEL */ #endif /* _MACH_MACH_I386_TYPES_H_ */ |