aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>1999-01-29 08:36:45 +0000
committerMatthew Dillon <dillon@FreeBSD.org>1999-01-29 08:36:45 +0000
commit3cfc69e6c2a8a51bb277254e4dfed9dca2eaab98 (patch)
tree1ec92aad1d4847306c84421afc93861663a6b00f
parent9e26dd2a54c5fc0693161a71c4d3c27088fc8552 (diff)
downloadsrc-3cfc69e6c2a8a51bb277254e4dfed9dca2eaab98.tar.gz
src-3cfc69e6c2a8a51bb277254e4dfed9dca2eaab98.zip
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.
Notes
Notes: svn path=/head/; revision=43387
-rw-r--r--sys/amd64/amd64/vm_machdep.c6
-rw-r--r--sys/amd64/include/cpu.h4
-rw-r--r--sys/i386/i386/vm_machdep.c6
-rw-r--r--sys/i386/include/cpu.h4
-rw-r--r--sys/kern/init_main.c6
-rw-r--r--sys/kern/kern_module.c6
-rw-r--r--sys/sys/exec.h12
-rw-r--r--sys/sys/module.h8
8 files changed, 28 insertions, 24 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index d0bdc9393b55..297a10f0fed1 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 7b2ef5b10566..af69a36184d9 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 d0bdc9393b55..297a10f0fed1 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 7b2ef5b10566..af69a36184d9 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 ed621ebad2af..8a2217acd62a 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 ce82661804ca..86a393d266a8 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 <sys/param.h>
@@ -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 48a4eaf56af4..d8216ca2d585 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 <sys/module.h>
+
#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 a5799954147a..05f48c297b27 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);