Get rid of the type field on zmessage
This commit is contained in:
parent
7bd6aa42b0
commit
685070d65e
13 changed files with 35 additions and 53 deletions
|
|
@ -140,8 +140,8 @@ void AhciDriver::DumpPorts() {
|
|||
void AhciDriver::InterruptLoop() {
|
||||
dbgln("Starting interrupt loop");
|
||||
while (true) {
|
||||
uint64_t type, bytes, caps;
|
||||
check(ZPortRecv(irq_port_cap_, 0, 0, 0, 0, &type, &bytes, &caps));
|
||||
uint64_t bytes, caps;
|
||||
check(ZPortRecv(irq_port_cap_, 0, 0, 0, 0, &bytes, &caps));
|
||||
for (uint64_t i = 0; i < 32; i++) {
|
||||
if (devices_[i] != nullptr && devices_[i]->IsInit() &&
|
||||
(ahci_hba_->interrupt_status & (1 << i))) {
|
||||
|
|
|
|||
|
|
@ -19,9 +19,13 @@ z_err_t DenaliServer::RunServer() {
|
|||
while (true) {
|
||||
uint64_t buff_size = kBuffSize;
|
||||
uint64_t cap_size = 0;
|
||||
uint64_t type = DENALI_INVALID;
|
||||
RET_ERR(ZChannelRecv(channel_cap_, buff_size, read_buffer_, 0, nullptr,
|
||||
&type, &buff_size, &cap_size));
|
||||
&buff_size, &cap_size));
|
||||
if (buff_size < sizeof(uint64_t)) {
|
||||
dbgln("Skipping invalid message");
|
||||
continue;
|
||||
}
|
||||
uint64_t type = *reinterpret_cast<uint64_t*>(read_buffer_);
|
||||
switch (type) {
|
||||
case Z_INVALID:
|
||||
dbgln(reinterpret_cast<char*>(read_buffer_));
|
||||
|
|
@ -55,6 +59,6 @@ void DenaliServer::HandleResponse(uint64_t lba, uint64_t size, uint64_t cap) {
|
|||
.lba = lba,
|
||||
.size = size,
|
||||
};
|
||||
check(ZChannelSend(channel_cap_, DENALI_READ, sizeof(resp),
|
||||
check(ZChannelSend(channel_cap_, sizeof(resp),
|
||||
reinterpret_cast<uint8_t*>(&resp), 1, &cap));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#define DENALI_READ 100
|
||||
|
||||
struct DenaliRead {
|
||||
uint64_t request_type = DENALI_READ;
|
||||
uint64_t device_id;
|
||||
|
||||
uint64_t lba;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue