[PATCH] briq_panel: read() and write() get __user pointers, damnit
[linux-2.6/verdex.git] / arch / mips / arc / identify.c
blob3ba7c47f9f23b1b9c4da4efcd31937ee0fcb39a7
1 /*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
6 * identify.c: identify machine by looking up system identifier
8 * Copyright (C) 1998 Thomas Bogendoerfer
10 * This code is based on arch/mips/sgi/kernel/system.c, which is
12 * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
14 #include <linux/init.h>
15 #include <linux/kernel.h>
16 #include <linux/types.h>
17 #include <linux/string.h>
19 #include <asm/sgialib.h>
20 #include <asm/bootinfo.h>
22 struct smatch {
23 char *arcname;
24 char *liname;
25 int group;
26 int type;
27 int flags;
30 static struct smatch mach_table[] = {
31 { "SGI-IP22",
32 "SGI Indy",
33 MACH_GROUP_SGI,
34 MACH_SGI_IP22,
35 PROM_FLAG_ARCS
36 }, { "SGI-IP27",
37 "SGI Origin",
38 MACH_GROUP_SGI,
39 MACH_SGI_IP27,
40 PROM_FLAG_ARCS
41 }, { "SGI-IP28",
42 "SGI IP28",
43 MACH_GROUP_SGI,
44 MACH_SGI_IP28,
45 PROM_FLAG_ARCS
46 }, { "SGI-IP30",
47 "SGI Octane",
48 MACH_GROUP_SGI,
49 MACH_SGI_IP30,
50 PROM_FLAG_ARCS
51 }, { "SGI-IP32",
52 "SGI O2",
53 MACH_GROUP_SGI,
54 MACH_SGI_IP32,
55 PROM_FLAG_ARCS
56 }, { "Microsoft-Jazz",
57 "Jazz MIPS_Magnum_4000",
58 MACH_GROUP_JAZZ,
59 MACH_MIPS_MAGNUM_4000,
61 }, { "PICA-61",
62 "Jazz Acer_PICA_61",
63 MACH_GROUP_JAZZ,
64 MACH_ACER_PICA_61,
66 }, { "RM200PCI",
67 "SNI RM200_PCI",
68 MACH_GROUP_SNI_RM,
69 MACH_SNI_RM200_PCI,
70 PROM_FLAG_DONT_FREE_TEMP
74 int prom_flags;
76 static struct smatch * __init string_to_mach(const char *s)
78 int i;
80 for (i = 0; i < (sizeof(mach_table) / sizeof (mach_table[0])); i++) {
81 if (!strcmp(s, mach_table[i].arcname))
82 return &mach_table[i];
85 panic("Yeee, could not determine architecture type <%s>", s);
88 char *system_type;
90 const char *get_system_type(void)
92 return system_type;
95 void __init prom_identify_arch(void)
97 pcomponent *p;
98 struct smatch *mach;
99 const char *iname;
102 * The root component tells us what machine architecture we have here.
104 p = ArcGetChild(PROM_NULL_COMPONENT);
105 if (p == NULL) {
106 #ifdef CONFIG_SGI_IP27
107 /* IP27 PROM misbehaves, seems to not implement ARC
108 GetChild(). So we just assume it's an IP27. */
109 iname = "SGI-IP27";
110 #else
111 iname = "Unknown";
112 #endif
113 } else
114 iname = (char *) (long) p->iname;
116 printk("ARCH: %s\n", iname);
117 mach = string_to_mach(iname);
118 system_type = mach->liname;
120 mips_machgroup = mach->group;
121 mips_machtype = mach->type;
122 prom_flags = mach->flags;