STRUCT SYSMON(9)
π 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 multipleregmapcalls. 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β cachedDEVICE_TEMPhysteresis, in millicelsius. yes, milli. be precise bestie π‘οΈsysmon_unmask_workβ astruct delayed_workthat 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:lockcovers the threshold registers and cached state that spans multipleregmapcalls, whileirq_lockis 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
- 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