#include <err.h>
#include <debug.h>
#include <platform/platform.h>
#include <os/Module.h>
#include <dev/RootDevice.h>
#include <dev/DeviceManager.h>
#include <platform/osk5912/platform_p.h>

namespace OS {
namespace Platform {

void Init()
{
}

static status_t platformInitPostHeap(Module *)
{
	/* create a generic root device and publish it */
	Dev::RootDevice *root = new Dev::RootDevice("root");
	Dev::SetRoot(root);

	/* create an interrupt controller object and add it to the list */
	InitPlatformPIC();
	
	/* create the system timer and add it to the list */
	InitPlatformTimer();

	return NO_ERROR;
}

static Module platformModule("platform", Module::LEVEL_SCHEDULER, &platformInitPostHeap);

}} // namespace OS::Platform
