diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/bootstrap.c | 2 | ||||
-rw-r--r-- | kern/debug.c | 11 | ||||
-rw-r--r-- | kern/eventcount.c | 1 | ||||
-rw-r--r-- | kern/ipc_kobject.c | 1 | ||||
-rw-r--r-- | kern/pc_sample.c | 1 | ||||
-rw-r--r-- | kern/printf.c | 2 | ||||
-rw-r--r-- | kern/sched_prim.c | 1 | ||||
-rw-r--r-- | kern/strings.c | 8 | ||||
-rw-r--r-- | kern/strings.h | 56 | ||||
-rw-r--r-- | kern/thread.c | 1 | ||||
-rw-r--r-- | kern/zalloc.c | 1 |
11 files changed, 21 insertions, 64 deletions
diff --git a/kern/bootstrap.c b/kern/bootstrap.c index 3613e38..540322d 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c @@ -31,6 +31,7 @@ */ #include <alloca.h> +#include <printf.h> #include <string.h> #include <mach/port.h> @@ -58,7 +59,6 @@ #else #include <mach/machine/multiboot.h> #include <mach/exec/exec.h> -#include <kern/strings.h> extern struct multiboot_info boot_info; /* XXX put this in a header! */ #endif diff --git a/kern/debug.c b/kern/debug.c index 6a31ab8..42764bd 100644 --- a/kern/debug.c +++ b/kern/debug.c @@ -24,6 +24,7 @@ * the rights to redistribute these changes. */ +#include <printf.h> #include <stdarg.h> #include "cpu_number.h" @@ -45,6 +46,12 @@ extern int db_breakpoints_inserted; simple_lock_data_t Assert_print_lock; /* uninited, we take our chances */ #endif +static void +do_cnputc(char c, vm_offset_t offset) +{ + cnputc(c); +} + void Assert(char *exp, char *file, int line) { @@ -144,7 +151,7 @@ panic(const char *s, ...) #endif printf(": "); va_start(listp, s); - _doprnt(s, &listp, cnputc, 0); + _doprnt(s, &listp, do_cnputc, 0, 0); va_end(listp); printf("\n"); @@ -175,6 +182,6 @@ log(int level, const char *fmt, ...) level++; #endif va_start(listp, fmt); - _doprnt(fmt, &listp, cnputc, 0); + _doprnt(fmt, &listp, do_cnputc, 0, 0); va_end(listp); } diff --git a/kern/eventcount.c b/kern/eventcount.c index b562f1a..4a8ebd7 100644 --- a/kern/eventcount.c +++ b/kern/eventcount.c @@ -35,6 +35,7 @@ * */ +#include <printf.h> #include <string.h> #include <mach/machine.h> diff --git a/kern/ipc_kobject.c b/kern/ipc_kobject.c index 7e51d92..d642228 100644 --- a/kern/ipc_kobject.c +++ b/kern/ipc_kobject.c @@ -33,6 +33,7 @@ * Functions for letting a port represent a kernel object. */ +#include <printf.h> #include <mach/port.h> #include <mach/kern_return.h> #include <mach/message.h> diff --git a/kern/pc_sample.c b/kern/pc_sample.c index b414941..a335c47 100644 --- a/kern/pc_sample.c +++ b/kern/pc_sample.c @@ -24,6 +24,7 @@ * the rights to redistribute these changes. */ +#include <printf.h> #include <string.h> #include <mach/mach_types.h> /* vm_address_t */ diff --git a/kern/printf.c b/kern/printf.c index 7dcb798..a1f18b0 100644 --- a/kern/printf.c +++ b/kern/printf.c @@ -113,9 +113,9 @@ * (compatibility) */ +#include <string.h> #include <mach/boolean.h> #include <kern/lock.h> -#include <kern/strings.h> #include <stdarg.h> #define isdigit(d) ((d) >= '0' && (d) <= '9') diff --git a/kern/sched_prim.c b/kern/sched_prim.c index 24b64f9..116bfe6 100644 --- a/kern/sched_prim.c +++ b/kern/sched_prim.c @@ -32,6 +32,7 @@ * */ +#include <printf.h> #include <mach/machine.h> #include <kern/ast.h> #include <kern/counters.h> diff --git a/kern/strings.c b/kern/strings.c index 89563cd..80e410e 100644 --- a/kern/strings.c +++ b/kern/strings.c @@ -31,7 +31,7 @@ * String functions. */ -#include <kern/strings.h> /* make sure we sell the truth */ +#include <string.h> #ifdef strcpy #undef strcmp @@ -84,7 +84,7 @@ int strncmp( register const char *s1, register const char *s2, - unsigned long n) + size_t n) { register unsigned int a, b; @@ -137,7 +137,7 @@ char * strncpy( register char *to, register const char *from, - register unsigned long count) + register size_t count) { register char *ret = to; @@ -161,7 +161,7 @@ strncpy( * the terminating null character. */ -unsigned long +size_t strlen( register const char *string) { diff --git a/kern/strings.h b/kern/strings.h deleted file mode 100644 index 225228d..0000000 --- a/kern/strings.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Mach Operating System - * Copyright (c) 1993 Carnegie Mellon University - * All Rights Reserved. - * - * Permission to use, copy, modify and distribute this software and its - * documentation is hereby granted, provided that both the copyright - * notice and this permission notice appear in all copies of the - * software, derivative works or modified versions, and any portions - * thereof, and that both notices appear in supporting documentation. - * - * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" - * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR - * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * Carnegie Mellon requests users of this software to return to - * - * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU - * School of Computer Science - * Carnegie Mellon University - * Pittsburgh PA 15213-3890 - * - * any improvements or extensions that they make and grant Carnegie Mellon - * the rights to redistribute these changes. - */ -/* - * File: strings.h - * Author: Alessandro Forin, Carnegie Mellon University - * Date: 3/93 - * - * Prototypes for string functions. The way GCC wants them. - */ - -extern int strcmp( - const char *, - const char * ); - -extern int strncmp( - const char *, - const char *, - unsigned long); - -extern char *strcpy( - char *, - const char *); - -extern char *strncpy( - char *, - const char *, - unsigned long); - -extern unsigned long strlen( - const char *); - -extern char *strsep(char **, const char *); -extern char *strchr(const char *, int); diff --git a/kern/thread.c b/kern/thread.c index 333ee9a..911ceb9 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -31,6 +31,7 @@ * Thread management primitives implementation. */ +#include <printf.h> #include <mach/std_types.h> #include <mach/policy.h> #include <mach/thread_info.h> diff --git a/kern/zalloc.c b/kern/zalloc.c index 48fbb32..e089023 100644 --- a/kern/zalloc.c +++ b/kern/zalloc.c @@ -34,6 +34,7 @@ * data blocks for which quick allocation/deallocation is possible. */ +#include <printf.h> #include <string.h> #include <kern/macro_help.h> |