summaryrefslogtreecommitdiff
path: root/device
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2008-12-01 22:04:15 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:27:21 +0200
commit4bdef12bf49e8712cb6b9104b14d7b4d565e6ec1 (patch)
tree314b5da00d15009e863d8f1077c4464dbb62e8d7 /device
parent4276d54c0037552d74b4ef6840783f905d3dd6c4 (diff)
2008-11-15 Shakthi Kannan <shakshurd@gmail.com>
* device/ds_routines.h (device_reference, device_deallocate): Add function prototypes. * kern/task.c (task_create): Moved unused i variable inside FAST_TAS. * vm/vm_map.h (vm_map_copy_page_discard): Add function prototype. * vm/vm_kern.c (projected_buffer_deallocate): Give &map->hdr instead of map to _vm_map_clip_start and _vm_map_clip_end functions. 2008-12-01 Samuel Thibault <samuel.thibault@ens-lyon.org> * device/device_emul.h (device_emulation_ops): Turn back reference, dealloc, dev_to_port, write_trap and writev_trap into taking a void*, as they do not always take a mach_device_t. * device/ds_routines.c (mach_device_emulation_ops): Cast mach_device_reference, mach_device_deallocate, mach_convert_device_to_port, device_write_trap and device_writev_trap to (void*) to make them accept a void* argument. * linux/pcmcia-cs/glue/ds.c (device_deallocate): Rename function into... (ds_device_deallocate): ... this. (dev_to_port): Call ds_device_deallocate instead of device_deallocate. (linux_pcmcia_emulation_ops): Use ds_device_deallocate instead of device_deallocate, cast mach_device_reference to (void*) to make it accept a void* argument.
Diffstat (limited to 'device')
-rw-r--r--device/device_emul.h10
-rw-r--r--device/ds_routines.c10
-rw-r--r--device/ds_routines.h2
3 files changed, 12 insertions, 10 deletions
diff --git a/device/device_emul.h b/device/device_emul.h
index 879736c..957bd50 100644
--- a/device/device_emul.h
+++ b/device/device_emul.h
@@ -32,9 +32,9 @@
/* Each emulation layer provides these operations. */
struct device_emulation_ops
{
- void (*reference) (mach_device_t);
- void (*dealloc) (mach_device_t);
- ipc_port_t (*dev_to_port) (mach_device_t);
+ void (*reference) (void *);
+ void (*dealloc) (void *);
+ ipc_port_t (*dev_to_port) (void *);
io_return_t (*open) (ipc_port_t, mach_msg_type_name_t,
dev_mode_t, char *, device_t *);
io_return_t (*close) (void *);
@@ -55,9 +55,9 @@ struct device_emulation_ops
io_return_t (*map) (void *, vm_prot_t, vm_offset_t,
vm_size_t, ipc_port_t *, boolean_t);
void (*no_senders) (mach_no_senders_notification_t *);
- io_return_t (*write_trap) (mach_device_t, dev_mode_t,
+ io_return_t (*write_trap) (void *, dev_mode_t,
recnum_t, vm_offset_t, vm_size_t);
- io_return_t (*writev_trap) (mach_device_t, dev_mode_t,
+ io_return_t (*writev_trap) (void *, dev_mode_t,
recnum_t, io_buf_vec_t *, vm_size_t);
};
diff --git a/device/ds_routines.c b/device/ds_routines.c
index 943185e..9ec5a6b 100644
--- a/device/ds_routines.c
+++ b/device/ds_routines.c
@@ -1818,9 +1818,9 @@ device_writev_trap (mach_device_t device, dev_mode_t mode,
struct device_emulation_ops mach_device_emulation_ops =
{
- mach_device_reference,
- mach_device_deallocate,
- mach_convert_device_to_port,
+ (void*) mach_device_reference,
+ (void*) mach_device_deallocate,
+ (void*) mach_convert_device_to_port,
device_open,
device_close,
device_write,
@@ -1832,6 +1832,6 @@ struct device_emulation_ops mach_device_emulation_ops =
device_set_filter,
device_map,
ds_no_senders,
- device_write_trap,
- device_writev_trap
+ (void*) device_write_trap,
+ (void*) device_writev_trap
};
diff --git a/device/ds_routines.h b/device/ds_routines.h
index 24668b4..e1f6aad 100644
--- a/device/ds_routines.h
+++ b/device/ds_routines.h
@@ -46,6 +46,8 @@ vm_map_t device_io_map;
kern_return_t device_read_alloc(io_req_t, vm_size_t);
kern_return_t device_write_get(io_req_t, boolean_t *);
boolean_t device_write_dealloc(io_req_t);
+void device_reference(device_t);
+void device_deallocate(device_t);
boolean_t ds_notify(mach_msg_header_t *msg);
boolean_t ds_open_done(io_req_t);