Back to home page

Quest Cross Reference

 
 

    


Warning, cross-references for /kernel/include/util/cpuid.h need to be fixed.

0001 /*                    The Quest Operating System
0002  *  Copyright (C) 2005-2010  Richard West, Boston University
0003  *
0004  *  This program is free software: you can redistribute it and/or modify
0005  *  it under the terms of the GNU General Public License as published by
0006  *  the Free Software Foundation, either version 3 of the License, or
0007  *  (at your option) any later version.
0008  *
0009  *  This program is distributed in the hope that it will be useful,
0010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012  *  GNU General Public License for more details.
0013  *
0014  *  You should have received a copy of the GNU General Public License
0015  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
0016  */
0017 
0018 #ifndef CPUID_H_
0019 #define CPUID_H_
0020 #include "types.h"
0021 
0022 #define I386_CPUID_BRAND_STRING_LENGTH 49
0023 #define I386_CPUID_BRAND_STRING_INPUT1 0x80000000
0024 #define I386_CPUID_BRAND_STRING_INPUT2 0x80000002
0025 #define I386_CPUID_BRAND_STRING_INPUT3 0x80000003
0026 #define I386_CPUID_BRAND_STRING_INPUT4 0x80000004
0027 
0028 
0029 static inline void
0030 cpuid (in_eax, in_ecx, out_eax, out_ebx, out_ecx, out_edx)
0031      uint32 in_eax, in_ecx;
0032      uint32 *out_eax, *out_ebx, *out_ecx, *out_edx;
0033 {
0034   uint32 eax, ebx, ecx, edx;
0035   asm volatile ("cpuid":"=a" (eax), "=b" (ebx), "=c" (ecx), "=d" (edx)
0036                 :"a" (in_eax), "c" (in_ecx));
0037   if (out_eax)
0038     *out_eax = eax;
0039   if (out_ebx)
0040     *out_ebx = ebx;
0041   if (out_ecx)
0042     *out_ecx = ecx;
0043   if (out_edx)
0044     *out_edx = edx;
0045 }
0046 
0047 void cpuid_get_brand_string (char *, uint32);
0048 uint32 cpuid_display_family_model (void);
0049 bool cpuid_vmx_support (void);
0050 bool cpuid_tsc_support (void);
0051 bool cpuid_rdtscp_support (void);
0052 bool cpuid_invariant_tsc_support (void);
0053 bool cpuid_msr_support (void);
0054 
0055 #endif
0056 
0057 /*
0058  * Local Variables:
0059  * indent-tabs-mode: nil
0060  * mode: C
0061  * c-file-style: "gnu"
0062  * c-basic-offset: 2
0063  * End:
0064  */
0065 
0066 /* vi: set et sw=2 sts=2: */