]> git.saurik.com Git - apple/libc.git/blob - mach/slot_name.c
Libc-339.tar.gz
[apple/libc.git] / mach / slot_name.c
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * File: slot_name.c
27 * Author: Avadis Tevanian, Jr.
28 *
29 * Copyright (C) 1987, Avadis Tevanian, Jr.
30 *
31 * Convert machine slot values to human readable strings.
32 *
33 * HISTORY
34 * 26-Jan-88 Mary Thompson (mrt) at Carnegie Mellon
35 * added case for CUP_SUBTYPE_RT_APC
36 *
37 * 28-Feb-87 Avadis Tevanian (avie) at Carnegie-Mellon University
38 * Created.
39 *
40 */
41
42 #include <mach/mach.h>
43 #include <mach-o/arch.h>
44 #include <stddef.h>
45
46 /*
47 * Convert the specified cpu_type/cpu_subtype pair to their
48 * human readable form.
49 */
50 void slot_name(cpu_type, cpu_subtype, cpu_name, cpu_subname)
51 cpu_type_t cpu_type;
52 cpu_subtype_t cpu_subtype;
53 char **cpu_name, **cpu_subname;
54 {
55 register char *name = "Unknown CPU";
56 register char *subname = "";
57 const NXArchInfo *ai = NXGetArchInfoFromCpuType(cpu_type, cpu_subtype);
58 if (ai != NULL) {
59 name = (char *)ai->name;
60 subname = (char *)ai->description;
61 }
62 *cpu_name = name;
63 *cpu_subname = subname;
64 }
65
66 kern_return_t msg_rpc(void) {
67 return KERN_FAILURE;
68 }
69
70 kern_return_t msg_send(void) {
71 return KERN_FAILURE;
72 }
73
74 kern_return_t msg_receive(void) {
75 return KERN_FAILURE;
76 }
77
78 mach_port_t task_self_(void) {
79 return mach_task_self();
80 }
81
82 mach_port_t host_self(void) {
83 return mach_host_self();
84 }
85