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