Lines Matching full:console
6 #include <linux/console.h>
11 * Printk console printing implementation for consoles which does not depend
14 * The state of the console is maintained in the "nbcon_state" atomic
17 * The console is locked when:
20 * console. Only higher priority contexts are allowed to take over the
21 * lock. A value of 0 (NBCON_PRIO_NONE) means the console is not locked.
23 * - The 'cpu' field denotes on which CPU the console is locked. It is used
35 * - The 'unsafe' field allows to take over the console in a safe way in the
37 * shared resources or when the console device is manipulated. It can be
38 * cleared, for example, after emitting one character when the console
42 * console in an unsafe state. The console will stay in the unsafe state
47 * 1) Direct acquire when the console is not owned or is owned by a lower
51 * when the current owner has lower priority and the console is in an
59 * console.
66 * console state.
68 * b) Gives up console ownership by clearing the 'prio' field.
71 * console is an unsafe state. It is used only in panic() by the final
80 * All operations on @console::nbcon_state are atomic cmpxchg based to
91 * - Whether to spin-wait if there is already an owner and the console is
107 * nbcon_state_set - Helper function to set the console state
108 * @con: Console to update
111 * Only to be used when the console is not yet or no longer visible in the
114 static inline void nbcon_state_set(struct console *con, struct nbcon_state *new) in nbcon_state_set()
120 * nbcon_state_read - Helper function to read the console state
121 * @con: Console to read
124 static inline void nbcon_state_read(struct console *con, struct nbcon_state *state) in nbcon_state_read()
130 * nbcon_state_try_cmpxchg() - Helper function for atomic_try_cmpxchg() on console state
131 * @con: Console to update
137 static inline bool nbcon_state_try_cmpxchg(struct console *con, struct nbcon_state *cur, in nbcon_state_try_cmpxchg()
162 * Having a 32bit representation in the console is sufficient. in __nbcon_seq_to_seq()
163 * If a console ever gets more than 2^31 records behind in __nbcon_seq_to_seq()
177 * nbcon_seq_read - Read the current console sequence
178 * @con: Console to read the sequence of
182 u64 nbcon_seq_read(struct console *con) in nbcon_seq_read()
190 * nbcon_seq_force - Force console sequence to a specific value
191 * @con: Console to work on
197 void nbcon_seq_force(struct console *con, u64 seq) in nbcon_seq_force()
214 * nbcon_seq_try_update - Try to update the console sequence number
222 * console. In the later case, it will stop printing anyway.
227 struct console *con = ctxt->console; in nbcon_seq_try_update()
240 * @cur: The current console state
242 * Acquire the console when it is released. Also acquire the console when
243 * the current owner has a lower priority and the console is in a safe state.
255 * -EBUSY: The current owner has a lower priority but the console
263 struct console *con = ctxt->console; in nbcon_context_try_acquire_direct()
277 * The console should never be safe for a direct acquire in nbcon_context_try_acquire_direct()
319 * @cur: The current console state
322 * It is called when the console is in an unsafe state. The current
323 * owner will release the console on exit from the unsafe region.
325 * Return: 0 on success and @cur is updated to the new console state.
333 * -EBUSY: The console is still locked. The caller should
343 struct console *con = ctxt->console; in nbcon_context_try_acquire_requested()
382 /* Handover success. This context now owns the console. */ in nbcon_context_try_acquire_requested()
389 * @cur: The current console state
392 * than the current owner and the console is in an unsafe state.
396 * the request. Then it waits until the current owner releases the console,
400 * region and releases the console. It does not touch the "req_prio" field
401 * so that the console stays reserved for the waiter.
410 * console or the handover request.
414 * willing to wait (zero timeout). Or the console does
426 struct console *con = ctxt->console; in nbcon_context_try_acquire_handover()
443 * Console stays unsafe after an unsafe takeover until re-initialized. in nbcon_context_try_acquire_handover()
455 * the console directly when the current state has been modified. in nbcon_context_try_acquire_handover()
464 /* Wait until there is no owner and then acquire the console. */ in nbcon_context_try_acquire_handover()
489 * the console or the handover request. in nbcon_context_try_acquire_handover()
519 * @cur: The current console state
521 * Acquire the console even in the unsafe state.
532 struct console *con = ctxt->console; in nbcon_context_try_acquire_hostile()
564 * nbcon_context_try_acquire - Try to acquire nbcon console
567 * Return: True if the console was acquired. False otherwise.
570 * caller should check the current console state to see if it is
572 * the console is not in an unsafe state.
578 struct console *con = ctxt->console; in nbcon_context_try_acquire()
608 ctxt->seq = nbcon_seq_read(ctxt->console); in nbcon_context_try_acquire()
634 * nbcon_context_release - Release the console
640 struct console *con = ctxt->console; in nbcon_context_release()
667 * @cur: The current console state
669 * Return: True if this context still owns the console. False if
677 * It can be called inside an unsafe section when the console is just
686 * the console and is no longer allowed to go forward. In this case it must
694 /* Make sure this context still owns the console. */ in nbcon_context_can_proceed()
698 /* The console owner can proceed if there is no waiter. */ in nbcon_context_can_proceed()
703 * A console owner within an unsafe region is always allowed to in nbcon_context_can_proceed()
724 * outermost callsite must make the final decision whether console in nbcon_context_can_proceed()
728 * The calling context no longer owns the console so go back all the in nbcon_context_can_proceed()
739 * Return: True if this context still owns the console. False if
746 * It can be called inside an unsafe section when the console is just
754 * the console and is no longer allowed to go forward. In this case it must
761 struct console *con = ctxt->console; in nbcon_can_proceed()
779 * owns the console. Otherwise false if ownership was handed
782 * This function allows console owners to modify the unsafe status of the
783 * console.
786 * the console and is no longer allowed to go forward. In this case it must
794 struct console *con = ctxt->console; in __nbcon_context_update_unsafe()
824 * Return: True if this context still owns the console. False if
828 * the console and is no longer allowed to go forward. In this case it must
844 * Return: True if this context still owns the console. False if
848 * the console and is no longer allowed to go forward. In this case it must
864 * Return: True if this context still owns the console. False if
868 * the console and is no longer allowed to go forward. In this case it must
871 * wants to do more it must reacquire the console first.
880 struct console *con = ctxt->console; in nbcon_emit_next_record()
941 * dropped count for the console. in nbcon_emit_next_record()
965 * nbcon_alloc - Allocate buffers needed by the nbcon console
966 * @con: Console to allocate buffers for
968 * Return: True on success. False otherwise and the console cannot
972 * be performed earlier in the console registration process.
974 bool nbcon_alloc(struct console *con) in nbcon_alloc()
978 * Boot console printing is synchronized with legacy console in nbcon_alloc()
995 * nbcon_init - Initialize the nbcon console specific data
996 * @con: Console to initialize
1003 void nbcon_init(struct console *con) in nbcon_init()
1015 * nbcon_free - Free and cleanup the nbcon console specific data
1016 * @con: Console to free/cleanup nbcon data
1018 void nbcon_free(struct console *con) in nbcon_free()