diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2023-01-24 01:44:23 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-01-25 02:06:29 +0100 |
commit | b379d5afdf65cce11426ab0349a3778b3fd632f5 (patch) | |
tree | 806d1d45fad3b713bd3e967ccf39847db427aa55 /i386/include | |
parent | 2281d4ba935f2b6c06d2ee0e5258c41c78bd8d39 (diff) | |
download | gnumach-b379d5afdf65cce11426ab0349a3778b3fd632f5.tar.gz gnumach-b379d5afdf65cce11426ab0349a3778b3fd632f5.tar.bz2 gnumach-b379d5afdf65cce11426ab0349a3778b3fd632f5.zip |
Fix several warnings for -Wmissing-prototypes (part 2)
* i386/i386/io_map.c: code is unused.
* i386/i386/io_perm.c: include mig prototypes.
* i386/i386/mp_desc.c: Deleted interrupt_stack_alloc since it is not
used.
* i386/i386/seg.h: Moved descriptor structs to i386/include/mach/i386/mach_i386_types.h
as that represents the interface types for RPCs.
Defined aliases for real_descriptor since those are used by the i386 RPCs. Inlined many
functions here too and removed seg.c.
* i386/i386/seg.c: Removed. All the functions are inline now.
* i386/i386/trap.c: Use static.
* i386/i386/trap.h: Define missing prototypes.
* i386/i386/tss.h: Use static inline for ltr.
* i386/i386/user_ldt.c: Include mig prototypes.
* i386/include/mach/i386/mach_i386.defs: Define real_descriptor_t types
since those are used in the RPC definition. Now both prototypes and
definitions will match.
* i386/include/mach/i386/mach_i386_types.h: Move struct descriptor
from seg.h since we need those for the RPC interfaces. Removed include
of io_perm.h since it generates circular includes otherwise.
* i386/intel/pmap.c: pmap_map is unused. Added static qualifier for
several functions.
* i386/intel/pmap.h: pmap_update_interrupt declared for non-SMP and SMP.
Message-Id: <Y89+R2VekOQK4IUo@jupiter.lan>
Diffstat (limited to 'i386/include')
-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_ */ |