diff options
author | Thomas Schwinge <tschwinge@gnu.org> | 2006-02-20 21:10:28 +0000 |
---|---|---|
committer | Thomas Schwinge <tschwinge@gnu.org> | 2009-06-18 00:26:35 +0200 |
commit | ef4ad2eff0364329bb0e35865c2fcdcad364b739 (patch) | |
tree | 8493fba73f9e76454a5fc9769059d8c7b882c83a /util | |
parent | 44b9d528984254f021865f65c0e7749f3d9d97f4 (diff) |
2006-02-20 Thomas Schwinge <tschwinge@gnu.org>
Remove unused and unsupported code. Consult the file
`DEVELOPMENT' for details. Partly based on suggestions by
Gianluca Guida <glguida@gmail.com>.
* util/about_to_die.c: Remove file.
* util/config.h: Likewise.
* util/cpu.c: Likewise.
* util/cpu.h: Likewise.
* util/cpu_init.c: Likewise.
* util/cpu_subs.h: Likewise.
* util/debug.h: Likewise.
* util/die.c: Likewise.
* util/phys_mem.h: Likewise.
* util/ref_count.h: Likewise.
* util/cpus.h: Move from here...
* bogus/cpus.h: ... to here.
* Makefile.in (bogus-files): Add `cpus.h'.
(util-cfiles): Only contain `putchar.c' and `puts.c'.
(util-files): Only contain `$(util-cfiles)'.
Diffstat (limited to 'util')
-rw-r--r-- | util/about_to_die.c | 34 | ||||
-rw-r--r-- | util/config.h | 23 | ||||
-rw-r--r-- | util/cpu.c | 27 | ||||
-rw-r--r-- | util/cpu.h | 41 | ||||
-rw-r--r-- | util/cpu_init.c | 40 | ||||
-rw-r--r-- | util/cpu_subs.h | 23 | ||||
-rw-r--r-- | util/cpus.h | 27 | ||||
-rw-r--r-- | util/debug.h | 81 | ||||
-rw-r--r-- | util/die.c | 54 | ||||
-rw-r--r-- | util/phys_mem.h | 34 | ||||
-rw-r--r-- | util/ref_count.h | 68 |
11 files changed, 0 insertions, 452 deletions
diff --git a/util/about_to_die.c b/util/about_to_die.c deleted file mode 100644 index 9b039cc..0000000 --- a/util/about_to_die.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 1995 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ - -/* Call this to declare intention to die, - before doing final printfs and such. - The default implementation does nothing, - but typical actions might be to restore the video mode - to a standard setting, or stop other processors. - Note that this might very well be called several times - before die() is finally called. */ -void about_to_die(int exit_code) -{ -} - diff --git a/util/config.h b/util/config.h deleted file mode 100644 index 23b2bf6..0000000 --- a/util/config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 1995 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ -/* This file is just an empty default config.h file. */ diff --git a/util/cpu.c b/util/cpu.c deleted file mode 100644 index 0e45ac4..0000000 --- a/util/cpu.c +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 1995 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ - -#include "cpu.h" - -struct cpu cpu[NCPUS]; - diff --git a/util/cpu.h b/util/cpu.h deleted file mode 100644 index 8eb0b23..0000000 --- a/util/cpu.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 1995 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ -#ifndef _UTIL_CPU_H_ -#define _UTIL_CPU_H_ - -#include "cpus.h" - - -/* There's one of these data structures per processor. */ -struct cpu -{ -#define cpu_sub(name) struct cpu_##name name; -#include "cpu_subs.h" -#undef cpu_sub -int dummy; -}; - -extern struct cpu cpu[NCPUS]; - - -#endif /* _UTIL_CPU_H_ */ diff --git a/util/cpu_init.c b/util/cpu_init.c deleted file mode 100644 index c59824b..0000000 --- a/util/cpu_init.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 1995 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ - -#include "cpu.h" - -void cpu_init(struct cpu *cpu) -{ -#define cpu_sub(name) cpu_##name##_init(cpu); -#include "cpu_subs.h" -#undef cpu_sub -} - -void cpus_init() -{ - int n; - - for (n = 0; n < NCPUS; n++) - cpu_init(&cpu[n]); -} - diff --git a/util/cpu_subs.h b/util/cpu_subs.h deleted file mode 100644 index 850ef38..0000000 --- a/util/cpu_subs.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 1995 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ -/* This file is just a terminator for the set of cpu_subs.h headers. */ diff --git a/util/cpus.h b/util/cpus.h deleted file mode 100644 index 355ecdb..0000000 --- a/util/cpus.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 1995 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ - -/* Default cpus.h sets things up for a uniprocessor. */ -#define NCPUS 1 -#undef MULTIPROCESSOR - diff --git a/util/debug.h b/util/debug.h deleted file mode 100644 index 7b2abb6..0000000 --- a/util/debug.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 1995-1993 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ -/* - * File: debug.h - * Author: Bryan Ford - * - * This file contains definitions for kernel debugging, - * which are compiled in on the DEBUG symbol. - * - */ -#ifndef _MACH_UTIL_DEBUG_H_ -#define _MACH_UTIL_DEBUG_H_ - -#include <mach/macro_help.h> - - -#ifndef NDEBUG - -extern void panic(const char *fmt, ...); - -#define here() printf("@ %s:%d\n", __FILE__, __LINE__) -#define message(args) ({ printf("@ %s:%d: ", __FILE__, __LINE__); printf args; printf("\n"); }) - -#define otsan() panic("%s:%d: off the straight and narrow!", __FILE__, __LINE__) - -#define assert(v) \ - MACRO_BEGIN \ - if (!(v)) \ - panic("%s:%d: failed assertion `"#v"'\n", \ - __FILE__, __LINE__); \ - MACRO_END - -#define do_debug(stmt) stmt - -#define debugmsg(args) \ - ({ printf("%s:%d: ", __FILE__, __LINE__); printf args; printf("\n"); }) - -#define struct_id_decl unsigned struct_id; -#define struct_id_init(p,id) ((p)->struct_id = (id)) -#define struct_id_denit(p) ((p)->struct_id = 0) -#define struct_id_verify(p,id) \ - ({ if ((p)->struct_id != (id)) \ - panic("%s:%d: "#p" (%08x) struct_id should be "#id" (%08x), is %08x\n", \ - __FILE__, __LINE__, (p), (id), (p->struct_id)); \ - }) - -#else /* NDEBUG */ - -#define otsan() -#define assert(v) -#define do_debug(stmt) -#define debugmsg(args) - -#define struct_id_decl -#define struct_id_init(p,id) -#define struct_id_denit(p) -#define struct_id_verify(p,id) - -#endif /* NDEBUG */ - -#endif _MACH_UTIL_DEBUG_H_ diff --git a/util/die.c b/util/die.c deleted file mode 100644 index c2eeeaf..0000000 --- a/util/die.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 1995-1994 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ - -#include <stdarg.h> - -/* Note: These routines are deprecated and should not be used anymore. - Use panic() instead. */ -void die(const char *fmt, ...) -{ - int exit_code = fmt != 0; - - about_to_die(exit_code); - - if (fmt) - { - va_list vl; - - va_start(vl, fmt); - vprintf(fmt, vl); - va_end(vl); - - putchar('\n'); - - exit(exit_code); - } - else - exit(exit_code); -} - -void die_no_mem(void) -{ - die("Not enough memory."); -} - diff --git a/util/phys_mem.h b/util/phys_mem.h deleted file mode 100644 index 2e18a6b..0000000 --- a/util/phys_mem.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 1995 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ -#ifndef _UTIL_PHYS_MEM_H_ -#define _UTIL_PHYS_MEM_H_ - -#include <mach/machine/vm_types.h> - - -/* This always holds the physical address - of the top of known physical memory. */ -extern vm_offset_t phys_mem_max; - - -#endif _UTIL_PHYS_MEM_H_ diff --git a/util/ref_count.h b/util/ref_count.h deleted file mode 100644 index b6d3404..0000000 --- a/util/ref_count.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 1995-1993 The University of Utah and - * the Computer Systems Laboratory at the University of Utah (CSL). - * All rights reserved. - * - * Permission to use, copy, modify and distribute this software is hereby - * granted provided that (1) source code retains these copyright, permission, - * and disclaimer notices, and (2) redistributions including binaries - * reproduce the notices in supporting documentation, and (3) all advertising - * materials mentioning features or use of this software display the following - * acknowledgement: ``This product includes software developed by the - * Computer Systems Laboratory at the University of Utah.'' - * - * THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS - * IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF - * ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. - * - * CSL requests users of this software to return to csl-dist@cs.utah.edu any - * improvements that they make and grant CSL redistribution rights. - * - * Author: Bryan Ford, University of Utah CSL - */ -/* - * File: refcount.h - * - * This defines the system-independent atomic reference count data type. - * (This file will often be overridden - * by better machine-dependent implementations.) - * - */ - -#ifndef _KERN_REF_COUNT_H_ -#define _KERN_REF_COUNT_H_ - -#include <mach/macro_help.h> - -#include "simple_lock.h" - - -struct ref_count { - decl_simple_lock_data(,lock) /* lock for reference count */ - int count; /* number of references */ -}; - -#define ref_count_init(refcount, refs) \ - MACRO_BEGIN \ - simple_lock_init(&(refcount)->lock); \ - ((refcount)->count = (refs)); \ - MACRO_END - -#define ref_count_take(refcount) \ - MACRO_BEGIN \ - simple_lock(&(refcount)->lock); \ - (refcount)->count++; \ - simple_unlock(&(refcount)->lock); \ - MACRO_END - -#define ref_count_drop(refcount, func) \ - MACRO_BEGIN \ - int new_value; \ - simple_lock(&(refcount)->lock); \ - new_value = --(refcount)->count; \ - simple_unlock(&(refcount)->lock); \ - if (new_value == 0) { func; } \ - MACRO_END - - -#endif _KERN_REF_COUNT_H_ |