The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sparc64/sparc64/identcpu.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Initial implementation:
    3  * Copyright (c) 2001 Robert Drehmel
    4  * All rights reserved.
    5  *
    6  * As long as the above copyright statement and this notice remain
    7  * unchanged, you can do what ever you want with this file.
    8  *
    9  * $FreeBSD: releng/6.0/sys/sparc64/sparc64/identcpu.c 139825 2005-01-07 02:29:27Z imp $
   10  */
   11 #include <sys/param.h>
   12 #include <sys/systm.h>
   13 #include <sys/kernel.h>
   14 #include <sys/sysctl.h>
   15 
   16 #include <machine/cpufunc.h>
   17 #include <machine/md_var.h>
   18 #include <machine/ver.h>
   19 
   20 char machine[] = "sparc64";
   21 SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD,
   22     machine, 0, "Machine class");
   23 
   24 static char cpu_model[128];
   25 SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD,
   26     cpu_model, 0, "Machine model");
   27 
   28 int cpu_impl;
   29 
   30 void
   31 cpu_identify(u_long vers, u_int freq, u_int id)
   32 {
   33         const char *manus;
   34         const char *impls;
   35 
   36         switch (VER_MANUF(vers)) {
   37         case 0x04:
   38                 manus = "HAL";
   39                 break;
   40         case 0x13:
   41         case 0x17:
   42         case 0x22:
   43         case 0x3e:
   44                 manus = "Sun Microsystems";
   45                 break;
   46         default:
   47                 manus = NULL;
   48                 break;
   49         }
   50         switch (VER_IMPL(vers)) {
   51         case CPU_IMPL_SPARC64:
   52                 impls = "SPARC64";
   53                 break;
   54         case CPU_IMPL_ULTRASPARCI:
   55                 impls = "UltraSparc-I";
   56                 break;
   57         case CPU_IMPL_ULTRASPARCII:
   58                 impls = "UltraSparc-II";
   59                 break;
   60         case CPU_IMPL_ULTRASPARCIIi:
   61                 impls = "UltraSparc-IIi";
   62                 break;
   63         case CPU_IMPL_ULTRASPARCIIe:
   64                 /* V9 Manual says `UltraSparc-e'.  I assume this is wrong. */
   65                 impls = "UltraSparc-IIe";
   66                 break;
   67         case CPU_IMPL_ULTRASPARCIII:
   68                 impls = "UltraSparc-III";
   69                 break;
   70         case CPU_IMPL_ULTRASPARCIIIp:
   71                 impls = "UltraSparc-III+";
   72                 break;
   73         case CPU_IMPL_ULTRASPARCIIIi:
   74                 impls = "UltraSparc-IIIi";
   75                 break;
   76         default:
   77                 impls = NULL;
   78                 break;
   79         }
   80         if (manus == NULL || impls == NULL) {
   81                 printf(
   82                     "CPU: unknown; please e-mail the following value together\n"
   83                     "     with the exact name of your processor to "
   84                     "<freebsd-sparc64@FreeBSD.org>.\n"
   85                     "     version register: <0x%lx>\n", vers);
   86                 return;
   87         }
   88 
   89         snprintf(cpu_model, sizeof(cpu_model), "%s %s", manus, impls);
   90         printf("cpu%d: %s %s Processor (%d.%02d MHz CPU)\n", id, manus, impls,
   91             (freq + 4999) / 1000000, ((freq + 4999) / 10000) % 100);
   92         if (bootverbose) {
   93                 printf("  mask=0x%lx maxtl=%ld maxwin=%ld\n", VER_MASK(vers),
   94                     VER_MAXTL(vers), VER_MAXWIN(vers));
   95         }
   96 }

Cache object: fd1ac6e0cc16ab4d8adb720a24381f37


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.