2011-02-22 17:09:58 +00:00
|
|
|
// Basically stuff that is needed to go into C++ Land
|
2011-03-14 19:31:10 +00:00
|
|
|
|
|
|
|
#include "Tier0/cpp.h"
|
|
|
|
#include "Tier0/kstdio.h"
|
|
|
|
|
2012-10-01 13:03:10 +00:00
|
|
|
extern u64 _start_ctors;
|
|
|
|
extern u64 _end_ctors;
|
2011-03-14 19:31:10 +00:00
|
|
|
void CKernelStart(void);
|
|
|
|
|
|
|
|
void cpp_call_ctors(void)
|
|
|
|
{
|
2012-10-01 13:03:10 +00:00
|
|
|
u32 Number = ((void *)&_end_ctors - (void *)&_start_ctors) / 8;
|
2011-03-14 19:31:10 +00:00
|
|
|
kprintf("[i] Calling %i constructors before jumping to Tier1..\n", Number);
|
2012-10-01 13:03:10 +00:00
|
|
|
for(u64 *C = (u64*)&_start_ctors; C < (u64*)&_end_ctors; ++C)
|
2011-03-14 19:31:10 +00:00
|
|
|
{
|
2013-09-01 21:06:00 +00:00
|
|
|
kprintf("should've called %x\n", *C);
|
|
|
|
// ((void (*) (void)) (*C)) ();
|
2011-03-14 19:31:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void cpp_start_ckernel(void)
|
|
|
|
{
|
|
|
|
CKernelStart();
|
|
|
|
}
|
|
|
|
|
|
|
|
void __cxa_pure_virtual()
|
|
|
|
{
|
|
|
|
kprintf("[e] A pure virtual call happened. WTF?\n");
|
|
|
|
}
|
|
|
|
|
2012-10-28 11:24:43 +00:00
|
|
|
int __cxa_atexit(void (*f)(void *), void *arg, void *__dso_handle)
|
2011-03-14 19:31:10 +00:00
|
|
|
{
|
|
|
|
// Do nothing, for now.
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void __cxa_finalize(void *f)
|
|
|
|
{
|
|
|
|
// -- " -- " --
|
|
|
|
}
|
2012-10-28 11:24:43 +00:00
|
|
|
|
|
|
|
void *__dso_handle = 0;
|