MCPcopy Create free account
hub / github.com/Bananymous/banan-os / append_command_queue

Method append_command_queue

kernel/kernel/Input/PS2/Controller.cpp:99–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 return 1;
98 ASSERT_NOT_REACHED();
99 }
100
101 bool PS2Controller::append_command_queue(PS2Device* device, uint8_t command, uint8_t response_size)
102 {
103 SpinLockGuard _(m_command_lock);
104 if (m_command_queue.size() + 1 >= m_command_queue.capacity())
105 {
106 dprintln("PS/2 command queue full");
107 return false;
108 }
109 m_command_queue.push(Command {
110 .state = Command::State::NotSent,
111 .device_index = get_device_index(device),
112 .out_data = { command, 0x00 },
113 .out_count = 1,
114 .in_count = response_size,
115 .send_index = 0
116 });
117 return true;
118 }
119

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
capacityMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected