summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2010-05-19 21:50:57 -0500
committerPatrick Williams <iawillia@us.ibm.com>2010-05-19 21:50:57 -0500
commit27503f42c300f6ba65ff6cc06290696fe6153b7f (patch)
tree6bf7fbd6b14eceaacdd17c05b979a929c469667d /src/kernel
parentb0e457a7589a0ee6b78ed676566c6410da371570 (diff)
downloadtalos-hostboot-27503f42c300f6ba65ff6cc06290696fe6153b7f.tar.gz
talos-hostboot-27503f42c300f6ba65ff6cc06290696fe6153b7f.zip
Call default constructors.
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/kernel.C33
1 files changed, 28 insertions, 5 deletions
diff --git a/src/kernel/kernel.C b/src/kernel/kernel.C
index 2d97204e1..d44095719 100644
--- a/src/kernel/kernel.C
+++ b/src/kernel/kernel.C
@@ -1,14 +1,37 @@
#include <stdint.h>
#include <kernel/console.H>
+#include <util/singleton.H>
+
+class Kernel
+{
+ public:
+ void cppBootstrap();
+
+ protected:
+ Kernel() {};
+};
int main()
{
printk("Booting Chenoo kernel...\n");
- printk("Testing a character %c %c %c\n", 'a', 'b', 'c');
- printk("Testing numbers %hhd %hu %x %lx %lld\n",
- (char)-1, (short)1234, 0xabcdef12, 0xdeadbeef,
- 0x0123456789abcdef);
- while(1);
+
+ Kernel& kernel = Singleton<Kernel>::instance();
+ kernel.cppBootstrap();
+ while(1);
return 0;
}
+
+void Kernel::cppBootstrap()
+{
+ // Call default constructors for any static objects.
+ extern void (*ctor_start)();
+ extern void (*ctor_end)();
+ void(**ctors)() = &ctor_start;
+ while(ctors != &ctor_end)
+ {
+ (*ctors)();
+ ctors++;
+ }
+}
+
OpenPOWER on IntegriCloud