summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-03-09 01:04:52 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2012-03-09 01:04:52 +0100
commit4ae07e7e07cf77f1b7ce06bebf1057bfe4a16c54 (patch)
treeb36ddbd87707b330069c83f1298e6b8e6015e2cb /i386
parentdfb4a89ba3bee1c4c000f8e6b54fb92ed25fb2b7 (diff)
Use unsigned long for addresses and sizes
TODO: remonter formats * i386/include/mach/i386/vm_types.h (vm_offset_t): Define to unsigned long. (signed32_t): Define to signed int. (unsigned32_t): Define to unsigned int. * i386/include/mach/sa/stdarg.h (__va_size): Use sizeof(unsigned long)-1 instead of 3. * include/mach/port.h (mach_port_t): Define to vm_offset_t instead of natural_t. * include/sys/types.h (size_t): Define to unsigned long instead of natural_t. * linux/src/include/asm-i386/posix_types.h (__kernel_size_t): Define to unsigned long. (__kernel_ssize_t): Define to long. * linux/src/include/linux/stddef.h (size_t): Define to unsigned long. * device/dev_pager.c (dev_pager_hash): Cast port to vm_offset_t insted of natural_t. (device_pager_data_request): Fix format. * device/ds_routines.c (ds_no_senders): Fix format. * i386/i386/io_map.c (io_map): Likewise. * i386/i386at/autoconf.c (take_dev_irq): Likewise. * i386/i386at/com.c (comattach): Likewise. * i386/i386at/lpr.c (lprattach): Likewise. * i386/i386at/model_dep.c (mem_size_init, mem_size_init, c_boot_entry): Likewise. * i386/intel/pmap.c (pmap_enter): Likewise. * ipc/ipc_notify.c (ipc_notify_port_deleted, ipc_notify_msg_accepted, ipc_notify_dead_name): Likewise. * ipc/mach_port.c (mach_port_destroy, mach_port_deallocate): Likewise. * kern/ipc_kobject.c (ipc_kobject_destroy): Likewise. * kern/slab.c (kalloc_init): Likewise. * vm/vm_fault.c (vm_fault_page): Likewise. * vm/vm_map.c (vm_map_pmap_enter): Likewise. * xen/block.c (device_read): Likewise. * device/net_io.c (bpf_match): Take unsigned long * instead of unsigned int *. (bpf_do_filter): Make mem unsigned long instead of long. * i386/i386/ktss.c (ktss_init): Cast pointer to unsigned long instead of unsigned. * i386/i386/pcb.c (stack_attach, switch_ktss): Cast pointers to long instead of int. * i386/i386/trap.c (dump_ss): Likewise. * ipc/ipc_hash.c (IH_LOCAL_HASH): Cast object to vm_offset_t. * ipc/mach_msg.c (mach_msg_receive, mach_msg_receive_continue): Cast kmsg to vm_offset_t instead of natural_t. * kern/pc_sample.c (take_pc_sample): Cast to vm_offset_t instead of natural_t. * kern/boot_script.c (sym, arg): Set type of `val' field to long instead of int. (create_task, builtin_symbols, boot_script_parse_line, boot_script_define_function): Cast to long instead of int. * kern/bootstrap.c (bootstrap_create): Likewise. * kern/sched_prim.c (decl_simple_lock_data): Likewise. * kern/printf.c (vsnprintf): Set size type to size_t. * kern/printf.h (vsnprintf): Likewise. * vm/vm_map.h (kentry_data_size): Fix type to vm_size_t. * vm/vm_object.c (vm_object_pmap_protect_by_page): Fix size parameter type to vm_size_t.
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/io_map.c2
-rw-r--r--i386/i386/ktss.c2
-rw-r--r--i386/i386/pcb.c12
-rw-r--r--i386/i386/trap.c4
-rw-r--r--i386/i386at/autoconf.c2
-rw-r--r--i386/i386at/com.c2
-rw-r--r--i386/i386at/lpr.c2
-rw-r--r--i386/i386at/model_dep.c6
-rw-r--r--i386/include/mach/i386/vm_types.h6
-rw-r--r--i386/include/mach/sa/stdarg.h2
-rw-r--r--i386/intel/pmap.c2
11 files changed, 21 insertions, 21 deletions
diff --git a/i386/i386/io_map.c b/i386/i386/io_map.c
index 5b77552d..b095f224 100644
--- a/i386/i386/io_map.c
+++ b/i386/i386/io_map.c
@@ -49,7 +49,7 @@ io_map(phys_addr, size)
*/
start = kernel_virtual_start;
kernel_virtual_start += round_page(size);
- printf("stealing kernel virtual addresses %08x-%08x\n", start, kernel_virtual_start);
+ printf("stealing kernel virtual addresses %08lx-%08lx\n", start, kernel_virtual_start);
}
else {
(void) kmem_alloc_pageable(kernel_map, &start, round_page(size));
diff --git a/i386/i386/ktss.c b/i386/i386/ktss.c
index 66432f3e..e2c44257 100644
--- a/i386/i386/ktss.c
+++ b/i386/i386/ktss.c
@@ -48,7 +48,7 @@ ktss_init()
#ifdef MACH_XEN
/* Xen won't allow us to do any I/O by default anyway, just register
* exception stack */
- if (hyp_stack_switch(KERNEL_DS, (unsigned)(exception_stack+1024)))
+ if (hyp_stack_switch(KERNEL_DS, (unsigned long)(exception_stack+1024)))
panic("couldn't register exception stack\n");
#else /* MACH_XEN */
/* Initialize the master TSS descriptor. */
diff --git a/i386/i386/pcb.c b/i386/i386/pcb.c
index e065dbb2..dfe0444f 100644
--- a/i386/i386/pcb.c
+++ b/i386/i386/pcb.c
@@ -93,10 +93,10 @@ void stack_attach(thread, stack, continuation)
* This function will not return normally,
* so we don`t have to worry about a return address.
*/
- STACK_IKS(stack)->k_eip = (int) Thread_continue;
- STACK_IKS(stack)->k_ebx = (int) continuation;
- STACK_IKS(stack)->k_esp = (int) STACK_IEL(stack);
- STACK_IKS(stack)->k_ebp = (int) 0;
+ STACK_IKS(stack)->k_eip = (long) Thread_continue;
+ STACK_IKS(stack)->k_ebx = (long) continuation;
+ STACK_IKS(stack)->k_esp = (long) STACK_IEL(stack);
+ STACK_IKS(stack)->k_ebp = (long) 0;
/*
* Point top of kernel stack to user`s registers.
@@ -152,8 +152,8 @@ void switch_ktss(pcb)
*/
pcb_stack_top = (pcb->iss.efl & EFL_VM)
- ? (int) (&pcb->iss + 1)
- : (int) (&pcb->iss.v86_segs);
+ ? (long) (&pcb->iss + 1)
+ : (long) (&pcb->iss.v86_segs);
#ifdef MACH_XEN
/* No IO mask here */
diff --git a/i386/i386/trap.c b/i386/i386/trap.c
index 01c83f50..d594907e 100644
--- a/i386/i386/trap.c
+++ b/i386/i386/trap.c
@@ -217,8 +217,8 @@ dump_ss(regs);
printf("now %08x\n", subcode);
#endif
if (trunc_page(subcode) == 0
- || (subcode >= (int)_start
- && subcode < (int)etext)) {
+ || (subcode >= (long)_start
+ && subcode < (long)etext)) {
printf("Kernel page fault at address 0x%x, "
"eip = 0x%x\n",
subcode, regs->eip);
diff --git a/i386/i386at/autoconf.c b/i386/i386at/autoconf.c
index d1f2863f..93c71412 100644
--- a/i386/i386at/autoconf.c
+++ b/i386/i386at/autoconf.c
@@ -135,7 +135,7 @@ void take_dev_irq(
printf("The device below will clobber IRQ %d.\n", pic);
printf("You have two devices at the same IRQ.\n");
printf("This won't work. Reconfigure your hardware and try again.\n");
- printf("%s%d: port = %x, spl = %d, pic = %d.\n",
+ printf("%s%d: port = %lx, spl = %ld, pic = %d.\n",
dev->name, dev->unit, dev->address,
dev->sysdep, dev->sysdep1);
while (1);
diff --git a/i386/i386at/com.c b/i386/i386at/com.c
index f02c7f83..165b0fab 100644
--- a/i386/i386at/com.c
+++ b/i386/i386at/com.c
@@ -229,7 +229,7 @@ comattach(struct bus_device *dev)
u_short addr = dev->address;
take_dev_irq(dev);
- printf(", port = %x, spl = %d, pic = %d. (DOS COM%d)",
+ printf(", port = %lx, spl = %ld, pic = %d. (DOS COM%d)",
dev->address, dev->sysdep, dev->sysdep1, unit+1);
/* comcarrier[unit] = addr->flags;*/
diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c
index 468608c7..b69e813e 100644
--- a/i386/i386at/lpr.c
+++ b/i386/i386at/lpr.c
@@ -102,7 +102,7 @@ void lprattach(struct bus_device *dev)
u_short addr = (u_short) dev->address;
take_dev_irq(dev);
- printf(", port = %x, spl = %d, pic = %d.",
+ printf(", port = %lx, spl = %ld, pic = %d.",
dev->address, dev->sysdep, dev->sysdep1);
lprinfo[unit] = dev;
diff --git a/i386/i386at/model_dep.c b/i386/i386at/model_dep.c
index 980708cf..2f785207 100644
--- a/i386/i386at/model_dep.c
+++ b/i386/i386at/model_dep.c
@@ -284,7 +284,7 @@ mem_size_init(void)
phys_last_addr = phys_last_kb * 0x400;
#endif /* MACH_HYP */
- printf("AT386 boot: physical memory from 0x%x to 0x%x\n",
+ printf("AT386 boot: physical memory from 0x%lx to 0x%lx\n",
phys_first_addr, phys_last_addr);
/* Reserve room for virtual mappings.
@@ -292,7 +292,7 @@ mem_size_init(void)
max_phys_size = VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS - VM_KERNEL_MAP_SIZE;
if (phys_last_addr - phys_first_addr > max_phys_size) {
phys_last_addr = phys_first_addr + max_phys_size;
- printf("Truncating memory size to %dMiB\n", (phys_last_addr - phys_first_addr) / (1024 * 1024));
+ printf("Truncating memory size to %luMiB\n", (phys_last_addr - phys_first_addr) / (1024 * 1024));
/* TODO Xen: be nice, free lost memory */
}
@@ -514,7 +514,7 @@ void c_boot_entry(vm_offset_t bi)
strtab_size = (vm_offset_t)phystokv(boot_info.syms.a.strsize);
kern_sym_end = kern_sym_start + 4 + symtab_size + strtab_size;
- printf("kernel symbol table at %08x-%08x (%d,%d)\n",
+ printf("kernel symbol table at %08lx-%08lx (%d,%d)\n",
kern_sym_start, kern_sym_end,
symtab_size, strtab_size);
}
diff --git a/i386/include/mach/i386/vm_types.h b/i386/include/mach/i386/vm_types.h
index d54008ef..1439940b 100644
--- a/i386/include/mach/i386/vm_types.h
+++ b/i386/include/mach/i386/vm_types.h
@@ -73,7 +73,7 @@ typedef unsigned int uint32;
* A vm_offset_t is a type-neutral pointer,
* e.g. an offset into a virtual memory space.
*/
-typedef natural_t vm_offset_t;
+typedef unsigned long vm_offset_t;
typedef vm_offset_t * vm_offset_array_t;
/*
@@ -88,11 +88,11 @@ typedef natural_t vm_size_t;
*/
typedef signed char signed8_t;
typedef signed short signed16_t;
-typedef signed long signed32_t;
+typedef signed int signed32_t;
typedef signed long long signed64_t;
typedef unsigned char unsigned8_t;
typedef unsigned short unsigned16_t;
-typedef unsigned long unsigned32_t;
+typedef unsigned int unsigned32_t;
typedef unsigned long long unsigned64_t;
typedef float float32_t;
typedef double float64_t;
diff --git a/i386/include/mach/sa/stdarg.h b/i386/include/mach/sa/stdarg.h
index ba0f78a1..550fec4f 100644
--- a/i386/include/mach/sa/stdarg.h
+++ b/i386/include/mach/sa/stdarg.h
@@ -39,7 +39,7 @@ typedef __builtin_va_list va_list;
#else
-#define __va_size(type) ((sizeof(type)+3) & ~0x3)
+#define __va_size(type) ((sizeof(type)+sizeof(unsigned long)-1) & ~(sizeof(unsigned long)-1))
#ifndef _VA_LIST_
#define _VA_LIST_
diff --git a/i386/intel/pmap.c b/i386/intel/pmap.c
index d6e18e50..86d2415d 100644
--- a/i386/intel/pmap.c
+++ b/i386/intel/pmap.c
@@ -1747,7 +1747,7 @@ void pmap_enter(pmap, v, pa, prot, wired)
vm_offset_t old_pa;
assert(pa != vm_page_fictitious_addr);
-if (pmap_debug) printf("pmap(%x, %x)\n", v, pa);
+if (pmap_debug) printf("pmap(%lx, %lx)\n", v, pa);
if (pmap == PMAP_NULL)
return;