]> git.saurik.com Git - apple/libc.git/blob - mach/slot_name.c
Libc-391.5.18.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 * 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
11 * file.
12 *
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.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /*
24 * File: slot_name.c
25 * Author: Avadis Tevanian, Jr.
26 *
27 * Copyright (C) 1987, Avadis Tevanian, Jr.
28 *
29 * Convert machine slot values to human readable strings.
30 *
31 * HISTORY
32 * 26-Jan-88 Mary Thompson (mrt) at Carnegie Mellon
33 * added case for CUP_SUBTYPE_RT_APC
34 *
35 * 28-Feb-87 Avadis Tevanian (avie) at Carnegie-Mellon University
36 * Created.
37 *
38 */
39
40 #include <mach/mach.h>
41 #include <mach-o/arch.h>
42 #include <stddef.h>
43
44 /*
45 * Convert the specified cpu_type/cpu_subtype pair to their
46 * human readable form.
47 */
48 void slot_name(cpu_type, cpu_subtype, cpu_name, cpu_subname)
49 cpu_type_t cpu_type;
50 cpu_subtype_t cpu_subtype;
51 char **cpu_name, **cpu_subname;
52 {
53 register char *name = "Unknown CPU";
54 register char *subname = "";
55 const NXArchInfo *ai = NXGetArchInfoFromCpuType(cpu_type, cpu_subtype);
56 if (ai != NULL) {
57 name = (char *)ai->name;
58 subname = (char *)ai->description;
59 }
60 *cpu_name = name;
61 *cpu_subname = subname;
62 }
63
64 kern_return_t msg_rpc(void) {
65 return KERN_FAILURE;
66 }
67
68 kern_return_t msg_send(void) {
69 return KERN_FAILURE;
70 }
71
72 kern_return_t msg_receive(void) {
73 return KERN_FAILURE;
74 }
75
76 mach_port_t task_self_(void) {
77 return mach_task_self();
78 }
79
80 mach_port_t host_self(void) {
81 return mach_host_self();
82 }
83