--- Gnu-Mach/kern/syscall_emulation.c 2020/09/02 04:36:57 1.1.1.1 +++ Gnu-Mach/kern/syscall_emulation.c 2020/09/02 04:45:20 1.1.1.2 @@ -24,6 +24,8 @@ * the rights to redistribute these changes. */ +#include + #include #include #include @@ -198,9 +200,9 @@ task_set_emulation_vector_internal(task, * Copy the entries to the new emulation vector, * deallocate the current one, and use the new one. */ - bcopy((char *)&cur_eml->disp_vector[0], - (char *)&new_eml->disp_vector[cur_start-new_start], - cur_eml->disp_count * sizeof(vm_offset_t)); + memcpy(&new_eml->disp_vector[cur_start-new_start], + &cur_eml->disp_vector[0], + cur_eml->disp_count * sizeof(vm_offset_t)); if (--cur_eml->ref_count == 0) old_eml = cur_eml; /* discard old vector */ @@ -258,7 +260,7 @@ task_set_emulation_vector_internal(task, new_size = count_to_size(new_end - new_start); new_eml = (eml_dispatch_t) kalloc(new_size); - bzero((char *)new_eml, new_size); + memset(new_eml, 0, new_size); simple_lock_init(&new_eml->lock); new_eml->ref_count = 1; new_eml->disp_min = new_start; @@ -271,9 +273,9 @@ task_set_emulation_vector_internal(task, * We have the emulation vector. * Install the new emulation entries. */ - bcopy((char *)&emulation_vector[0], - (char *)&cur_eml->disp_vector[vector_start - cur_eml->disp_min], - emulation_vector_count * sizeof(vm_offset_t)); + memcpy(&cur_eml->disp_vector[vector_start - cur_eml->disp_min], + &emulation_vector[0], + emulation_vector_count * sizeof(vm_offset_t)); task_unlock(task); @@ -334,24 +336,6 @@ task_set_emulation_vector(task, vector_s } /* - * Compatibility entry. Vector is passed inline. - */ -kern_return_t -xxx_task_set_emulation_vector(task, vector_start, emulation_vector, - emulation_vector_count) - task_t task; - int vector_start; - emulation_vector_t emulation_vector; - unsigned int emulation_vector_count; -{ - return task_set_emulation_vector_internal( - task, - vector_start, - emulation_vector, - emulation_vector_count); -} - -/* * task_get_emulation_vector: [Server Entry] * * Get the list of emulated system calls for this task. @@ -417,9 +401,9 @@ task_get_emulation_vector(task, vector_s */ *vector_start = eml->disp_min; *emulation_vector_count = eml->disp_count; - bcopy((char *)eml->disp_vector, - (char *)addr, - vector_size); + memcpy((void *)addr, + eml->disp_vector, + vector_size); /* * Unlock the task and free any memory we did not need @@ -444,7 +428,7 @@ task_get_emulation_vector(task, vector_s */ size_left = size_used - vector_size; if (size_left > 0) - bzero((char *)addr + vector_size, size_left); + memset((char *)addr + vector_size, 0, size_left); /* * Make memory into copyin form - this unwires it. @@ -458,53 +442,6 @@ task_get_emulation_vector(task, vector_s } /* - * xxx_task_get_emulation: [Server Entry] - * get the list of emulated system calls for this task. - * Compatibility code: return list in-line. - */ -kern_return_t -xxx_task_get_emulation_vector(task, vector_start, emulation_vector, - emulation_vector_count) - task_t task; - int *vector_start; - emulation_vector_t emulation_vector; /* pointer to OUT array */ - unsigned int *emulation_vector_count; /*IN/OUT*/ -{ - register eml_dispatch_t eml; - - if (task == TASK_NULL) - return( EML_BAD_TASK ); - - task_lock(task); - - eml = task->eml_dispatch; - if (eml == EML_DISPATCH_NULL) { - task_unlock(task); - *vector_start = 0; - *emulation_vector_count = 0; - return( KERN_SUCCESS ); - } - - simple_lock(&eml->lock); - - if (*emulation_vector_count < eml->disp_count) { - simple_unlock(&eml->lock); - task_unlock(task); - return( EML_BAD_CNT ); - } - - *vector_start = eml->disp_min; - *emulation_vector_count = eml->disp_count; - bcopy((char *)eml->disp_vector, (char *)emulation_vector, - *emulation_vector_count * sizeof(vm_offset_t)); - simple_unlock(&eml->lock); - - task_unlock(task); - - return( KERN_SUCCESS ); -} - -/* * task_set_emulation: [Server Entry] * set up for user space emulation of syscalls within this task. */