aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/dev
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/dev')
-rw-r--r--src/kernel/dev/pciide.c18
-rw-r--r--src/kernel/dev/vesa.c14
2 files changed, 16 insertions, 16 deletions
diff --git a/src/kernel/dev/pciide.c b/src/kernel/dev/pciide.c
index 5abc148..9a78315 100644
--- a/src/kernel/dev/pciide.c
+++ b/src/kernel/dev/pciide.c
@@ -656,12 +656,12 @@ typedef struct {
uint8_t type;
} ide_vfs_dev_t;
-bool ide_vfs_open(fs_node_ptr n, int mode);
-bool ide_vfs_stat(fs_node_ptr n, stat_t *st);
+bool ide_vfs_open(fs_node_t *n, int mode);
+bool ide_vfs_stat(fs_node_t *n, stat_t *st);
size_t ide_vfs_read(fs_handle_t *f, size_t offset, size_t len, char* buf);
size_t ide_vfs_write(fs_handle_t *f, size_t offset, size_t len, const char* buf);
-int ide_vfs_ioctl(fs_node_ptr f, int command, void* data);
+int ide_vfs_ioctl(fs_handle_t *f, int command, void* data);
void ide_vfs_close(fs_handle_t *f);
fs_node_ops_t ide_vfs_node_ops = {
@@ -707,8 +707,8 @@ void ide_register_device(ide_controller_t *c, uint8_t device, fs_t *iofs) {
}
}
-bool ide_vfs_open(fs_node_ptr n, int mode) {
- ide_vfs_dev_t *d = (ide_vfs_dev_t*)n;
+bool ide_vfs_open(fs_node_t *n, int mode) {
+ ide_vfs_dev_t *d = (ide_vfs_dev_t*)n->data;
int ok_modes = (FM_READ
| (d->type == IDE_ATA ? FM_WRITE : 0)
@@ -718,8 +718,8 @@ bool ide_vfs_open(fs_node_ptr n, int mode) {
return true;
}
-bool ide_vfs_stat(fs_node_ptr n, stat_t *st) {
- ide_vfs_dev_t *d = (ide_vfs_dev_t*)n;
+bool ide_vfs_stat(fs_node_t *n, stat_t *st) {
+ ide_vfs_dev_t *d = (ide_vfs_dev_t*)n->data;
st->type = FT_BLOCKDEV | FT_DEV;
st->access = (d->type == IDE_ATA ? FM_WRITE : 0) | FM_READ | FM_IOCTL;
@@ -752,8 +752,8 @@ uint8_t err = ide_write_sectors(d->c, d->device,
return len;
}
-int ide_vfs_ioctl(fs_node_ptr f, int command, void* data) {
- ide_vfs_dev_t *d = (ide_vfs_dev_t*)f;
+int ide_vfs_ioctl(fs_handle_t *h, int command, void* data) {
+ ide_vfs_dev_t *d = (ide_vfs_dev_t*)h->node->data;
int ret = 0;
diff --git a/src/kernel/dev/vesa.c b/src/kernel/dev/vesa.c
index 645a649..f1a87d8 100644
--- a/src/kernel/dev/vesa.c
+++ b/src/kernel/dev/vesa.c
@@ -214,10 +214,10 @@ typedef struct {
// ---- VESA code
-bool vesa_open(fs_node_ptr n, int mode);
+bool vesa_open(fs_node_t *n, int mode);
void vesa_close(fs_handle_t *f);
-int vesa_ioctl(fs_node_ptr n, int command, void* data);
-bool vesa_stat(fs_node_ptr n, stat_t *st);
+int vesa_ioctl(fs_handle_t *n, int command, void* data);
+bool vesa_stat(fs_node_t *n, stat_t *st);
void vesa_init_driver(fs_t *iofs, vesa_mode_t *mode_data, int nmodes);
void vesa_clear(vesa_driver_t *d);
@@ -354,7 +354,7 @@ fail_setup:
if (mode_data) free(mode_data);
}
-bool vesa_open(fs_node_ptr n, int mode) {
+bool vesa_open(fs_node_t *n, int mode) {
int ok_modes = FM_READ | FM_WRITE | FM_MMAP;
if (mode & ~ok_modes) return false;
@@ -365,13 +365,13 @@ void vesa_close(fs_handle_t *f) {
// nothing to do
}
-int vesa_ioctl(fs_node_ptr n, int command, void* data) {
+int vesa_ioctl(fs_handle_t *h, int command, void* data) {
// TODO
return 0;
}
-bool vesa_stat(fs_node_ptr n, stat_t *st) {
- vesa_driver_t *d = (vesa_driver_t*)d;
+bool vesa_stat(fs_node_t *n, stat_t *st) {
+ vesa_driver_t *d = (vesa_driver_t*)n->data;
framebuffer_info_t *i = (d->current_mode == -1 ? 0 : &d->modes[d->current_mode].info);