2023-06-15 16:20:29 -07:00
|
|
|
#pragma once
|
|
|
|
|
2023-06-21 18:38:11 -07:00
|
|
|
#include <glacier/status/error.h>
|
2023-06-21 23:14:42 -07:00
|
|
|
#include <mammoth/endpoint_server.h>
|
2023-06-21 18:38:11 -07:00
|
|
|
|
2023-06-15 16:20:29 -07:00
|
|
|
#include "ahci/ahci_driver.h"
|
|
|
|
#include "denali/denali.h"
|
|
|
|
|
|
|
|
class DenaliServer {
|
|
|
|
public:
|
2023-06-26 11:38:17 -07:00
|
|
|
DenaliServer(glcr::UniquePtr<EndpointServer> server, AhciDriver& driver);
|
2023-06-15 16:20:29 -07:00
|
|
|
|
2023-06-21 18:38:11 -07:00
|
|
|
glcr::ErrorCode RunServer();
|
2023-06-15 16:20:29 -07:00
|
|
|
|
2023-06-21 23:14:42 -07:00
|
|
|
void HandleResponse(z_cap_t reply_port, uint64_t lba, uint64_t size,
|
|
|
|
z_cap_t cap);
|
2023-06-16 01:31:23 -07:00
|
|
|
|
2023-06-15 16:20:29 -07:00
|
|
|
private:
|
|
|
|
static const uint64_t kBuffSize = 1024;
|
2023-06-26 11:38:17 -07:00
|
|
|
glcr::UniquePtr<EndpointServer> server_;
|
2023-06-15 16:20:29 -07:00
|
|
|
uint8_t read_buffer_[kBuffSize];
|
|
|
|
|
|
|
|
AhciDriver& driver_;
|
|
|
|
|
2023-06-21 23:14:42 -07:00
|
|
|
glcr::ErrorCode HandleRead(const DenaliRead& read, z_cap_t reply_port);
|
2023-06-15 16:20:29 -07:00
|
|
|
};
|