From 0df54d980737b7c4bb07aa4ac29e1e7689a6019b Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 15 Jul 2009 09:09:48 +0100 Subject: minios: switch to C99 integer types This is a necessary step to make minios build on NetBSD. Signed-off-by: Christoph Egger --- extras/mini-os/include/arch/cc.h | 18 +++++----- extras/mini-os/include/fs.h | 6 ++-- extras/mini-os/include/hypervisor.h | 6 ++-- extras/mini-os/include/linux/types.h | 2 +- extras/mini-os/include/sched.h | 4 +-- extras/mini-os/include/time.h | 4 +-- extras/mini-os/include/types.h | 39 +++++++++------------- extras/mini-os/include/x86/os.h | 2 +- .../mini-os/include/x86/x86_32/hypercall-x86_32.h | 4 +-- .../mini-os/include/x86/x86_64/hypercall-x86_64.h | 2 +- 10 files changed, 40 insertions(+), 47 deletions(-) (limited to 'extras/mini-os/include') diff --git a/extras/mini-os/include/arch/cc.h b/extras/mini-os/include/arch/cc.h index 02aeb2f4bd..85cfbdba8f 100644 --- a/extras/mini-os/include/arch/cc.h +++ b/extras/mini-os/include/arch/cc.h @@ -13,17 +13,17 @@ #include #include #include -typedef u8 u8_t; -typedef s8 s8_t; -typedef u16 u16_t; -typedef s16 s16_t; -typedef u32 u32_t; -typedef s32 s32_t; -typedef u64 u64_t; -typedef s64 s64_t; +typedef uint8_t u8_t; +typedef int8_t s8_t; +typedef uint16_t u16_t; +typedef int16_t s16_t; +typedef uint32_t u32_t; +typedef int32_t s32_t; +typedef uint64_t u64_t; +typedef int64_t s64_t; typedef uintptr_t mem_ptr_t; -typedef u16 u_short; +typedef uint16_t u_short; /* Compiler hints for packing lwip's structures - */ #define PACK_STRUCT_FIELD(_x) _x diff --git a/extras/mini-os/include/fs.h b/extras/mini-os/include/fs.h index aa19135822..2f91f8d264 100644 --- a/extras/mini-os/include/fs.h +++ b/extras/mini-os/include/fs.h @@ -11,13 +11,13 @@ struct fs_import { domid_t dom_id; /* dom id of the exporting domain */ - u16 export_id; /* export id (exporting dom specific) */ - u16 import_id; /* import id (specific to this domain) */ + uint16_t export_id; /* export id (exporting dom specific) */ + uint16_t import_id; /* import id (specific to this domain) */ struct minios_list_head list; /* list of all imports */ unsigned int nr_entries; /* Number of entries in rings & request array */ struct fsif_front_ring ring; /* frontend ring (contains shared ring) */ - u32 gnt_refs[FSIF_RING_SIZE_PAGES]; /* grant references to the shared ring */ + uint32_t gnt_refs[FSIF_RING_SIZE_PAGES]; /* grant references to the shared ring */ evtchn_port_t local_port; /* local event channel port */ char *backend; /* XenBus location of the backend */ struct fs_request *requests; /* Table of requests */ diff --git a/extras/mini-os/include/hypervisor.h b/extras/mini-os/include/hypervisor.h index b4c7292a47..e299df1f73 100644 --- a/extras/mini-os/include/hypervisor.h +++ b/extras/mini-os/include/hypervisor.h @@ -40,9 +40,9 @@ extern union start_info_union start_info_union; /* hypervisor.c */ void force_evtchn_callback(void); void do_hypervisor_callback(struct pt_regs *regs); -void mask_evtchn(u32 port); -void unmask_evtchn(u32 port); -void clear_evtchn(u32 port); +void mask_evtchn(uint32_t port); +void unmask_evtchn(uint32_t port); +void clear_evtchn(uint32_t port); extern int in_callback; diff --git a/extras/mini-os/include/linux/types.h b/extras/mini-os/include/linux/types.h index 978f29e2cb..ac596a7e2f 100644 --- a/extras/mini-os/include/linux/types.h +++ b/extras/mini-os/include/linux/types.h @@ -1,5 +1,5 @@ #ifndef _LINUX_TYPES_H_ #define _LINUX_TYPES_H_ #include -typedef u64 __u64; +typedef uint64_t __u64; #endif /* _LINUX_TYPES_H_ */ diff --git a/extras/mini-os/include/sched.h b/extras/mini-os/include/sched.h index c60e61e94a..538bed5b8d 100644 --- a/extras/mini-os/include/sched.h +++ b/extras/mini-os/include/sched.h @@ -20,7 +20,7 @@ struct thread thread_regs_t regs; #endif /* !defined(__ia64__) */ struct minios_list_head thread_list; - u32 flags; + uint32_t flags; s_time_t wakeup_time; #ifdef HAVE_LIBC struct _reent reent; @@ -54,6 +54,6 @@ void schedule(void); void wake(struct thread *thread); void block(struct thread *thread); -void msleep(u32 millisecs); +void msleep(uint32_t millisecs); #endif /* __SCHED_H__ */ diff --git a/extras/mini-os/include/time.h b/extras/mini-os/include/time.h index ac83df855b..5d6ed672d1 100644 --- a/extras/mini-os/include/time.h +++ b/extras/mini-os/include/time.h @@ -29,7 +29,7 @@ * The other macros are for convenience to approximate short intervals * of real time into system time */ -typedef s64 s_time_t; +typedef int64_t s_time_t; #define NOW() ((s_time_t)monotonic_clock()) #define SECONDS(_s) (((s_time_t)(_s)) * 1000000000UL ) #define TENTHS(_ts) (((s_time_t)(_ts)) * 100000000UL ) @@ -57,7 +57,7 @@ void init_time(void); void fini_time(void); s_time_t get_s_time(void); s_time_t get_v_time(void); -u64 monotonic_clock(void); +uint64_t monotonic_clock(void); void block_domain(s_time_t until); #endif /* _MINIOS_TIME_H_ */ diff --git a/extras/mini-os/include/types.h b/extras/mini-os/include/types.h index 19b730280d..456e21ac06 100644 --- a/extras/mini-os/include/types.h +++ b/extras/mini-os/include/types.h @@ -21,20 +21,6 @@ #define _TYPES_H_ #include -typedef signed char s8; -typedef unsigned char u8; -typedef signed short s16; -typedef unsigned short u16; -typedef signed int s32; -typedef unsigned int u32; -#ifdef __i386__ -typedef signed long long s64; -typedef unsigned long long u64; -#elif defined(__x86_64__) || defined(__ia64__) -typedef signed long s64; -typedef unsigned long u64; -#endif - /* FreeBSD compat types */ #ifndef HAVE_LIBC typedef unsigned char u_char; @@ -72,15 +58,22 @@ typedef int intptr_t; typedef unsigned long uintptr_t; typedef long intptr_t; #endif /* __i386__ || __x86_64__ */ -typedef u8 uint8_t; -typedef s8 int8_t; -typedef u16 uint16_t; -typedef s16 int16_t; -typedef u32 uint32_t; -typedef s32 int32_t; -typedef u64 uint64_t, uintmax_t; -typedef s64 int64_t, intmax_t; -typedef u64 off_t; +typedef unsigned char uint8_t; +typedef signed char int8_t; +typedef unsigned short uint16_t; +typedef signed short int16_t; +typedef unsigned int uint32_t; +typedef signed int int32_t; +#ifdef __i386__ +typedef signed long long int64_t; +typedef unsigned long long uint64_t; +#elif defined(__x86_64__) || defined(__ia64__) +typedef signed long int64_t; +typedef unsigned long uint64_t; +#endif +typedef uint64_t uintmax_t; +typedef int64_t intmax_t; +typedef uint64_t off_t; #endif typedef intptr_t ptrdiff_t; diff --git a/extras/mini-os/include/x86/os.h b/extras/mini-os/include/x86/os.h index 7fc3a83b53..6bd0ebee99 100644 --- a/extras/mini-os/include/x86/os.h +++ b/extras/mini-os/include/x86/os.h @@ -445,7 +445,7 @@ static __inline__ unsigned long __ffs(unsigned long word) : /* no outputs */ \ : "c" (msr), "a" (val1), "d" (val2)) -#define wrmsrl(msr,val) wrmsr(msr,(u32)((u64)(val)),((u64)(val))>>32) +#define wrmsrl(msr,val) wrmsr(msr,(uint32_t)((uint64_t)(val)),((uint64_t)(val))>>32) #else /* ifdef __x86_64__ */ diff --git a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h index d5f5b1e713..43028eea0a 100644 --- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h +++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h @@ -174,7 +174,7 @@ HYPERVISOR_sched_op( static inline long HYPERVISOR_set_timer_op( - u64 timeout) + uint64_t timeout) { unsigned long timeout_hi = (unsigned long)(timeout>>32); unsigned long timeout_lo = (unsigned long)timeout; @@ -197,7 +197,7 @@ HYPERVISOR_get_debugreg( static inline int HYPERVISOR_update_descriptor( - u64 ma, u64 desc) + uint64_t ma, uint64_t desc) { return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32); } diff --git a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h index 32ea5bd611..b874f039fe 100644 --- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h +++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h @@ -178,7 +178,7 @@ HYPERVISOR_sched_op( static inline long HYPERVISOR_set_timer_op( - u64 timeout) + uint64_t timeout) { return _hypercall1(long, set_timer_op, timeout); } -- cgit v1.2.3