~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/power/cpupower/debug/i386/intel_gsic.c

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 // SPDX-License-Identifier: GPL-2.0-only
  2 /*
  3  *  (C) 2003  Bruno Ducrot
  4  *  (C) 2004  Dominik Brodowski <linux@dominikbrodowski.de>
  5  *
  6  * Based on code found in
  7  * linux/include/asm-i386/ist.h and linux/arch/i386/kernel/setup.c
  8  * and originally developed by Andy Grover <andrew.grover@intel.com>
  9  */
 10 
 11 #include <stdio.h>
 12 #include <string.h>
 13 #include <lrmi.h>
 14 
 15 int main (void)
 16 {
 17         struct LRMI_regs        r;
 18         int                     retval;
 19 
 20         if (!LRMI_init())
 21                 return 0;
 22 
 23         memset(&r, 0, sizeof(r));
 24 
 25         r.eax = 0x0000E980;
 26         r.edx = 0x47534943;
 27 
 28         retval = LRMI_int(0x15, &r);
 29 
 30         if (!retval) {
 31                 printf("Failed!\n");
 32                 return 0;
 33         }
 34         if (r.eax == 0x47534943) {
 35                 printf("BIOS supports GSIC call:\n");
 36                 printf("\tsignature: %c%c%c%c\n",
 37                        (r.eax >> 24) & 0xff,
 38                        (r.eax >> 16) & 0xff,
 39                        (r.eax >> 8) & 0xff,
 40                        (r.eax) & 0xff);
 41                 printf("\tcommand port = 0x%.4x\n",
 42                        r.ebx & 0xffff);
 43                 printf("\tcommand =      0x%.4x\n",
 44                        (r.ebx >> 16) & 0xffff);
 45                 printf("\tevent port =   0x%.8x\n", r.ecx);
 46                 printf("\tflags =        0x%.8x\n", r.edx);
 47                 if (((r.ebx >> 16) & 0xffff) != 0x82) {
 48                         printf("non-default command value. If speedstep-smi "
 49                                "doesn't work out of the box,\nyou may want to "
 50                                "try out the default value by passing "
 51                                "smi_cmd=0x82 to the module\n ON YOUR OWN "
 52                                "RISK.\n");
 53                 }
 54                 if ((r.ebx & 0xffff) != 0xb2) {
 55                         printf("non-default command port. If speedstep-smi "
 56                                "doesn't work out of the box,\nyou may want to "
 57                                "try out the default value by passing "
 58                                "smi_port=0x82 to the module\n ON YOUR OWN "
 59                                "RISK.\n");
 60                 }
 61         } else {
 62                 printf("BIOS DOES NOT support GSIC call.  Dumping registers anyway:\n");
 63                 printf("eax = 0x%.8x\n", r.eax);
 64                 printf("ebx = 0x%.8x\n", r.ebx);
 65                 printf("ecx = 0x%.8x\n", r.ecx);
 66                 printf("edx = 0x%.8x\n", r.edx);
 67                 printf("Note also that some BIOS do not support the initial "
 68                        "GSIC call, but the newer\nspeedstep-smi driver may "
 69                        "work.\nFor this, you need to pass some arguments to "
 70                        "the speedstep-smi driver:\n");
 71                 printf("\tsmi_cmd=0x?? smi_port=0x?? smi_sig=1\n");
 72                 printf("\nUnfortunately, you have to know what exactly are "
 73                        "smi_cmd and smi_port, and this\nis system "
 74                        "dependent.\n");
 75         }
 76         return 1;
 77 }
 78 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php