STRUCT HWSPINLOCK_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to the Kernel API Manual entry for struct hwspinlock_ops πŸ’– this is the platform-specific hwspinlock handler moment, and yes it’s giving low-level but make it cute ✨

🌸 NAME 🌸

struct hwspinlock_ops β€” platform-specific hwspinlock handlers πŸŽ€

✨ SYNOPSIS ✨

okay so the struct is literally this, no cap:

       struct hwspinlock_ops {
           int (*trylock)(struct hwspinlock *lock);
           void (*unlock)(struct hwspinlock *lock);
           int (*bust)(struct hwspinlock *lock, unsigned int id);
           void (*relax)(struct hwspinlock *lock);
        };

πŸ’« Members πŸ’«

  • trylock β€” makes a single attempt to take the lock. returns 0 on failure and true on success. may _not_ sleep. no napping on the job 😴🚫
  • unlock β€” releases the lock. always succeed. may _not_ sleep. periodt πŸ’…
  • bust β€” optional, platform-specific bust handler, called by hwspinlock core to bust a specific lock. πŸ’₯
  • relax β€” optional, platform-specific relax handler, called by hwspinlock core while spinning on a lock, between two successive invocations of trylock. may _not_ sleep. πŸ§˜β€β™€οΈβœ¨

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/hwspinlock/hwspinlock_internal.h β€” struct hwspinlock(9), struct hwspinlock_device(9). go read them, iykyk πŸ‘‘


mwah πŸ’‹ this page is from ./drivers/hwspinlock in the Kernel API Manual, dated October 2026. go off, bestie πŸ’–

πŸ“¦ where this page comes from