Use macro wrappers for device op prototypes
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m35s

This commit is contained in:
2026-03-15 14:27:54 +01:00
parent c784264dc8
commit cd5604da43
15 changed files with 95 additions and 160 deletions

View File

@@ -147,7 +147,7 @@ static int32_t ps2kb_keycode (void) {
}
static void ps2kb_irq (void* arg, void* regs, bool user, struct reschedule_ctx* rctx) {
(void)arg, (void)regs;
(void)arg, (void)regs, (void)user;
uint64_t frb, fsq;
int32_t keycode = ps2kb_keycode ();
@@ -177,9 +177,7 @@ static void ps2kb_irq (void* arg, void* regs, bool user, struct reschedule_ctx*
spin_unlock (&ps2kb_ringbuffer_lock, frb);
}
int ps2kb_read_key (struct device* device, struct proc* proc, struct reschedule_ctx* rctx,
uint64_t* lockflags, void* a1, void* a2, void* a3, void* a4) {
(void)device, (void)a2, (void)a3, (void)a4;
DEFINE_DEVICE_OP (ps2kb_read_key) {
uint64_t frb, fsq;
if (!(proc->procgroup->capabilities & PROC_CAP_KB))
@@ -231,9 +229,7 @@ static void ps2kb_set_typematic (uint8_t delay, uint8_t rate) {
outb (KB_DATA, (delay << 5) | (rate & 0x1F));
}
bool ps2kb_init (struct device* device, void* arg, struct proc* proc, struct reschedule_ctx* rctx) {
(void)device, (void)arg, (void)proc, (void)rctx;
DEFINE_DEVICE_INIT (ps2kb_init) {
ioapic_route_irq (PS2KB, 1, 0, thiscpu->lapic_id);
irq_attach (&ps2kb_irq, NULL, PS2KB);
@@ -257,7 +253,7 @@ bool ps2kb_init (struct device* device, void* arg, struct proc* proc, struct res
return true;
}
void ps2kb_fini (struct device* device, struct proc* proc, struct reschedule_ctx* rctx) {
DEFINE_DEVICE_FINI (ps2kb_fini) {
(void)device, (void)proc, (void)rctx;
irq_detach (PS2KB);