summaryrefslogtreecommitdiff
path: root/device
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 /device
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 'device')
-rw-r--r--device/dev_pager.c4
-rw-r--r--device/ds_routines.c2
-rw-r--r--device/net_io.c6
3 files changed, 6 insertions, 6 deletions
diff --git a/device/dev_pager.c b/device/dev_pager.c
index bc58a15..e0ca2c7 100644
--- a/device/dev_pager.c
+++ b/device/dev_pager.c
@@ -165,7 +165,7 @@ decl_simple_lock_data(,
dev_pager_hash_lock)
#define dev_pager_hash(name_port) \
- (((natural_t)(name_port) & 0xffffff) % DEV_PAGER_HASH_COUNT)
+ (((vm_offset_t)(name_port) & 0xffffff) % DEV_PAGER_HASH_COUNT)
void dev_pager_hash_init(void)
{
@@ -336,7 +336,7 @@ kern_return_t device_pager_data_request(
#endif /* lint */
if (device_pager_debug)
- printf("(device_pager)data_request: pager=%p, offset=0x%x, length=0x%x\n",
+ printf("(device_pager)data_request: pager=%p, offset=0x%lx, length=0x%x\n",
pager, offset, length);
ds = dev_pager_hash_lookup((ipc_port_t)pager);
diff --git a/device/ds_routines.c b/device/ds_routines.c
index 5a6fdd2..68589de 100644
--- a/device/ds_routines.c
+++ b/device/ds_routines.c
@@ -1449,7 +1449,7 @@ static void
ds_no_senders(notification)
mach_no_senders_notification_t *notification;
{
- printf("ds_no_senders called! device_port=0x%x count=%d\n",
+ printf("ds_no_senders called! device_port=0x%lx count=%d\n",
notification->not_header.msgh_remote_port,
notification->not_count);
}
diff --git a/device/net_io.c b/device/net_io.c
index 52a0716..4ebf996 100644
--- a/device/net_io.c
+++ b/device/net_io.c
@@ -394,7 +394,7 @@ int net_add_q_info (ipc_port_t rcv_port);
int bpf_match (
net_hash_header_t hash,
int n_keys,
- unsigned int *keys,
+ unsigned long *keys,
net_hash_entry_t **hash_headpp,
net_hash_entry_t *entpp);
@@ -1638,7 +1638,7 @@ bpf_do_filter(infp, p, wirelen, header, hlen, hash_headpp, entpp)
register unsigned long A, X;
register int k;
- long mem[BPF_MEMWORDS];
+ unsigned long mem[BPF_MEMWORDS];
/* Generic pointer to either HEADER or P according to the specified offset. */
char *data = NULL;
@@ -2032,7 +2032,7 @@ int
bpf_match (hash, n_keys, keys, hash_headpp, entpp)
net_hash_header_t hash;
register int n_keys;
- register unsigned int *keys;
+ register unsigned long *keys;
net_hash_entry_t **hash_headpp, *entpp;
{
register net_hash_entry_t head, entp;