From 1c7115fb5f80e294b4cc5eb1ea863df6dd3024f4 Mon Sep 17 00:00:00 2001 From: dillon Date: Fri, 29 Jan 1999 08:36:45 +0000 Subject: More -Wall / -Wcast-qual cleanup. Also, EXEC_SET can't use C_DECLARE_MODULE due to the linker_file_sysinit() function making modifications to the data. --- sys/amd64/amd64/vm_machdep.c | 6 +++--- sys/amd64/include/cpu.h | 4 ++-- sys/i386/i386/vm_machdep.c | 6 +++--- sys/i386/include/cpu.h | 4 ++-- sys/kern/init_main.c | 6 +++--- sys/kern/kern_module.c | 6 +++--- sys/sys/exec.h | 12 ++++++++++-- sys/sys/module.h | 8 ++------ 8 files changed, 28 insertions(+), 24 deletions(-) diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index d0bdc93..297a10f 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.114 1998/12/16 15:21:51 bde Exp $ + * $Id: vm_machdep.c,v 1.115 1999/01/06 23:05:37 julian Exp $ */ #include "npx.h" @@ -201,8 +201,8 @@ cpu_fork(p1, p2) void cpu_set_fork_handler(p, func, arg) struct proc *p; - void (*func) __P((void *)); - void *arg; + void (*func) __P((const void *)); + const void *arg; { /* * Note that the trap frame follows the args, so the function diff --git a/sys/amd64/include/cpu.h b/sys/amd64/include/cpu.h index 7b2ef5b..af69a36 100644 --- a/sys/amd64/include/cpu.h +++ b/sys/amd64/include/cpu.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)cpu.h 5.4 (Berkeley) 5/9/91 - * $Id: cpu.h,v 1.35 1997/10/28 11:43:47 bde Exp $ + * $Id: cpu.h,v 1.36 1998/08/31 08:41:40 kato Exp $ */ #ifndef _MACHINE_CPU_H_ @@ -130,7 +130,7 @@ extern int want_resched; /* resched was called */ void fork_trampoline __P((void)); void fork_return __P((struct proc *, struct trapframe)); -void cpu_set_fork_handler __P((struct proc *, void (*pc)(void *), void *)); +void cpu_set_fork_handler __P((struct proc *, void (*pc)(const void *), const void *)); #endif #endif /* !_MACHINE_CPU_H_ */ diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index d0bdc93..297a10f 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -38,7 +38,7 @@ * * from: @(#)vm_machdep.c 7.3 (Berkeley) 5/13/91 * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ - * $Id: vm_machdep.c,v 1.114 1998/12/16 15:21:51 bde Exp $ + * $Id: vm_machdep.c,v 1.115 1999/01/06 23:05:37 julian Exp $ */ #include "npx.h" @@ -201,8 +201,8 @@ cpu_fork(p1, p2) void cpu_set_fork_handler(p, func, arg) struct proc *p; - void (*func) __P((void *)); - void *arg; + void (*func) __P((const void *)); + const void *arg; { /* * Note that the trap frame follows the args, so the function diff --git a/sys/i386/include/cpu.h b/sys/i386/include/cpu.h index 7b2ef5b..af69a36 100644 --- a/sys/i386/include/cpu.h +++ b/sys/i386/include/cpu.h @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)cpu.h 5.4 (Berkeley) 5/9/91 - * $Id: cpu.h,v 1.35 1997/10/28 11:43:47 bde Exp $ + * $Id: cpu.h,v 1.36 1998/08/31 08:41:40 kato Exp $ */ #ifndef _MACHINE_CPU_H_ @@ -130,7 +130,7 @@ extern int want_resched; /* resched was called */ void fork_trampoline __P((void)); void fork_return __P((struct proc *, struct trapframe)); -void cpu_set_fork_handler __P((struct proc *, void (*pc)(void *), void *)); +void cpu_set_fork_handler __P((struct proc *, void (*pc)(const void *), const void *)); #endif #endif /* !_MACHINE_CPU_H_ */ diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index ed621eb..8a2217a 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -39,7 +39,7 @@ * SUCH DAMAGE. * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 - * $Id: init_main.c,v 1.103 1999/01/07 21:23:39 julian Exp $ + * $Id: init_main.c,v 1.104 1999/01/26 02:38:10 julian Exp $ */ #include "opt_devfs.h" @@ -569,7 +569,7 @@ SYSINIT(retrofit, SI_SUB_ROOT_FDTAB, SI_ORDER_FIRST, xxx_vfs_root_fdtab, NULL) *************************************************************************** */ -static void kthread_init __P((void *dummy)); +static void kthread_init __P((const void *dummy)); SYSINIT_KP(init,SI_SUB_KTHREAD_INIT, SI_ORDER_FIRST, kthread_init, NULL) @@ -579,7 +579,7 @@ static void start_init __P((struct proc *p)); /* ARGSUSED*/ static void kthread_init(dummy) - void *dummy; + const void *dummy; { /* Create process 1 (init(8)). */ start_init(curproc); diff --git a/sys/kern/kern_module.c b/sys/kern/kern_module.c index ce82661..86a393d 100644 --- a/sys/kern/kern_module.c +++ b/sys/kern/kern_module.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_module.c,v 1.14 1999/01/09 16:50:04 dfr Exp $ + * $Id: kern_module.c,v 1.15 1999/01/27 21:49:56 dillon Exp $ */ #include @@ -77,9 +77,9 @@ module_shutdown(int arg1, void* arg2) } void -module_register_init(void *arg) +module_register_init(const void *arg) { - moduledata_t* data = (moduledata_t*) arg; + const moduledata_t* data = (const moduledata_t*) arg; int error; error = module_register(data->name, data->evhand, data->priv, data->_file); diff --git a/sys/sys/exec.h b/sys/sys/exec.h index 48a4eaf..d8216ca 100644 --- a/sys/sys/exec.h +++ b/sys/sys/exec.h @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)exec.h 8.3 (Berkeley) 1/21/94 - * $Id: exec.h,v 1.21 1998/12/16 16:28:58 bde Exp $ + * $Id: exec.h,v 1.22 1999/01/29 06:47:53 dillon Exp $ */ #ifndef _SYS_EXEC_H_ @@ -82,7 +82,15 @@ int exec_register __P((const struct execsw *)); int exec_unregister __P((const struct execsw *)); #ifndef LKM + +/* + * note: name##_mod cannot be const storage because the + * linker_file_sysinit() function modifies _file in the + * moduledata_t. + */ + #include + #define EXEC_SET(name, execsw_arg) \ static int name ## _modevent(module_t mod, int type, void *data) \ { \ @@ -111,7 +119,7 @@ int exec_unregister __P((const struct execsw *)); name ## _modevent, \ (void *)& execsw_arg \ }; \ - C_DECLARE_MODULE(name, name ## _mod, SI_SUB_EXEC, SI_ORDER_ANY) + DECLARE_MODULE(name, name ## _mod, SI_SUB_EXEC, SI_ORDER_ANY) #endif #endif diff --git a/sys/sys/module.h b/sys/sys/module.h index a579995..05f48c2 100644 --- a/sys/sys/module.h +++ b/sys/sys/module.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: module.h,v 1.8 1999/01/27 21:50:00 dillon Exp $ + * $Id: module.h,v 1.9 1999/01/29 06:47:53 dillon Exp $ */ #ifndef _SYS_MODULE_H_ @@ -67,11 +67,7 @@ typedef union modspecific { SYSINIT(name##module, sub, order, module_register_init, &data) \ struct __hack -#define C_DECLARE_MODULE(name, data, sub, order) \ - C_SYSINIT(name##module, sub, order, module_register_init, &data) \ - struct __hack - -void module_register_init(void *data); +void module_register_init(const void *data); int module_register(const char *name, modeventhand_t callback, void *arg, void *file); module_t module_lookupbyname(const char *name); -- cgit v1.1