Kernel: Make HardwareTimer::model() return StringView

This commit is contained in:
Andreas Kling 2021-08-05 20:50:00 +02:00
parent 32a150f2b4
commit f572d96539
Notes: sideshowbarker 2024-07-18 07:26:05 +09:00
5 changed files with 5 additions and 5 deletions

View File

@ -16,7 +16,7 @@ class APICTimer final : public HardwareTimer<GenericInterruptHandler> {
public:
static APICTimer* initialize(u8, HardwareTimerBase&);
virtual HardwareTimerType timer_type() const override { return HardwareTimerType::LocalAPICTimer; }
virtual const char* model() const override { return "LocalAPIC"; }
virtual StringView model() const override { return "LocalAPIC"sv; }
virtual size_t ticks_per_second() const override;
virtual bool is_periodic() const override { return m_timer_mode == APIC::TimerMode::Periodic; }

View File

@ -19,7 +19,7 @@ public:
static NonnullRefPtr<HPETComparator> create(u8 number, u8 irq, bool periodic_capable, bool is_64bit_capable);
virtual HardwareTimerType timer_type() const override { return HardwareTimerType::HighPrecisionEventTimer; }
virtual const char* model() const override { return "HPET"; }
virtual StringView model() const override { return "HPET"sv; }
u8 comparator_number() const { return m_comparator_number; }
bool is_enabled() const { return m_enabled; }

View File

@ -35,7 +35,7 @@ public:
// classes then should forward this to e.g. GenericInterruptHandler.
virtual void will_be_destroyed() = 0;
virtual const char* model() const = 0;
virtual StringView model() const = 0;
virtual HardwareTimerType timer_type() const = 0;
virtual Function<void(const RegisterState&)> set_callback(Function<void(const RegisterState&)>) = 0;

View File

@ -36,7 +36,7 @@ class PIT final : public HardwareTimer<IRQHandler> {
public:
static NonnullRefPtr<PIT> initialize(Function<void(const RegisterState&)>);
virtual HardwareTimerType timer_type() const override { return HardwareTimerType::i8253; }
virtual const char* model() const override { return "i8254"; }
virtual StringView model() const override { return "i8254"sv; }
virtual size_t ticks_per_second() const override;
virtual bool is_periodic() const override { return m_periodic; }

View File

@ -15,7 +15,7 @@ class RealTimeClock final : public HardwareTimer<IRQHandler> {
public:
static NonnullRefPtr<RealTimeClock> create(Function<void(const RegisterState&)> callback);
virtual HardwareTimerType timer_type() const override { return HardwareTimerType::RTC; }
virtual const char* model() const override { return "Real Time Clock"; }
virtual StringView model() const override { return "Real Time Clock"sv; }
virtual size_t ticks_per_second() const override;
virtual bool is_periodic() const override { return true; }