feat: refactor to use gcc types
This commit is contained in:
@@ -25,17 +25,17 @@
|
||||
|
||||
typedef struct block_device block_device;
|
||||
|
||||
typedef u8 (*block_device_driver_check_device)(const block_device *device, u8 *first_sector);
|
||||
typedef uint8_t (*block_device_driver_check_device)(const block_device *device, uint8_t *first_sector);
|
||||
|
||||
typedef u8 (*block_device_driver_free)(const block_device *device);
|
||||
typedef uint8_t (*block_device_driver_free)(const block_device *device);
|
||||
|
||||
typedef u8 (*block_device_access)(const block_device *device, u8 direction, u32 lba, u8 sectors, void *target);
|
||||
typedef uint8_t (*block_device_access)(const block_device *device, uint8_t direction, uint32_t lba, uint8_t sectors, void *target);
|
||||
|
||||
|
||||
typedef struct {
|
||||
char name[16];
|
||||
struct {
|
||||
u8 root_only: 1;
|
||||
uint8_t root_only: 1;
|
||||
} flags;
|
||||
block_device_driver_check_device check_device;
|
||||
block_device_driver_free free_device;
|
||||
@@ -43,24 +43,24 @@ typedef struct {
|
||||
|
||||
typedef struct block_device {
|
||||
struct {
|
||||
u8 present: 1;
|
||||
u8 scanned: 1;
|
||||
u8 unreadable: 1;
|
||||
u8 root_device: 1;
|
||||
u8 driver_installed: 1;
|
||||
uint8_t present: 1;
|
||||
uint8_t scanned: 1;
|
||||
uint8_t unreadable: 1;
|
||||
uint8_t root_device: 1;
|
||||
uint8_t driver_installed: 1;
|
||||
} flags;
|
||||
char identifier[16];
|
||||
u32 num_lba;
|
||||
u16 block_size;
|
||||
uint32_t num_lba;
|
||||
uint16_t block_size;
|
||||
block_device_access access;
|
||||
block_dev_driver *driver;
|
||||
void *device_info; // pointer to driver defined structure
|
||||
// todo device info
|
||||
} block_device;
|
||||
|
||||
u8 block_dev_register_driver(block_dev_driver *driver);
|
||||
uint8_t block_dev_register_driver(block_dev_driver *driver);
|
||||
|
||||
u8 block_dev_register(block_device *device);
|
||||
uint8_t block_dev_register(block_device *device);
|
||||
|
||||
void block_dev_free(block_device *device);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user