nbcon_state_try_cmpxchg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… nbcon_state_try_cmpxchg β€” the Kernel API Manual, bestie edition πŸŽ€

okay so picture this: we're deep in the Kernel API Manual and today's main character is nbcon_state_try_cmpxchg(9). she's a helper function, and she's here to do the atomic_try_cmpxchg() thing but for console state. that's it, that's the vibe. ✨


✨ NAME ✨

nbcon_state_try_cmpxchg β€” literally just a helper function for atomic_try_cmpxchg() on console state. so demure. so mindful. 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

bool nbcon_state_try_cmpxchg (struct console *con , struct nbcon_state
*cur , struct nbcon_state *new );

yes she returns a bool, yes she takes three pointers, no we're not scared. πŸ‘‘


πŸ’– ARGUMENTS πŸ’–

  • con β€” the console we're updating. the one getting the glow-up. 🫢
  • cur β€” the old/expected state. like, what we think is going on rn. πŸ‘€
  • new β€” the new state. the upgrade. the after photo. πŸ’…

πŸŽ€ RETURN πŸŽ€

  • True on success β€” we ate, we slayed, no notes. πŸ”₯
  • False on fail β€” and heads up bestie, cur gets updated. so like, don't ignore her, she's telling you something. 😭

🌈 SEE ALSO 🌈

okay this list is long and honestly iconic of her. she runs with the whole Kernel file ./kernel/printk/nbcon.c crew:

nbcon_state_set(9), nbcon_state_read(9), nbcon_seq_read(9), nbcon_seq_force(9), nbcon_seq_try_update(9), nbcon_context_try_acquire_direct(9), nbcon_context_try_acquire_requested(9), nbcon_context_try_acquire_handover(9), nbcon_context_try_acquire_hostile(9), nbcon_context_try_acquire(9), nbcon_context_release(9), nbcon_context_can_proceed(9), nbcon_can_proceed(9), __nbcon_context_update_unsafe(9), nbcon_enter_unsafe(9), nbcon_exit_unsafe(9), nbcon_reacquire_nobuf(9), nbcon_emit_next_record(9), nbcon_kthread_should_wakeup(9), nbcon_kthread_func(9), nbcon_irq_work(9), nbcon_kthreads_wake(9), nbcon_kthread_create(9), nbcon_get_cpu_emergency_nesting(9), nbcon_get_default_prio(9), nbcon_allow_unsafe_takeover(9), nbcon_legacy_emit_next_record(9), __nbcon_atomic_flush_pending_con(9), nbcon_atomic_flush_pending_con(9), __nbcon_atomic_flush_pending(9), nbcon_atomic_flush_pending(9), nbcon_atomic_flush_unsafe(9), nbcon_cpu_emergency_enter(9), nbcon_cpu_emergency_exit(9), nbcon_alloc(9), nbcon_free(9), nbcon_device_try_acquire(9), nbcon_device_release(9), nbcon_kdb_try_acquire(9), nbcon_kdb_release(9), nbcon_write_context_is_braille(9), nbcon_braille_try_acquire(9), nbcon_braille_release(9)

like I said. the whole friend group. no cap. πŸ’œ


and that's the page, bestie 🧚 β€” brought to you from ./kernel/printk, dated October 2026, signed off in true nbcon_state_try_cmpxchg(9) fashion. go forth and compare-and-swap responsibly πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from