Use macro wrappers for device op prototypes
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m35s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m35s
This commit is contained in:
@@ -88,7 +88,9 @@ static void ide_delay (uint16_t ctrl) {
|
||||
#pragma clang optimize on
|
||||
|
||||
static void ide_irq (void* arg, void* regs, bool user, struct reschedule_ctx* rctx) {
|
||||
uint64_t fd, fp;
|
||||
(void)user, (void)regs, (void)rctx;
|
||||
|
||||
uint64_t fd;
|
||||
|
||||
struct idedrv* idedrv = arg;
|
||||
|
||||
@@ -229,10 +231,7 @@ static void ide_prepare (struct idedrv* idedrv, size_t sector, uint16_t sector_c
|
||||
}
|
||||
}
|
||||
|
||||
bool idedrv_init (struct device* device, void* arg, struct proc* proc,
|
||||
struct reschedule_ctx* rctx) {
|
||||
(void)proc, (void)rctx;
|
||||
|
||||
DEFINE_DEVICE_INIT (idedrv_init) {
|
||||
struct idedrv_init* init = arg;
|
||||
|
||||
struct idedrv* idedrv = malloc (sizeof (*idedrv));
|
||||
@@ -259,7 +258,7 @@ bool idedrv_init (struct device* device, void* arg, struct proc* proc,
|
||||
return true;
|
||||
}
|
||||
|
||||
void idedrv_fini (struct device* device, struct proc* proc, struct reschedule_ctx* rctx) {
|
||||
DEFINE_DEVICE_FINI (idedrv_fini) {
|
||||
struct idedrv* idedrv = device->udata;
|
||||
|
||||
if (idedrv->current_req != NULL) {
|
||||
@@ -273,10 +272,7 @@ void idedrv_fini (struct device* device, struct proc* proc, struct reschedule_ct
|
||||
free (idedrv);
|
||||
}
|
||||
|
||||
int idedrv_read (struct device* device, struct proc* proc, struct reschedule_ctx* rctx,
|
||||
uint64_t* lockflags, void* a1, void* a2, void* a3, void* a4) {
|
||||
(void)proc, (void)rctx, (void)a4;
|
||||
|
||||
DEFINE_DEVICE_OP (idedrv_read) {
|
||||
if (a1 == NULL || a2 == NULL || a3 == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
|
||||
@@ -337,11 +333,7 @@ int idedrv_read (struct device* device, struct proc* proc, struct reschedule_ctx
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
int idedrv_write (struct device* device, struct proc* proc, struct reschedule_ctx* rctx,
|
||||
uint64_t* lockflags, void* a1, void* a2, void* a3, void* a4) {
|
||||
(void)proc, (void)rctx, (void)a4;
|
||||
uint64_t fp;
|
||||
|
||||
DEFINE_DEVICE_OP (idedrv_write) {
|
||||
if (a1 == NULL || a2 == NULL || a3 == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
|
||||
@@ -429,9 +421,8 @@ int idedrv_write (struct device* device, struct proc* proc, struct reschedule_ct
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
int idedrv_get_device_type (struct device* device, struct proc* proc, struct reschedule_ctx* rctx,
|
||||
uint64_t* lockflags, void* a1, void* a2, void* a3, void* a4) {
|
||||
(void)proc, (void)rctx, (void)device, (void)a2, (void)a3, (void)a4;
|
||||
DEFINE_DEVICE_OP (idedrv_get_device_type) {
|
||||
(void)proc, (void)rctx, (void)device, (void)a2, (void)a3, (void)a4, (void)lockflags;
|
||||
|
||||
if (a1 == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
@@ -443,9 +434,8 @@ int idedrv_get_device_type (struct device* device, struct proc* proc, struct res
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
int idedrv_get_sector_size (struct device* device, struct proc* proc, struct reschedule_ctx* rctx,
|
||||
uint64_t* lockflags, void* a1, void* a2, void* a3, void* a4) {
|
||||
(void)proc, (void)rctx, (void)a2, (void)a3, (void)a4;
|
||||
DEFINE_DEVICE_OP (idedrv_get_sector_size) {
|
||||
(void)proc, (void)rctx, (void)a2, (void)a3, (void)a4, (void)lockflags;
|
||||
|
||||
if (a1 == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
@@ -459,9 +449,8 @@ int idedrv_get_sector_size (struct device* device, struct proc* proc, struct res
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
int idedrv_get_size (struct device* device, struct proc* proc, struct reschedule_ctx* rctx,
|
||||
uint64_t* lockflags, void* a1, void* a2, void* a3, void* a4) {
|
||||
(void)proc, (void)rctx, (void)a2, (void)a3, (void)a4;
|
||||
DEFINE_DEVICE_OP (idedrv_get_size) {
|
||||
(void)proc, (void)rctx, (void)a2, (void)a3, (void)a4, (void)lockflags;
|
||||
|
||||
if (a1 == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
|
||||
Reference in New Issue
Block a user