STRUCT VIORTC_CLASS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct viortc_class(9) πŸ’–

okay so bestie, welcome to the struct viortc_class(9) page from the Kernel API Manual β€” yes, the whole manual, and yes, this one lil struct is the main character today πŸ‘‘


✨ NAME ✨

struct viortc_class β€” the RTC class wrapper, and honestly it's giving "small but crucial" πŸŽ€


🌸 SYNOPSIS 🌸

struct viortc_class {
    struct viortc_dev *viortc;
    struct rtc_device *rtc;
    u16 vio_clk_id;
    bool stopped;
 };

no cap, that's the whole thing. four fields. four. and every single one of them is doing something πŸ’…


πŸ¦‹ Members πŸ¦‹

  • viortc β€” the virtio_rtc device data, aka where the virtio side of the story lives 🫢
  • rtc β€” the RTC device. yep, the actual real-time-clock device, iconic ⭐
  • vio_clk_id β€” the virtio_rtc clock id. it's a u16, she's little, she's fierce πŸŽ€
  • stopped β€” whether RTC ops are disallowed or not πŸ‘€ heads up bestie: access to this is protected by rtc_lock, so like, don't just vibe in there without the lock, fr fr πŸ”₯
ngl, take the locking note seriously β€” the manpage says access is protected by rtc_lock, and we are not out here freelancing 😭

🌈 SEE ALSO 🌈

kernel file ./drivers/virtio/virtio_rtc_class.c β€” go read the source, iykyk πŸ’œ

and the whole friend group, all (9): viortc_class_get_locked(9), viortc_class_read_time(9), viortc_class_read_alarm(9), viortc_class_set_alarm(9), viortc_class_alarm_irq_enable(9), viortc_class_alarm(9), viortc_class_stop(9), viortc_class_register(9), viortc_class_init(9) πŸ¦‹


that's the page!! sending u off with a lil sign-off from ./drivers/virtio, dated October 2026 β€” go be a main character in the virtio_rtc code bestie, slay πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from