|
Public Types |
enum | Vendor {
Vendor_unknown = 0,
Vendor_intel,
Vendor_amd,
Vendor_cyrix,
Vendor_via,
Vendor_umc,
Vendor_nexgen,
Vendor_rise,
Vendor_transmeta,
Vendor_sis,
Vensor_nsc
} |
enum | CacheTLB {
Cache_unknown = 0,
Cache_l1_data,
Cache_l1_inst,
Cache_l1_trace,
Cache_l2,
Cache_l3,
Tlb_data_4k,
Tlb_inst_4k,
Tlb_data_4M,
Tlb_inst_4M,
Tlb_data_4k_4M,
Tlb_inst_4k_4M
} |
enum | { Ldt_entry_size = 8
} |
enum | Local_features { Lf_rdpmc = 0x00000001,
Lf_rdpmc32 = 0x00000002
} |
enum | Lbr { LBR_UNINITIALIZED = 0,
LBR_NONE,
LBR_P6,
LBR_P4
} |
Static Public Member Functions |
static void | init () |
static Unsigned64 | time_us () |
static int | can_wrmsr () |
static char const * | vendor_str () |
static char const * | model_str () |
static Cpu::Vendor const | vendor () |
static unsigned int const | family () |
static unsigned int const | model () |
static unsigned int const | stepping () |
static unsigned int const | type () |
static Unsigned64 | frequency () |
static unsigned int const | brand () |
static unsigned int const | features () |
static unsigned int const | ext_features () |
static unsigned int const | ext_amd_features () |
static unsigned int const | local_features () |
static bool | have_superpages () |
static bool | have_tsc () |
static bool | have_sysenter () |
static FIASCO_INIT void | identify () |
| Identify the CPU features.
|
static Unsigned32 | muldiv (Unsigned32 val, Unsigned32 mul, Unsigned32 div) |
static Unsigned64 | ns_to_tsc (Unsigned64 ns) |
static Unsigned64 | tsc_to_ns (Unsigned64 tsc) |
static Unsigned64 | tsc_to_us (Unsigned64 tsc) |
static void | tsc_to_s_and_ns (Unsigned64 tsc, Unsigned32 *s, Unsigned32 *ns) |
static void | busy_wait_ns (Unsigned64 ns) |
static Unsigned64 | rdtsc (void) |
static Unsigned32 | get_scaler_tsc_to_ns () |
static Unsigned32 | get_scaler_tsc_to_us () |
static Unsigned32 | get_scaler_ns_to_tsc () |
static Unsigned32 | get_flags () |
static void | set_flags (Unsigned32 efl) |
static Unsigned32 | get_es () |
static Unsigned32 | get_ss () |
static Unsigned32 | get_fs () |
static Unsigned32 | get_gs () |
static void | set_ds (Unsigned32 val) |
static void | set_es (Unsigned32 val) |
static void | set_fs (Unsigned32 val) |
static void | set_gs (Unsigned32 val) |
static void | show_cache_tlb_info (const char *indent) |
static void | memcpy_bytes (void *dst, void const *src, size_t n) |
static void | memcpy_mwords (void *dst, void const *src, size_t n) |
static void | memcpy_bytes_fs (void *dst, void const *src, size_t n) |
static void | memcpy_mwords_fs (void *dst, void const *src, size_t n) |
static void | set_cr0 (Unsigned32 val) |
static void | set_pdbr (Address addr) |
static void | set_cr4 (Unsigned32 val) |
static void | set_ldt (Unsigned16 val) |
static void | set_cs () |
static void | set_ss (Unsigned32 val) |
static void | set_tr (Unsigned16 val) |
static Mword | get_cr0 () |
static Address | get_pdbr () |
static Mword | get_cr4 () |
static Unsigned16 | get_ldt () |
static Unsigned16 | get_tr () |
static Unsigned64 | rdmsr (Unsigned32 reg) |
static Unsigned64 | rdpmc (Unsigned32 idx, Unsigned32) |
static void | wrmsr (Unsigned32 low, Unsigned32 high, Unsigned32 reg) |
static void | wrmsr (Unsigned64 msr, Unsigned32 reg) |
static void | enable_rdpmc () |
static Cpu::Lbr const | lbr_type () |
static void | enable_lbr (void) |
static void | disable_lbr (void) |
static FIASCO_INIT void | init_sysenter (Address kernel_esp) |
static void | set_sysenter (void(*func)(void)) |
static void | get_sysenter (void(**func)(void)) |
static FIASCO_INIT void | init_gdt (Address gdt_mem, Address user_max) |
static FIASCO_INIT void | init_tss (Address tss_mem, size_t tss_size) |
static FIASCO_INIT void | init_tss_dbf (Address tss_dbf_mem, Address kdir) |
static void | set_gdt () |
static void | set_tss () |
static Gdt * | get_gdt () |
static Tss * | get_tss () |
static void | enable_ldt (Address addr, int size) |
Private Types |
typedef void( | Sysenter )(void) |
Static Private Member Functions |
static Lbr lbr | asm ("CPU_LBR") |
static Sysenter *current_sysenter | asm ("CURRENT_SYSENTER") |
static Gdt *gdt | asm ("CPU_GDT") |
static Tss *tss | asm ("CPU_TSS") |
static FIASCO_INIT void | cpuid (Unsigned32 const mode, Unsigned32 *const eax, Unsigned32 *const ebx, Unsigned32 *const ecx, Unsigned32 *const edx) |
static FIASCO_INIT void | cache_tlb_intel () |
static FIASCO_INIT void | cache_tlb_l1 () |
static FIASCO_INIT void | cache_tlb_l2 (Cpu::Vendor vendor) |
static FIASCO_INIT void | set_model_str (Cpu::Vendor const vendor, unsigned const version, Unsigned16 const l2_cache) |
static FIASCO_INIT void | calibrate_tsc () |
Private Attributes |
Cpu::Vendor_table | packed |
Static Private Attributes |
static Unsigned64 | _frequency |
static Unsigned32 | _version |
static Unsigned32 | _brand |
static Unsigned32 | _features |
static Unsigned32 | _ext_features |
static Unsigned32 | _ext_amd_features |
static Unsigned32 | _local_features |
static Unsigned16 | _inst_tlb_4k_entries |
static Unsigned16 | _data_tlb_4k_entries |
static Unsigned16 | _inst_tlb_4m_entries |
static Unsigned16 | _data_tlb_4m_entries |
static Unsigned16 | _inst_tlb_4k_4m_entries |
static Unsigned16 | _data_tlb_4k_4m_entries |
static Unsigned16 | _l2_inst_tlb_4k_entries |
static Unsigned16 | _l2_data_tlb_4k_entries |
static Unsigned16 | _l2_inst_tlb_4m_entries |
static Unsigned16 | _l2_data_tlb_4m_entries |
static Unsigned16 | _l1_trace_cache_size |
static Unsigned16 | _l1_trace_cache_asso |
static Unsigned16 | _l1_data_cache_size |
static Unsigned16 | _l1_data_cache_asso |
static Unsigned16 | _l1_data_cache_line_size |
static Unsigned16 | _l1_inst_cache_size |
static Unsigned16 | _l1_inst_cache_asso |
static Unsigned16 | _l1_inst_cache_line_size |
static Unsigned16 | _l2_cache_size |
static Unsigned16 | _l2_cache_asso |
static Unsigned16 | _l2_cache_line_size |
static Vendor | _vendor |
static char | _model_str [32] |
static Vendor_table const | intel_table [] |
static Vendor_table const | amd_table [] |
static Vendor_table const | cyrix_table [] |
static Vendor_table const | via_table [] |
static Vendor_table const | umc_table [] |
static Vendor_table const | nexgen_table [] |
static Vendor_table const | rise_table [] |
static Vendor_table const | transmeta_table [] |
static Vendor_table const | sis_table [] |
static Vendor_table const | nsc_table [] |
static Cache_table const | intel_cache_table [] |
static char *const | vendor_ident [] |
static Vendor_table const
*const | vendor_table [] |
static Unsigned32 | scaler_tsc_to_ns |
static Unsigned32 | scaler_tsc_to_us |
static Unsigned32 | scaler_ns_to_tsc |
static Tss * | tss_dbf |
Classes |
struct | Cache_table |
struct | Vendor_table |
|
Initial value:
{
{ 0xFF0, 0x440, 0xFFFF, "Gx86 (Media GX)" },
{ 0xFF0, 0x490, 0xFFFF, "5x86" },
{ 0xFF0, 0x520, 0xFFFF, "6x86 (M1)" },
{ 0xFF0, 0x540, 0xFFFF, "GXm" },
{ 0xFF0, 0x600, 0xFFFF, "6x86MX (M2)" },
{ 0x0, 0x0, 0xFFFF, "" }
}
|
|
Initial value:
{
{ 0xFF0, 0x540, 0xFFFF, "IDT Winchip C6" },
{ 0xFF0, 0x580, 0xFFFF, "IDT Winchip 2A/B" },
{ 0xFF0, 0x590, 0xFFFF, "IDT Winchip 3" },
{ 0xFF0, 0x650, 0xFFFF, "Via Jalapeno (Joshua)" },
{ 0xFF0, 0x660, 0xFFFF, "Via C5A (Samuel)" },
{ 0xFF8, 0x670, 0xFFFF, "Via C5B (Samuel 2)" },
{ 0xFF8, 0x678, 0xFFFF, "Via C5C (Ezra)" },
{ 0xFF0, 0x680, 0xFFFF, "Via C5N (Ezra-T)" },
{ 0xFF0, 0x690, 0xFFFF, "Via C5P (Nehemiah)" },
{ 0xFF0, 0x6a0, 0xFFFF, "Via C5J (Esther)" },
{ 0x0, 0x0, 0xFFFF, "" }
}
|