summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-05-20 10:09:42 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-05-20 10:09:42 -0500
commitd5a43e2fa43f8178aaa7ca67a9615d3ab4e68dbb (patch)
tree42a229b00c7a11e9ddbb1821c96fc7db7f3e0df3
parent27503f42c300f6ba65ff6cc06290696fe6153b7f (diff)
downloadtalos-hostboot-d5a43e2fa43f8178aaa7ca67a9615d3ab4e68dbb.tar.gz
talos-hostboot-d5a43e2fa43f8178aaa7ca67a9615d3ab4e68dbb.zip
Add %s, %z support in console driver.
-rw-r--r--src/kernel/console.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/kernel/console.C b/src/kernel/console.C
index 06cd98e2b..2c33645fe 100644
--- a/src/kernel/console.C
+++ b/src/kernel/console.C
@@ -31,6 +31,20 @@ class ConsoleDisplay
static void display(Console& c, _T value) {};
};
+template <ConsoleTraits::trait _S>
+class ConsoleDisplay<char*, _S>
+{
+ public:
+ static void display(Console&c, char* value)
+ {
+ while(*value != '\0')
+ {
+ c.putc(*value);
+ value++;
+ }
+ }
+};
+
template <>
class ConsoleDisplay<char, ConsoleTraits::NONE>
{
@@ -112,6 +126,7 @@ void printk(const char* str, ...)
if (format)
{
ConsoleDisplay<char>::display(console, '%');
+ format = false;
}
else
{
@@ -138,6 +153,11 @@ void printk(const char* str, ...)
size++;
break;
}
+ case 'z': // size_t or ssize_t
+ {
+ size = 4;
+ break;
+ }
case 'd': // decimal
{
format = false;
OpenPOWER on IntegriCloud