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 
   10 #include <sys/cdefs.h>
   11 __FBSDID("$FreeBSD$");
   12 
   13 #include <sys/param.h>
   14 #include <sys/systm.h>
   15 #include <sys/kernel.h>
   16 #include <sys/sysctl.h>
   17 
   18 #include <machine/cpufunc.h>
   19 #include <machine/md_var.h>
   20 #include <machine/ver.h>
   21 
   22 char machine[] = MACHINE;
   23 SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD,
   24     machine, 0, "Machine class");
   25 
   26 static char cpu_model[128];
   27 SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD,
   28     cpu_model, 0, "Machine model");
   29 
   30 int cpu_impl;
   31 
   32 void setPQL2(int *const size, int *const ways);
   33 
   34 void
   35 setPQL2(int *const size, int *const ways)
   36 {
   37 #ifdef SUN4V
   38 /* XXX hardcoding is lame */
   39         *size = 3*1024;
   40         *ways = 12;
   41 #endif
   42         return;
   43 }
   44 
   45 void
   46 cpu_identify(u_long vers, u_int freq, u_int id)
   47 {
   48         const char *manus;
   49         const char *impls;
   50 
   51         switch (VER_MANUF(vers)) {
   52         case 0x04:
   53                 manus = "HAL";
   54                 break;
   55         case 0x13:
   56         case 0x17:
   57         case 0x22:
   58         case 0x3e:
   59                 manus = "Sun Microsystems";
   60                 break;
   61         default:
   62                 manus = NULL;
   63                 break;
   64         }
   65         switch (VER_IMPL(vers)) {
   66         case CPU_IMPL_SPARC64:
   67                 impls = "SPARC64";
   68                 break;
   69         case CPU_IMPL_ULTRASPARCI:
   70                 impls = "UltraSparc-I";
   71                 break;
   72         case CPU_IMPL_ULTRASPARCII:
   73                 impls = "UltraSparc-II";
   74                 break;
   75         case CPU_IMPL_ULTRASPARCIIi:
   76                 impls = "UltraSparc-IIi";
   77                 break;
   78         case CPU_IMPL_ULTRASPARCIIe:
   79                 /* V9 Manual says `UltraSparc-e'.  I assume this is wrong. */
   80                 impls = "UltraSparc-IIe";
   81                 break;
   82         case CPU_IMPL_ULTRASPARCIII:
   83                 impls = "UltraSparc-III";
   84                 break;
   85         case CPU_IMPL_ULTRASPARCIIIp:
   86                 impls = "UltraSparc-III+";
   87                 break;
   88         case CPU_IMPL_ULTRASPARCIIIi:
   89                 impls = "UltraSparc-IIIi";
   90                 break;
   91         case CPU_IMPL_ULTRASPARCIV:
   92                 impls = "UltraSparc-IV";
   93                 break;
   94         case CPU_IMPL_ULTRASPARCIVp:
   95                 impls = "UltraSparc-IV+";
   96                 break;
   97         case CPU_IMPL_ULTRASPARCIIIip:
   98                 impls = "UltraSparc-IIIi+";
   99                 break;
  100         default:
  101                 impls = NULL;
  102                 break;
  103         }
  104         if (manus == NULL || impls == NULL) {
  105                 printf(
  106                     "CPU: unknown; please e-mail the following value together\n"
  107                     "     with the exact name of your processor to "
  108                     "<freebsd-sparc64@FreeBSD.org>.\n"
  109                     "     version register: <0x%lx>\n", vers);
  110                 return;
  111         }
  112 
  113         snprintf(cpu_model, sizeof(cpu_model), "%s %s", manus, impls);
  114         printf("cpu%d: %s %s Processor (%d.%02d MHz CPU)\n", id, manus, impls,
  115             (freq + 4999) / 1000000, ((freq + 4999) / 10000) % 100);
  116         if (bootverbose) {
  117                 printf("  mask=0x%lx maxtl=%ld maxwin=%ld\n", VER_MASK(vers),
  118                     VER_MAXTL(vers), VER_MAXWIN(vers));
  119         }
  120 }

Cache object: bc92ba4af740c5b9f84b3c0123d7e30d


[ 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.