summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-05-18 15:55:03 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-05-18 15:55:03 -0500
commitcf138201c24fdc83ee7835b65cce67e7d7a85e70 (patch)
tree16650f82ac519ff60bc9100b4e90868463bd987d /src/include
parent9ea98f274e18a3407ce109a331553e1c910274d9 (diff)
downloadtalos-hostboot-cf138201c24fdc83ee7835b65cce67e7d7a85e70.tar.gz
talos-hostboot-cf138201c24fdc83ee7835b65cce67e7d7a85e70.zip
Create simple console.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/kernel/console.H25
-rw-r--r--src/include/stdint.h17
-rw-r--r--src/include/string.h17
-rw-r--r--src/include/util/singleton.H18
4 files changed, 77 insertions, 0 deletions
diff --git a/src/include/kernel/console.H b/src/include/kernel/console.H
new file mode 100644
index 000000000..4c5f7a52a
--- /dev/null
+++ b/src/include/kernel/console.H
@@ -0,0 +1,25 @@
+#ifndef __KERNEL_CONSOLE_H
+#define __KERNEL_CONSOLE_H
+
+#include <stdint.h>
+#include <string.h>
+
+void printk(const char*);
+
+class Console
+{
+ public:
+ int putc(int);
+
+ enum { BUFFER_SIZE = 1024 * 4 };
+
+ protected:
+ Console();
+ ~Console() {};
+
+ private:
+ char * iv_buffer;
+ size_t iv_pos;
+};
+
+#endif
diff --git a/src/include/stdint.h b/src/include/stdint.h
new file mode 100644
index 000000000..350f4c3da
--- /dev/null
+++ b/src/include/stdint.h
@@ -0,0 +1,17 @@
+#ifndef __STDINT_H
+#define __STDINT_H
+
+typedef char int8_t;
+typedef short int int16_t;
+typedef long int int32_t;
+typedef long long int int64_t;
+
+typedef unsigned char uint8_t;
+typedef unsigned short int uint16_t;
+typedef unsigned long int uint32_t;
+typedef unsigned long long int uint64_t;
+
+typedef uint64_t size_t;
+typedef int64_t ssize_t;
+
+#endif
diff --git a/src/include/string.h b/src/include/string.h
new file mode 100644
index 000000000..f1465a4c0
--- /dev/null
+++ b/src/include/string.h
@@ -0,0 +1,17 @@
+#ifndef __STRING_H
+#define __STRING_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+ void* memset(void* s, int c, size_t n);
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif
diff --git a/src/include/util/singleton.H b/src/include/util/singleton.H
new file mode 100644
index 000000000..f448303df
--- /dev/null
+++ b/src/include/util/singleton.H
@@ -0,0 +1,18 @@
+#ifndef __UTIL_SINGLETON_H
+#define __UTIL_SINGLETON_H
+
+template <typename _T>
+class Singleton : private _T
+{
+ public:
+ static _T& instance()
+ {
+ static Singleton<_T> instance;
+ return instance;
+ };
+
+ private:
+ Singleton() : _T() {};
+};
+
+#endif
OpenPOWER on IntegriCloud