summaryrefslogtreecommitdiff
path: root/kern
diff options
context:
space:
mode:
Diffstat (limited to 'kern')
-rw-r--r--kern/bootstrap.c10
-rw-r--r--kern/debug.c20
-rw-r--r--kern/printf.c27
3 files changed, 22 insertions, 35 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c
index c3c971d..d6dcad4 100644
--- a/kern/bootstrap.c
+++ b/kern/bootstrap.c
@@ -43,7 +43,7 @@
#include <vm/vm_kern.h>
#include <device/device_port.h>
-#include <sys/varargs.h>
+#include <stdarg.h>
#include <mach/machine/multiboot.h>
#include <mach/exec/exec.h>
@@ -335,9 +335,7 @@ extern vm_offset_t user_stack_low();
extern vm_offset_t set_user_regs();
void
-static build_args_and_stack(boot_exec_info, va_alist)
- struct exec_info *boot_exec_info;
- va_dcl
+static build_args_and_stack(struct exec_info *boot_exec_info, ...)
{
vm_offset_t stack_base;
vm_size_t stack_size;
@@ -358,7 +356,7 @@ static build_args_and_stack(boot_exec_info, va_alist)
/*
* Calculate the size of the argument list.
*/
- va_start(argv_ptr);
+ va_start(argv_ptr, boot_exec_info);
arg_len = 0;
arg_count = 0;
for (;;) {
@@ -417,7 +415,7 @@ static build_args_and_stack(boot_exec_info, va_alist)
/*
* Then the strings and string pointers for each argument
*/
- va_start(argv_ptr);
+ va_start(argv_ptr, boot_exec_info);
while (--arg_count >= 0) {
arg_ptr = va_arg(argv_ptr, char *);
arg_item_len = strlen(arg_ptr) + 1; /* include trailing 0 */
diff --git a/kern/debug.c b/kern/debug.c
index 26c402d..2ba15fe 100644
--- a/kern/debug.c
+++ b/kern/debug.c
@@ -24,15 +24,18 @@
* the rights to redistribute these changes.
*/
+#include <stdarg.h>
+
#include <mach_kdb.h>
#include <norma_ipc.h>
#include <cpus.h>
#include "cpu_number.h"
#include <kern/lock.h>
-#include <sys/varargs.h>
#include <kern/thread.h>
+#warning missing include for panic()
+void panic(const char *s, ...);
extern void cnputc();
@@ -105,7 +108,7 @@ void Debugger(message)
boolean_t panic_lock_initialized = FALSE;
decl_simple_lock_data(, panic_lock)
-char *panicstr;
+const char *panicstr;
int paniccpu;
void
@@ -120,9 +123,7 @@ panic_init()
/*VARARGS1*/
void
-panic(s, va_alist)
- char * s;
- va_dcl
+panic(const char *s, ...)
{
va_list listp;
#if NORMA_IPC
@@ -152,7 +153,7 @@ panic(s, va_alist)
printf("(cpu %U)", paniccpu);
#endif
printf(": ");
- va_start(listp);
+ va_start(listp, s);
_doprnt(s, &listp, cnputc, 0);
va_end(listp);
printf("\n");
@@ -176,17 +177,14 @@ panic(s, va_alist)
*/
/*VARARGS2*/
void
-log(level, fmt, va_alist)
- int level;
- char * fmt;
- va_dcl
+log(int level, const char *fmt, ...)
{
va_list listp;
#ifdef lint
level++;
#endif
- va_start(listp);
+ va_start(listp, fmt);
_doprnt(fmt, &listp, cnputc, 0);
va_end(listp);
}
diff --git a/kern/printf.c b/kern/printf.c
index 693c660..85e6278 100644
--- a/kern/printf.c
+++ b/kern/printf.c
@@ -115,7 +115,7 @@
#include <mach/boolean.h>
#include <kern/lock.h>
#include <kern/strings.h>
-#include <sys/varargs.h>
+#include <stdarg.h>
#define isdigit(d) ((d) >= '0' && (d) <= '9')
#define Ctod(c) ((c) - '0')
@@ -161,7 +161,7 @@ void printf_init()
}
void _doprnt(
- register char *fmt,
+ register const char *fmt,
va_list *argp,
/* character output routine */
void (*putc)( char, vm_offset_t),
@@ -509,20 +509,16 @@ void _doprnt(
*/
extern void cnputc( char, /*not really*/vm_offset_t);
-void vprintf(fmt, listp)
- char * fmt;
- va_list listp;
+void vprintf(const char *fmt, va_list listp)
{
_doprnt(fmt, &listp, cnputc, 16, 0);
}
/*VARARGS1*/
-void printf(fmt, va_alist)
- char * fmt;
- va_dcl
+void printf(const char *fmt, ...)
{
va_list listp;
- va_start(listp);
+ va_start(listp, fmt);
vprintf(fmt, listp);
va_end(listp);
}
@@ -533,9 +529,7 @@ int indent = 0;
* Printing (to console) with indentation.
*/
/*VARARGS1*/
-void iprintf(fmt, va_alist)
- char * fmt;
- va_dcl
+void iprintf(const char *fmt, ...)
{
va_list listp;
register int i;
@@ -550,7 +544,7 @@ void iprintf(fmt, va_alist)
i--;
}
}
- va_start(listp);
+ va_start(listp, fmt);
_doprnt(fmt, &listp, cnputc, 16, 0);
va_end(listp);
}
@@ -572,15 +566,12 @@ sputc(
}
int
-sprintf( buf, fmt, va_alist)
- char *buf;
- char *fmt;
- va_dcl
+sprintf(char *buf, const char *fmt, ...)
{
va_list listp;
char *start = buf;
- va_start(listp);
+ va_start(listp, fmt);
_doprnt(fmt, &listp, sputc, 16, (vm_offset_t)&buf);
va_end(listp);