ia64/xen-unstable

changeset 4809:66dfa86ee331

bitkeeper revision 1.1389.5.40 (428084e6OcTkByL6plgj4UPN6alYkA)

Fix the 64-bit build.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue May 10 09:54:46 2005 +0000 (2005-05-10)
parents f470118a979e
children a700865a85dc
files .rootkeys xen/arch/x86/acpi/boot.c xen/arch/x86/mm.c xen/arch/x86/mpparse.c xen/arch/x86/shadow.c xen/common/sched_sedf.c xen/include/asm-x86/bitops.h xen/include/asm-x86/x86_32/domain_page.h xen/include/asm-x86/x86_64/domain_page.h xen/include/xen/inttypes.h xen/include/xen/lib.h
line diff
     1.1 --- a/.rootkeys	Mon May 09 17:50:17 2005 +0000
     1.2 +++ b/.rootkeys	Tue May 10 09:54:46 2005 +0000
     1.3 @@ -1450,6 +1450,7 @@ 3ddb79c0HIghfBF8zFUdmXhOU8i6hA xen/inclu
     1.4  3ddb79c1W0lQca8gRV7sN6j3iY4Luw xen/include/xen/event.h
     1.5  41262590CyJy4vd42dnqzsn8-eeGvw xen/include/xen/grant_table.h
     1.6  3ddb79c0GurNF9tDWqQbAwJFH8ugfA xen/include/xen/init.h
     1.7 +428084e41zemtCAtYLcD9bUzwE35SA xen/include/xen/inttypes.h
     1.8  3ddb79c1nzaWu8NoF4xCCMSFJR4MlA xen/include/xen/ioport.h
     1.9  3ddb79c2qAxCOABlkKtD8Txohe-qEw xen/include/xen/irq.h
    1.10  3ddb79c2b3qe-6Ann09FqZBF4IrJaQ xen/include/xen/irq_cpustat.h
     2.1 --- a/xen/arch/x86/acpi/boot.c	Mon May 09 17:50:17 2005 +0000
     2.2 +++ b/xen/arch/x86/acpi/boot.c	Tue May 10 09:54:46 2005 +0000
     2.3 @@ -44,7 +44,6 @@ int sbf_port; /* XXX XEN */
     2.4  static inline void  acpi_madt_oem_check(char *oem_id, char *oem_table_id) { }
     2.5  extern void __init clustered_apic_check(void);
     2.6  static inline int ioapic_setup_disabled(void) { return 0; }
     2.7 -#include <asm/proto.h>
     2.8  
     2.9  #else	/* X86 */
    2.10  
    2.11 @@ -110,7 +109,7 @@ char *__acpi_map_table(unsigned long phy
    2.12  	if (!phys_addr || !size)
    2.13  	return NULL;
    2.14  
    2.15 -	if (phys_addr < (end_pfn_map << PAGE_SHIFT))
    2.16 +	if (phys_addr < (max_page << PAGE_SHIFT))
    2.17  		return __va(phys_addr);
    2.18  
    2.19  	return NULL;
    2.20 @@ -155,7 +154,7 @@ char *__acpi_map_table(unsigned long phy
    2.21  		mapped_size += PAGE_SIZE;
    2.22  	}
    2.23  
    2.24 -	return ((unsigned char *) base + offset);
    2.25 +	return ((char *) base + offset);
    2.26  }
    2.27  #endif
    2.28  
     3.1 --- a/xen/arch/x86/mm.c	Mon May 09 17:50:17 2005 +0000
     3.2 +++ b/xen/arch/x86/mm.c	Tue May 10 09:54:46 2005 +0000
     3.3 @@ -1813,8 +1813,7 @@ int do_mmu_update(
     3.4      struct exec_domain *ed = current;
     3.5      struct domain *d = ed->domain;
     3.6      u32 type_info;
     3.7 -    struct map_dom_mem_cache mapcache = MAP_DOM_MEM_CACHE_INIT;
     3.8 -    struct map_dom_mem_cache sh_mapcache = MAP_DOM_MEM_CACHE_INIT;
     3.9 +    struct map_dom_mem_cache mapcache, sh_mapcache;
    3.10  
    3.11      LOCK_BIGLOCK(d);
    3.12  
    3.13 @@ -1830,6 +1829,9 @@ int do_mmu_update(
    3.14              (void)get_user(done, pdone);
    3.15      }
    3.16  
    3.17 +    init_map_domain_mem_cache(&mapcache);
    3.18 +    init_map_domain_mem_cache(&sh_mapcache);
    3.19 +
    3.20      if ( !set_foreigndom(cpu, foreigndom) )
    3.21      {
    3.22          rc = -EINVAL;
    3.23 @@ -2037,8 +2039,8 @@ int do_mmu_update(
    3.24      }
    3.25  
    3.26   out:
    3.27 -    unmap_domain_mem_cache(&mapcache);
    3.28 -    unmap_domain_mem_cache(&sh_mapcache);
    3.29 +    destroy_map_domain_mem_cache(&mapcache);
    3.30 +    destroy_map_domain_mem_cache(&sh_mapcache);
    3.31  
    3.32      process_deferred_ops(cpu);
    3.33  
     4.1 --- a/xen/arch/x86/mpparse.c	Mon May 09 17:50:17 2005 +0000
     4.2 +++ b/xen/arch/x86/mpparse.c	Tue May 10 09:54:46 2005 +0000
     4.3 @@ -690,7 +690,7 @@ void __init get_smp_config (void)
     4.4  		 * Read the physical hardware table.  Anything here will
     4.5  		 * override the defaults.
     4.6  		 */
     4.7 -		if (!smp_read_mpc((void *)mpf->mpf_physptr)) {
     4.8 +		if (!smp_read_mpc((void *)(unsigned long)mpf->mpf_physptr)) {
     4.9  			smp_found_config = 0;
    4.10  			printk(KERN_ERR "BIOS bug, MP table errors detected!...\n");
    4.11  			printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n");
     5.1 --- a/xen/arch/x86/shadow.c	Mon May 09 17:50:17 2005 +0000
     5.2 +++ b/xen/arch/x86/shadow.c	Tue May 10 09:54:46 2005 +0000
     5.3 @@ -808,12 +808,15 @@ alloc_p2m_table(struct domain *d)
     5.4      struct pfn_info *page, *l2page;
     5.5      l2_pgentry_t *l2;
     5.6      unsigned long mfn, pfn;
     5.7 -    struct map_dom_mem_cache l2cache = MAP_DOM_MEM_CACHE_INIT;
     5.8 -    struct map_dom_mem_cache l1cache = MAP_DOM_MEM_CACHE_INIT;
     5.9 +    struct map_dom_mem_cache l1cache, l2cache;
    5.10  
    5.11      l2page = alloc_domheap_page(NULL);
    5.12 -    if ( !l2page )
    5.13 +    if ( l2page == NULL )
    5.14          return 0;
    5.15 +
    5.16 +    init_map_domain_mem_cache(&l1cache);
    5.17 +    init_map_domain_mem_cache(&l2cache);
    5.18 +
    5.19      d->arch.phys_table = mk_pagetable(page_to_phys(l2page));
    5.20      l2 = map_domain_mem_with_cache(page_to_phys(l2page), &l2cache);
    5.21      memset(l2, 0, PAGE_SIZE);
    5.22 @@ -848,8 +851,8 @@ alloc_p2m_table(struct domain *d)
    5.23          list_ent = page->list.next;
    5.24      }
    5.25  
    5.26 -    unmap_domain_mem_cache(&l2cache);
    5.27 -    unmap_domain_mem_cache(&l1cache);
    5.28 +    destroy_map_domain_mem_cache(&l2cache);
    5.29 +    destroy_map_domain_mem_cache(&l1cache);
    5.30  
    5.31      return 1;
    5.32  }
     6.1 --- a/xen/common/sched_sedf.c	Mon May 09 17:50:17 2005 +0000
     6.2 +++ b/xen/common/sched_sedf.c	Tue May 10 09:54:46 2005 +0000
     6.3 @@ -1,4 +1,4 @@
     6.4 -/*******************************************************************************
     6.5 +/******************************************************************************
     6.6   * Simple EDF scheduler for xen
     6.7   *
     6.8   * by Stephan Diestelhorst (C)  2004 Cambridge University
     6.9 @@ -180,9 +180,10 @@ static inline void extraq_add_sort_updat
    6.10  	struct sedf_edom_info *curinf;
    6.11  	
    6.12  	ASSERT(!extraq_on(d,i));
    6.13 -	PRINT(3, "Adding domain %i.%i (score= %i, short_pen= %lli) to L%i "\
    6.14 -	         "extraq\n", d->domain->id, d->id, EDOM_INFO(d)->score[i],
    6.15 -	         EDOM_INFO(d)->short_block_lost_tot, i);	
    6.16 +	PRINT(3, "Adding domain %i.%i (score= %i, short_pen= %"PRIi64")"
    6.17 +              " to L%i extraq\n",
    6.18 +              d->domain->id, d->id, EDOM_INFO(d)->score[i],
    6.19 +              EDOM_INFO(d)->short_block_lost_tot, i);	
    6.20  	/*iterate through all elements to find our "hole" and on our way
    6.21  	  update all the other scores*/
    6.22  	list_for_each(cur,EXTRAQ(d->processor,i)){
    6.23 @@ -266,8 +267,8 @@ static inline void __del_from_queue(stru
    6.24  {
    6.25      struct list_head *list = LIST(d);
    6.26      ASSERT(__task_on_queue(d));
    6.27 -    PRINT(3,"Removing domain %i.%i (bop= %llu) from runq/waitq\n", d->domain->id,
    6.28 -          d->id, PERIOD_BEGIN(EDOM_INFO(d)));
    6.29 +    PRINT(3,"Removing domain %i.%i (bop= %"PRIu64") from runq/waitq\n",
    6.30 +          d->domain->id, d->id, PERIOD_BEGIN(EDOM_INFO(d)));
    6.31      list_del(list);
    6.32      list->next = NULL;
    6.33      ASSERT(!__task_on_queue(d));
    6.34 @@ -307,8 +308,8 @@ int name##_comp(struct list_head* el1, s
    6.35  DOMAIN_COMPARER(waitq, list, PERIOD_BEGIN(d1), PERIOD_BEGIN(d2))
    6.36  static inline void __add_to_waitqueue_sort(struct exec_domain *d) {
    6.37  	ASSERT(!__task_on_queue(d));
    6.38 -	PRINT(3,"Adding domain %i.%i (bop= %llu) to waitq\n", d->domain->id,
    6.39 -	      d->id, PERIOD_BEGIN(EDOM_INFO(d)));
    6.40 +	PRINT(3,"Adding domain %i.%i (bop= %"PRIu64") to waitq\n",
    6.41 +              d->domain->id, d->id, PERIOD_BEGIN(EDOM_INFO(d)));
    6.42  	list_insert_sort(WAITQ(d->processor), LIST(d), waitq_comp);
    6.43  	ASSERT(__task_on_queue(d));
    6.44  }
    6.45 @@ -320,8 +321,8 @@ static inline void __add_to_waitqueue_so
    6.46   */ 
    6.47  DOMAIN_COMPARER(runq, list, d1->deadl_abs, d2->deadl_abs)
    6.48  static inline void __add_to_runqueue_sort(struct exec_domain *d) {
    6.49 -	PRINT(3,"Adding domain %i.%i (deadl= %llu) to runq\n", d->domain->id,
    6.50 -	      d->id, EDOM_INFO(d)->deadl_abs);
    6.51 +	PRINT(3,"Adding domain %i.%i (deadl= %"PRIu64") to runq\n",
    6.52 +              d->domain->id, d->id, EDOM_INFO(d)->deadl_abs);
    6.53  	list_insert_sort(RUNQ(d->processor), LIST(d), runq_comp);
    6.54  }
    6.55  
    6.56 @@ -530,9 +531,9 @@ struct list_head* waitq) {
    6.57  			/*we missed the deadline or the slice was
    6.58  				already finished... might hapen because
    6.59  				of dom_adj.*/
    6.60 -			PRINT(4,"\tDomain %i.%i exceeded it's deadline/"\
    6.61 -				"slice (%llu / %llu) now: %llu "\
    6.62 -				"cputime: %llu\n",
    6.63 +			PRINT(4,"\tDomain %i.%i exceeded it's deadline/"
    6.64 +				"slice (%"PRIu64" / %"PRIu64") now: %"PRIu64
    6.65 +				" cputime: %"PRIu64"\n",
    6.66  				curinf->exec_domain->domain->id,
    6.67  				curinf->exec_domain->id,
    6.68  				curinf->deadl_abs, curinf->slice, now,
    6.69 @@ -599,7 +600,7 @@ static inline void desched_extra_dom(s_t
    6.70  		/*reduce block lost, probably more sophistication here!*/
    6.71  		/*inf->short_block_lost_tot -= EXTRA_QUANTUM;*/
    6.72  		inf->short_block_lost_tot -= now - inf->sched_start_abs;
    6.73 -		PRINT(3,"Domain %i.%i: Short_block_loss: %lli\n", 
    6.74 +		PRINT(3,"Domain %i.%i: Short_block_loss: %"PRIi64"\n", 
    6.75  		      inf->exec_domain->domain->id, inf->exec_domain->id,
    6.76  		      inf->short_block_lost_tot);
    6.77  		if (inf->short_block_lost_tot <= 0) {
    6.78 @@ -796,7 +797,7 @@ sched_done:
    6.79  	/*TODO: Do something USEFUL when this happens and find out, why it
    6.80  	still can happen!!!*/
    6.81  	if (ret.time<0) {
    6.82 -		printk("Ouch! We are seriously BEHIND schedule! %lli\n",
    6.83 +		printk("Ouch! We are seriously BEHIND schedule! %"PRIi64"\n",
    6.84  		       ret.time);
    6.85  		ret.time = EXTRA_QUANTUM;
    6.86  	}
    6.87 @@ -1158,8 +1159,8 @@ void sedf_wake(struct exec_domain *d) {
    6.88  		/*initial setup of the deadline*/
    6.89  		inf->deadl_abs = now + inf->slice;
    6.90  		
    6.91 -	PRINT(3,"waking up domain %i.%i (deadl= %llu period= %llu "\
    6.92 -	        "now= %llu)\n", d->domain->id, d->id, inf->deadl_abs,
    6.93 +	PRINT(3,"waking up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64" "\
    6.94 +	        "now= %"PRIu64")\n", d->domain->id, d->id, inf->deadl_abs,
    6.95  		 inf->period, now);
    6.96  #ifdef SEDF_STATS	
    6.97  	inf->block_tot++;
    6.98 @@ -1220,8 +1221,8 @@ void sedf_wake(struct exec_domain *d) {
    6.99  			extraq_check_add_unblocked(d, 1);
   6.100  		}
   6.101  	}
   6.102 -	PRINT(3,"woke up domain %i.%i (deadl= %llu period= %llu "\
   6.103 -	        "now= %llu)\n", d->domain->id, d->id, inf->deadl_abs,
   6.104 +	PRINT(3,"woke up domain %i.%i (deadl= %"PRIu64" period= %"PRIu64" "\
   6.105 +	        "now= %"PRIu64")\n", d->domain->id, d->id, inf->deadl_abs,
   6.106  		inf->period, now);
   6.107  	if (PERIOD_BEGIN(inf) > now) {
   6.108  		__add_to_waitqueue_sort(d);
   6.109 @@ -1258,21 +1259,21 @@ void sedf_wake(struct exec_domain *d) {
   6.110  static void sedf_dump_domain(struct exec_domain *d) {
   6.111  	printk("%i.%i has=%c ", d->domain->id, d->id,
   6.112  		test_bit(EDF_RUNNING, &d->flags) ? 'T':'F');
   6.113 -	printk("p=%llu sl=%llu ddl=%llu w=%hu c=%llu sc=%i xtr(%s)=%llu ew=%hu",
   6.114 +	printk("p=%"PRIu64" sl=%"PRIu64" ddl=%"PRIu64" w=%hu c=%"PRIu64" sc=%i xtr(%s)=%"PRIu64" ew=%hu",
   6.115  	  EDOM_INFO(d)->period, EDOM_INFO(d)->slice, EDOM_INFO(d)->deadl_abs,
   6.116  	  EDOM_INFO(d)->weight, d->cpu_time, EDOM_INFO(d)->score[EXTRA_UTIL_Q],
   6.117  	 (EDOM_INFO(d)->status & EXTRA_AWARE) ? "yes" : "no",
   6.118  	  EDOM_INFO(d)->extra_time_tot, EDOM_INFO(d)->extraweight);
   6.119  	if (d->cpu_time !=0)
   6.120 -		printf(" (%llu%%)", (EDOM_INFO(d)->extra_time_tot * 100)
   6.121 +		printf(" (%"PRIu64"%%)", (EDOM_INFO(d)->extra_time_tot * 100)
   6.122  		                 / d->cpu_time);
   6.123  #ifdef SEDF_STATS
   6.124  	if (EDOM_INFO(d)->block_time_tot!=0)
   6.125 -		printf(" pen=%llu%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
   6.126 +		printf(" pen=%"PRIu64"%%", (EDOM_INFO(d)->penalty_time_tot * 100) /
   6.127  		                     EDOM_INFO(d)->block_time_tot);
   6.128  	if (EDOM_INFO(d)->block_tot!=0)
   6.129  		printf("\n   blks=%u sh=%u (%u%%) (shc=%u (%u%%) shex=%i "\
   6.130 -		       "shexsl=%i) l=%u (%u%%) avg: b=%llu p=%llu",
   6.131 +		       "shexsl=%i) l=%u (%u%%) avg: b=%"PRIu64" p=%"PRIu64"",
   6.132  		    EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_block_tot,
   6.133  		   (EDOM_INFO(d)->short_block_tot * 100) 
   6.134  		  / EDOM_INFO(d)->block_tot, EDOM_INFO(d)->short_cont,
   6.135 @@ -1296,7 +1297,7 @@ static void sedf_dump_cpu_state(int i)
   6.136  	struct exec_domain    *ed;
   6.137  	int loop = 0;
   6.138  	
   6.139 -	printk("now=%llu\n",NOW());
   6.140 +	printk("now=%"PRIu64"\n",NOW());
   6.141  	queue = RUNQ(i);
   6.142  	printk("RUNQ rq %lx   n: %lx, p: %lx\n",  (unsigned long)queue,
   6.143  		(unsigned long) queue->next, (unsigned long) queue->prev);
   6.144 @@ -1396,8 +1397,8 @@ static inline int sedf_adjust_weights(st
   6.145  static int sedf_adjdom(struct domain *p, struct sched_adjdom_cmd *cmd) {
   6.146  	struct exec_domain *ed;
   6.147  
   6.148 -	PRINT(2,"sedf_adjdom was called, domain-id %i new period %llu "\
   6.149 -	        "new slice %llu\nlatency %llu extra:%s\n",
   6.150 +	PRINT(2,"sedf_adjdom was called, domain-id %i new period %"PRIu64" "\
   6.151 +	        "new slice %"PRIu64"\nlatency %"PRIu64" extra:%s\n",
   6.152  		p->id, cmd->u.sedf.period, cmd->u.sedf.slice,
   6.153  		cmd->u.sedf.latency, (cmd->u.sedf.extratime)?"yes":"no");
   6.154  	if ( cmd->direction == SCHED_INFO_PUT )
     7.1 --- a/xen/include/asm-x86/bitops.h	Mon May 09 17:50:17 2005 +0000
     7.2 +++ b/xen/include/asm-x86/bitops.h	Tue May 10 09:54:46 2005 +0000
     7.3 @@ -368,6 +368,7 @@ static __inline__ unsigned long find_fir
     7.4   * The Hamming Weight of a number is the total number of bits set in it.
     7.5   */
     7.6  
     7.7 +#define hweight64(x) generic_hweight64(x)
     7.8  #define hweight32(x) generic_hweight32(x)
     7.9  #define hweight16(x) generic_hweight16(x)
    7.10  #define hweight8(x) generic_hweight8(x)
     8.1 --- a/xen/include/asm-x86/x86_32/domain_page.h	Mon May 09 17:50:17 2005 +0000
     8.2 +++ b/xen/include/asm-x86/x86_32/domain_page.h	Tue May 10 09:54:46 2005 +0000
     8.3 @@ -33,40 +33,45 @@ struct map_dom_mem_cache {
     8.4  
     8.5  #define MAP_DOM_MEM_CACHE_INIT { .pa = 0 }
     8.6  
     8.7 +static inline void
     8.8 +init_map_domain_mem_cache(struct map_dom_mem_cache *cache)
     8.9 +{
    8.10 +    ASSERT(cache != NULL);
    8.11 +    *cache = MAP_DOM_MEM_CACHE_INIT;
    8.12 +}
    8.13 +
    8.14  static inline void *
    8.15 -map_domain_mem_with_cache(unsigned long pa,
    8.16 -                          struct map_dom_mem_cache *cache)
    8.17 +map_domain_mem_with_cache(unsigned long pa, struct map_dom_mem_cache *cache)
    8.18  {
    8.19 -    if ( likely(cache != NULL) )
    8.20 +    ASSERT(cache != NULL);
    8.21 +
    8.22 +    if ( likely(cache->pa) )
    8.23      {
    8.24 -        if ( likely(cache->pa) )
    8.25 -        {
    8.26 -            if ( likely((pa & PAGE_MASK) == (cache->pa & PAGE_MASK)) )
    8.27 -                goto done;
    8.28 -            unmap_domain_mem(cache->va);
    8.29 -        }
    8.30 -        cache->pa = (pa & PAGE_MASK) | 1;
    8.31 -        cache->va = map_domain_mem(cache->pa);
    8.32 -    done:
    8.33 -        return (void *)(((unsigned long)cache->va & PAGE_MASK) |
    8.34 -                        (pa & ~PAGE_MASK));
    8.35 +        if ( likely((pa & PAGE_MASK) == (cache->pa & PAGE_MASK)) )
    8.36 +            goto done;
    8.37 +        unmap_domain_mem(cache->va);
    8.38      }
    8.39  
    8.40 -    return map_domain_mem(pa);
    8.41 +    cache->pa = (pa & PAGE_MASK) | 1;
    8.42 +    cache->va = map_domain_mem(cache->pa);
    8.43 +
    8.44 + done:
    8.45 +    return (void *)(((unsigned long)cache->va & PAGE_MASK) |
    8.46 +                    (pa & ~PAGE_MASK));
    8.47  }
    8.48  
    8.49  static inline void
    8.50 -unmap_domain_mem_with_cache(void *va,
    8.51 -                            struct map_dom_mem_cache *cache)
    8.52 +unmap_domain_mem_with_cache(void *va, struct map_dom_mem_cache *cache)
    8.53  {
    8.54 -    if ( unlikely(!cache) )
    8.55 -        unmap_domain_mem(va);
    8.56 +    ASSERT(cache != NULL);
    8.57 +    unmap_domain_mem(va);
    8.58  }
    8.59  
    8.60  static inline void
    8.61 -unmap_domain_mem_cache(struct map_dom_mem_cache *cache)
    8.62 +destroy_map_domain_mem_cache(struct map_dom_mem_cache *cache)
    8.63  {
    8.64 -    if ( likely(cache != NULL) && likely(cache->pa) )
    8.65 +    ASSERT(cache != NULL);
    8.66 +    if ( likely(cache->pa) )
    8.67      {
    8.68          unmap_domain_mem(cache->va);
    8.69          cache->pa = 0;
     9.1 --- a/xen/include/asm-x86/x86_64/domain_page.h	Mon May 09 17:50:17 2005 +0000
     9.2 +++ b/xen/include/asm-x86/x86_64/domain_page.h	Tue May 10 09:54:46 2005 +0000
     9.3 @@ -10,4 +10,12 @@
     9.4  #define map_domain_mem(_pa)   phys_to_virt(_pa)
     9.5  #define unmap_domain_mem(_va) ((void)(_va))
     9.6  
     9.7 +struct map_dom_mem_cache { 
     9.8 +};
     9.9 +
    9.10 +#define init_map_domain_mem_cache(_c)      ((void)(_c))
    9.11 +#define map_domain_mem_with_cache(_p,_c)   (map_domain_mem(_p))
    9.12 +#define unmap_domain_mem_with_cache(_v,_c) ((void)(_v))
    9.13 +#define destroy_map_domain_mem_cache(_c)   ((void)(_c))
    9.14 +
    9.15  #endif /* __ASM_DOMAIN_PAGE_H__ */
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/xen/include/xen/inttypes.h	Tue May 10 09:54:46 2005 +0000
    10.3 @@ -0,0 +1,251 @@
    10.4 +/* Copyright (C) 1997-2001, 2004 Free Software Foundation, Inc.
    10.5 +   This file is part of the GNU C Library.
    10.6 +
    10.7 +   The GNU C Library is free software; you can redistribute it and/or
    10.8 +   modify it under the terms of the GNU Lesser General Public
    10.9 +   License as published by the Free Software Foundation; either
   10.10 +   version 2.1 of the License, or (at your option) any later version.
   10.11 +
   10.12 +   The GNU C Library is distributed in the hope that it will be useful,
   10.13 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
   10.14 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   10.15 +   Lesser General Public License for more details.
   10.16 +
   10.17 +   You should have received a copy of the GNU Lesser General Public
   10.18 +   License along with the GNU C Library; if not, write to the Free
   10.19 +   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   10.20 +   02111-1307 USA.  */
   10.21 +
   10.22 +/*
   10.23 + *	ISO C99: 7.8 Format conversion of integer types	<inttypes.h>
   10.24 + */
   10.25 +
   10.26 +#ifndef _XEN_INTTYPES_H
   10.27 +#define _XEN_INTTYPES_H	1
   10.28 +
   10.29 +#include <xen/config.h>
   10.30 +#include <xen/types.h>
   10.31 +
   10.32 +# if BITS_PER_LONG == 64
   10.33 +#  define __PRI64_PREFIX	"l"
   10.34 +#  define __PRIPTR_PREFIX	"l"
   10.35 +# else
   10.36 +#  define __PRI64_PREFIX	"ll"
   10.37 +#  define __PRIPTR_PREFIX
   10.38 +# endif
   10.39 +
   10.40 +/* Macros for printing format specifiers.  */
   10.41 +
   10.42 +/* Decimal notation.  */
   10.43 +# define PRId8		"d"
   10.44 +# define PRId16		"d"
   10.45 +# define PRId32		"d"
   10.46 +# define PRId64		__PRI64_PREFIX "d"
   10.47 +
   10.48 +# define PRIdLEAST8	"d"
   10.49 +# define PRIdLEAST16	"d"
   10.50 +# define PRIdLEAST32	"d"
   10.51 +# define PRIdLEAST64	__PRI64_PREFIX "d"
   10.52 +
   10.53 +# define PRIdFAST8	"d"
   10.54 +# define PRIdFAST16	__PRIPTR_PREFIX "d"
   10.55 +# define PRIdFAST32	__PRIPTR_PREFIX "d"
   10.56 +# define PRIdFAST64	__PRI64_PREFIX "d"
   10.57 +
   10.58 +
   10.59 +# define PRIi8		"i"
   10.60 +# define PRIi16		"i"
   10.61 +# define PRIi32		"i"
   10.62 +# define PRIi64		__PRI64_PREFIX "i"
   10.63 +
   10.64 +# define PRIiLEAST8	"i"
   10.65 +# define PRIiLEAST16	"i"
   10.66 +# define PRIiLEAST32	"i"
   10.67 +# define PRIiLEAST64	__PRI64_PREFIX "i"
   10.68 +
   10.69 +# define PRIiFAST8	"i"
   10.70 +# define PRIiFAST16	__PRIPTR_PREFIX "i"
   10.71 +# define PRIiFAST32	__PRIPTR_PREFIX "i"
   10.72 +# define PRIiFAST64	__PRI64_PREFIX "i"
   10.73 +
   10.74 +/* Octal notation.  */
   10.75 +# define PRIo8		"o"
   10.76 +# define PRIo16		"o"
   10.77 +# define PRIo32		"o"
   10.78 +# define PRIo64		__PRI64_PREFIX "o"
   10.79 +
   10.80 +# define PRIoLEAST8	"o"
   10.81 +# define PRIoLEAST16	"o"
   10.82 +# define PRIoLEAST32	"o"
   10.83 +# define PRIoLEAST64	__PRI64_PREFIX "o"
   10.84 +
   10.85 +# define PRIoFAST8	"o"
   10.86 +# define PRIoFAST16	__PRIPTR_PREFIX "o"
   10.87 +# define PRIoFAST32	__PRIPTR_PREFIX "o"
   10.88 +# define PRIoFAST64	__PRI64_PREFIX "o"
   10.89 +
   10.90 +/* Unsigned integers.  */
   10.91 +# define PRIu8		"u"
   10.92 +# define PRIu16		"u"
   10.93 +# define PRIu32		"u"
   10.94 +# define PRIu64		__PRI64_PREFIX "u"
   10.95 +
   10.96 +# define PRIuLEAST8	"u"
   10.97 +# define PRIuLEAST16	"u"
   10.98 +# define PRIuLEAST32	"u"
   10.99 +# define PRIuLEAST64	__PRI64_PREFIX "u"
  10.100 +
  10.101 +# define PRIuFAST8	"u"
  10.102 +# define PRIuFAST16	__PRIPTR_PREFIX "u"
  10.103 +# define PRIuFAST32	__PRIPTR_PREFIX "u"
  10.104 +# define PRIuFAST64	__PRI64_PREFIX "u"
  10.105 +
  10.106 +/* lowercase hexadecimal notation.  */
  10.107 +# define PRIx8		"x"
  10.108 +# define PRIx16		"x"
  10.109 +# define PRIx32		"x"
  10.110 +# define PRIx64		__PRI64_PREFIX "x"
  10.111 +
  10.112 +# define PRIxLEAST8	"x"
  10.113 +# define PRIxLEAST16	"x"
  10.114 +# define PRIxLEAST32	"x"
  10.115 +# define PRIxLEAST64	__PRI64_PREFIX "x"
  10.116 +
  10.117 +# define PRIxFAST8	"x"
  10.118 +# define PRIxFAST16	__PRIPTR_PREFIX "x"
  10.119 +# define PRIxFAST32	__PRIPTR_PREFIX "x"
  10.120 +# define PRIxFAST64	__PRI64_PREFIX "x"
  10.121 +
  10.122 +/* UPPERCASE hexadecimal notation.  */
  10.123 +# define PRIX8		"X"
  10.124 +# define PRIX16		"X"
  10.125 +# define PRIX32		"X"
  10.126 +# define PRIX64		__PRI64_PREFIX "X"
  10.127 +
  10.128 +# define PRIXLEAST8	"X"
  10.129 +# define PRIXLEAST16	"X"
  10.130 +# define PRIXLEAST32	"X"
  10.131 +# define PRIXLEAST64	__PRI64_PREFIX "X"
  10.132 +
  10.133 +# define PRIXFAST8	"X"
  10.134 +# define PRIXFAST16	__PRIPTR_PREFIX "X"
  10.135 +# define PRIXFAST32	__PRIPTR_PREFIX "X"
  10.136 +# define PRIXFAST64	__PRI64_PREFIX "X"
  10.137 +
  10.138 +
  10.139 +/* Macros for printing `intmax_t' and `uintmax_t'.  */
  10.140 +# define PRIdMAX	__PRI64_PREFIX "d"
  10.141 +# define PRIiMAX	__PRI64_PREFIX "i"
  10.142 +# define PRIoMAX	__PRI64_PREFIX "o"
  10.143 +# define PRIuMAX	__PRI64_PREFIX "u"
  10.144 +# define PRIxMAX	__PRI64_PREFIX "x"
  10.145 +# define PRIXMAX	__PRI64_PREFIX "X"
  10.146 +
  10.147 +
  10.148 +/* Macros for printing `intptr_t' and `uintptr_t'.  */
  10.149 +# define PRIdPTR	__PRIPTR_PREFIX "d"
  10.150 +# define PRIiPTR	__PRIPTR_PREFIX "i"
  10.151 +# define PRIoPTR	__PRIPTR_PREFIX "o"
  10.152 +# define PRIuPTR	__PRIPTR_PREFIX "u"
  10.153 +# define PRIxPTR	__PRIPTR_PREFIX "x"
  10.154 +# define PRIXPTR	__PRIPTR_PREFIX "X"
  10.155 +
  10.156 +
  10.157 +/* Macros for scanning format specifiers.  */
  10.158 +
  10.159 +/* Signed decimal notation.  */
  10.160 +# define SCNd8		"hhd"
  10.161 +# define SCNd16		"hd"
  10.162 +# define SCNd32		"d"
  10.163 +# define SCNd64		__PRI64_PREFIX "d"
  10.164 +
  10.165 +# define SCNdLEAST8	"hhd"
  10.166 +# define SCNdLEAST16	"hd"
  10.167 +# define SCNdLEAST32	"d"
  10.168 +# define SCNdLEAST64	__PRI64_PREFIX "d"
  10.169 +
  10.170 +# define SCNdFAST8	"hhd"
  10.171 +# define SCNdFAST16	__PRIPTR_PREFIX "d"
  10.172 +# define SCNdFAST32	__PRIPTR_PREFIX "d"
  10.173 +# define SCNdFAST64	__PRI64_PREFIX "d"
  10.174 +
  10.175 +/* Signed decimal notation.  */
  10.176 +# define SCNi8		"hhi"
  10.177 +# define SCNi16		"hi"
  10.178 +# define SCNi32		"i"
  10.179 +# define SCNi64		__PRI64_PREFIX "i"
  10.180 +
  10.181 +# define SCNiLEAST8	"hhi"
  10.182 +# define SCNiLEAST16	"hi"
  10.183 +# define SCNiLEAST32	"i"
  10.184 +# define SCNiLEAST64	__PRI64_PREFIX "i"
  10.185 +
  10.186 +# define SCNiFAST8	"hhi"
  10.187 +# define SCNiFAST16	__PRIPTR_PREFIX "i"
  10.188 +# define SCNiFAST32	__PRIPTR_PREFIX "i"
  10.189 +# define SCNiFAST64	__PRI64_PREFIX "i"
  10.190 +
  10.191 +/* Unsigned decimal notation.  */
  10.192 +# define SCNu8		"hhu"
  10.193 +# define SCNu16		"hu"
  10.194 +# define SCNu32		"u"
  10.195 +# define SCNu64		__PRI64_PREFIX "u"
  10.196 +
  10.197 +# define SCNuLEAST8	"hhu"
  10.198 +# define SCNuLEAST16	"hu"
  10.199 +# define SCNuLEAST32	"u"
  10.200 +# define SCNuLEAST64	__PRI64_PREFIX "u"
  10.201 +
  10.202 +# define SCNuFAST8	"hhu"
  10.203 +# define SCNuFAST16	__PRIPTR_PREFIX "u"
  10.204 +# define SCNuFAST32	__PRIPTR_PREFIX "u"
  10.205 +# define SCNuFAST64	__PRI64_PREFIX "u"
  10.206 +
  10.207 +/* Octal notation.  */
  10.208 +# define SCNo8		"hho"
  10.209 +# define SCNo16		"ho"
  10.210 +# define SCNo32		"o"
  10.211 +# define SCNo64		__PRI64_PREFIX "o"
  10.212 +
  10.213 +# define SCNoLEAST8	"hho"
  10.214 +# define SCNoLEAST16	"ho"
  10.215 +# define SCNoLEAST32	"o"
  10.216 +# define SCNoLEAST64	__PRI64_PREFIX "o"
  10.217 +
  10.218 +# define SCNoFAST8	"hho"
  10.219 +# define SCNoFAST16	__PRIPTR_PREFIX "o"
  10.220 +# define SCNoFAST32	__PRIPTR_PREFIX "o"
  10.221 +# define SCNoFAST64	__PRI64_PREFIX "o"
  10.222 +
  10.223 +/* Hexadecimal notation.  */
  10.224 +# define SCNx8		"hhx"
  10.225 +# define SCNx16		"hx"
  10.226 +# define SCNx32		"x"
  10.227 +# define SCNx64		__PRI64_PREFIX "x"
  10.228 +
  10.229 +# define SCNxLEAST8	"hhx"
  10.230 +# define SCNxLEAST16	"hx"
  10.231 +# define SCNxLEAST32	"x"
  10.232 +# define SCNxLEAST64	__PRI64_PREFIX "x"
  10.233 +
  10.234 +# define SCNxFAST8	"hhx"
  10.235 +# define SCNxFAST16	__PRIPTR_PREFIX "x"
  10.236 +# define SCNxFAST32	__PRIPTR_PREFIX "x"
  10.237 +# define SCNxFAST64	__PRI64_PREFIX "x"
  10.238 +
  10.239 +
  10.240 +/* Macros for scanning `intmax_t' and `uintmax_t'.  */
  10.241 +# define SCNdMAX	__PRI64_PREFIX "d"
  10.242 +# define SCNiMAX	__PRI64_PREFIX "i"
  10.243 +# define SCNoMAX	__PRI64_PREFIX "o"
  10.244 +# define SCNuMAX	__PRI64_PREFIX "u"
  10.245 +# define SCNxMAX	__PRI64_PREFIX "x"
  10.246 +
  10.247 +/* Macros for scaning `intptr_t' and `uintptr_t'.  */
  10.248 +# define SCNdPTR	__PRIPTR_PREFIX "d"
  10.249 +# define SCNiPTR	__PRIPTR_PREFIX "i"
  10.250 +# define SCNoPTR	__PRIPTR_PREFIX "o"
  10.251 +# define SCNuPTR	__PRIPTR_PREFIX "u"
  10.252 +# define SCNxPTR	__PRIPTR_PREFIX "x"
  10.253 +
  10.254 +#endif /* _XEN_INTTYPES_H */
    11.1 --- a/xen/include/xen/lib.h	Mon May 09 17:50:17 2005 +0000
    11.2 +++ b/xen/include/xen/lib.h	Tue May 10 09:54:46 2005 +0000
    11.3 @@ -1,6 +1,7 @@
    11.4  #ifndef __LIB_H__
    11.5  #define __LIB_H__
    11.6  
    11.7 +#include <xen/inttypes.h>
    11.8  #include <stdarg.h>
    11.9  #include <xen/config.h>
   11.10  #include <xen/types.h>