diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2006-11-05 18:54:52 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-18 00:26:50 +0200 |
commit | ffc607f8a4c1c6f1c63a7b61b54f185ada87a9a5 (patch) | |
tree | 35fb5835c103b647de4de4a53ba94e4b1b5cb563 /vm | |
parent | 7e8b31e61e4bd9207bde37662e757a5988c556df (diff) |
2006-11-05 Barry deFreese <bddebian@comcast.net>
memcpy/memset cleanup.
* include/string.h: New file.
* include/mach/mig_support.h: Include `string.h'.
[MACH_KERNEL] (bcopy): Remove extern declaration.
[MACH_KERNEL] (memcpy): Remove macro.
* device/cirbuf.c: Include `string.h'.
(q_to_b, b_to_q): Replace bcopy() with memcpy() and bzero() with
memset(), clean memcpy() and memset() invocation.
* device/cons.c (cnputc): Likewise.
* device/dev_pager.c (device_pager_data_request_done): Likewise.
* device/ds_routines.c (device_write_get, ds_read_done): Likewise.
* device/kmsg.c: Likewise.
* device/net_io.c (net_filter, net_set_filter, net_getstat): Likewise.
* i386/i386/fpu.c (fpu_set_state, fpu_get_state) fp_load)
(fp_state_alloc): Likewise.
* i386/i386/iopb.c (io_tss_init, i386_io_port_list): Likewise.
* i386/i386/mp_desc.c (mp_desc_init): Likewise.
* i386/i386/pcb.c (pcb_init, thread_setstatus)
(thread_getstatus): Likewise.
* i386/i386/phys.c (pmap_zero_page, pmap_copy_page, copy_to_phys)
(copy_from_phys): Likewise.
* i386/i386/trap.c (v86_assist): Likewise.
* i386/i386/user_ldt.c (i386_set_ldt, i386_get_ldt): Likewise.
* i386/i386at/immc.c (immc_cnputc): Likewise.
* i386/i386at/kd_event.c (X_kdb_enter_init, X_kdb_exit_init): Likewise.
* i386/intel/pmap.c (pmap_init, pmap_page_table_page_alloc)
(pmap_create): Likewise.
* ipc/ipc_entry.c (ipc_entry_grow_table): Likewise.
* ipc/ipc_kmsg.c (ipc_kmsg_get_from_kernel)
(ipc_kmsg_put_to_kernel): Likewise.
* ipc/ipc_object.c (ipc_object_alloc, ipc_object_alloc_name): Likewise.
* ipc/ipc_port.c (ipc_port_dngrow): Likewise.
* ipc/ipc_space.c: Likewise.
* ipc/mach_debug.c (mach_port_space_info)
(mach_port_space_info): Likewise.
* kern/act.c (act_create): Likewise.
* kern/boot_script.c: Likewise.
* kern/bootstrap.c: Likewise.
* kern/eventcount.c (evc_init): Likewise.
* kern/host.c (host_info, host_processor_sets): Likewise.
* kern/lock.c (lock_init): Likewise.
* kern/lock_mon.c (lock_info_clear): Likewise.
* kern/mach_clock.c (mapable_time_init): Likewise.
* kern/pc_sample.c (get_sampled_pcs): Likewise.
* kern/processor.c (processor_set_things): Likewise.
* kern/syscall_emulation.c (task_set_emulation_vector_internal)
(task_get_emulation_vector, xxx_task_get_emulation_vector): Likewise.
* kern/task.c (task_threads): Likewise.
* kern/xpr.c (xprbootstrap): Likewise.
* kern/zalloc.c (host_zone_info): Likewise.
* vm/vm_debug.c (mach_vm_object_pages): Likewise.
* vm/vm_kern.c (projected_buffer_allocate, copyinmap)
(copyoutmap): Likewise.
* vm/vm_object.c (vm_object_bootstrap): Likewise.
* vm/vm_resident.c (vm_page_grab_contiguous_pages): Likewise.
Diffstat (limited to 'vm')
-rw-r--r-- | vm/vm_debug.c | 6 | ||||
-rw-r--r-- | vm/vm_kern.c | 8 | ||||
-rw-r--r-- | vm/vm_object.c | 4 | ||||
-rw-r--r-- | vm/vm_resident.c | 4 |
4 files changed, 15 insertions, 7 deletions
diff --git a/vm/vm_debug.c b/vm/vm_debug.c index a6e9347..29ec8da 100644 --- a/vm/vm_debug.c +++ b/vm/vm_debug.c @@ -33,6 +33,8 @@ #if MACH_VM_DEBUG +#include <string.h> + #include <kern/thread.h> #include <mach/kern_return.h> #include <mach/machine/vm_types.h> @@ -402,8 +404,8 @@ mach_vm_object_pages(object, pagesp, countp) addr + rsize_used, size - rsize_used); if (size_used != rsize_used) - bzero((char *) (addr + size_used), - rsize_used - size_used); + memset((char *) (addr + size_used), 0, + rsize_used - size_used); kr = vm_map_copyin(ipc_kernel_map, addr, rsize_used, TRUE, ©); diff --git a/vm/vm_kern.c b/vm/vm_kern.c index b83c058..ed81f0a 100644 --- a/vm/vm_kern.c +++ b/vm/vm_kern.c @@ -34,6 +34,8 @@ * Kernel memory management. */ +#include <string.h> + #include <mach/kern_return.h> #include <machine/vm_param.h> #include <kern/assert.h> @@ -149,7 +151,7 @@ projected_buffer_allocate(map, size, persistence, kernel_p, kmem_alloc_pages(object, 0, *kernel_p, *kernel_p + size, VM_PROT_READ | VM_PROT_WRITE); - bzero(*kernel_p, size); /*Zero fill*/ + memset((void*) *kernel_p, 0, size); /*Zero fill*/ /* Set up physical mappings for user pmap */ @@ -1035,7 +1037,7 @@ int copyinmap(map, fromaddr, toaddr, length) { if (vm_map_pmap(map) == kernel_pmap) { /* assume a correct copy */ - bcopy(fromaddr, toaddr, length); + memcpy(toaddr, fromaddr, length); return 0; } @@ -1061,7 +1063,7 @@ int copyoutmap(map, fromaddr, toaddr, length) { if (vm_map_pmap(map) == kernel_pmap) { /* assume a correct copy */ - bcopy(fromaddr, toaddr, length); + memcpy(toaddr, fromaddr, length); return 0; } diff --git a/vm/vm_object.c b/vm/vm_object.c index e2a5f43..7d00fbe 100644 --- a/vm/vm_object.c +++ b/vm/vm_object.c @@ -33,6 +33,8 @@ * Virtual memory object module. */ +#include <string.h> + #include <mach/memory_object.h> #include <vm/memory_object_default.user.h> #include <vm/memory_object_user.user.h> @@ -253,7 +255,7 @@ void vm_object_bootstrap(void) */ vm_object_template = (vm_object_t) zalloc(vm_object_zone); - bzero((char *) vm_object_template, sizeof *vm_object_template); + memset(vm_object_template, 0, sizeof *vm_object_template); vm_object_template->ref_count = 1; vm_object_template->size = 0; diff --git a/vm/vm_resident.c b/vm/vm_resident.c index b939b1d..2c99ab5 100644 --- a/vm/vm_resident.c +++ b/vm/vm_resident.c @@ -33,6 +33,8 @@ * Resident memory management module. */ +#include <string.h> + #include <mach/vm_prot.h> #include <kern/counters.h> #include <kern/sched_prim.h> @@ -959,7 +961,7 @@ vm_page_grab_contiguous_pages( } else alloc_size = 0; - bzero(bits, size); + memset(bits, 0, size); /* * A very large granularity call, its rare so that is ok |