CPUID Instruction
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@936
This commit is contained in:
parent
df814b12ce
commit
2639d29db8
5 changed files with 30 additions and 4 deletions
|
@ -96,6 +96,9 @@ bool Interrupt(Bitu num);
|
|||
bool CPU_IRET(bool use32);
|
||||
bool CPU_SetSegGeneral(SegNames seg,Bitu value);
|
||||
|
||||
void CPU_CPUID(void);
|
||||
|
||||
|
||||
//Flag Handling
|
||||
Bitu get_CF(void);
|
||||
Bitu get_AF(void);
|
||||
|
|
|
@ -388,6 +388,9 @@ l_M_Ed:
|
|||
case D_AAS:
|
||||
AAS();
|
||||
goto nextopcode;
|
||||
case D_CPUID:
|
||||
CPU_CPUID();
|
||||
goto nextopcode;
|
||||
default:
|
||||
LOG(LOG_CPU|LOG_ERROR,"LOAD:Unhandled code %d opcode %X",inst.code.load,inst.entry);
|
||||
break;
|
||||
|
|
|
@ -294,7 +294,7 @@ static OpCode OpCodeTable[1024]={
|
|||
|
||||
/* 0x1a0 - 0x1a7 */
|
||||
{L_SEG ,0 ,S_PUSHw ,fs },{L_POPw ,0 ,S_SEGI ,fs },
|
||||
{0 ,0 ,0 ,0 },{L_MODRM ,O_BTw ,0 ,0 },
|
||||
{D_CPUID ,0 ,0 ,0 },{L_MODRM ,O_BTw ,0 ,0 },
|
||||
{L_MODRM ,O_DSHLw ,S_Ew,M_EwGwIb },{L_MODRM ,O_DSHLw ,S_Ew ,M_EwGwCL },
|
||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
||||
/* 0x1a8 - 0x1af */
|
||||
|
@ -651,7 +651,7 @@ static OpCode OpCodeTable[1024]={
|
|||
|
||||
/* 0x3a0 - 0x3a7 */
|
||||
{L_SEG ,0 ,S_PUSHd ,fs },{L_POPd ,0 ,S_SEGI ,fs },
|
||||
{0 ,0 ,0 ,0 },{L_MODRM ,O_BTd ,0 ,0 },
|
||||
{D_CPUID ,0 ,0 ,0 },{L_MODRM ,O_BTd ,0 ,0 },
|
||||
{L_MODRM ,O_DSHLd ,S_Ed,M_EdGdIb },{L_MODRM ,O_DSHLd ,S_Ed ,M_EdGdCL },
|
||||
{0 ,0 ,0 ,0 },{0 ,0 ,0 ,0 },
|
||||
/* 0x3a8 - 0x3af */
|
||||
|
|
|
@ -42,6 +42,7 @@ enum {
|
|||
|
||||
D_RETFw,D_RETFd,
|
||||
D_RETFwIw,D_RETFdIw,
|
||||
D_CPUID,
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -569,11 +569,30 @@ bool CPU_SetSegGeneral(SegNames seg,Bitu value) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void CPU_CPUID(void) {
|
||||
switch (reg_eax) {
|
||||
case 0: /* Vendor ID String and maximum level? */
|
||||
reg_eax=0;
|
||||
reg_ebx=('G'<< 24) || ('e' << 16) || ('n' << 8) || 'u';
|
||||
reg_edx=('i'<< 24) || ('n' << 16) || ('e' << 8) || 'T';
|
||||
reg_ecx=('n'<< 24) || ('t' << 16) || ('e' << 8) || 'l';
|
||||
break;
|
||||
case 1: /* get processor type/family/model/stepping and feature flags */
|
||||
reg_eax=0x402; /* intel 486 sx? */
|
||||
reg_ebx=0; /* Not Supported */
|
||||
reg_ecx=0; /* No features */
|
||||
reg_edx=0; /* Nothing either */
|
||||
break;
|
||||
default:
|
||||
LOG(LOG_CPU|LOG_ERROR,"Unhandled CPUID Function %x",reg_eax);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CPU_Real_16_Slow_Start(void);
|
||||
|
||||
void CPU_Core_Full_Start(void);
|
||||
|
||||
|
||||
void SetCPU16bit()
|
||||
{
|
||||
cpu.state=0;
|
||||
|
|
Loading…
Add table
Reference in a new issue