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.
This commit is contained in:
Matthew Dillon 1999-01-29 08:36:45 +00:00
parent 9e26dd2a54
commit 3cfc69e6c2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43387
8 changed files with 28 additions and 24 deletions

View File

@ -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

View File

@ -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_ */

View File

@ -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

View File

@ -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_ */

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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);