summaryrefslogtreecommitdiff
path: root/dev/console.hh
diff options
context:
space:
mode:
Diffstat (limited to 'dev/console.hh')
-rw-r--r--dev/console.hh47
1 files changed, 35 insertions, 12 deletions
diff --git a/dev/console.hh b/dev/console.hh
index ba4250db4..b88cab3ef 100644
--- a/dev/console.hh
+++ b/dev/console.hh
@@ -1,4 +1,30 @@
-/* $Id$ */
+/*
+ * Copyright (c) 2003 The Regents of The University of Michigan
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met: redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer;
+ * 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;
+ * neither the name of the copyright holders 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 COPYRIGHT HOLDERS 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 COPYRIGHT
+ * OWNER 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.
+ */
/* @file
* User Console Interface
@@ -69,8 +95,8 @@ class SimConsole : public SimObject
protected:
// interrupt status/enable
- int intr_status;
- int intr_enable;
+ int _status;
+ int _enable;
// interrupt handle
IntrControl *intr;
@@ -79,16 +105,13 @@ class SimConsole : public SimObject
/////////////////
// OS interface
- // Input a character from the console. Returns the character (if
- // any) or -1 if there is no character pending on this console. If
- // no further characters are pending, the (input) interrupt is
- // cleared.
+ // Get a character from the console.
+ // return of -1 means there is no character pending.
+ // Interrupts are cleared when the buffer is empty.
int in();
- // Output a character to the console. This never fails, as this
- // device doesn't model finite buffering capacity.
- void out(char c);
- void simple(char c);
+ // Send a character to the console
+ void out(char c, bool raise_int = true);
enum {
TransmitInterrupt = 1,
@@ -96,7 +119,7 @@ class SimConsole : public SimObject
};
// Read the current interrupt status of this console.
- int intStatus();
+ int intStatus() { return _status; }
// Set the interrupt enable bits.
int clearInt(int i);