mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 09:06:32 +00:00
new: 增加block_device和gendisk抽象
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <driver/disk/block_device.h>
|
||||
#include <common/blk_types.h>
|
||||
#include <driver/pci/pci.h>
|
||||
#include <mm/mm.h>
|
||||
|
||||
|
@ -1,42 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/glib.h>
|
||||
#include "stdint.h"
|
||||
#include <common/semaphore.h>
|
||||
|
||||
#define BLK_TYPE_AHCI 0
|
||||
struct block_device_operation
|
||||
{
|
||||
long (*open)();
|
||||
long (*close)();
|
||||
long (*ioctl)(long cmd, long arg);
|
||||
long (*transfer)(long cmd, ul LBA_start, ul count, uint64_t buffer, uint8_t arg0, uint8_t arg1);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 块设备请求队列内的packet
|
||||
*
|
||||
*/
|
||||
struct block_device_request_packet
|
||||
{
|
||||
uchar cmd;
|
||||
uint64_t LBA_start;
|
||||
uint32_t count;
|
||||
uint64_t buffer_vaddr;
|
||||
|
||||
uint8_t device_type; // 0: ahci
|
||||
void (*end_handler)(ul num, ul arg);
|
||||
|
||||
wait_queue_node_t wait_queue;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 块设备的请求队列
|
||||
*
|
||||
*/
|
||||
struct block_device_request_queue
|
||||
{
|
||||
wait_queue_node_t wait_queue_list;
|
||||
struct block_device_request_packet * in_service; // 正在请求的结点
|
||||
ul request_count;
|
||||
};
|
Reference in New Issue
Block a user