X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/de355530ae67247cbd0da700edb3a2a1dae884c2..13fec9890cf095cc781fdf7b8917cb03bf32dd4c:/bsd/dev/ppc/stubs.c diff --git a/bsd/dev/ppc/stubs.c b/bsd/dev/ppc/stubs.c index 630a1b0b6..3f0df507d 100644 --- a/bsd/dev/ppc/stubs.c +++ b/bsd/dev/ppc/stubs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -27,50 +27,16 @@ #include #include -#include #include #include #include #include #include #include -#include #include #include -/* - * copy a null terminated string from the kernel address space into - * the user address space. - * - if the user is denied write access, return EFAULT. - * - if the end of string isn't found before - * maxlen bytes are copied, return ENAMETOOLONG, - * indicating an incomplete copy. - * - otherwise, return 0, indicating success. - * the number of bytes copied is always returned in lencopied. - */ -int -copyoutstr(from, to, maxlen, lencopied) - void * from, * to; - size_t maxlen, *lencopied; -{ - int slen,len,error=0; - - /* XXX Must optimize this */ - - slen = strlen(from) + 1; - if (slen > maxlen) - error = ENAMETOOLONG; - - len = min(maxlen,slen); - if (copyout(from, to, len)) - error = EFAULT; - *lencopied = len; - - return error; -} - - /* * copy a null terminated string from one point to another in * the kernel address space. @@ -83,13 +49,10 @@ copyoutstr(from, to, maxlen, lencopied) */ /* from ppc/fault_copy.c -Titan1T4 VERSION */ int -copystr(vfrom, vto, maxlen, lencopied) - register void * vfrom, *vto; - size_t maxlen, *lencopied; +copystr(const void *vfrom, void *vto, size_t maxlen, size_t *lencopied) { register unsigned l; - int error; -caddr_t from, to; + caddr_t from, to; from = vfrom; to = vto; @@ -112,44 +75,6 @@ size_t count; return 0; } -struct unix_syscallargs { - int flavor; - int r3; - int arg1, arg2,arg3,arg4,arg5,arg6,arg7; -}; - -set_bsduthreadargs(thread_t th, void * pcb, struct unix_syscallargs * sarg) -{ -struct uthread * ut; - - ut = get_bsdthread_info(th); - ut->uu_ar0 = (int *)pcb; - - if (sarg->flavor) - { - ut->uu_arg[0] = sarg->arg1; - ut->uu_arg[1] = sarg->arg2; - ut->uu_arg[2] = sarg->arg3; - ut->uu_arg[3] = sarg->arg4; - ut->uu_arg[4] = sarg->arg5; - ut->uu_arg[5] = sarg->arg6; - ut->uu_arg[7] = sarg->arg7; - } - else - { - ut->uu_arg[0] = sarg->r3; - ut->uu_arg[1] = sarg->arg1; - ut->uu_arg[2] = sarg->arg2; - ut->uu_arg[3] = sarg->arg3; - ut->uu_arg[4] = sarg->arg4; - ut->uu_arg[5] = sarg->arg5; - ut->uu_arg[6] = sarg->arg6; - ut->uu_arg[7] = sarg->arg7; - } - - return(1); -} - void * get_bsduthreadarg(thread_t th) { @@ -159,7 +84,7 @@ struct uthread *ut; } int * -get_bsduthreadrval(thread_act_t th) +get_bsduthreadrval(thread_t th) { struct uthread *ut; ut = get_bsdthread_info(th);