viortc_read_cross(9)
π viortc_read_cross β like, the manual page for it (Kernel API Manual, bestie)
okay so welcome to viortc_read_cross(9), a page from the Kernel API Manual β¨ and honestly? it's a little guy. a tiny wrapper. but it's an important tiny wrapper, so let's get into it π«Ά
πΈ NAME πΈ
viortc_read_cross β the VIRTIO_RTC_REQ_READ_CROSS wrapper. that's it, that's the whole vibe. it wraps the request. it's giving middleman but make it iconic π
β¨ SYNOPSIS β¨
int viortc_read_cross (struct viortc_dev *viortc , u16 vio_clk_id , u8
hw_counter , u64 *reading , u64 *cycles );
like yes she takes five arguments and returns an int, no cap. the line breaks are a little chaotic but we respect her π
π¦ ARGUMENTS π¦
so here's who's who in the group chat:
viortcβ the device data. this is the main character, the device itself πvio_clk_idβ thevirtio_rtcclock id (typeu16). which clock are we talking about, bestie? this tells you π₯hw_counterβ thevirtio_rtcHW counter type (typeu8). specifying the hardware counter flavor πreadingβ the clock reading, measured in[ns]. it's au64 *, so yes, pointer, so yes, she writes into it π«cyclesβ the HW counter cycles during the clock reading. also au64 *. also gets written into. both of them, lowkey, get filled in π
π§ CONTEXT π§
Process context. that's the whole section. process context, periodt. so like, don't be calling this from some weird atomic place, iykyk π
β RETURN β
Zero on success π β and a negative error code otherwise π. classic. no surprises, no drama, we love a predictable return value π
π₯ SEE ALSO π₯
okay this list is LONG and honestly it ate. buckle up bestie, we're going through the whole friend group:
the kernel file ./drivers/virtio/virtio_rtc_driver.c plus:
struct viortc_vq(9)struct viortc_dev(9)struct viortc_msg(9)viortc_class_from_dev(9)viortc_alarms_supported(9)viortc_feed_vq(9)viortc_msg_init(9)viortc_msg_release(9)viortc_do_cb(9)viortc_requestq_hdlr(9)viortc_cb_requestq(9)viortc_alarmq_hdlr(9)viortc_cb_alarmq(9)viortc_get_resp_errno(9)viortc_msg_xfer(9)VIORTC_DECLARE_MSG_HDL_ONSTACK(9)VIORTC_MSG(9)VIORTC_MSG_INIT(9)VIORTC_MSG_WRITE(9)VIORTC_MSG_READ(9)viortc_read(9)viortc_cfg(9)viortc_clock_cap(9)viortc_cross_cap(9)viortc_read_alarm(9)viortc_set_alarm(9)viortc_set_alarm_enabled(9)viortc_init_rtc_class_clock(9)viortc_init_ptp_clock(9)viortc_init_clock(9)viortc_clocks_deinit(9)viortc_clocks_init(9)viortc_populate_vq(9)viortc_alloc_vq_bufs(9)viortc_init_vqs(9)viortc_probe(9)viortc_remove(9)
see? told you. the whole squad π«Ά
ngl if you're here it's probably because something with VIRTIO_RTC_REQ_READ_CROSS is doing bits and you need to know what the wrapper promises. it promises zero or negative. that's the contract. slay β¨
and that's the page!! brought to you by the source ./drivers/virtio, dated October 2026, and known to all her friends as viortc_read_cross(9) π mwah, go read some virtio code bestie π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms