Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
ioforge_block.h
Go to the documentation of this file.
1#ifndef __IOFORGE__IOFORGE_BLOCK_H__
2#define __IOFORGE__IOFORGE_BLOCK_H__
3
4#include "string.h"
5#include <type.h>
6#include <ioforge/ioforge.h>
7
8#ifdef __cplusplus
9extern "C" {
10#endif
11
13 IOFORGE_BLOCK_OP_READ = 0, // ATA: READ DMA EXT
14 IOFORGE_BLOCK_OP_WRITE = 1, // ATA: WRITE DMA EXT
15 IOFORGE_BLOCK_OP_PACKET = 2, // ATAPI: PACKET command (0xA0)
16 IOFORGE_BLOCK_OP_FLUSH = 3, // ATA: FLUSH CACHE EXT
18};
19
20// Flags untuk ATAPI
22 IOFORGE_FLAG_DMA = (1 << 0), // DMA mode (vs PIO)
24 (1 << 1), // Direction: device → host jika 0 (for DMA)
25 IOFORGE_FLAG_NODATA = (1 << 2), // Packet cmd tanpa data transfer
26};
27
45
47
49 int (*submit)(struct ioforge_block_device* dev,
50 struct ioforge_block_request* req);
51};
52
53enum {
58};
59
68
70 void* ctx);
71
75 void* ctx);
76
77#define EINVAL 22
78#define EROFS 20
79
80#ifdef __cplusplus
81}
82#endif
83
84#endif // __IOFORGE__IOFORGE_BLOCK_H__
void foreach_block_device_by_type(struct ioforge_device *node, uint8_t type, ioforge_block_visitor_fn callback, void *ctx)
@ IOFORGE_BLOCK_TYPE_SEMB
@ IOFORGE_BLOCK_TYPE_SATA
@ IOFORGE_BLOCK_TYPE_PM
@ IOFORGE_BLOCK_TYPE_SATAPI
void(* ioforge_block_visitor_fn)(struct ioforge_block_device *dev, void *ctx)
ioforge_block_flags
@ IOFORGE_FLAG_WRITE
@ IOFORGE_FLAG_DMA
@ IOFORGE_FLAG_NODATA
ioforge_block_op_type
@ IOFORGE_BLOCK_OP_PACKET
@ IOFORGE_BLOCK_OP_FLUSH
@ IOFORGE_BLOCK_OP_IDENTIFY
@ IOFORGE_BLOCK_OP_WRITE
@ IOFORGE_BLOCK_OP_READ
struct ioforge_device base
struct ioforge_block_op ops
int(* submit)(struct ioforge_block_device *dev, struct ioforge_block_request *req)
unsigned short uint16_t
Definition type.h:13
unsigned int uint32_t
Definition type.h:19
unsigned long uint64_t
Definition type.h:25
unsigned char uint8_t
Definition type.h:7
uint8_t type
Definition vnode.h:2