Fennix  1.0.0
Full Documentation
Loading...
Searching...
No Matches
block.h
Go to the documentation of this file.
1/*
2 This file is part of Fennix Kernel.
3
4 Fennix Kernel is free software: you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation, either version 3 of
7 the License, or (at your option) any later version.
8
9 Fennix Kernel is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with Fennix Kernel. If not, see <https://www.gnu.org/licenses/>.
16*/
17
18#ifndef __FENNIX_API_BLOCK_H__
19#define __FENNIX_API_BLOCK_H__
20
21#include <types.h>
22
23#if __has_include(<interface/fs.h>)
24#include <interface/fs.h>
25#else
26#include <fs.h>
27#endif
28
30{
38 const char *Name;
39
46 size_t Size;
47
54 uint32_t BlockSize;
55
62 size_t BlockCount;
63
73
81};
82
83#ifndef __kernel__
95dev_t RegisterBlockDevice(struct BlockDevice *Device);
96
107int UnregisterBlockDevice(dev_t DeviceID);
108#endif // __kernel__
109
110#endif // __FENNIX_API_BLOCK_H__
const InodeOperations * Ops
Pointer to the block device operations structure.
Definition block.h:72
uint32_t BlockSize
Size of a single block in bytes.
Definition block.h:54
dev_t RegisterBlockDevice(struct BlockDevice *Device)
Registers a block device with the kernel block subsystem.
size_t BlockCount
Number of blocks in the device.
Definition block.h:62
size_t Size
Total size of the device in bytes.
Definition block.h:46
void * PrivateData
Opaque pointer to driver-specific or hardware-specific data.
Definition block.h:80
int UnregisterBlockDevice(dev_t DeviceID)
Unregisters a block device from the kernel block subsystem.
const char * Name
Base name of the device.
Definition block.h:38