STRUCT VIORTC_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ struct viortc_dev(9) β€” the kernel API manual, bestie edition πŸ’œ

okay so this is the man page for struct viortc_dev(9) from the Kernel API Manual, and it's literally the glow-up era of virtio_rtc device data. it's giving "i hold everything together" energy. let's get into it 🫢


✨ NAME ✨

struct viortc_dev β€” the virtio_rtc device data struct. that's it, that's the vibe. it's the main character that carries all the device info πŸ’…


🌸 SYNOPSIS 🌸

struct viortc_dev {
    struct virtio_device *vdev;
    struct viortc_class *viortc_class;
    struct viortc_vq vqs[VIORTC_MAX_NR_QUEUES];
    struct viortc_ptp_clock **clocks_to_unregister;
    void **alarmq_bufs;
    unsigned int num_alarmq_bufs;
    u16 num_clocks;
 };

like, look at those fields. no notes. iconic. πŸ‘‘


πŸŽ€ Members πŸŽ€

  • vdev β€” the virtio device itself. the whole reason we're here, fr fr.
  • viortc_class β€” the RTC class wrapper for the UTC-like clock. it's NULL if that clock isn't available, so don't come for it if it's not there 😭
  • vqs β€” the virtqueues. plural. we contain multitudes πŸ¦‹
  • clocks_to_unregister β€” clock references that are only used during device removal. like, this is a very specific-purpose field, bestie, and there's a real reason for that: for any other use there would be a race between device creation and setting the pointers here. so yeah, don't try it, that's a πŸ’€ situation, ngl.
  • alarmq_bufs β€” the alarmq buffers list. the name is basically the whole job πŸ“
  • num_alarmq_bufs β€” # of alarmq buffers. keeping count. someone has to 🧚
  • num_clocks β€” # of virtio_rtc clocks. also keeping count. also someone has to ✨

πŸ”₯ SEE ALSO πŸ”₯

the kernel file ./drivers/virtio/virtio_rtc_driver.c, plus literally the whole extended universe of structs and functions β€” go study, it's a whole syllabus 😀


and that's the page, bestie πŸ’– this one came out of ./drivers/virtio and it's dated October 2026 β€” bookmark it, screenshot it, send it to the group chat, whatever you gotta do 🌈⭐

πŸ“¦ where this page comes from