nbcon_state_try_cmpxchg(9)
π 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 π
Trueon success β we ate, we slayed, no notes. π₯Falseon fail β and heads up bestie,curgets 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
- 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