Example #1
0
/**
 * effects: Clone IDT into CPU Struct
 */
static NTSTATUS _HvmSetupIdt (
    PCPU Cpu
)
{
    UCHAR i;

    if (!Cpu || !Cpu->IdtArea)
        return STATUS_INVALID_PARAMETER;

    memcpy ((PVOID)Cpu->IdtArea, (PVOID) GetIdtBase(), GetIdtLimit());

    // just use the system IDT?
    //for (i = 0; i < 255; i++)
    //{
    //    CmSetIdtEntry(
    //        Cpu->IdtArea, 
    //        BP_IDT_LIMIT, 
    //        0x0d,    // #GP
    //        BP_GDT64_CODE, 
    //        InGeneralProtection, 
    //        0, 
    //        LA_PRESENT | LA_DPL_0 | LA_INTGATE64);
    //}

    CmReloadIdtr((PVOID)Cpu->IdtArea, GetIdtLimit());

    return STATUS_SUCCESS;
}
Example #2
0
static ZVMSTATUS HvmSetupIdt (
  PCPU Cpu
)
{
  //uint8_t i;

  if (!Cpu || !Cpu->IdtArea)
    return ZVM_INVALID_PARAMETER;

  memcpy (Cpu->IdtArea, (void *) GetIdtBase (),GetIdtLimit());

  CmReloadIdtr (Cpu->IdtArea, GetIdtLimit());

  return ZVMSUCCESS;
}