]>
git.saurik.com Git - apple/xnu.git/blob - bsd/dev/ppc/stubs.c
2 * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 * Copyright (c) 1997 by Apple Computer, Inc., all rights reserved
25 * Copyright (c) 1993 NeXT Computer, Inc.
29 #include <sys/param.h>
30 #include <sys/systm.h>
31 #include <sys/ioctl.h>
36 #include <kern/thread.h>
37 #include <kern/task.h>
38 #include <vm/vm_map.h>
42 * copy a null terminated string from one point to another in
43 * the kernel address space.
44 * - no access checks are performed.
45 * - if the end of string isn't found before
46 * maxlen bytes are copied, return ENAMETOOLONG,
47 * indicating an incomplete copy.
48 * - otherwise, return 0, indicating success.
49 * the number of bytes copied is always returned in lencopied.
51 /* from ppc/fault_copy.c -Titan1T4 VERSION */
53 copystr(const void *vfrom
, void *vto
, size_t maxlen
, size_t *lencopied
)
60 for (l
= 0; l
< maxlen
; l
++)
61 if ((*to
++ = *from
++) == '\0') {
71 int copywithin(src
, dst
, count
)
80 get_bsduthreadarg(thread_t th
)
83 ut
= get_bsdthread_info(th
);
84 return((void *)(ut
->uu_arg
));
88 get_bsduthreadrval(thread_t th
)
91 ut
= get_bsdthread_info(th
);
92 return(&ut
->uu_rval
[0]);