MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / Read

Method Read

Kernel/src/arch/x86_64/mouse.cpp:127–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 }
126
127 ssize_t Read(size_t offset, size_t size, uint8_t *buffer){
128 if(size < sizeof(MousePacket)) return 0;
129
130 if(packetCount <= 0) return 0; // No packets
131
132 MousePacket* pkt = (MousePacket*)buffer;
133 *pkt = packetQueue[packetQueueStart];
134
135 packetQueueStart++;
136
137 if(packetQueueStart >= PACKET_QUEUE_SIZE) {
138 packetQueueStart = 0;
139 }
140
141 packetCount--;
142
143 return sizeof(MousePacket);
144 }
145 };
146
147 MouseDevice mouseDev("mouse0");

Callers 1

SysEndpointDequeueFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected