summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-03-31 23:03:34 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-03-31 23:03:34 +0200
commit7845a7023cc0bc9ed33c5348c51426f26e84611a (patch)
tree17a68913c2460ab637e5a6588c88da5e381b3096
parent38149699cd27636b58d4b6539f7a6612783eb45c (diff)
parent2926f6f92dab25ba19c3e758931e6b3e34db1891 (diff)
Merge branch 'master' into master-x86_64
-rw-r--r--device/dev_pager.c2
-rw-r--r--i386/i386/seg.h2
-rw-r--r--i386/i386at/model_dep.c2
-rw-r--r--i386/include/mach/i386/vm_types.h4
-rw-r--r--xen/net.c2
-rw-r--r--xen/public/io/ring.h6
6 files changed, 14 insertions, 4 deletions
diff --git a/device/dev_pager.c b/device/dev_pager.c
index 84db5ed8..4508ad14 100644
--- a/device/dev_pager.c
+++ b/device/dev_pager.c
@@ -329,7 +329,7 @@ kern_return_t device_pager_data_request(
if (device_pager_debug)
printf("(device_pager)data_request: pager=%p, offset=0x%lx, length=0x%lx\n",
- pager, offset, length);
+ pager, (unsigned long) offset, (unsigned long) length);
ds = dev_pager_hash_lookup(pager);
if (ds == DEV_PAGER_NULL)
diff --git a/i386/i386/seg.h b/i386/i386/seg.h
index b1a14fe4..d2bb3f0d 100644
--- a/i386/i386/seg.h
+++ b/i386/i386/seg.h
@@ -241,7 +241,7 @@ fill_descriptor64(struct real_descriptor64 *_desc, unsigned long base, unsigned
/* Fill a gate with particular values. */
MACH_INLINE void
-fill_gate(struct real_gate *gate, unsigned offset, unsigned short selector,
+fill_gate(struct real_gate *gate, unsigned long offset, unsigned short selector,
unsigned char access, unsigned char word_count)
{
gate->offset_low = offset & 0xffff;
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 40bc7cdc..aaeed807 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -577,7 +577,7 @@ void c_boot_entry(vm_offset_t bi)
printf("kernel symbol table at %08lx-%08lx (%ld,%ld)\n",
kern_sym_start, kern_sym_end,
- symtab_size, strtab_size);
+ (unsigned long) symtab_size, (unsigned long) strtab_size);
}
if ((boot_info.flags & MULTIBOOT_ELF_SHDR)
diff --git a/i386/include/mach/i386/vm_types.h b/i386/include/mach/i386/vm_types.h
index 78fb805b..28609e7c 100644
--- a/i386/include/mach/i386/vm_types.h
+++ b/i386/include/mach/i386/vm_types.h
@@ -83,7 +83,11 @@ typedef unsigned long phys_addr_t;
* expressing the difference between two
* vm_offset_t entities.
*/
+#ifdef __x86_64__
typedef unsigned long vm_size_t;
+#else
+typedef natural_t vm_size_t;
+#endif
#endif /* __ASSEMBLER__ */
diff --git a/xen/net.c b/xen/net.c
index 1dc2209e..4507ead3 100644
--- a/xen/net.c
+++ b/xen/net.c
@@ -47,7 +47,7 @@
/* Hypervisor part */
#define ADDRESS_SIZE 6
-#define WINDOW __RING_SIZE((netif_rx_sring_t*)0, PAGE_SIZE)
+#define WINDOW __CONST_RING_SIZE(netif_rx, PAGE_SIZE)
struct net_data {
struct device device;
diff --git a/xen/public/io/ring.h b/xen/public/io/ring.h
index 6ce1d0d4..8669564b 100644
--- a/xen/public/io/ring.h
+++ b/xen/public/io/ring.h
@@ -50,6 +50,12 @@ typedef unsigned int RING_IDX;
* A ring contains as many entries as will fit, rounded down to the nearest
* power of two (so we can mask with (size-1) to loop around).
*/
+#define __CONST_RING_SIZE(_s, _sz) \
+ (__RD32(((_sz) - offsetof(struct _s##_sring, ring)) / \
+ sizeof(((struct _s##_sring *)0)->ring[0])))
+/*
+ * The same for passing in an actual pointer instead of a name tag.
+ */
#define __RING_SIZE(_s, _sz) \
(__RD32(((_sz) - (long)(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0])))