debuggers.hg

changeset 19978:d3db03f64e46

minios: switch to C99 integer types

This is a necessary step to make minios build on NetBSD.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Jul 15 09:09:48 2009 +0100 (2009-07-15)
parents eac682b9c7bc
children c4d78e5755a1
files extras/mini-os/arch/ia64/common.c extras/mini-os/arch/ia64/time.c extras/mini-os/arch/x86/time.c extras/mini-os/events.c extras/mini-os/gnttab.c extras/mini-os/hypervisor.c extras/mini-os/include/arch/cc.h extras/mini-os/include/fs.h extras/mini-os/include/hypervisor.h extras/mini-os/include/linux/types.h extras/mini-os/include/sched.h extras/mini-os/include/time.h extras/mini-os/include/types.h extras/mini-os/include/x86/os.h extras/mini-os/include/x86/x86_32/hypercall-x86_32.h extras/mini-os/include/x86/x86_64/hypercall-x86_64.h extras/mini-os/kernel.c extras/mini-os/lib/math.c extras/mini-os/lib/sys.c extras/mini-os/lwip-arch.c extras/mini-os/lwip-net.c extras/mini-os/sched.c stubdom/pciutils.patch tools/include/xen-sys/MiniOS/privcmd.h
line diff
     1.1 --- a/extras/mini-os/arch/ia64/common.c	Tue Jul 14 21:25:24 2009 +0100
     1.2 +++ b/extras/mini-os/arch/ia64/common.c	Wed Jul 15 09:09:48 2009 +0100
     1.3 @@ -68,7 +68,7 @@ char boot_cmd_line[COMMAND_LINE_SIZE+1];
     1.4  
     1.5  
     1.6  void
     1.7 -ia64_write_itr_i(ia64_pte_t* pteP, u32 reg, uint64_t vAddr,
     1.8 +ia64_write_itr_i(ia64_pte_t* pteP, uint32_t reg, uint64_t vAddr,
     1.9  		  uint64_t ps, uint64_t pk)
    1.10  {
    1.11  	/* The virtual address. */
     2.1 --- a/extras/mini-os/arch/ia64/time.c	Tue Jul 14 21:25:24 2009 +0100
     2.2 +++ b/extras/mini-os/arch/ia64/time.c	Wed Jul 15 09:09:48 2009 +0100
     2.3 @@ -178,7 +178,7 @@ timer_interrupt(evtchn_port_t port, stru
     2.4  /*
     2.5   * monotonic_clock(): returns # of nanoseconds passed since time_init()
     2.6   */
     2.7 -u64
     2.8 +uint64_t
     2.9  monotonic_clock(void)
    2.10  {
    2.11  	uint64_t delta;
     3.1 --- a/extras/mini-os/arch/x86/time.c	Tue Jul 14 21:25:24 2009 +0100
     3.2 +++ b/extras/mini-os/arch/x86/time.c	Wed Jul 15 09:09:48 2009 +0100
     3.3 @@ -46,15 +46,15 @@
     3.4  
     3.5  /* These are peridically updated in shared_info, and then copied here. */
     3.6  struct shadow_time_info {
     3.7 -	u64 tsc_timestamp;     /* TSC at last update of time vals.  */
     3.8 -	u64 system_timestamp;  /* Time, in nanosecs, since boot.    */
     3.9 -	u32 tsc_to_nsec_mul;
    3.10 -	u32 tsc_to_usec_mul;
    3.11 +	uint64_t tsc_timestamp;     /* TSC at last update of time vals.  */
    3.12 +	uint64_t system_timestamp;  /* Time, in nanosecs, since boot.    */
    3.13 +	uint32_t tsc_to_nsec_mul;
    3.14 +	uint32_t tsc_to_usec_mul;
    3.15  	int tsc_shift;
    3.16 -	u32 version;
    3.17 +	uint32_t version;
    3.18  };
    3.19  static struct timespec shadow_ts;
    3.20 -static u32 shadow_ts_version;
    3.21 +static uint32_t shadow_ts_version;
    3.22  
    3.23  static struct shadow_time_info shadow;
    3.24  
    3.25 @@ -84,11 +84,11 @@ static inline int time_values_up_to_date
    3.26   * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction,
    3.27   * yielding a 64-bit result.
    3.28   */
    3.29 -static inline u64 scale_delta(u64 delta, u32 mul_frac, int shift)
    3.30 +static inline uint64_t scale_delta(uint64_t delta, uint32_t mul_frac, int shift)
    3.31  {
    3.32 -	u64 product;
    3.33 +	uint64_t product;
    3.34  #ifdef __i386__
    3.35 -	u32 tmp1, tmp2;
    3.36 +	uint32_t tmp1, tmp2;
    3.37  #endif
    3.38  
    3.39  	if ( shift < 0 )
    3.40 @@ -106,11 +106,11 @@ static inline u64 scale_delta(u64 delta,
    3.41  		"xor  %5,%5    ; "
    3.42  		"adc  %5,%%edx ; "
    3.43  		: "=A" (product), "=r" (tmp1), "=r" (tmp2)
    3.44 -		: "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) );
    3.45 +		: "a" ((uint32_t)delta), "1" ((uint32_t)(delta >> 32)), "2" (mul_frac) );
    3.46  #else
    3.47  	__asm__ (
    3.48  		"mul %%rdx ; shrd $32,%%rdx,%%rax"
    3.49 -		: "=a" (product) : "0" (delta), "d" ((u64)mul_frac) );
    3.50 +		: "=a" (product) : "0" (delta), "d" ((uint64_t)mul_frac) );
    3.51  #endif
    3.52  
    3.53  	return product;
    3.54 @@ -119,7 +119,7 @@ static inline u64 scale_delta(u64 delta,
    3.55  
    3.56  static unsigned long get_nsec_offset(void)
    3.57  {
    3.58 -	u64 now, delta;
    3.59 +	uint64_t now, delta;
    3.60  	rdtscll(now);
    3.61  	delta = now - shadow.tsc_timestamp;
    3.62  	return scale_delta(delta, shadow.tsc_to_nsec_mul, shadow.tsc_shift);
    3.63 @@ -151,10 +151,10 @@ static void get_time_values_from_xen(voi
    3.64   *		Note: This function is required to return accurate
    3.65   *		time even in the absence of multiple timer ticks.
    3.66   */
    3.67 -u64 monotonic_clock(void)
    3.68 +uint64_t monotonic_clock(void)
    3.69  {
    3.70 -	u64 time;
    3.71 -	u32 local_time_version;
    3.72 +	uint64_t time;
    3.73 +	uint32_t local_time_version;
    3.74  
    3.75  	do {
    3.76  		local_time_version = shadow.version;
    3.77 @@ -185,7 +185,7 @@ static void update_wallclock(void)
    3.78  
    3.79  int gettimeofday(struct timeval *tv, void *tz)
    3.80  {
    3.81 -    u64 nsec = monotonic_clock();
    3.82 +    uint64_t nsec = monotonic_clock();
    3.83      nsec += shadow_ts.tv_nsec;
    3.84      
    3.85      
     4.1 --- a/extras/mini-os/events.c	Tue Jul 14 21:25:24 2009 +0100
     4.2 +++ b/extras/mini-os/events.c	Wed Jul 15 09:09:48 2009 +0100
     4.3 @@ -28,7 +28,7 @@
     4.4  typedef struct _ev_action_t {
     4.5  	evtchn_handler_t handler;
     4.6  	void *data;
     4.7 -    u32 count;
     4.8 +    uint32_t count;
     4.9  } ev_action_t;
    4.10  
    4.11  static ev_action_t ev_actions[NR_EVS];
     5.1 --- a/extras/mini-os/gnttab.c	Tue Jul 14 21:25:24 2009 +0100
     5.2 +++ b/extras/mini-os/gnttab.c	Wed Jul 15 09:09:48 2009 +0100
     5.3 @@ -102,7 +102,7 @@ gnttab_grant_transfer(domid_t domid, uns
     5.4  int
     5.5  gnttab_end_access(grant_ref_t ref)
     5.6  {
     5.7 -    u16 flags, nflags;
     5.8 +    uint16_t flags, nflags;
     5.9  
    5.10      BUG_ON(ref >= NR_GRANT_ENTRIES || ref < NR_RESERVED_ENTRIES);
    5.11  
    5.12 @@ -123,7 +123,7 @@ unsigned long
    5.13  gnttab_end_transfer(grant_ref_t ref)
    5.14  {
    5.15      unsigned long frame;
    5.16 -    u16 flags;
    5.17 +    uint16_t flags;
    5.18  
    5.19      BUG_ON(ref >= NR_GRANT_ENTRIES || ref < NR_RESERVED_ENTRIES);
    5.20  
     6.1 --- a/extras/mini-os/hypervisor.c	Tue Jul 14 21:25:24 2009 +0100
     6.2 +++ b/extras/mini-os/hypervisor.c	Wed Jul 15 09:09:48 2009 +0100
     6.3 @@ -87,13 +87,13 @@ void force_evtchn_callback(void)
     6.4      };
     6.5  }
     6.6  
     6.7 -inline void mask_evtchn(u32 port)
     6.8 +inline void mask_evtchn(uint32_t port)
     6.9  {
    6.10      shared_info_t *s = HYPERVISOR_shared_info;
    6.11      synch_set_bit(port, &s->evtchn_mask[0]);
    6.12  }
    6.13  
    6.14 -inline void unmask_evtchn(u32 port)
    6.15 +inline void unmask_evtchn(uint32_t port)
    6.16  {
    6.17      shared_info_t *s = HYPERVISOR_shared_info;
    6.18      vcpu_info_t *vcpu_info = &s->vcpu_info[smp_processor_id()];
    6.19 @@ -114,7 +114,7 @@ inline void unmask_evtchn(u32 port)
    6.20      }
    6.21  }
    6.22  
    6.23 -inline void clear_evtchn(u32 port)
    6.24 +inline void clear_evtchn(uint32_t port)
    6.25  {
    6.26      shared_info_t *s = HYPERVISOR_shared_info;
    6.27      synch_clear_bit(port, &s->evtchn_pending[0]);
     7.1 --- a/extras/mini-os/include/arch/cc.h	Tue Jul 14 21:25:24 2009 +0100
     7.2 +++ b/extras/mini-os/include/arch/cc.h	Wed Jul 15 09:09:48 2009 +0100
     7.3 @@ -13,17 +13,17 @@
     7.4  #include <mini-os/os.h>
     7.5  #include <mini-os/types.h>
     7.6  #include <time.h>
     7.7 -typedef  u8  u8_t;
     7.8 -typedef  s8  s8_t;
     7.9 -typedef u16 u16_t;
    7.10 -typedef s16 s16_t;
    7.11 -typedef u32 u32_t;
    7.12 -typedef s32 s32_t;
    7.13 -typedef u64 u64_t;
    7.14 -typedef s64 s64_t;
    7.15 +typedef uint8_t  u8_t;
    7.16 +typedef int8_t   s8_t;
    7.17 +typedef uint16_t u16_t;
    7.18 +typedef int16_t  s16_t;
    7.19 +typedef uint32_t u32_t;
    7.20 +typedef int32_t  s32_t;
    7.21 +typedef uint64_t u64_t;
    7.22 +typedef int64_t  s64_t;
    7.23  typedef uintptr_t mem_ptr_t;
    7.24  
    7.25 -typedef u16 u_short;
    7.26 +typedef uint16_t u_short;
    7.27  
    7.28  /*   Compiler hints for packing lwip's structures - */
    7.29  #define PACK_STRUCT_FIELD(_x)  _x
     8.1 --- a/extras/mini-os/include/fs.h	Tue Jul 14 21:25:24 2009 +0100
     8.2 +++ b/extras/mini-os/include/fs.h	Wed Jul 15 09:09:48 2009 +0100
     8.3 @@ -11,13 +11,13 @@
     8.4  struct fs_import 
     8.5  {
     8.6      domid_t dom_id;                 /* dom id of the exporting domain       */ 
     8.7 -    u16 export_id;                  /* export id (exporting dom specific)   */
     8.8 -    u16 import_id;                  /* import id (specific to this domain)  */ 
     8.9 +    uint16_t export_id;             /* export id (exporting dom specific)   */
    8.10 +    uint16_t import_id;             /* import id (specific to this domain)  */ 
    8.11      struct minios_list_head list;   /* list of all imports                  */
    8.12      unsigned int nr_entries;        /* Number of entries in rings & request
    8.13                                         array                                */
    8.14      struct fsif_front_ring ring;    /* frontend ring (contains shared ring) */
    8.15 -    u32 gnt_refs[FSIF_RING_SIZE_PAGES];  /* grant references to the shared ring  */
    8.16 +    uint32_t gnt_refs[FSIF_RING_SIZE_PAGES];  /* grant references to the shared ring  */
    8.17      evtchn_port_t local_port;       /* local event channel port             */
    8.18      char *backend;                  /* XenBus location of the backend       */
    8.19      struct fs_request *requests;    /* Table of requests                    */
     9.1 --- a/extras/mini-os/include/hypervisor.h	Tue Jul 14 21:25:24 2009 +0100
     9.2 +++ b/extras/mini-os/include/hypervisor.h	Wed Jul 15 09:09:48 2009 +0100
     9.3 @@ -40,9 +40,9 @@ extern union start_info_union start_info
     9.4  /* hypervisor.c */
     9.5  void force_evtchn_callback(void);
     9.6  void do_hypervisor_callback(struct pt_regs *regs);
     9.7 -void mask_evtchn(u32 port);
     9.8 -void unmask_evtchn(u32 port);
     9.9 -void clear_evtchn(u32 port);
    9.10 +void mask_evtchn(uint32_t port);
    9.11 +void unmask_evtchn(uint32_t port);
    9.12 +void clear_evtchn(uint32_t port);
    9.13  
    9.14  extern int in_callback;
    9.15  
    10.1 --- a/extras/mini-os/include/linux/types.h	Tue Jul 14 21:25:24 2009 +0100
    10.2 +++ b/extras/mini-os/include/linux/types.h	Wed Jul 15 09:09:48 2009 +0100
    10.3 @@ -1,5 +1,5 @@
    10.4  #ifndef _LINUX_TYPES_H_
    10.5  #define _LINUX_TYPES_H_
    10.6  #include <mini-os/types.h>
    10.7 -typedef u64 __u64;
    10.8 +typedef uint64_t __u64;
    10.9  #endif /* _LINUX_TYPES_H_ */
    11.1 --- a/extras/mini-os/include/sched.h	Tue Jul 14 21:25:24 2009 +0100
    11.2 +++ b/extras/mini-os/include/sched.h	Wed Jul 15 09:09:48 2009 +0100
    11.3 @@ -20,7 +20,7 @@ struct thread
    11.4      thread_regs_t regs;
    11.5  #endif /* !defined(__ia64__) */
    11.6      struct minios_list_head thread_list;
    11.7 -    u32 flags;
    11.8 +    uint32_t flags;
    11.9      s_time_t wakeup_time;
   11.10  #ifdef HAVE_LIBC
   11.11      struct _reent reent;
   11.12 @@ -54,6 +54,6 @@ void schedule(void);
   11.13  
   11.14  void wake(struct thread *thread);
   11.15  void block(struct thread *thread);
   11.16 -void msleep(u32 millisecs);
   11.17 +void msleep(uint32_t millisecs);
   11.18  
   11.19  #endif /* __SCHED_H__ */
    12.1 --- a/extras/mini-os/include/time.h	Tue Jul 14 21:25:24 2009 +0100
    12.2 +++ b/extras/mini-os/include/time.h	Wed Jul 15 09:09:48 2009 +0100
    12.3 @@ -29,7 +29,7 @@
    12.4   * The other macros are for convenience to approximate short intervals
    12.5   * of real time into system time 
    12.6   */
    12.7 -typedef s64 s_time_t;
    12.8 +typedef int64_t s_time_t;
    12.9  #define NOW()                   ((s_time_t)monotonic_clock())
   12.10  #define SECONDS(_s)             (((s_time_t)(_s))  * 1000000000UL )
   12.11  #define TENTHS(_ts)             (((s_time_t)(_ts)) * 100000000UL )
   12.12 @@ -57,7 +57,7 @@ void     init_time(void);
   12.13  void     fini_time(void);
   12.14  s_time_t get_s_time(void);
   12.15  s_time_t get_v_time(void);
   12.16 -u64      monotonic_clock(void);
   12.17 +uint64_t monotonic_clock(void);
   12.18  void     block_domain(s_time_t until);
   12.19  
   12.20  #endif /* _MINIOS_TIME_H_ */
    13.1 --- a/extras/mini-os/include/types.h	Tue Jul 14 21:25:24 2009 +0100
    13.2 +++ b/extras/mini-os/include/types.h	Wed Jul 15 09:09:48 2009 +0100
    13.3 @@ -21,20 +21,6 @@
    13.4  #define _TYPES_H_
    13.5  #include <stddef.h>
    13.6  
    13.7 -typedef signed char         s8;
    13.8 -typedef unsigned char       u8;
    13.9 -typedef signed short        s16;
   13.10 -typedef unsigned short      u16;
   13.11 -typedef signed int          s32;
   13.12 -typedef unsigned int        u32;
   13.13 -#ifdef __i386__
   13.14 -typedef signed long long    s64;
   13.15 -typedef unsigned long long  u64;
   13.16 -#elif defined(__x86_64__) || defined(__ia64__)
   13.17 -typedef signed long         s64;
   13.18 -typedef unsigned long       u64;
   13.19 -#endif
   13.20 -
   13.21  /* FreeBSD compat types */
   13.22  #ifndef HAVE_LIBC
   13.23  typedef unsigned char       u_char;
   13.24 @@ -72,15 +58,22 @@ typedef int                 intptr_t;
   13.25  typedef unsigned long       uintptr_t;
   13.26  typedef long                intptr_t;
   13.27  #endif /* __i386__ || __x86_64__ */
   13.28 -typedef  u8 uint8_t;
   13.29 -typedef  s8 int8_t;
   13.30 -typedef u16 uint16_t;
   13.31 -typedef s16 int16_t;
   13.32 -typedef u32 uint32_t;
   13.33 -typedef s32 int32_t;
   13.34 -typedef u64 uint64_t, uintmax_t;
   13.35 -typedef s64 int64_t, intmax_t;
   13.36 -typedef u64 off_t;
   13.37 +typedef unsigned char uint8_t;
   13.38 +typedef   signed char int8_t;
   13.39 +typedef unsigned short uint16_t;
   13.40 +typedef   signed short int16_t;
   13.41 +typedef unsigned int uint32_t;
   13.42 +typedef   signed int int32_t;
   13.43 +#ifdef __i386__
   13.44 +typedef   signed long long int64_t;
   13.45 +typedef unsigned long long uint64_t;
   13.46 +#elif defined(__x86_64__) || defined(__ia64__)
   13.47 +typedef   signed long int64_t;
   13.48 +typedef unsigned long uint64_t;
   13.49 +#endif
   13.50 +typedef uint64_t uintmax_t;
   13.51 +typedef  int64_t intmax_t;
   13.52 +typedef uint64_t off_t;
   13.53  #endif
   13.54  
   13.55  typedef intptr_t            ptrdiff_t;
    14.1 --- a/extras/mini-os/include/x86/os.h	Tue Jul 14 21:25:24 2009 +0100
    14.2 +++ b/extras/mini-os/include/x86/os.h	Wed Jul 15 09:09:48 2009 +0100
    14.3 @@ -445,7 +445,7 @@ static __inline__ unsigned long __ffs(un
    14.4                             : /* no outputs */ \
    14.5                             : "c" (msr), "a" (val1), "d" (val2))
    14.6  
    14.7 -#define wrmsrl(msr,val) wrmsr(msr,(u32)((u64)(val)),((u64)(val))>>32)
    14.8 +#define wrmsrl(msr,val) wrmsr(msr,(uint32_t)((uint64_t)(val)),((uint64_t)(val))>>32)
    14.9  
   14.10  
   14.11  #else /* ifdef __x86_64__ */
    15.1 --- a/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Tue Jul 14 21:25:24 2009 +0100
    15.2 +++ b/extras/mini-os/include/x86/x86_32/hypercall-x86_32.h	Wed Jul 15 09:09:48 2009 +0100
    15.3 @@ -174,7 +174,7 @@ HYPERVISOR_sched_op(
    15.4  
    15.5  static inline long
    15.6  HYPERVISOR_set_timer_op(
    15.7 -	u64 timeout)
    15.8 +	uint64_t timeout)
    15.9  {
   15.10  	unsigned long timeout_hi = (unsigned long)(timeout>>32);
   15.11  	unsigned long timeout_lo = (unsigned long)timeout;
   15.12 @@ -197,7 +197,7 @@ HYPERVISOR_get_debugreg(
   15.13  
   15.14  static inline int
   15.15  HYPERVISOR_update_descriptor(
   15.16 -	u64 ma, u64 desc)
   15.17 +	uint64_t ma, uint64_t desc)
   15.18  {
   15.19  	return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
   15.20  }
    16.1 --- a/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Tue Jul 14 21:25:24 2009 +0100
    16.2 +++ b/extras/mini-os/include/x86/x86_64/hypercall-x86_64.h	Wed Jul 15 09:09:48 2009 +0100
    16.3 @@ -178,7 +178,7 @@ HYPERVISOR_sched_op(
    16.4  
    16.5  static inline long
    16.6  HYPERVISOR_set_timer_op(
    16.7 -	u64 timeout)
    16.8 +	uint64_t timeout)
    16.9  {
   16.10  	return _hypercall1(long, set_timer_op, timeout);
   16.11  }
    17.1 --- a/extras/mini-os/kernel.c	Tue Jul 14 21:25:24 2009 +0100
    17.2 +++ b/extras/mini-os/kernel.c	Wed Jul 15 09:09:48 2009 +0100
    17.3 @@ -49,7 +49,7 @@
    17.4  
    17.5  static struct netfront_dev *net_dev;
    17.6  
    17.7 -u8 xen_features[XENFEAT_NR_SUBMAPS * 32];
    17.8 +uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];
    17.9  
   17.10  void setup_xen_features(void)
   17.11  {
    18.1 --- a/extras/mini-os/lib/math.c	Tue Jul 14 21:25:24 2009 +0100
    18.2 +++ b/extras/mini-os/lib/math.c	Wed Jul 15 09:09:48 2009 +0100
    18.3 @@ -68,8 +68,8 @@
    18.4   * one or more of the following formats.
    18.5   */
    18.6  union uu {
    18.7 -        s64            q;              /* as a (signed) quad */
    18.8 -        s64            uq;             /* as an unsigned quad */
    18.9 +        int64_t           q;              /* as a (signed) quad */
   18.10 +        int64_t          uq;             /* as an unsigned quad */
   18.11          long           sl[2];          /* as two signed longs */
   18.12          unsigned long  ul[2];          /* as two unsigned longs */
   18.13  };
   18.14 @@ -90,7 +90,7 @@ union uu {
   18.15  #ifndef HAVE_LIBC
   18.16  #define CHAR_BIT        8               /* number of bits in a char */
   18.17  #endif
   18.18 -#define QUAD_BITS       (sizeof(s64) * CHAR_BIT)
   18.19 +#define QUAD_BITS       (sizeof(int64_t) * CHAR_BIT)
   18.20  #define LONG_BITS       (sizeof(long) * CHAR_BIT)
   18.21  #define HALF_BITS       (sizeof(long) * CHAR_BIT / 2)
   18.22  
   18.23 @@ -147,8 +147,8 @@ shl(register digit *p, register int len,
   18.24   * divisor are 4 `digits' in this base (they are shorter if they have
   18.25   * leading zeros).
   18.26   */
   18.27 -u64
   18.28 -__qdivrem(u64 uq, u64 vq, u64 *arq)
   18.29 +uint64_t
   18.30 +__qdivrem(uint64_t uq, uint64_t vq, uint64_t *arq)
   18.31  {
   18.32  	union uu tmp;
   18.33  	digit *u, *v, *q;
   18.34 @@ -348,31 +348,31 @@ u64
   18.35   * Divide two signed quads.
   18.36   * ??? if -1/2 should produce -1 on this machine, this code is wrong
   18.37   */
   18.38 -s64
   18.39 -__divdi3(s64 a, s64 b)
   18.40 +int64_t
   18.41 +__divdi3(int64_t a, int64_t b)
   18.42  {
   18.43 -	u64 ua, ub, uq;
   18.44 +	uint64_t ua, ub, uq;
   18.45  	int neg;
   18.46  
   18.47  	if (a < 0)
   18.48 -		ua = -(u64)a, neg = 1;
   18.49 +		ua = -(uint64_t)a, neg = 1;
   18.50  	else
   18.51  		ua = a, neg = 0;
   18.52  	if (b < 0)
   18.53 -		ub = -(u64)b, neg ^= 1;
   18.54 +		ub = -(uint64_t)b, neg ^= 1;
   18.55  	else
   18.56  		ub = b;
   18.57 -	uq = __qdivrem(ua, ub, (u64 *)0);
   18.58 +	uq = __qdivrem(ua, ub, (uint64_t *)0);
   18.59  	return (neg ? -uq : uq);
   18.60  }
   18.61  
   18.62  /*
   18.63   * Divide two unsigned quads.
   18.64   */
   18.65 -u64
   18.66 -__udivdi3(u64 a, u64 b)
   18.67 +uint64_t
   18.68 +__udivdi3(uint64_t a, uint64_t b)
   18.69  {
   18.70 -        return (__qdivrem(a, b, (u64 *)0));
   18.71 +        return (__qdivrem(a, b, (uint64_t *)0));
   18.72  }
   18.73  
   18.74  
    19.1 --- a/extras/mini-os/lib/sys.c	Tue Jul 14 21:25:24 2009 +0100
    19.2 +++ b/extras/mini-os/lib/sys.c	Wed Jul 15 09:09:48 2009 +0100
    19.3 @@ -1189,7 +1189,7 @@ int clock_gettime(clockid_t clk_id, stru
    19.4  	}
    19.5  	case CLOCK_REALTIME:
    19.6  	{
    19.7 -	    u64 nsec = monotonic_clock();
    19.8 +	    uint64_t nsec = monotonic_clock();
    19.9  
   19.10  	    tp->tv_sec = nsec / 1000000000ULL;
   19.11  	    tp->tv_nsec = nsec % 1000000000ULL;
    20.1 --- a/extras/mini-os/lwip-arch.c	Tue Jul 14 21:25:24 2009 +0100
    20.2 +++ b/extras/mini-os/lwip-arch.c	Wed Jul 15 09:09:48 2009 +0100
    20.3 @@ -20,7 +20,7 @@ void sys_init(void)
    20.4  
    20.5  /* Creates and returns a new semaphore. The "count" argument specifies
    20.6   * the initial state of the semaphore. */
    20.7 -sys_sem_t sys_sem_new(u8_t count)
    20.8 +sys_sem_t sys_sem_new(uint8_t count)
    20.9  {
   20.10      struct semaphore *sem = xmalloc(struct semaphore);
   20.11      sem->count = count;
   20.12 @@ -50,13 +50,13 @@ void sys_sem_signal(sys_sem_t sem)
   20.13   * semaphore wasn't signaled within the specified time, the return value is
   20.14   * SYS_ARCH_TIMEOUT. If the thread didn't have to wait for the semaphore
   20.15   * (i.e., it was already signaled), the function may return zero. */
   20.16 -u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout)
   20.17 +uint32_t sys_arch_sem_wait(sys_sem_t sem, uint32_t timeout)
   20.18  {
   20.19      /* Slightly more complicated than the normal minios semaphore:
   20.20       * need to wake on timeout *or* signal */
   20.21      sys_prot_t prot;
   20.22 -    s64_t then = NOW();
   20.23 -    s64_t deadline;
   20.24 +    int64_t then = NOW();
   20.25 +    int64_t deadline;
   20.26  
   20.27      if (timeout == 0)
   20.28  	deadline = 0;
   20.29 @@ -174,9 +174,9 @@ static void do_mbox_fetch(sys_mbox_t mbo
   20.30   * The return values are the same as for the sys_arch_sem_wait() function:
   20.31   * Number of milliseconds spent waiting or SYS_ARCH_TIMEOUT if there was a
   20.32   * timeout. */
   20.33 -u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout)
   20.34 +uint32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, uint32_t timeout)
   20.35  {
   20.36 -    u32 rv;
   20.37 +    uint32_t rv;
   20.38      if (mbox == SYS_MBOX_NULL)
   20.39          return SYS_ARCH_TIMEOUT;
   20.40  
   20.41 @@ -199,7 +199,7 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t mbo
   20.42   *     sys_arch_mbox_fetch(mbox,msg,1)
   20.43   * although this would introduce unnecessary delays. */
   20.44  
   20.45 -u32_t sys_arch_mbox_tryfetch(sys_mbox_t mbox, void **msg) {
   20.46 +uint32_t sys_arch_mbox_tryfetch(sys_mbox_t mbox, void **msg) {
   20.47      if (mbox == SYS_MBOX_NULL)
   20.48          return SYS_ARCH_TIMEOUT;
   20.49  
    21.1 --- a/extras/mini-os/lwip-net.c	Tue Jul 14 21:25:24 2009 +0100
    21.2 +++ b/extras/mini-os/lwip-net.c	Wed Jul 15 09:09:48 2009 +0100
    21.3 @@ -207,7 +207,7 @@ netfront_input(struct netif *netif, unsi
    21.4      etharp_ip_input(netif, p);
    21.5  #endif
    21.6      /* skip Ethernet header */
    21.7 -    pbuf_header(p, -(s16)sizeof(struct eth_hdr));
    21.8 +    pbuf_header(p, -(int16_t)sizeof(struct eth_hdr));
    21.9      /* pass to network layer */
   21.10      if (tcpip_input(p, netif) == ERR_MEM)
   21.11        /* Could not store it, drop */
    22.1 --- a/extras/mini-os/sched.c	Tue Jul 14 21:25:24 2009 +0100
    22.2 +++ b/extras/mini-os/sched.c	Wed Jul 15 09:09:48 2009 +0100
    22.3 @@ -227,7 +227,7 @@ void block(struct thread *thread)
    22.4      clear_runnable(thread);
    22.5  }
    22.6  
    22.7 -void msleep(u32 millisecs)
    22.8 +void msleep(uint32_t millisecs)
    22.9  {
   22.10      struct thread *thread = get_current();
   22.11      thread->wakeup_time = NOW()  + MILLISECS(millisecs);
    23.1 --- a/stubdom/pciutils.patch	Tue Jul 14 21:25:24 2009 +0100
    23.2 +++ b/stubdom/pciutils.patch	Wed Jul 15 09:09:48 2009 +0100
    23.3 @@ -54,22 +54,22 @@ diff -urN pciutils-2.2.9.orig/lib/access
    23.4   all: $(PCILIB) $(PCILIBPC)
    23.5   
    23.6   $(PCILIB): $(OBJS)
    23.7 ---- pciutils-2.2.9.orig/lib/types.h	2007-09-03 09:44:15.000000000 +0100
    23.8 -+++ pciutils-2.2.9/lib/types.h	2008-07-01 12:17:08.396156000 +0100
    23.9 -@@ -17,9 +17,13 @@
   23.10 - typedef DWORD u32;
   23.11 - #elif defined(PCI_HAVE_STDINT_H)
   23.12 - #include <stdint.h>
   23.13 -+#ifdef PCI_OS_MINIOS
   23.14 -+#include <types.h>
   23.15 -+#else
   23.16 +--- pciutils-2.2.9.orig/lib/types.h    2009-07-14 18:18:59.000000000 +0200
   23.17 ++++ pciutils-2.2.9/lib/types.h 2009-07-14 18:19:16.000000000 +0200
   23.18 +@@ -20,10 +20,12 @@ typedef DWORD u32;
   23.19   typedef uint8_t u8;
   23.20   typedef uint16_t u16;
   23.21   typedef uint32_t u32;
   23.22 -+#endif
   23.23 ++typedef uint64_t u64;
   23.24   #else
   23.25   typedef u_int8_t u8;
   23.26   typedef u_int16_t u16;
   23.27 + typedef u_int32_t u32;
   23.28 ++typedef u_int64_t u64;
   23.29 + #endif
   23.30 +
   23.31 + #ifdef PCI_HAVE_64BIT_ADDRESS
   23.32 + 
   23.33  --- pciutils-2.2.9.orig/lib/minios.c	1970-01-01 01:00:00.000000000 +0100
   23.34  +++ pciutils-2.2.9/lib/minios.c	2008-07-01 12:31:40.554260000 +0100
   23.35  @@ -0,0 +1,113 @@
    24.1 --- a/tools/include/xen-sys/MiniOS/privcmd.h	Tue Jul 14 21:25:24 2009 +0100
    24.2 +++ b/tools/include/xen-sys/MiniOS/privcmd.h	Wed Jul 15 09:09:48 2009 +0100
    24.3 @@ -5,12 +5,12 @@
    24.4  
    24.5  typedef struct privcmd_hypercall
    24.6  {
    24.7 -	u64 op;
    24.8 -	u64 arg[5];
    24.9 +	uint64_t op;
   24.10 +	uint64_t arg[5];
   24.11  } privcmd_hypercall_t;
   24.12  
   24.13  typedef struct privcmd_mmap_entry {
   24.14 -	u64 mfn;
   24.15 +	uint64_t mfn;
   24.16  } privcmd_mmap_entry_t; 
   24.17  
   24.18  #endif /* __MINIOS_PUBLIC_PRIVCMD_H__ */