]>
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 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1997 by Apple Computer, Inc., all rights reserved
24 * Copyright (c) 1993 NeXT Computer, Inc.
28 #include <sys/param.h>
29 #include <sys/systm.h>
30 #include <sys/ioctl.h>
35 #include <kern/thread.h>
36 #include <kern/task.h>
37 #include <vm/vm_map.h>
41 * copy a null terminated string from one point to another in
42 * the kernel address space.
43 * - no access checks are performed.
44 * - if the end of string isn't found before
45 * maxlen bytes are copied, return ENAMETOOLONG,
46 * indicating an incomplete copy.
47 * - otherwise, return 0, indicating success.
48 * the number of bytes copied is always returned in lencopied.
50 /* from ppc/fault_copy.c -Titan1T4 VERSION */
52 copystr(const void *vfrom
, void *vto
, size_t maxlen
, size_t *lencopied
)
59 for (l
= 0; l
< maxlen
; l
++)
60 if ((*to
++ = *from
++) == '\0') {
70 int copywithin(src
, dst
, count
)
79 get_bsduthreadarg(thread_t th
)
82 ut
= get_bsdthread_info(th
);
83 return((void *)(ut
->uu_arg
));
87 get_bsduthreadrval(thread_t th
)
90 ut
= get_bsdthread_info(th
);
91 return(&ut
->uu_rval
[0]);