summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@gnu.org>2007-04-30 20:30:11 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:27:09 +0200
commitbc85b8639e6a4f3133d8bf10161a5947dfb5b29d (patch)
tree5f981ababb0bb14005efb9f1eba00cf9dad741ed /kern
parent7f320586e5b3c2017b9ddd70bf97ac64f51f1be4 (diff)
2007-04-30 Thomas Schwinge <tschwinge@gnu.org>
We're not in the eighties anymore. List arguments in function prototypes and definitions for a lot of symbols. Also drop some unused prototypes. I refrain from listing every changed symbol. * chips/busses.h: Do as described. * ddb/db_break.c: Likewise. * ddb/db_break.h: Likewise. * ddb/db_command.c: Likewise. * ddb/db_command.h: Likewise. * ddb/db_lex.c: Likewise. * ddb/db_lex.h: Likewise. * ddb/db_output.c: Likewise. * ddb/db_output.h: Likewise. * ddb/db_sym.h: Likewise. * ddb/db_task_thread.c: Likewise. * ddb/db_task_thread.h: Likewise. * ddb/db_variables.h: Likewise. * ddb/db_watch.c: Likewise. * ddb/db_watch.h: Likewise. * device/buf.h: Likewise. * device/conf.h: Likewise. * device/dev_hdr.h: Likewise. * device/ds_routines.h: Likewise. * device/if_ether.h: Likewise. * device/io_req.h: Likewise. * device/net_io.h: Likewise. * i386/i386/io_port.h: Likewise. * i386/i386/lock.h: Likewise. * i386/i386/mp_desc.c: Likewise. * i386/i386/mp_desc.h: Likewise. * i386/i386/proc_reg.h: Likewise. * i386/i386/user_ldt.h: Likewise. * i386/i386at/kd_queue.h: Likewise. * i386/i386at/kdsoft.h: Likewise. * i386/intel/pmap.c: Likewise. * i386/intel/pmap.h: Likewise. * include/mach/mach_traps.h: Likewise. * ipc/ipc_entry.h: Likewise. * ipc/ipc_hash.h: Likewise. * ipc/ipc_kmsg.h: Likewise. * ipc/ipc_marequest.c: Likewise. * ipc/ipc_marequest.h: Likewise. * ipc/ipc_mqueue.h: Likewise. * ipc/ipc_notify.h: Likewise. * ipc/ipc_object.h: Likewise. * ipc/ipc_port.h: Likewise. * ipc/ipc_pset.h: Likewise. * ipc/ipc_right.h: Likewise. * ipc/ipc_space.h: Likewise. * ipc/ipc_table.h: Likewise. * ipc/mach_msg.c: Likewise. * ipc/mach_msg.h: Likewise. * kern/ast.c: Likewise. * kern/ast.h: Likewise. * kern/debug.c: Likewise. * kern/debug.h: Likewise. * kern/ipc_tt.c: Likewise. * kern/ipc_tt.h: Likewise. * kern/mach_factor.c: Likewise. * kern/mach_factor.h: Likewise. * kern/printf.c: Likewise. * kern/printf.h: Likewise. * kern/queue.h: Likewise. * kern/sched.h: Likewise. * kern/syscall_subr.c: Likewise. * kern/syscall_subr.h: Likewise. * kern/task.h: Likewise. * kern/thread_swap.c: Likewise. * kern/thread_swap.h: Likewise. * kern/timer.h: Likewise. * kern/xpr.c: Likewise. * kern/xpr.h: Likewise. * kern/zalloc.c: Likewise. * kern/zalloc.h: Likewise. * ipc/ipc_port.h: Don't include <ipc/ipc_space.h>. * device/net_io.h: Include <device/if_hdr.h> and <device/io_req.h>. * ipc/ipc_entry.h: Include <mach/mach_types.h> and <ipc/ipc_types.h>. * ipc/ipc_kmsg.h: Include <ipc/ipc_object.h>, <ipc/ipc_types.h> and <vm/vm_map.h>. * ipc/ipc_marequest.h: Include <mach_debug/hash_info.h> and <ipc/ipc_types.h>. * ipc/ipc_object.h: Include <ipc/ipc_types.h>. * ipc/ipc_right.h: Include <ipc/ipc_entry.h>. * ipc/ipc_space.h: Include <mach/mach_types.h> and <ipc/ipc_types.h>. * kern/ipc_tt.h: Include <mach/mach_types.h>. * kern/sched.h: Include <kern/kern_types.h>. * ipc/ipc_hash.c (ipc_hash_index_t): Move type definition... * ipc/ipc_hash.h: ... into here.
Diffstat (limited to 'kern')
-rw-r--r--kern/ast.c2
-rw-r--r--kern/ast.h2
-rw-r--r--kern/debug.c2
-rw-r--r--kern/debug.h2
-rw-r--r--kern/ipc_tt.c2
-rw-r--r--kern/ipc_tt.h47
-rw-r--r--kern/mach_factor.c2
-rw-r--r--kern/mach_factor.h5
-rw-r--r--kern/printf.c2
-rw-r--r--kern/printf.h4
-rw-r--r--kern/queue.h10
-rw-r--r--kern/sched.h5
-rw-r--r--kern/syscall_subr.c12
-rw-r--r--kern/syscall_subr.h8
-rw-r--r--kern/task.h18
-rw-r--r--kern/thread_swap.c6
-rw-r--r--kern/thread_swap.h10
-rw-r--r--kern/timer.h18
-rw-r--r--kern/xpr.c4
-rw-r--r--kern/xpr.h10
-rw-r--r--kern/zalloc.c18
-rw-r--r--kern/zalloc.h6
22 files changed, 96 insertions, 99 deletions
diff --git a/kern/ast.c b/kern/ast.c
index d692a99..d46f0d6 100644
--- a/kern/ast.c
+++ b/kern/ast.c
@@ -66,7 +66,7 @@ ast_init()
}
void
-ast_taken()
+ast_taken(void)
{
register thread_t self = current_thread();
register ast_t reasons;
diff --git a/kern/ast.h b/kern/ast.h
index ba22af8..6fd509c 100644
--- a/kern/ast.h
+++ b/kern/ast.h
@@ -83,7 +83,7 @@ extern volatile ast_t need_ast[NCPUS];
#endif /* MACHINE_AST */
-extern void ast_taken();
+extern void ast_taken(void);
/*
* ast_needed, ast_on, ast_off, ast_context, and ast_propagate
diff --git a/kern/debug.c b/kern/debug.c
index c6e0257..d07f1ed 100644
--- a/kern/debug.c
+++ b/kern/debug.c
@@ -115,7 +115,7 @@ const char *panicstr;
int paniccpu;
void
-panic_init()
+panic_init(void)
{
if (!panic_lock_initialized)
{
diff --git a/kern/debug.h b/kern/debug.h
index 62be7fc..64fbf8a 100644
--- a/kern/debug.h
+++ b/kern/debug.h
@@ -57,7 +57,7 @@
#endif /* NDEBUG */
-extern void panic_init();
+extern void panic_init(void);
extern void panic (const char *s, ...) __attribute__ ((noreturn));
#endif /* _mach_debug__debug_ */
diff --git a/kern/ipc_tt.c b/kern/ipc_tt.c
index fb89fac..e14ebac 100644
--- a/kern/ipc_tt.c
+++ b/kern/ipc_tt.c
@@ -537,7 +537,7 @@ mach_task_self(void)
*/
mach_port_t
-mach_thread_self()
+mach_thread_self(void)
{
thread_t thread = current_thread();
task_t task = thread->task;
diff --git a/kern/ipc_tt.h b/kern/ipc_tt.h
index 0e6ce9d..e2009b9 100644
--- a/kern/ipc_tt.h
+++ b/kern/ipc_tt.h
@@ -28,61 +28,62 @@
#define _KERN_IPC_TT_H_
#include <mach/boolean.h>
+#include <mach/mach_types.h>
#include <mach/port.h>
-extern void ipc_task_init();
-extern void ipc_task_enable();
-extern void ipc_task_disable();
-extern void ipc_task_terminate();
+extern void ipc_task_init(task_t, task_t);
+extern void ipc_task_enable(task_t);
+extern void ipc_task_disable(task_t);
+extern void ipc_task_terminate(task_t);
-extern void ipc_thread_init();
-extern void ipc_thread_enable();
-extern void ipc_thread_disable();
-extern void ipc_thread_terminate();
+extern void ipc_thread_init(thread_t);
+extern void ipc_thread_enable(thread_t);
+extern void ipc_thread_disable(thread_t);
+extern void ipc_thread_terminate(thread_t);
extern struct ipc_port *
-retrieve_task_self(/* task_t */);
+retrieve_task_self(task_t);
extern struct ipc_port *
-retrieve_task_self_fast(/* task_t */);
+retrieve_task_self_fast(task_t);
extern struct ipc_port *
-retrieve_thread_self(/* thread_t */);
+retrieve_thread_self(thread_t);
extern struct ipc_port *
-retrieve_thread_self_fast(/* thread_t */);
+retrieve_thread_self_fast(thread_t);
extern struct ipc_port *
-retrieve_task_exception(/* task_t */);
+retrieve_task_exception(task_t);
extern struct ipc_port *
-retrieve_thread_exception(/* thread_t */);
+retrieve_thread_exception(thread_t);
extern struct task *
-convert_port_to_task(/* struct ipc_port * */);
+convert_port_to_task(struct ipc_port *);
extern struct ipc_port *
-convert_task_to_port(/* task_t */);
+convert_task_to_port(task_t);
extern void
-task_deallocate(/* task_t */);
+task_deallocate(task_t);
extern struct thread *
-convert_port_to_thread(/* struct ipc_port * */);
+convert_port_to_thread(struct ipc_port *);
extern struct ipc_port *
-convert_thread_to_port(/* thread_t */);
+convert_thread_to_port(thread_t);
extern void
-thread_deallocate(/* thread_t */);
+thread_deallocate(thread_t);
extern struct vm_map *
-convert_port_to_map(/* struct ipc_port * */);
+convert_port_to_map(struct ipc_port *);
extern struct ipc_space *
-convert_port_to_space(/* struct ipc_port * */);
+convert_port_to_space(struct ipc_port *);
extern void
-space_deallocate(/* ipc_space_t */);
+space_deallocate(ipc_space_t);
#endif /* _KERN_IPC_TT_H_ */
diff --git a/kern/mach_factor.c b/kern/mach_factor.c
index 89e1851..6fbda83 100644
--- a/kern/mach_factor.c
+++ b/kern/mach_factor.c
@@ -55,7 +55,7 @@ static long fract[3] = {
983, /* (59.0/60.) 1 minute average */
};
-void compute_mach_factor()
+void compute_mach_factor(void)
{
register processor_set_t pset;
register processor_t processor;
diff --git a/kern/mach_factor.h b/kern/mach_factor.h
index 81624bb..0ec64be 100644
--- a/kern/mach_factor.h
+++ b/kern/mach_factor.h
@@ -1,6 +1,5 @@
/*
- *
- * Copyright (C) 2006 Free Software Foundation, Inc.
+ * Copyright (C) 2006, 2007 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,6 +26,6 @@
#include <sys/types.h>
-extern void compute_mach_factor();
+extern void compute_mach_factor(void);
#endif /* _KERN_MACH_FACTOR_H_ */
diff --git a/kern/printf.c b/kern/printf.c
index 74bb6c4..99dffbd 100644
--- a/kern/printf.c
+++ b/kern/printf.c
@@ -153,7 +153,7 @@ boolean_t _doprnt_truncates = FALSE;
boolean_t _doprnt_lock_initialized = FALSE;
decl_simple_lock_data(,_doprnt_lock)
-void printf_init()
+void printf_init(void)
{
if (!_doprnt_lock_initialized)
{
diff --git a/kern/printf.h b/kern/printf.h
index f5930dc..6d41eb8 100644
--- a/kern/printf.h
+++ b/kern/printf.h
@@ -1,6 +1,6 @@
/*
* Header file for printf type functions.
- * Copyright (C) 2006 Free Software Foundation.
+ * Copyright (C) 2006, 2007 Free Software Foundation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
#include <sys/types.h>
#include <stdarg.h>
-extern void printf_init ();
+extern void printf_init (void);
extern void _doprnt (const char *fmt,
va_list *argp,
diff --git a/kern/queue.h b/kern/queue.h
index 3481db3..97a0a76 100644
--- a/kern/queue.h
+++ b/kern/queue.h
@@ -79,11 +79,11 @@ typedef struct queue_entry *queue_entry_t;
#define enqueue(queue,elt) enqueue_tail(queue, elt)
#define dequeue(queue) dequeue_head(queue)
-void enqueue_head();
-void enqueue_tail();
-queue_entry_t dequeue_head();
-queue_entry_t dequeue_tail();
-void remqueue();
+void enqueue_head(queue_t, queue_entry_t);
+void enqueue_tail(queue_t, queue_entry_t);
+queue_entry_t dequeue_head(queue_t);
+queue_entry_t dequeue_tail(queue_t);
+void remqueue(queue_t, queue_entry_t);
/*
* Macro: queue_init
diff --git a/kern/sched.h b/kern/sched.h
index c4ff647..434e022 100644
--- a/kern/sched.h
+++ b/kern/sched.h
@@ -37,6 +37,7 @@
#include <kern/queue.h>
#include <kern/lock.h>
+#include <kern/kern_types.h>
#include <kern/macro_help.h>
#if MACH_FIXPRI
@@ -106,8 +107,8 @@ typedef struct run_queue *run_queue_t;
* Scheduler routines.
*/
-extern struct run_queue *rem_runq();
-extern struct thread *choose_thread();
+extern struct run_queue *rem_runq(thread_t);
+extern struct thread *choose_thread(processor_t);
extern queue_head_t action_queue; /* assign/shutdown queue */
decl_simple_lock_data(extern,action_lock);
diff --git a/kern/syscall_subr.c b/kern/syscall_subr.c
index 28119f1..4db1f16 100644
--- a/kern/syscall_subr.c
+++ b/kern/syscall_subr.c
@@ -62,10 +62,10 @@
* lock and then be a good citizen and really suspend.
*/
-extern void thread_depress_priority();
-extern kern_return_t thread_depress_abort();
+extern void thread_depress_priority(thread_t, mach_msg_timeout_t);
+extern kern_return_t thread_depress_abort(thread_t);
-void swtch_continue()
+void swtch_continue(void)
{
register processor_t myprocessor;
@@ -75,7 +75,7 @@ void swtch_continue()
/*NOTREACHED*/
}
-boolean_t swtch()
+boolean_t swtch(void)
{
register processor_t myprocessor;
@@ -93,7 +93,7 @@ boolean_t swtch()
myprocessor->processor_set->runq.count > 0);
}
-void swtch_pri_continue()
+void swtch_pri_continue(void)
{
register thread_t thread = current_thread();
register processor_t myprocessor;
@@ -139,7 +139,7 @@ boolean_t swtch_pri(pri)
myprocessor->processor_set->runq.count > 0);
}
-void thread_switch_continue()
+void thread_switch_continue(void)
{
register thread_t cur_thread = current_thread();
diff --git a/kern/syscall_subr.h b/kern/syscall_subr.h
index 8790d73..4ac9489 100644
--- a/kern/syscall_subr.h
+++ b/kern/syscall_subr.h
@@ -27,9 +27,9 @@
#ifndef _KERN_SYSCALL_SUBR_H_
#define _KERN_SYSCALL_SUBR_H_
-extern int swtch();
-extern int swtch_pri();
-extern int thread_switch();
-extern void thread_depress_timeout();
+extern int swtch(void);
+extern int swtch_pri(int);
+extern int thread_switch(mach_port_t, int, mach_msg_timeout_t);
+extern void thread_depress_timeout(thread_t);
#endif /* _KERN_SYSCALL_SUBR_H_ */
diff --git a/kern/task.h b/kern/task.h
index e467a2f..8c905c2 100644
--- a/kern/task.h
+++ b/kern/task.h
@@ -150,16 +150,14 @@ extern kern_return_t task_assign_default(
* Internal only routines
*/
-extern void task_init();
-extern void task_reference();
-extern void task_deallocate();
-extern kern_return_t task_hold();
-extern kern_return_t task_dowait();
-extern kern_return_t task_release();
-extern kern_return_t task_halt();
-
-extern kern_return_t task_suspend_nowait();
-extern task_t kernel_task_create();
+extern void task_init(void);
+extern void task_reference(task_t);
+extern void task_deallocate(task_t);
+extern kern_return_t task_hold(task_t);
+extern kern_return_t task_dowait(task_t, boolean_t);
+extern kern_return_t task_release(task_t);
+
+extern task_t kernel_task_create(task_t, vm_size_t);
extern task_t kernel_task;
diff --git a/kern/thread_swap.c b/kern/thread_swap.c
index b75e0f4..f29bd5b 100644
--- a/kern/thread_swap.c
+++ b/kern/thread_swap.c
@@ -70,7 +70,7 @@ decl_simple_lock_data(, swapper_lock_data)
*
* Initialize the swapper module.
*/
-void swapper_init()
+void swapper_init(void)
{
queue_init(&swapin_queue);
simple_lock_init(&swapper_lock_data);
@@ -154,7 +154,7 @@ void thread_doswapin(thread)
* This procedure executes as a kernel thread. Threads that need to
* be swapped in are swapped in by this thread.
*/
-void swapin_thread_continue()
+void swapin_thread_continue(void)
{
for (;;) {
register thread_t thread;
@@ -182,7 +182,7 @@ void swapin_thread_continue()
}
}
-void swapin_thread()
+void swapin_thread(void)
{
stack_privilege(current_thread());
diff --git a/kern/thread_swap.h b/kern/thread_swap.h
index c08f39f..3113030 100644
--- a/kern/thread_swap.h
+++ b/kern/thread_swap.h
@@ -35,10 +35,10 @@
/*
* exported routines
*/
-extern void swapper_init();
-extern void thread_swapin( /* thread_t thread */ );
-extern void thread_doswapin( /* thread_t thread */ );
-extern void swapin_thread();
-extern void thread_swapout( /* thread_t thread */ );
+extern void swapper_init(void);
+extern void thread_swapin(thread_t thread);
+extern void thread_doswapin(thread_t thread);
+extern void swapin_thread(void);
+extern void thread_swapout(thread_t thread);
#endif /* _KERN_THREAD_SWAP_H_ */
diff --git a/kern/timer.h b/kern/timer.h
index 4018236..07e46fc 100644
--- a/kern/timer.h
+++ b/kern/timer.h
@@ -124,13 +124,13 @@ typedef struct timer_save timer_save_data_t, *timer_save_t;
#define start_timer(timer)
#define timer_switch(timer)
#else /* STAT_TIME */
-extern void start_timer();
-extern void timer_switch();
+extern void start_timer(timer_t);
+extern void timer_switch(timer_t);
#endif /* STAT_TIME */
-extern void timer_read();
-extern void thread_read_times();
-extern unsigned timer_delta();
+extern void timer_read(timer_t, time_value_t *);
+extern void thread_read_times(thread_t, time_value_t *, time_value_t *);
+extern unsigned timer_delta(timer_t, timer_save_t);
#if STAT_TIME
/*
@@ -148,10 +148,10 @@ MACRO_END
/*
* Exported hardware interface to timers
*/
-extern void time_trap_uentry();
-extern void time_trap_uexit();
-extern timer_t time_int_entry();
-extern void time_int_exit();
+extern void time_trap_uentry(unsigned);
+extern void time_trap_uexit(int);
+extern timer_t time_int_entry(unsigned, timer_t);
+extern void time_int_exit(unsigned, timer_t);
#endif /* STAT_TIME */
/*
diff --git a/kern/xpr.c b/kern/xpr.c
index af494d2..465ba7b 100644
--- a/kern/xpr.c
+++ b/kern/xpr.c
@@ -88,7 +88,7 @@ int arg1, arg2, arg3, arg4, arg5;
x->cpuinfo = cpu_number();
}
-void xprbootstrap()
+void xprbootstrap(void)
{
vm_offset_t addr;
vm_size_t size;
@@ -125,7 +125,7 @@ void xprbootstrap()
int xprinitial = 0;
-void xprinit()
+void xprinit(void)
{
xprflags |= xprinitial;
}
diff --git a/kern/xpr.h b/kern/xpr.h
index 1e1204d..4a06216 100644
--- a/kern/xpr.h
+++ b/kern/xpr.h
@@ -89,11 +89,9 @@ struct xprbuf {
int cpuinfo;
};
-#ifndef WANT_PROTOTYPES
-extern void xpr();
-#endif
-extern void xpr_dump();
-extern void xprinit();
-extern void xprbootstrap();
+extern void xpr(char *, int, int, int, int, int);
+extern void xpr_dump(struct xprbuf *, int);
+extern void xprinit(void);
+extern void xprbootstrap(void);
#endif /* _KERN_XPR_H_ */
diff --git a/kern/zalloc.c b/kern/zalloc.c
index 9728d46..126937e 100644
--- a/kern/zalloc.c
+++ b/kern/zalloc.c
@@ -95,10 +95,10 @@ extern vm_offset_t zone_map_min_address;
(&(zone_page_table[(atop(((vm_offset_t)addr) - zone_map_min_address))]))
-extern void zone_page_alloc();
-extern void zone_page_dealloc();
-extern void zone_page_in_use();
-extern void zone_page_free();
+extern void zone_page_alloc(vm_offset_t, vm_size_t);
+extern void zone_page_dealloc(vm_offset_t, vm_size_t);
+extern void zone_page_in_use(vm_offset_t, vm_size_t);
+extern void zone_page_free(vm_offset_t, vm_size_t);
zone_t zone_zone; /* this is the zone containing other zones */
@@ -165,7 +165,7 @@ vm_offset_t zone_map_min_address;
vm_offset_t zone_map_max_address;
int zone_pages;
-extern void zone_page_init();
+extern void zone_page_init(vm_offset_t, vm_size_t, int);
#define ZONE_PAGE_USED 0
#define ZONE_PAGE_UNUSED -1
@@ -361,7 +361,7 @@ static vm_offset_t zget_space(vm_offset_t size, vm_size_t align)
* earlier in memory initialization. zone_bootstrap is called
* before zone_init.
*/
-void zone_bootstrap()
+void zone_bootstrap(void)
{
simple_lock_init(&all_zones_lock);
first_zone = ZONE_NULL;
@@ -378,7 +378,7 @@ void zone_bootstrap()
sizeof(struct zone), 0, "zones");
}
-void zone_init()
+void zone_init(void)
{
vm_offset_t zone_min;
vm_offset_t zone_max;
@@ -732,7 +732,7 @@ struct zone_free_entry {
* pages. zone_gc is called by consider_zone_gc when the system
* begins to run out of memory.
*/
-static void zone_gc()
+static void zone_gc(void)
{
int max_zones;
zone_t z;
@@ -841,7 +841,7 @@ unsigned zone_gc_max_rate = 0; /* in ticks */
*/
void
-consider_zone_gc()
+consider_zone_gc(void)
{
/*
* By default, don't attempt zone GC more frequently
diff --git a/kern/zalloc.h b/kern/zalloc.h
index 3f9bf21..f1a1850 100644
--- a/kern/zalloc.h
+++ b/kern/zalloc.h
@@ -80,11 +80,11 @@ void zfree(zone_t zone, vm_offset_t elem);
void zcram(zone_t zone, vm_offset_t newmem, vm_size_t size);
/* Exported only to vm/vm_init.c */
-void zone_bootstrap();
-void zone_init();
+void zone_bootstrap(void);
+void zone_init(void);
/* Exported only to vm/vm_pageout.c */
-void consider_zone_gc();
+void consider_zone_gc(void);
/* Memory type bits for zones */