From 7bbfa39f59dcbc55b21d31abb9e2febef6a51ebb Mon Sep 17 00:00:00 2001 From: Flavio Cruz Date: Wed, 30 Mar 2016 02:26:28 +0200 Subject: Use uint32_t instead of unsigned32_t. Implement stdint.h and use it in gnumach. Remove old type definitions such as signed* and unsigned*. * Makefile.am: Add -ffreestanding. * i386/i386/xen.h: Use uint64_t. * i386/include/mach/i386/machine_types.defs: Use uint32_t and int32_t. * i386/include/mach/i386/vm_types.h: Remove definitions of int*, uint*, unsigned* and signed* types. * i386/xen/xen.c: Use uint64_t. * include/device/device_types.defs: Use uint32_t. * include/mach/std_types.defs: Use POSIX types. * include/mach/std_types.h: Include stdint.h. * include/stdint.h: New file with POSIX types. * include/sys/types.h: Include stdint.h. * ipc/ipc_kmsg.c: Use uint64_t. * kern/exception.c: Use uint32_t. * linux/dev/include/linux/types.h: Remove POSIX types. * xen/block.c: Use uint64_t. * xen/net.c: Do not use removed unsigned*_t types. * xen/ring.h: Use uint32_t instead. * xen/store.c: Use uint32_t. * xen/store.h: Use uint32_t. * xen/time.c: Use POSIX types only. * xen/time.h: Use uint64_t. --- i386/i386/xen.h | 4 ++-- i386/include/mach/i386/machine_types.defs | 4 ++-- i386/include/mach/i386/vm_types.h | 24 ------------------------ i386/xen/xen.c | 2 +- 4 files changed, 5 insertions(+), 29 deletions(-) (limited to 'i386') diff --git a/i386/i386/xen.h b/i386/i386/xen.h index c6811873..49b0d52f 100644 --- a/i386/i386/xen.h +++ b/i386/i386/xen.h @@ -356,8 +356,8 @@ _hypcall2(int, set_debugreg, int, reg, unsigned long, value); _hypcall1(unsigned long, get_debugreg, int, reg); /* x86-specific */ -MACH_INLINE unsigned64_t hyp_cpu_clock(void) { - unsigned64_t tsc; +MACH_INLINE uint64_t hyp_cpu_clock(void) { + uint64_t tsc; asm volatile("rdtsc":"=A"(tsc)); return tsc; } diff --git a/i386/include/mach/i386/machine_types.defs b/i386/include/mach/i386/machine_types.defs index 6ac17cf4..6ff93dbd 100755 --- a/i386/include/mach/i386/machine_types.defs +++ b/i386/include/mach/i386/machine_types.defs @@ -47,7 +47,7 @@ * a port in user space as an integer and * in kernel space as a pointer. */ -type natural_t = unsigned32; +type natural_t = uint32_t; /* * An integer_t is the signed counterpart @@ -56,6 +56,6 @@ type natural_t = unsigned32; * other types in a machine-independent * way. */ -type integer_t = int32; +type integer_t = int32_t; #endif /* _MACHINE_MACHINE_TYPES_DEFS_ */ diff --git a/i386/include/mach/i386/vm_types.h b/i386/include/mach/i386/vm_types.h index 4a58b1cb..4e259f9b 100644 --- a/i386/include/mach/i386/vm_types.h +++ b/i386/include/mach/i386/vm_types.h @@ -59,16 +59,6 @@ typedef unsigned int natural_t; */ typedef int integer_t; -#ifndef _POSIX_SOURCE - -/* - * An int32 is an integer that is at least 32 bits wide - */ -typedef int int32; -typedef unsigned int uint32; - -#endif /* _POSIX_SOURCE */ - /* * A vm_offset_t is a type-neutral pointer, * e.g. an offset into a virtual memory space. @@ -92,20 +82,6 @@ typedef unsigned long phys_addr_t; */ typedef natural_t vm_size_t; -/* - * These types are _exactly_ as wide as indicated in their names. - */ -typedef signed char signed8_t; -typedef signed short signed16_t; -typedef signed int signed32_t; -typedef signed long long signed64_t; -typedef unsigned char unsigned8_t; -typedef unsigned short unsigned16_t; -typedef unsigned int unsigned32_t; -typedef unsigned long long unsigned64_t; -typedef float float32_t; -typedef double float64_t; - #endif /* __ASSEMBLER__ */ /* diff --git a/i386/xen/xen.c b/i386/xen/xen.c index a46ee2c6..44d37e6f 100644 --- a/i386/xen/xen.c +++ b/i386/xen/xen.c @@ -46,7 +46,7 @@ void hyp_failsafe_c_callback(struct failsafe_callback_regs *regs) { extern void return_to_iret; -void hypclock_machine_intr(int old_ipl, void *ret_addr, struct i386_interrupt_state *regs, unsigned64_t delta) { +void hypclock_machine_intr(int old_ipl, void *ret_addr, struct i386_interrupt_state *regs, uint64_t delta) { if (ret_addr == &return_to_iret) { clock_interrupt(delta/1000, /* usec per tick */ (regs->efl & EFL_VM) || /* user mode */ -- cgit v1.2.3