1 Star 0 Fork 0

zhengjun186110/SGX-hardware

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
cpuid.h 1.71 KB
Copy Edit Raw Blame History
///////////////////////////////////////////////////////////////////////////////
// cpuid.h - 2023
//
/// This module contains multi-platform, non-privlidged code that utilizes the
/// CPUID instruction to discover & report SGX capabilities.
///
/// @file cpuid.h
/// @author Lars Luhr <mail@ayeks.de>
/// @author Mark Nelson <marknels@hawaii.edu>
///////////////////////////////////////////////////////////////////////////////
#pragma once
#include <inttypes.h> // For PRIx64 uint64_t PRIx32 uint32_t
/// Call `CPUID`, passing `eax`, `ebx`, `ecx` and `eax` in & out
void native_cpuid32( uint32_t* eax
,uint32_t* ebx
,uint32_t* ecx
,uint32_t* edx );
// Print the register set:
// eax: 80000008 ebx: 00000000 ecx: 00000000 edx: 00000000
void print_registers32( uint32_t eax
,uint32_t ebx
,uint32_t ecx
,uint32_t edx );
/// Does this CPU support the CPUID instruction?
///
/// gcc supports intrisics to detect certain CPU features:
/// https://gcc.gnu.org/onlinedocs/gcc-13.2.0/gcc/x86-Built-in-Functions.html
/// ... however, as of GCC 13.2, the detection does not support SGX, so
/// we'll do it old school.
///
extern void doesCPUIDwork( void );
// If this is a genuine Intel CPU, then print that fact.
// If not, tell the user what it is and exit.
//
// If it is a genuine Intel CPU, make sure it's capapble of examining SGX
// features.
void isIntelCPU( void );
// Print the CPU Brand String. This will look like this:
// CPU: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
void printCPUBrandString( void );
void supportsSGXInstructions( void );
void enumerateEPCsections( void );
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zhengjun186110/SGX-hardware.git
git@gitee.com:zhengjun186110/SGX-hardware.git
zhengjun186110
SGX-hardware
SGX-hardware
master

Search

0d507c66 1850385 C8b1a773 1850385