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. --- xen/time.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'xen/time.c') diff --git a/xen/time.c b/xen/time.c index 4ebe91fa..3ad73e23 100644 --- a/xen/time.c +++ b/xen/time.c @@ -28,14 +28,14 @@ #include "time.h" #include "store.h" -static unsigned64_t lastnsec; +static uint64_t lastnsec; /* 2^64 nanoseconds ~= 500 years */ -static unsigned64_t hyp_get_stime(void) { - unsigned32_t version; - unsigned64_t cpu_clock, last_cpu_clock, delta, system_time; - unsigned64_t delta_high, delta_low; - unsigned32_t mul; +static uint64_t hyp_get_stime(void) { + uint32_t version; + uint64_t cpu_clock, last_cpu_clock, delta, system_time; + uint64_t delta_high, delta_low; + uint32_t mul; signed8_t shift; volatile struct vcpu_time_info *time = &hyp_shared_info.vcpu_info[0].time; @@ -56,14 +56,14 @@ static unsigned64_t hyp_get_stime(void) { else delta <<= shift; delta_high = delta >> 32; - delta_low = (unsigned32_t) delta; - return system_time + ((delta_low * (unsigned64_t) mul) >> 32) - + (delta_high * (unsigned64_t) mul); + delta_low = (uint32_t) delta; + return system_time + ((delta_low * (uint64_t) mul) >> 32) + + (delta_high * (uint64_t) mul); } -unsigned64_t hyp_get_time(void) { - unsigned32_t version; - unsigned32_t sec, nsec; +uint64_t hyp_get_time(void) { + uint32_t version; + uint32_t sec, nsec; do { version = hyp_shared_info.wc_version; @@ -77,7 +77,7 @@ unsigned64_t hyp_get_time(void) { } static void hypclock_intr(int unit, int old_ipl, void *ret_addr, struct i386_interrupt_state *regs) { - unsigned64_t nsec, delta; + uint64_t nsec, delta; if (!lastnsec) return; @@ -116,7 +116,7 @@ int readtodc(tp) u_int *tp; { - unsigned64_t t = hyp_get_time(); + uint64_t t = hyp_get_time(); u_int n = t / 1000000000; *tp = n; -- cgit v1.2.3