diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-08-28 00:10:45 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-08-28 01:15:48 +0200 |
commit | c566ad85a2d6728ebc8ec0f461a3b35df300e96e (patch) | |
tree | 2b2ed31e04e74c84ce1925df6db1dc809fb57625 /i386 | |
parent | 7d642c99641ffc6960c8dd9ea88634bdaae80213 (diff) | |
download | gnumach-c566ad85a2d6728ebc8ec0f461a3b35df300e96e.tar.gz gnumach-c566ad85a2d6728ebc8ec0f461a3b35df300e96e.tar.bz2 gnumach-c566ad85a2d6728ebc8ec0f461a3b35df300e96e.zip |
Fix inclusability of <mach/mach_types.h>
Now that mach/machine/vm_types.h uses stdint types, we have to ship a
header that defines them.
Diffstat (limited to 'i386')
-rw-r--r-- | i386/Makefrag.am | 1 | ||||
-rw-r--r-- | i386/include/mach/i386/stdint.h | 55 | ||||
-rw-r--r-- | i386/include/mach/i386/vm_types.h | 16 |
3 files changed, 64 insertions, 8 deletions
diff --git a/i386/Makefrag.am b/i386/Makefrag.am index c1043c4f..8d6ef8cd 100644 --- a/i386/Makefrag.am +++ b/i386/Makefrag.am @@ -257,6 +257,7 @@ include_mach_i386_HEADERS = \ i386/include/mach/i386/machine_types.defs \ i386/include/mach/i386/multiboot.h \ i386/include/mach/i386/syscall_sw.h \ + i386/include/mach/i386/stdint.h \ i386/include/mach/i386/thread_status.h \ i386/include/mach/i386/trap.h \ i386/include/mach/i386/vm_param.h \ diff --git a/i386/include/mach/i386/stdint.h b/i386/include/mach/i386/stdint.h new file mode 100644 index 00000000..5336400d --- /dev/null +++ b/i386/include/mach/i386/stdint.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2016 Free Software Foundation, Inc. + * + * This file is part of GNU Mach. + * + * GNU Mach is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any later + * version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef _MACH_MACHINE_STDINT_H_ +#define _MACH_MACHINE_STDINT_H_ + +/* + * These types are _exactly_ as wide as indicated in their names. + */ + +typedef char __mach_int8_t; +typedef short __mach_int16_t; +typedef int __mach_int32_t; +#if __x86_64__ +typedef long int __mach_int64_t; +#else +typedef long long int __mach_int64_t; +#endif /* __x86_64__ */ + +typedef unsigned char __mach_uint8_t; +typedef unsigned short __mach_uint16_t; +typedef unsigned int __mach_uint32_t; +#if __x86_64__ +typedef unsigned long int __mach_uint64_t; +#else +typedef unsigned long long int __mach_uint64_t; +#endif /* __x86_64__ */ + +/* Types for `void *' pointers. */ +#if __x86_64__ +typedef long int __mach_intptr_t; +typedef unsigned long int __mach_uintptr_t; +#else +typedef int __mach_intptr_t; +typedef unsigned int __mach_uintptr_t; +#endif /* __x86_64__ */ + +#endif /* _MACH_MACHINE_STDINT_H_ */ diff --git a/i386/include/mach/i386/vm_types.h b/i386/include/mach/i386/vm_types.h index 16aedc44..7a43d75d 100644 --- a/i386/include/mach/i386/vm_types.h +++ b/i386/include/mach/i386/vm_types.h @@ -37,7 +37,7 @@ #ifdef __ASSEMBLER__ #else /* __ASSEMBLER__ */ -#include <stdint.h> +#include <mach/machine/stdint.h> #ifdef MACH_KERNEL #include <kern/assert.h> @@ -104,17 +104,17 @@ typedef vm_size_t * vm_size_array_t; * functions. */ #if defined(MACH_KERNEL) && defined(USER32) -typedef uint32_t rpc_vm_address_t; -typedef uint32_t rpc_vm_offset_t; -typedef uint32_t rpc_vm_size_t; -static inline uint64_t convert_vm_from_user(uint32_t uaddr) +typedef __mach_uint32_t rpc_vm_address_t; +typedef __mach_uint32_t rpc_vm_offset_t; +typedef __mach_uint32_t rpc_vm_size_t; +static inline __mach_uint64_t convert_vm_from_user(__mach_uint32_t uaddr) { - return (uint64_t)uaddr; + return (__mach_uint64_t)uaddr; } -static inline uint32_t convert_vm_to_user(uint64_t kaddr) +static inline __mach_uint32_t convert_vm_to_user(__mach_uint64_t kaddr) { assert(kaddr <= 0xFFFFFFFF); - return (uint32_t)kaddr; + return (__mach_uint32_t)kaddr; } #else /* MACH_KERNEL */ typedef vm_offset_t rpc_vm_address_t; |