mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 20:57:35 +00:00
Kernel: Stop using NonnullLockRefPtrVector
This commit is contained in:
parent
21db2b7b90
commit
7369d0ab5f
41 changed files with 90 additions and 109 deletions
|
@ -187,21 +187,21 @@ void HPET::update_periodic_comparator_value()
|
|||
if (m_main_counter_64bits)
|
||||
regs.main_counter_value.high = 0;
|
||||
for (auto& comparator : m_comparators) {
|
||||
auto& timer = regs.timers[comparator.comparator_number()];
|
||||
if (!comparator.is_enabled())
|
||||
auto& timer = regs.timers[comparator->comparator_number()];
|
||||
if (!comparator->is_enabled())
|
||||
continue;
|
||||
if (comparator.is_periodic()) {
|
||||
if (comparator->is_periodic()) {
|
||||
// Note that this means we're restarting all periodic timers. There is no
|
||||
// way to resume periodic timers properly because we reset the main counter
|
||||
// and we can only write the period into the comparator value...
|
||||
timer.capabilities = timer.capabilities | (u32)HPETFlags::TimerConfiguration::ValueSet;
|
||||
u64 value = ns_to_raw_counter_ticks(1000000000ull / comparator.ticks_per_second());
|
||||
u64 value = ns_to_raw_counter_ticks(1000000000ull / comparator->ticks_per_second());
|
||||
dbgln_if(HPET_DEBUG, "HPET: Update periodic comparator {} comparator value to {} main value was: {}",
|
||||
comparator.comparator_number(),
|
||||
comparator->comparator_number(),
|
||||
value,
|
||||
previous_main_value);
|
||||
timer.comparator_value.low = (u32)value;
|
||||
if (comparator.is_64bit_capable()) {
|
||||
if (comparator->is_64bit_capable()) {
|
||||
timer.capabilities = timer.capabilities | (u32)HPETFlags::TimerConfiguration::ValueSet;
|
||||
timer.comparator_value.high = (u32)(value >> 32);
|
||||
}
|
||||
|
@ -210,12 +210,12 @@ void HPET::update_periodic_comparator_value()
|
|||
u64 current_value = (u64)timer.comparator_value.low | ((u64)timer.comparator_value.high << 32);
|
||||
u64 value = current_value - previous_main_value;
|
||||
dbgln_if(HPET_DEBUG, "HPET: Update non-periodic comparator {} comparator value from {} to {} main value was: {}",
|
||||
comparator.comparator_number(),
|
||||
comparator->comparator_number(),
|
||||
current_value,
|
||||
value,
|
||||
previous_main_value);
|
||||
timer.comparator_value.low = (u32)value;
|
||||
if (comparator.is_64bit_capable())
|
||||
if (comparator->is_64bit_capable())
|
||||
timer.comparator_value.high = (u32)(value >> 32);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <Kernel/Library/NonnullLockRefPtrVector.h>
|
||||
#include <Kernel/Memory/Region.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
|
||||
|
@ -29,7 +28,7 @@ public:
|
|||
u64 raw_counter_ticks_to_ns(u64) const;
|
||||
u64 ns_to_raw_counter_ticks(u64) const;
|
||||
|
||||
NonnullLockRefPtrVector<HPETComparator> const& comparators() const { return m_comparators; }
|
||||
Vector<NonnullLockRefPtr<HPETComparator>> const& comparators() const { return m_comparators; }
|
||||
void disable(HPETComparator const&);
|
||||
void enable(HPETComparator const&);
|
||||
|
||||
|
@ -76,6 +75,6 @@ private:
|
|||
bool m_main_counter_64bits : 1;
|
||||
bool legacy_replacement_route_capable : 1;
|
||||
|
||||
NonnullLockRefPtrVector<HPETComparator> m_comparators;
|
||||
Vector<NonnullLockRefPtr<HPETComparator>> m_comparators;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue