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:
@@ -7,10 +7,7 @@
|
||||
#include <proc/reschedule.h>
|
||||
#include <status.h>
|
||||
|
||||
bool partdrv_init (struct device* device, void* arg, struct proc* proc,
|
||||
struct reschedule_ctx* rctx) {
|
||||
(void)proc, (void)rctx;
|
||||
|
||||
DEFINE_DEVICE_INIT (partdrv_init) {
|
||||
struct partdrv_init* init = arg;
|
||||
|
||||
struct partdrv* partdrv = malloc (sizeof (*partdrv));
|
||||
@@ -27,16 +24,13 @@ bool partdrv_init (struct device* device, void* arg, struct proc* proc,
|
||||
return true;
|
||||
}
|
||||
|
||||
void partdrv_fini (struct device* device, struct proc* proc, struct reschedule_ctx* rctx) {
|
||||
(void)proc, (void)rctx;
|
||||
DEFINE_DEVICE_FINI (partdrv_fini) {
|
||||
struct partdrv* partdrv = device->udata;
|
||||
|
||||
free (partdrv);
|
||||
}
|
||||
|
||||
int partdrv_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 (partdrv_read) {
|
||||
uint64_t fs;
|
||||
|
||||
if (a1 == NULL || a2 == NULL || a3 == NULL)
|
||||
@@ -56,9 +50,7 @@ int partdrv_read (struct device* device, struct proc* proc, struct reschedule_ct
|
||||
return ret;
|
||||
}
|
||||
|
||||
int partdrv_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;
|
||||
DEFINE_DEVICE_OP (partdrv_write) {
|
||||
uint64_t fs;
|
||||
|
||||
if (a1 == NULL || a2 == NULL || a3 == NULL)
|
||||
@@ -78,10 +70,7 @@ int partdrv_write (struct device* device, struct proc* proc, struct reschedule_c
|
||||
return ret;
|
||||
}
|
||||
|
||||
int partdrv_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 (partdrv_get_device_type) {
|
||||
if (a1 == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
|
||||
@@ -92,9 +81,7 @@ int partdrv_get_device_type (struct device* device, struct proc* proc, struct re
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
int partdrv_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 (partdrv_get_sector_size) {
|
||||
uint64_t fs;
|
||||
|
||||
if (a1 == NULL)
|
||||
@@ -111,10 +98,7 @@ int partdrv_get_sector_size (struct device* device, struct proc* proc, struct re
|
||||
return ST_OK;
|
||||
}
|
||||
|
||||
int partdrv_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 (partdrv_get_size) {
|
||||
if (a1 == NULL)
|
||||
return -ST_BAD_ADDRESS_SPACE;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user