mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Change "GetMillisecondsSinceClassCreation" to "GetNanosecondsSinceClassCreation"
This commit is contained in:
parent
fcbb298077
commit
8471126696
@ -55,10 +55,13 @@ namespace Time
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t HighPrecisionEventTimer::GetMillisecondsSinceClassCreation()
|
uint64_t HighPrecisionEventTimer::GetNanosecondsSinceClassCreation()
|
||||||
{
|
{
|
||||||
#if defined(a86)
|
#if defined(a86)
|
||||||
return (this->GetCounter() - this->ClassCreationTime) / (this->clk / this->ConvertUnit(Units::Milliseconds));
|
uint64_t Subtraction = this->GetCounter() - this->ClassCreationTime;
|
||||||
|
if (Subtraction <= 0 || this->clk <= 0)
|
||||||
|
return 0;
|
||||||
|
return Subtraction / (this->clk / ConvertUnit(Units::Nanoseconds));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ namespace Time
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t TimeStampCounter::GetMillisecondsSinceClassCreation()
|
uint64_t TimeStampCounter::GetNanosecondsSinceClassCreation()
|
||||||
{
|
{
|
||||||
#if defined(a86)
|
#if defined(a86)
|
||||||
return (this->GetCounter() - this->ClassCreationTime) / this->clk;
|
return (this->GetCounter() - this->ClassCreationTime) / this->clk;
|
||||||
|
@ -118,7 +118,7 @@ namespace Time
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t time::GetMillisecondsSinceClassCreation()
|
uint64_t time::GetNanosecondsSinceClassCreation()
|
||||||
{
|
{
|
||||||
switch (ActiveTimer)
|
switch (ActiveTimer)
|
||||||
{
|
{
|
||||||
@ -132,7 +132,7 @@ namespace Time
|
|||||||
fixme("PIT sleep not implemented");
|
fixme("PIT sleep not implemented");
|
||||||
return false;
|
return false;
|
||||||
case HPET:
|
case HPET:
|
||||||
return this->hpet->GetMillisecondsSinceClassCreation();
|
return this->hpet->GetNanosecondsSinceClassCreation();
|
||||||
case ACPI:
|
case ACPI:
|
||||||
fixme("ACPI sleep not implemented");
|
fixme("ACPI sleep not implemented");
|
||||||
return false;
|
return false;
|
||||||
@ -140,7 +140,7 @@ namespace Time
|
|||||||
fixme("APIC sleep not implemented");
|
fixme("APIC sleep not implemented");
|
||||||
return false;
|
return false;
|
||||||
case TSC:
|
case TSC:
|
||||||
return this->tsc->GetMillisecondsSinceClassCreation();
|
return this->tsc->GetNanosecondsSinceClassCreation();
|
||||||
default:
|
default:
|
||||||
error("Unknown timer");
|
error("Unknown timer");
|
||||||
return false;
|
return false;
|
||||||
|
@ -103,7 +103,7 @@ namespace Time
|
|||||||
bool Sleep(uint64_t Duration, Units Unit);
|
bool Sleep(uint64_t Duration, Units Unit);
|
||||||
uint64_t GetCounter();
|
uint64_t GetCounter();
|
||||||
uint64_t CalculateTarget(uint64_t Target, Units Unit);
|
uint64_t CalculateTarget(uint64_t Target, Units Unit);
|
||||||
uint64_t GetMillisecondsSinceClassCreation();
|
uint64_t GetNanosecondsSinceClassCreation();
|
||||||
|
|
||||||
HighPrecisionEventTimer(void *hpet);
|
HighPrecisionEventTimer(void *hpet);
|
||||||
~HighPrecisionEventTimer();
|
~HighPrecisionEventTimer();
|
||||||
@ -151,7 +151,7 @@ namespace Time
|
|||||||
bool Sleep(uint64_t Duration, Units Unit);
|
bool Sleep(uint64_t Duration, Units Unit);
|
||||||
uint64_t GetCounter();
|
uint64_t GetCounter();
|
||||||
uint64_t CalculateTarget(uint64_t Target, Units Unit);
|
uint64_t CalculateTarget(uint64_t Target, Units Unit);
|
||||||
uint64_t GetMillisecondsSinceClassCreation();
|
uint64_t GetNanosecondsSinceClassCreation();
|
||||||
|
|
||||||
TimeStampCounter();
|
TimeStampCounter();
|
||||||
~TimeStampCounter();
|
~TimeStampCounter();
|
||||||
@ -192,7 +192,7 @@ namespace Time
|
|||||||
bool Sleep(uint64_t Duration, Units Unit);
|
bool Sleep(uint64_t Duration, Units Unit);
|
||||||
uint64_t GetCounter();
|
uint64_t GetCounter();
|
||||||
uint64_t CalculateTarget(uint64_t Target, Units Unit);
|
uint64_t CalculateTarget(uint64_t Target, Units Unit);
|
||||||
uint64_t GetMillisecondsSinceClassCreation();
|
uint64_t GetNanosecondsSinceClassCreation();
|
||||||
void FindTimers(void *acpi);
|
void FindTimers(void *acpi);
|
||||||
time();
|
time();
|
||||||
~time();
|
~time();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user