From d1ee506ebd11d305e5384ea0edf072d8076b4eac Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Thu, 9 Nov 2006 23:33:45 +0000 Subject: 2006-11-09 Barry deFreese [task #5726 --- ``GCC built-in functions''] * include/printf.h: Move file... * kern/printf.h: ... here. * kern/debug.h (panic_init, panic): Add prototypes. * chips/busses.c: Don't include `printf.h', include `kern/printf.h' and `kern/debug.h'. * ddb/db_command.c: Likewise. * ddb/db_cond.c: Likewise. * ddb/db_output.c: Likewise. * device/cirbuf.c: Likewise. * device/cons.c: Likewise. * device/dev_name.c: Likewise. * device/dev_pager.c: Likewise. * device/device_init.c: Likewise. * device/dk_label.c: Likewise. * device/ds_routines.c: Likewise. * device/net_io.c: Likewise. * device/subrs.c: Likewise. * i386/i386/debug_i386.c: Likewise. * i386/i386/fpe_linkage.c: Likewise. * i386/i386/fpu.c: Likewise. * i386/i386/io_map.c: Likewise. * i386/i386/kttd_interface.c: Likewise. * i386/i386/mp_desc.c: Likewise. * i386/i386/pcb.c: Likewise. * i386/i386/pic.c: Likewise. * i386/i386/trap.c: Likewise. * i386/i386at/autoconf.c: Likewise. * i386/i386at/com.c: Likewise. * i386/i386at/i386at_ds_routines.c: Likewise. * i386/i386at/kd.c: Likewise. * i386/i386at/kd_event.c: Likewise. * i386/i386at/kd_mouse.c: Likewise. * i386/i386at/lpr.c: Likewise. * i386/i386at/model_dep.c: Likewise. * i386/intel/pmap.c: Likewise. * ipc/ipc_entry.c: Likewise. * ipc/ipc_hash.c: Likewise. * ipc/ipc_kmsg.c: Likewise. * ipc/ipc_mqueue.c: Likewise. * ipc/ipc_notify.c: Likewise. * ipc/ipc_object.c: Likewise. * ipc/ipc_port.c: Likewise. * ipc/ipc_pset.c: Likewise. * ipc/ipc_right.c: Likewise. * ipc/mach_msg.c: Likewise. * ipc/mach_port.c: Likewise. * ipc/mach_rpc.c: Likewise. * kern/act.c: Likewise. * kern/ast.c: Likewise. * kern/bootstrap.c: Likewise. * kern/debug.c: Likewise. * kern/eventcount.c: Likewise. * kern/exception.c: Likewise. * kern/host.c: Likewise. * kern/ipc_host.c: Likewise. * kern/ipc_kobject.c: Likewise. * kern/ipc_mig.c: Likewise. * kern/ipc_sched.c: Likewise. * kern/ipc_tt.c: Likewise. * kern/kalloc.c: Likewise. * kern/lock.c: Likewise. * kern/mach_clock.c: Likewise. * kern/machine.c: Likewise. * kern/pc_sample.c: Likewise. * kern/printf.c: Likewise. * kern/processor.c: Likewise. * kern/sched_prim.c: Likewise. * kern/server_loop.ch: Likewise. * kern/startup.c: Likewise. * kern/task.c: Likewise. * kern/thread.c: Likewise. * kern/thread_swap.c: Likewise. * kern/xpr.c: Likewise. * kern/zalloc.c: Likewise. * vm/memory_object.c: Likewise. * vm/vm_debug.c: Likewise. * vm/vm_fault.c: Likewise. * vm/vm_kern.c: Likewise. * vm/vm_map.c: Likewise. * vm/vm_object.c: Likewise. * vm/vm_object.h: Likewise. * vm/vm_pageout.c: Likewise. * vm/vm_resident.c: Likewise. --- kern/act.c | 1 + kern/ast.c | 1 + kern/bootstrap.c | 3 ++- kern/debug.c | 6 ++---- kern/debug.h | 3 +++ kern/eventcount.c | 3 ++- kern/exception.c | 1 + kern/host.c | 1 + kern/ipc_host.c | 1 + kern/ipc_kobject.c | 3 ++- kern/ipc_mig.c | 1 + kern/ipc_sched.c | 1 + kern/ipc_tt.c | 1 + kern/kalloc.c | 1 + kern/lock.c | 1 + kern/mach_clock.c | 1 + kern/machine.c | 1 + kern/pc_sample.c | 2 +- kern/printf.c | 2 +- kern/printf.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ kern/processor.c | 1 + kern/sched_prim.c | 3 ++- kern/server_loop.ch | 1 + kern/startup.c | 3 ++- kern/task.c | 1 + kern/thread.c | 3 ++- kern/thread_swap.c | 1 + kern/xpr.c | 1 + kern/zalloc.c | 3 ++- 29 files changed, 90 insertions(+), 13 deletions(-) create mode 100644 kern/printf.h (limited to 'kern') diff --git a/kern/act.c b/kern/act.c index a7a8ac9..2954826 100644 --- a/kern/act.c +++ b/kern/act.c @@ -35,6 +35,7 @@ #include #include #include +#include /* for panic() */ #include #include #include "ipc_target.h" diff --git a/kern/ast.c b/kern/ast.c index 8fff997..1d967fc 100644 --- a/kern/ast.c +++ b/kern/ast.c @@ -37,6 +37,7 @@ #include #include +#include /* for panic() */ #include "cpu_number.h" #include #include diff --git a/kern/bootstrap.c b/kern/bootstrap.c index 540322d..4539765 100644 --- a/kern/bootstrap.c +++ b/kern/bootstrap.c @@ -31,14 +31,15 @@ */ #include -#include #include #include #include #include #include +#include /* for panic() */ #include +#include #include #include #include diff --git a/kern/debug.c b/kern/debug.c index 42764bd..f8774fc 100644 --- a/kern/debug.c +++ b/kern/debug.c @@ -24,16 +24,14 @@ * the rights to redistribute these changes. */ -#include +#include #include #include "cpu_number.h" #include #include -#warning missing include for panic() -void panic(const char *s, ...); - +#include extern void cnputc(); void Debugger(); diff --git a/kern/debug.h b/kern/debug.h index 526ccc6..28e7b73 100644 --- a/kern/debug.h +++ b/kern/debug.h @@ -57,4 +57,7 @@ #endif /* NDEBUG */ +extern void panic_init(); +extern void panic (const char *s, ...); + #endif /* _mach_debug__debug_ */ diff --git a/kern/eventcount.c b/kern/eventcount.c index 4a8ebd7..576607c 100644 --- a/kern/eventcount.c +++ b/kern/eventcount.c @@ -35,11 +35,12 @@ * */ -#include +#include #include #include #include +#include /* For panic() */ #include "cpu_number.h" #include #include diff --git a/kern/exception.c b/kern/exception.c index 62292b4..21a3581 100644 --- a/kern/exception.c +++ b/kern/exception.c @@ -38,6 +38,7 @@ #include #include #include +#include /* for panic() */ #include #include #include diff --git a/kern/host.c b/kern/host.c index 6e98c2c..b1056af 100644 --- a/kern/host.c +++ b/kern/host.c @@ -32,6 +32,7 @@ #include #include +#include /* for panic() */ #include #include #include diff --git a/kern/ipc_host.c b/kern/ipc_host.c index d4049d2..2cf322d 100644 --- a/kern/ipc_host.c +++ b/kern/ipc_host.c @@ -33,6 +33,7 @@ */ #include +#include /* for panic() */ #include #include #include diff --git a/kern/ipc_kobject.c b/kern/ipc_kobject.c index d642228..d9fbe17 100644 --- a/kern/ipc_kobject.c +++ b/kern/ipc_kobject.c @@ -33,7 +33,8 @@ * Functions for letting a port represent a kernel object. */ -#include +#include /* For panic() */ +#include #include #include #include diff --git a/kern/ipc_mig.c b/kern/ipc_mig.c index 4f45eba..cc25f0e 100644 --- a/kern/ipc_mig.c +++ b/kern/ipc_mig.c @@ -29,6 +29,7 @@ #include #include #include +#include /* for panic() */ #include #include #include diff --git a/kern/ipc_sched.c b/kern/ipc_sched.c index e1edfd6..cfd7b90 100644 --- a/kern/ipc_sched.c +++ b/kern/ipc_sched.c @@ -27,6 +27,7 @@ #include #include #include "cpu_number.h" +#include /* for panic() */ #include #include #include diff --git a/kern/ipc_tt.c b/kern/ipc_tt.c index b1a9443..b757bb8 100644 --- a/kern/ipc_tt.c +++ b/kern/ipc_tt.c @@ -35,6 +35,7 @@ #include #include #include +#include /* for panic() */ #include #include #include diff --git a/kern/kalloc.c b/kern/kalloc.c index 24dfe68..4b9713e 100644 --- a/kern/kalloc.c +++ b/kern/kalloc.c @@ -38,6 +38,7 @@ #include #include +#include /* for panic() */ #include #include #include diff --git a/kern/lock.c b/kern/lock.c index ba0f0c2..5bdca08 100644 --- a/kern/lock.c +++ b/kern/lock.c @@ -36,6 +36,7 @@ #include +#include /* for panic() */ #include #include #include diff --git a/kern/mach_clock.c b/kern/mach_clock.c index d67897b..c53a7f3 100644 --- a/kern/mach_clock.c +++ b/kern/mach_clock.c @@ -43,6 +43,7 @@ #include #include #include "cpu_number.h" +#include /* for panic() */ #include #include #include diff --git a/kern/machine.c b/kern/machine.c index 3a5d21f..9f737b4 100644 --- a/kern/machine.c +++ b/kern/machine.c @@ -40,6 +40,7 @@ #include #include #include +#include /* for panic() */ #include #include #include diff --git a/kern/pc_sample.c b/kern/pc_sample.c index a335c47..e26fd41 100644 --- a/kern/pc_sample.c +++ b/kern/pc_sample.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. */ -#include +#include #include #include /* vm_address_t */ diff --git a/kern/printf.c b/kern/printf.c index 37543b3..22b0987 100644 --- a/kern/printf.c +++ b/kern/printf.c @@ -114,7 +114,7 @@ */ #include -#include +#include #include #include #include diff --git a/kern/printf.h b/kern/printf.h new file mode 100644 index 0000000..f5930dc --- /dev/null +++ b/kern/printf.h @@ -0,0 +1,52 @@ +/* + * Header file for printf type functions. + * Copyright (C) 2006 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 + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* + * String handling functions. + * + */ + +#ifndef _MACH_SA_SYS_PRINTF_H_ +#define _MACH_SA_SYS_PRINTF_H_ + +#include +#include + +extern void printf_init (); + +extern void _doprnt (const char *fmt, + va_list *argp, + void (*putc)(char, vm_offset_t), + int radix, + vm_offset_t putc_arg); + +extern void printnum (unsigned long u, int base, + void (*putc)(char, vm_offset_t), + vm_offset_t putc_arg); + +extern int sprintf (char *buf, const char *fmt, ...); + +extern int printf (const char *fmt, ...); + +extern int indent; +extern void iprintf (const char *fmt, ...); + +extern int vprintf(const char *fmt, va_list listp); + +#endif /* _MACH_SA_SYS_PRINTF_H_ */ + diff --git a/kern/processor.c b/kern/processor.c index df9cb2e..6b471f8 100644 --- a/kern/processor.c +++ b/kern/processor.c @@ -34,6 +34,7 @@ #include #include #include +#include /* for panic() */ #include #include #include diff --git a/kern/sched_prim.c b/kern/sched_prim.c index 116bfe6..eee0258 100644 --- a/kern/sched_prim.c +++ b/kern/sched_prim.c @@ -32,11 +32,12 @@ * */ -#include +#include #include #include #include #include +#include /* for panic() */ #include #include #include diff --git a/kern/server_loop.ch b/kern/server_loop.ch index 5a0c69c..7b7b1a5 100644 --- a/kern/server_loop.ch +++ b/kern/server_loop.ch @@ -38,6 +38,7 @@ * Must redefine symbols for pager_server functions. */ +#include /* for panic() */ #include #include #include /* for kernel_map */ diff --git a/kern/startup.c b/kern/startup.c index 2957718..16ab508 100644 --- a/kern/startup.c +++ b/kern/startup.c @@ -27,13 +27,14 @@ * Mach kernel startup. */ -#include #include #include #include #include #include #include +#include /* for panic() */ +#include #include #include #include diff --git a/kern/task.c b/kern/task.c index f620bdf..d4fa825 100644 --- a/kern/task.c +++ b/kern/task.c @@ -39,6 +39,7 @@ #include #include #include +#include /* for panic() */ #include #include #include diff --git a/kern/thread.c b/kern/thread.c index 911ceb9..67b7706 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -31,7 +31,7 @@ * Thread management primitives implementation. */ -#include +#include #include #include #include @@ -41,6 +41,7 @@ #include #include #include +#include /* For panic() */ #include #include #include diff --git a/kern/thread_swap.c b/kern/thread_swap.c index 173b6ae..c5d5183 100644 --- a/kern/thread_swap.c +++ b/kern/thread_swap.c @@ -46,6 +46,7 @@ #include #include +#include /* for panic() */ #include #include #include diff --git a/kern/xpr.c b/kern/xpr.c index b5f6e71..147e3af 100644 --- a/kern/xpr.c +++ b/kern/xpr.c @@ -29,6 +29,7 @@ */ #include +#include /* for panic() */ #include #include #include "cpu_number.h" diff --git a/kern/zalloc.c b/kern/zalloc.c index e089023..e006177 100644 --- a/kern/zalloc.c +++ b/kern/zalloc.c @@ -34,10 +34,11 @@ * data blocks for which quick allocation/deallocation is possible. */ -#include #include +#include /* For panic() */ #include +#include #include #include #include -- cgit v1.2.3