[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Compiler fixes for ipc_mig.c, task.c, memory_object.c, vm_ke
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] Compiler fixes for ipc_mig.c, task.c, memory_object.c, vm_kern.c |
Date: |
Fri, 14 Nov 2008 00:55:55 +0100 |
User-agent: |
Mutt/1.5.12-2006-07-14 |
Shakthi Kannan, le Thu 13 Nov 2008 23:59:59 +0530, a écrit :
> --- a/kern/ipc_mig.c
> +++ b/kern/ipc_mig.c
> @@ -53,6 +53,10 @@
> #include <device/device_types.h>
> #include <device/ds_routines.h>
>
> +/* Function prototypes */
> +void device_reference (device_t dev);
> +void device_deallocate (device_t dev);
Err, no, these should rather to go ds_routines.h...
> diff --git a/kern/task.c b/kern/task.c
> index 45c59c5..f788e7b 100644
> --- a/kern/task.c
> +++ b/kern/task.c
> @@ -116,7 +116,6 @@ kern_return_t task_create(
> {
> register task_t new_task;
> register processor_set_t pset;
> - int i;
>
> new_task = (task_t) zalloc(task_zone);
> if (new_task == TASK_NULL) {
> @@ -183,6 +182,7 @@ kern_return_t task_create(
> #endif /* MACH_PCSAMPLE */
>
> #if FAST_TAS
> + int i;
> for (i = 0; i < TASK_FAST_TAS_NRAS; i++) {
> if (inherit_memory) {
> new_task->fast_tas_base[i] = parent_task->fast_tas_base[i];
That will be rejected by non-c99 compilers. Better just #ifdef it.
> diff --git a/vm/memory_object.c b/vm/memory_object.c
> index 57dde76..002a6bb 100644
> --- a/vm/memory_object.c
> +++ b/vm/memory_object.c
> @@ -75,6 +75,9 @@ typedef int memory_object_lock_result_t; /*
> moved
> from below */
> ipc_port_t memory_manager_default = IP_NULL;
> decl_simple_lock_data(,memory_manager_default_lock)
>
> +/* Function prototypes */
> +void vm_map_copy_page_discard (vm_map_copy_t copy);
Just the same: put it into vm_map.h
> index f29a014..8d85e7a 100644
> --- a/vm/vm_kern.c
> +++ b/vm/vm_kern.c
> @@ -269,7 +269,7 @@ projected_buffer_deallocate(map, start, end)
>
> /*Prepare for deallocation*/
> if (entry->vme_start < start)
> - _vm_map_clip_start(map, entry, start);
> + _vm_map_clip_start((struct vm_map_header *) map, entry, start);
Beeerk. And actually reveals a bug: that shouldn't be just map, but
&map->hdr (which is *not* the first member of struct vm_map, there is a
lock_data_t before...), same for clip_end.
Samuel