mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-09 07:06:47 +00:00
🆕 块设备驱动的一些数据结构
This commit is contained in:
parent
f4cd6f8811
commit
2f3f8868ae
39
kernel/driver/disk/block_device.h
Normal file
39
kernel/driver/disk/block_device.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "../../common/glib.h"
|
||||||
|
#include "stdint.h"
|
||||||
|
|
||||||
|
struct block_device_operation
|
||||||
|
{
|
||||||
|
long (*open)();
|
||||||
|
long (*close)();
|
||||||
|
long (*ioctl)(long cmd, long arg);
|
||||||
|
long (*transfer)(long cmd, ul LBA_start, ul count, uchar* buffer);
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 块设备请求队列内的packet
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
struct block_device_request_packet
|
||||||
|
{
|
||||||
|
uchar cmd;
|
||||||
|
uint32_t LBA_start;
|
||||||
|
uint32_t count;
|
||||||
|
uchar *buffer;
|
||||||
|
|
||||||
|
void (*end_handler)(ul num, ul arg);
|
||||||
|
|
||||||
|
struct List list;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 块设备的请求队列
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
struct block_device_request_queue
|
||||||
|
{
|
||||||
|
struct List queue_list;
|
||||||
|
struct block_device_request_packet * entry;
|
||||||
|
ul request_count;
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user