MCPcopy Create free account
hub / github.com/Bareflank/hypervisor / debug_ring_write

Function debug_ring_write

kernel/src/debug_ring_write.hpp:45–77  ·  view source on GitHub ↗

<!-- description --> @brief Outputs a character to the serial port. <!-- inputs/outputs --> @param mut_ring the debug ring to output to @param c the character to output

Source from the content-addressed store, hash-verified

43 /// @param c the character to output
44 ///
45 constexpr void
46 debug_ring_write(loader::debug_ring_t &mut_ring, bsl::char_type const c) noexcept
47 {
48 bsl::uintmx mut_epos{mut_ring.epos};
49 bsl::uintmx mut_spos{mut_ring.spos};
50
51 *mut_ring.buf.at_if(mut_epos) = c;
52 ++mut_epos;
53
54 if (mut_epos >= mut_ring.buf.size()) {
55 mut_epos = {};
56 }
57 else {
58 bsl::touch();
59 }
60
61 if (mut_epos == mut_spos) {
62 ++mut_spos;
63
64 if (mut_spos >= mut_ring.buf.size()) {
65 mut_spos = {};
66 }
67 else {
68 bsl::touch();
69 }
70 }
71 else {
72 bsl::touch();
73 }
74
75 mut_ring.epos = mut_epos;
76 mut_ring.spos = mut_spos;
77 }
78
79 /// <!-- description -->
80 /// @brief Outputs a string to the serial port.

Callers 6

stdio_out_charFunction · 0.50
stdio_out_cstrFunction · 0.50
behavior.cppFile · 0.50
requirements.cppFile · 0.50
behavior.cppFile · 0.50
requirements.cppFile · 0.50

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected