STRUCT SYSMON(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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

okay so bestie, welcome to the kernel API manual for struct sysmon β€” that's the driver data for Versal SysMon, no cap. it's a small struct but she's doing a LOT of work, and we're gonna go through every single field together. grab a boba, this is gonna be cute πŸ§‹βœ¨


✨ SYNOPSIS ✨

bestie. look at her. iconic honestly:

struct sysmon {
    struct regmap *regmap;
    struct mutex lock;
    spinlock_t irq_lock;
    unsigned int masked_temp;
    unsigned int temp_mask;
    int temp_hysteresis;
    struct delayed_work sysmon_unmask_work;
    unsigned int temp_oversampling;
    unsigned int supply_oversampling;
 };

okay literally framing this. anyway, let's meet the members πŸŽ€


🧚 Members 🧚

  • regmap β€” the register map for hardware access. she's the plug that gets us into the silicon, fr fr πŸ’…
  • lock β€” a mutex that protects read-modify-write sequences on threshold registers and cached state that spans multiple regmap calls. like, if you're touching more than one regmap call, you go through her first. no skipping the line πŸ”’
  • irq_lock β€” a spinlock protecting interrupt mask register updates. heads up: this is the MMIO path only. different lock, different lane πŸ›£οΈ
  • masked_temp β€” the currently masked temperature alarm bits. who's silenced rn 😭
  • temp_mask β€” the temperature interrupt configuration mask. the actual config, not the live state. iykyk 🎯
  • temp_hysteresis β€” cached DEVICE_TEMP hysteresis, in millicelsius. yes, milli. be precise bestie 🌑️
  • sysmon_unmask_work β€” a struct delayed_work that re-enables events after the alarm condition clears. she's the cleanup crew, showing up fashionably late but she DOES show up 🫢
  • temp_oversampling β€” the current temp oversampling ratio. more samples, more slay πŸ“
  • supply_oversampling β€” the current supply oversampling ratio. she's temp's bestie, they match 🌸

lowkey important: lock covers the threshold registers and cached state that spans multiple regmap calls, while irq_lock is strictly for interrupt mask register updates on the MMIO path only. don't mix them up, bestie πŸ’€

πŸ‘€ SEE ALSO πŸ‘€

  • Kernel file ./drivers/iio/adc/versal-sysmon.h β€” go read the source, it's giving main character energy πŸ“–πŸ‘‘

aaaand that's the whole vibe check, bestie πŸ’– this was struct sysmon from the Kernel API Manual, living in ./drivers/iio/adc, dated October 2026. periodt. go forth and read them registers responsibly βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from