Ejemplo n.º 1
0
/**
  Stalls the CPU for at least the given number of nanoseconds.

  Stalls the CPU for the number of nanoseconds specified by NanoSeconds.

  @param  NanoSeconds The minimum number of nanoseconds to delay.

  @return NanoSeconds

**/
UINTN
EFIAPI
NanoSecondDelay (
  IN      UINTN                     NanoSeconds
  )
{
  InternalAcpiDelay (
    (UINT32)DivU64x32 (
              MultU64x32 (
                NanoSeconds,
                ACPI_TIMER_FREQUENCY
                ),
              1000000000u
              )
    );
  return NanoSeconds;
}
Ejemplo n.º 2
0
/**
  Stalls the CPU for at least the given number of microseconds.

  Stalls the CPU for the number of microseconds specified by MicroSeconds.

  @param  MicroSeconds  The minimum number of microseconds to delay.

  @return MicroSeconds

**/
UINTN
   EFIAPI
   MicroSecondDelay (
   IN      UINTN                     MicroSeconds
   )
{
   InternalAcpiDelay (
      (UINT32)DivU64x32 (
      MultU64x32 (
      MicroSeconds,
      V_ACPI_TMR_FREQUENCY
      ),
      1000000u
      )
      );
   return MicroSeconds;
}
Ejemplo n.º 3
0
/**
  Stalls the CPU for at least the given number of nanoseconds.

  Stalls the CPU for the number of nanoseconds specified by NanoSeconds.

  @param  NanoSeconds The minimum number of nanoseconds to delay.

  @return NanoSeconds

**/
UINTN
EFIAPI
NanoSecondDelay (
  IN      UINTN                     NanoSeconds
  )
{
  if (InternalGetApciDescrptionTable() == NULL) {
    return NanoSeconds;
  }
  
  InternalAcpiDelay (
    (UINT32)DivU64x32 (
              MultU64x32 (
                NanoSeconds,
                3579545
                ),
              1000000000u
              )
    );
  return NanoSeconds;
}