Skip to content

Commit

Permalink
Pass physical addresses to the block driver PD instead of offsets
Browse files Browse the repository at this point in the history
Requires adding the blk_data_driver_paddr to the system file.

Signed-off-by: juliab <midnight@trainwit.ch>
  • Loading branch information
midnightveil authored and Ivan-Velickovic committed Jul 23, 2024
1 parent af8817c commit 2d8dbee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions blk/components/virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@

#define REQBK_SIZE BLK_QUEUE_SIZE_DRIV

#define BLK_DRIV_TO_PADDR(addr) ((addr) - blk_data_driver + blk_data_driver_paddr)

blk_storage_info_t *blk_config_driver;
blk_req_queue_t *blk_req_queue_driver;
blk_resp_queue_t *blk_resp_queue_driver;
uintptr_t blk_data_driver;
uintptr_t blk_data_driver_paddr;

blk_storage_info_t *blk_config;
blk_req_queue_t *blk_req_queue;
Expand Down Expand Up @@ -134,7 +137,7 @@ static void request_mbr()
assert(!err);
reqbk[mbr_req_id] = mbr_req_data;

err = blk_enqueue_req(&drv_h, READ_BLOCKS, mbr_addr - blk_data_driver, 0, 1, mbr_req_id);
err = blk_enqueue_req(&drv_h, READ_BLOCKS, BLK_DRIV_TO_PADDR(mbr_addr), 0, 1, mbr_req_id);
assert(!err);

microkit_notify_delayed(DRIVER_CH);
Expand Down Expand Up @@ -337,7 +340,7 @@ static void handle_client(int cli_id)
assert(!err);
reqbk[drv_req_id] = cli_data;

err = blk_enqueue_req(&drv_h, cli_code, drv_addr - blk_data_driver, drv_block_number, cli_count, drv_req_id);
err = blk_enqueue_req(&drv_h, cli_code, BLK_DRIV_TO_PADDR(drv_addr), drv_block_number, cli_count, drv_req_id);
assert(!err);
}
}
Expand Down

0 comments on commit 2d8dbee

Please sign in to comment.