Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/nathanw_sa]: src/sys/arch/hpc/stand/hpcboot code clean up.
details: https://anonhg.NetBSD.org/src/rev/0f3cce2a945c
branches: nathanw_sa
changeset: 504640:0f3cce2a945c
user: uch <uch%NetBSD.org@localhost>
date: Tue Apr 24 19:28:00 2001 +0000
description:
code clean up.
diffstat:
sys/arch/hpc/stand/hpcboot/arm/arm_boot.h | 55 ++++++++
sys/arch/hpc/stand/hpcboot/arm/arm_console.cpp | 87 +++++++++++++
sys/arch/hpc/stand/hpcboot/boot.h | 79 ++++++++++++
sys/arch/hpc/stand/hpcboot/mips/mips_arch.h | 146 +++++++++++++++++++++++
sys/arch/hpc/stand/hpcboot/mips/mips_boot.h | 55 ++++++++
sys/arch/hpc/stand/hpcboot/mips/mips_console.cpp | 61 +++++++++
sys/arch/hpc/stand/hpcboot/mips/mips_console.h | 54 ++++++++
sys/arch/hpc/stand/hpcboot/sh3/sh_boot.h | 55 ++++++++
8 files changed, 592 insertions(+), 0 deletions(-)
diffs (truncated from 624 to 300 lines):
diff -r 8121ea48d5d6 -r 0f3cce2a945c sys/arch/hpc/stand/hpcboot/arm/arm_boot.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpc/stand/hpcboot/arm/arm_boot.h Tue Apr 24 19:28:00 2001 +0000
@@ -0,0 +1,55 @@
+/* -*-C++-*- $NetBSD: arm_boot.h,v 1.2.8.2 2001/04/24 19:28:00 uch Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by UCHIYAMA Yasushi.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _HPCBOOT_ARM_BOOT_H_
+#define _HPCBOOT_ARM_BOOT_H_
+
+#include <boot.h>
+
+class ARMBoot : public Boot {
+private:
+ typedef Boot super;
+
+public:
+ ARMBoot(void);
+ ~ARMBoot(void);
+ virtual BOOL setup(void);
+ virtual BOOL create(void);
+};
+
+#endif //_HPCBOOT_ARM_BOOT_H_
diff -r 8121ea48d5d6 -r 0f3cce2a945c sys/arch/hpc/stand/hpcboot/arm/arm_console.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpc/stand/hpcboot/arm/arm_console.cpp Tue Apr 24 19:28:00 2001 +0000
@@ -0,0 +1,87 @@
+/* -*-C++-*- $NetBSD: arm_console.cpp,v 1.2.8.2 2001/04/24 19:28:01 uch Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by UCHIYAMA Yasushi.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <arm/arm_console.h>
+
+ARMConsole *ARMConsole::_instance = 0;
+
+ARMConsole *
+ARMConsole::Instance(MemoryManager *&mem)
+{
+ if (!_instance)
+ _instance = new ARMConsole(mem);
+ return _instance;
+}
+
+void
+ARMConsole::Destroy(void)
+{
+ if (_instance)
+ delete _instance;
+}
+
+BOOL
+ARMConsole::init(void)
+{
+ if (!super::init())
+ return FALSE;
+
+ _uart_base = _mem->mapPhysicalPage(0x80050000, 0x100, PAGE_READWRITE);
+ if (_uart_base == ~0)
+ return FALSE;
+ _uart_busy = _uart_base + 0x20;
+ _uart_transmit = _uart_base + 0x14;
+
+ return TRUE;
+}
+
+void
+ARMConsole::print(const TCHAR *fmt, ...)
+{
+ SETUP_WIDECHAR_BUFFER();
+
+ if (!setupMultibyteBuffer())
+ return;
+
+ for (int i = 0; _bufm[i] != '\0' && i < CONSOLE_BUFSIZE; i++) {
+ char s = _bufm[i];
+ if (s == '\n')
+ __putc('\r');
+ __putc(s);
+ }
+}
diff -r 8121ea48d5d6 -r 0f3cce2a945c sys/arch/hpc/stand/hpcboot/boot.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpc/stand/hpcboot/boot.h Tue Apr 24 19:28:00 2001 +0000
@@ -0,0 +1,79 @@
+/* -*-C++-*- $NetBSD: boot.h,v 1.2.8.2 2001/04/24 19:28:00 uch Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by UCHIYAMA Yasushi.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _HPCBOOT_BOOT_H_
+#define _HPCBOOT_BOOT_H_
+
+#include <hpcboot.h>
+#include <hpcmenu.h>
+
+class Console;
+class Architecture;
+class MemoryManager;
+class File;
+class Loader;
+
+class Boot {
+private:
+ static Boot *_instance;
+
+protected:
+ struct BootSetupArgs args;
+
+protected:
+ Boot(void);
+ virtual ~Boot(void);
+
+ Console *_cons; // LCD/Serial
+ Architecture *_arch; // StrongARM/VR41XX/TX39XX/SH3/SH4
+ MemoryManager *_mem; // VirtualAlloc/LockPage/MMU
+ File *_file; // FAT/FFS/via HTTP
+ Loader *_loader; // ELF/COFF
+
+public:
+ static Boot &Instance(void);
+ static void Destroy(void);
+
+ virtual BOOL create(void);
+ virtual BOOL setup(void);
+ friend void hpcboot(void *);
+
+ BOOL Boot::attachLoader(void);
+};
+
+#endif //_HPCBOOT_BOOT_H_
diff -r 8121ea48d5d6 -r 0f3cce2a945c sys/arch/hpc/stand/hpcboot/mips/mips_arch.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/hpc/stand/hpcboot/mips/mips_arch.h Tue Apr 24 19:28:00 2001 +0000
@@ -0,0 +1,146 @@
+/* -*-C++-*- $NetBSD: mips_arch.h,v 1.2.8.2 2001/04/24 19:28:01 uch Exp $ */
+
+/*-
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by UCHIYAMA Yasushi.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _HPCBOOT_MIPS_ARCH_H_
+#define _HPCBOOT_MIPS_ARCH_H_
+
+#include <hpcboot.h>
+#include <arch.h>
+
+class Console;
+
+class MIPSArchitecture : public Architecture {
+protected:
+ typedef void(*boot_func_t)(struct BootArgs *, struct PageTag *);
+
+ int _kmode;
+ boot_func_t _boot_func;
+
+public:
+ MIPSArchitecture(Console *&, MemoryManager *&);
+ virtual ~MIPSArchitecture(void);
+
+ virtual BOOL init(void);
+ BOOL setupLoader(void);
+ virtual void systemInfo(void);
+ virtual void cacheFlush(void) = 0;
+ void jump(paddr_t info, paddr_t pvce);
+};
Home |
Main Index |
Thread Index |
Old Index