Device IRQs WIP
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
#include <proc/reschedule.h>
|
||||
#include <status.h>
|
||||
|
||||
bool partdrv_init (struct device* device, void* arg) {
|
||||
bool partdrv_init (struct device* device, void* arg, struct proc* proc, struct reschedule_ctx* rctx) {
|
||||
(void)proc, (void)rctx;
|
||||
|
||||
struct partdrv_init* init = arg;
|
||||
|
||||
struct partdrv* partdrv = malloc (sizeof (*partdrv));
|
||||
@@ -24,7 +26,8 @@ bool partdrv_init (struct device* device, void* arg) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void partdrv_fini (struct device* device) {
|
||||
void partdrv_fini (struct device* device, struct proc* proc, struct reschedule_ctx* rctx) {
|
||||
(void)proc, (void)rctx;
|
||||
struct partdrv* partdrv = device->udata;
|
||||
|
||||
free (partdrv);
|
||||
@@ -45,7 +48,7 @@ int partdrv_read (struct device* device, struct proc* proc, struct reschedule_ct
|
||||
uint8_t* buffer = a3;
|
||||
|
||||
spin_lock (&super->lock);
|
||||
int ret = device_op (super, XDRV_READ, NULL, NULL, §or, §or_count, buffer);
|
||||
int ret = device_op (super, XDRV_READ, proc, rctx, §or, §or_count, buffer);
|
||||
spin_unlock (&super->lock);
|
||||
|
||||
return ret;
|
||||
@@ -66,7 +69,7 @@ int partdrv_write (struct device* device, struct proc* proc, struct reschedule_c
|
||||
uint8_t* buffer = a3;
|
||||
|
||||
spin_lock (&super->lock);
|
||||
int ret = device_op (super, XDRV_WRITE, NULL, NULL, §or, §or_count, buffer);
|
||||
int ret = device_op (super, XDRV_WRITE, proc, rctx, §or, §or_count, buffer);
|
||||
spin_unlock (&super->lock);
|
||||
|
||||
return ret;
|
||||
@@ -98,7 +101,7 @@ int partdrv_get_sector_size (struct device* device, struct proc* proc, struct re
|
||||
struct partdrv* partdrv = device->udata;
|
||||
|
||||
spin_lock (&partdrv->super->lock);
|
||||
device_op (partdrv->super, XDRV_GET_SECTOR_SIZE, NULL, NULL, secsize);
|
||||
device_op (partdrv->super, XDRV_GET_SECTOR_SIZE, proc, rctx, secsize);
|
||||
spin_unlock (&partdrv->super->lock);
|
||||
|
||||
return ST_OK;
|
||||
|
||||
Reference in New Issue
Block a user