From 2a8d65dfceb4ac35b09935a5e5fb62be1a44ab14 Mon Sep 17 00:00:00 2001 From: Marin Ramesa Date: Fri, 4 Apr 2014 21:52:39 +0200 Subject: Use explicit prototypes for struct dev_ops fields * device/conf.h: Include , , . Predefine struct io_req, io_req_t and io_return_t. (dev_ops): Add explicit prototypes for d_open, d_close, d_read, d_write, d_getstat, d_setstat, d_mmap, d_port_death. (nulldev_open, nulldev_close, nulldev_read, nulldev_write, nulldev_getstat, nulldev_setstat, nulldev_portdeath): Add prototypes. (nomap): Fix prototype. * device/dev_name.c (nulldev_open, nulldev_close, nulldev_read, nulldev_write, nulldev_getstat, nulldev_setstat, nulldev_portdeath): New functions. (nomap): Fix prototype. * device/ds_routines.c (dev_close): Pass 0 as flag parameter. * device/kmsg.c (kmsgclose): Drop return value. * device/kmsg.h (kmsgclose): Fix prototype. * i386/i386at/com.c (comopen): Fix prototype. (comclose): Fix prototype, drop return value. (comread, comwrite): Fix prototype. * i386/i386at/com.h (comopen, comclose, comread, comwrite): Fix prototype. * i386/i386at/conf.c (dev_ops): Use nulldev_open, nulldev_close, nulldev_read, nulldev_write, nulldev_getstat, nulldev_setstat, nulldev_portdeath where appropriate. * i386/i386at/kd.c (kdclose, kdread, kdwrite, kdmmap): Fix prototype. * i386/i386at/kd.h (kdclose, kdread, kdwrite, kdmmap): Likewise. * i386/i386at/kd_event.c (kbdopen): Likewise. * i386/i386at/kd_event.h (kbdopen): Likewise. * i386/i386at/kd_mouse.c (mouseopen): Likewise. * i386/i386at/kd_mouse.h (mouseopen): Likewise. * i386/i386at/lpr.c (lpropen, lprclose, lprread, lprwrite): Likewise. * i386/i386at/lpr.h (lpropen, lprclose, lprread, lprwrite): Likewise. * i386/i386at/mem.c (memmmap): Likewise. * i386/i386at/mem.h (memmmap): Likewise. * i386/i386at/model_dep.c (timemmap): Likewise. * i386/i386at/model_dep.h (timemmap): Likewise. * kern/mach_clock.c (timeopen, timeclose): Likewise. * kern/mach_clock.h: Include , predefine struct io_req and io_req_t. (timeopen, timeclose): Fix prototype. --- i386/i386at/conf.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'i386/i386at/conf.c') diff --git a/i386/i386at/conf.c b/i386/i386at/conf.c index 4fcd81e..ab4f680 100644 --- a/i386/i386at/conf.c +++ b/i386/i386at/conf.c @@ -81,9 +81,9 @@ struct dev_ops dev_name_list[] = /* We don't assign a console here, when we find one via cninit() we stick something appropriate here through the indirect list */ - { "cn", nulldev, nulldev, nulldev, - nulldev, nulldev, nulldev, nomap, - nodev, nulldev, nulldev, 0, + { "cn", nulldev_open, nulldev_close, nulldev_read, + nulldev_write, nulldev_getstat, nulldev_setstat, nomap, + nodev, nulldev, nulldev_portdeath, 0, nodev }, #ifndef MACH_HYP @@ -93,9 +93,9 @@ struct dev_ops dev_name_list[] = nodev }, #endif /* MACH_HYP */ - { timename, timeopen, timeclose, nulldev, - nulldev, nulldev, nulldev, timemmap, - nodev, nulldev, nulldev, 0, + { timename, timeopen, timeclose, nulldev_read, + nulldev_write, nulldev_getstat, nulldev_setstat, timemmap, + nodev, nulldev, nulldev_portdeath, 0, nodev }, #ifndef MACH_HYP @@ -114,25 +114,25 @@ struct dev_ops dev_name_list[] = #endif { mousename, mouseopen, mouseclose, mouseread, - nodev, mousegetstat, nulldev, nomap, - nodev, nulldev, nulldev, 0, + nulldev_write, mousegetstat, nulldev_setstat, nomap, + nodev, nulldev, nulldev_portdeath, 0, nodev }, { kbdname, kbdopen, kbdclose, kbdread, - nodev, kbdgetstat, kbdsetstat, nomap, - nodev, nulldev, nulldev, 0, + nulldev_write, kbdgetstat, kbdsetstat, nomap, + nodev, nulldev, nulldev_portdeath, 0, nodev }, - { memname, nulldev, nulldev, nodev, - nodev, nodev, nodev, memmmap, - nodev, nulldev, nulldev, 0, + { memname, nulldev_open, nulldev_close, nulldev_read, + nulldev_write, nulldev_getstat, nulldev_setstat, memmmap, + nodev, nulldev, nulldev_portdeath, 0, nodev }, #endif /* MACH_HYP */ #ifdef MACH_KMSG { kmsgname, kmsgopen, kmsgclose, kmsgread, - nodev, kmsggetstat, nodev, nomap, - nodev, nulldev, nulldev, 0, + nulldev_write, kmsggetstat, nulldev_setstat, nomap, + nodev, nulldev, nulldev_portdeath, 0, nodev }, #endif -- cgit v1.2.3