summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/include/cpuconf.h
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2000-11-08 16:01:27 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2000-11-08 16:01:27 +0000
commitfd438f5ca0b94ed3d88d133b522e0103dee486b8 (patch)
tree6d0a5d2c22adef30dd9a9bb3ce9d92ff9ebc024a /sys/arch/alpha/include/cpuconf.h
parent979a51167c72e38f0c094528a264a7fccca6d1c5 (diff)
Merge in big portions of the improvements NetBSD did to their alpha port.
Highlights: UVM, PMAP_NEW, bus_dma (only on some buses for now), new hardware support, possiblity for ELF, etc, etc. Too much to mention. This is still work in progress. video consoles might be broken, otherwise we have basically the same functionality as before plus more.
Diffstat (limited to 'sys/arch/alpha/include/cpuconf.h')
-rw-r--r--sys/arch/alpha/include/cpuconf.h105
1 files changed, 69 insertions, 36 deletions
diff --git a/sys/arch/alpha/include/cpuconf.h b/sys/arch/alpha/include/cpuconf.h
index f60c3efb5c3..0a437f0831a 100644
--- a/sys/arch/alpha/include/cpuconf.h
+++ b/sys/arch/alpha/include/cpuconf.h
@@ -1,5 +1,4 @@
-/* $OpenBSD: cpuconf.h,v 1.2 1997/11/10 15:53:09 niklas Exp $ */
-/* $NetBSD: cpuconf.h,v 1.1 1996/11/12 05:14:40 cgd Exp $ */
+/* $NetBSD: cpuconf.h,v 1.12 2000/06/08 03:10:06 thorpej Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All rights reserved.
@@ -30,45 +29,79 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+ * Additional reworking by Matthew Jacob for NASA/Ames Research Center.
+ * Copyright (c) 1997
+ */
-struct cpusw {
- const char *family, *option;
- int present;
- const char *(*model_name) __P((void));
- void (*cons_init) __P((void));
- const char *(*iobus_name) __P((void));
- void (*device_register) __P((struct device *dev,
- void *aux));
-};
+#ifndef _ALPHA_CPUCONF_H_
+#define _ALPHA_CPUCONF_H_
+
+/*
+ * Platform Specific Information and Function Hooks.
+ *
+ * The tags family and model information are strings describing the platform.
+ *
+ * The tag iobus describes the primary iobus for the platform- primarily
+ * to give a hint as to where to start configuring. The likely choices
+ * are one of tcasic, lca, apecs, cia, or tlsb.
+ */
-#define CONCAT(a,b) __CONCAT(a,b)
+struct clockframe;
-#define cpu_fn_name(p,f) CONCAT(CONCAT(p,_),f)
+struct platform {
+ /*
+ * Platform Information.
+ */
+ const char *family; /* Family Name */
+ const char *model; /* Model (variant) Name */
+ const char *iobus; /* Primary iobus name */
-#define cpu_decl(p) \
- extern const char *cpu_fn_name(p,model_name) __P((void)); \
- extern void cpu_fn_name(p,cons_init) __P((void)); \
- extern const char *cpu_fn_name(p,iobus_name) __P((void)); \
- extern void cpu_fn_name(p,device_register) \
- __P((struct device *, void*));
+ /*
+ * Platform Specific Function Hooks
+ * cons_init - console initialization
+ * device_register - boot configuration aid
+ * iointr - I/O interrupt handler
+ * clockintr - Clock Interrupt Handler
+ * mcheck_handler - Platform Specific Machine Check Handler
+ */
+ void (*cons_init)(void);
+ void (*device_register)(struct device *, void *);
+ void (*iointr)(void *, unsigned long);
+ void (*clockintr)(struct clockframe *);
+ void (*mcheck_handler)(unsigned long, struct trapframe *,
+ unsigned long, unsigned long);
+ void (*powerdown)(void);
+};
-#define cpu_unknown() { NULL, NULL, 0, }
-#define cpu_notdef(f) { f, NULL, 0 }
+/*
+ * There is an array of functions to initialize the platform structure.
+ *
+ * It's responsible for filling in the family, model_name and iobus
+ * tags. It may optionally fill in the cons_init, device_register and
+ * mcheck_handler tags.
+ *
+ * The iointr tag is filled in by set_iointr (in interrupt.c).
+ * The clockintr tag is filled in by cpu_initclocks (in clock.c).
+ *
+ * nocpu is function to call when you can't figure what platform you're on.
+ * There's no return from this function.
+ */
-#define cpu_option_string(o) __STRING(o)
-#define cpu_option_present(o) (CONCAT(N,o) > NULL)
-#define cpu_function_init(o,p,f) \
- (cpu_option_present(o) ? cpu_fn_name(p,f) : 0)
-#define cpu_init(f,o,p) \
- { \
- f, cpu_option_string(o) , cpu_option_present(o), \
- cpu_function_init(o,p,model_name), \
- cpu_function_init(o,p,cons_init), \
- cpu_function_init(o,p,iobus_name), \
- cpu_function_init(o,p,device_register), \
- }
+struct cpuinit {
+ void (*init)(void);
+ u_int64_t systype;
+ const char *option;
+};
#ifdef _KERNEL
-extern const struct cpusw cpusw[];
-extern const int ncpusw;
-#endif
+#define cpu_notsupp(st, str) { platform_not_supported, st, str }
+
+#define cpu_init(st, fn, opt) { fn, st, opt }
+
+extern struct platform platform;
+extern const struct cpuinit *platform_lookup(int);
+extern void platform_not_configured(void);
+extern void platform_not_supported(void);
+#endif /* _KERNEL */
+#endif /* ! _ALPHA_CPUCONF_H_ */