1*ce099b40Smartin /* -*-C++-*- $NetBSD: sh_console.h,v 1.12 2008/04/28 20:23:20 martin Exp $ */ 29173eae7Such 39173eae7Such /*- 42e968e7eSuch * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. 59173eae7Such * All rights reserved. 69173eae7Such * 79173eae7Such * This code is derived from software contributed to The NetBSD Foundation 89173eae7Such * by UCHIYAMA Yasushi. 99173eae7Such * 109173eae7Such * Redistribution and use in source and binary forms, with or without 119173eae7Such * modification, are permitted provided that the following conditions 129173eae7Such * are met: 139173eae7Such * 1. Redistributions of source code must retain the above copyright 149173eae7Such * notice, this list of conditions and the following disclaimer. 159173eae7Such * 2. Redistributions in binary form must reproduce the above copyright 169173eae7Such * notice, this list of conditions and the following disclaimer in the 179173eae7Such * documentation and/or other materials provided with the distribution. 189173eae7Such * 199173eae7Such * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 209173eae7Such * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 219173eae7Such * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 229173eae7Such * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 239173eae7Such * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 249173eae7Such * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 259173eae7Such * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 269173eae7Such * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 279173eae7Such * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 289173eae7Such * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 299173eae7Such * POSSIBILITY OF SUCH DAMAGE. 309173eae7Such */ 319173eae7Such 329173eae7Such #ifndef _HPCBOOT_SH_CONSOLE_H_ 339173eae7Such #define _HPCBOOT_SH_CONSOLE_H_ 349173eae7Such 359173eae7Such #include <console.h> 369173eae7Such 379173eae7Such class SHConsole : public SerialConsole { 38bd926f64Such private: 39bd926f64Such typedef SerialConsole super; 40bd926f64Such 412e79fe1eSuch typedef void (*print_func_t)(const char *); 42acb09f98Such print_func_t _print; // SHConsole native method folder. 43acb09f98Such 44acb09f98Such public: 45acb09f98Such enum consoleSelect { VIDEO, SERIAL }; 462e79fe1eSuch struct console_info { 4724c8a902Suwe uint32_t cpu, machine; 482e79fe1eSuch print_func_t print; 49ed95b7ebSuch int16_t serial_console; 50ed95b7ebSuch int16_t video_console; 512e79fe1eSuch }; 52acb09f98Such static const struct console_info _console_info[]; 53acb09f98Such static const struct console_info *selectBootConsole(Console &, 54ed95b7ebSuch enum consoleSelect); 55acb09f98Such 56acb09f98Such public: 57acb09f98Such SHConsole(void); //XXX 58acb09f98Such virtual ~SHConsole(); 59acb09f98Such virtual BOOL init(void); 60acb09f98Such virtual void print(const TCHAR *fmt, ...); 61acb09f98Such 624e6c980fSuch static void SCIPrint(const char *); 632e79fe1eSuch static void SCIFPrint(const char *); 644e6c980fSuch static void HD64461COMPrint(const char *); 652e968e7eSuch static void HD64465COMPrint(const char *); 669173eae7Such }; 679173eae7Such #endif //_HPCBOOT_SH_CONSOLE_H_ 68