mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-06 11:10:24 +00:00
This commit comprises the following changes to enable L4Linux to use several CPUs: * change default configuration for x86 and ARM * add atomic cmpxchg operation to l4re library * implement l4_sleep (per thread) * enable setting affinity for VCPUs and IRQs * move "per CPU" section within linker-script (x86 only) * introduce SMP run-script for pandaboard * deactivate direct scheduler (Fiasco.OC syscall) access by L4Linux
44 lines
723 B
C++
44 lines
723 B
C++
/*
|
|
* \brief L4Re functions needed by L4Linux.
|
|
* \author Stefan Kalkowski
|
|
* \date 2011-04-17
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2011-2012 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU General Public License version 2.
|
|
*/
|
|
|
|
#include <base/printf.h>
|
|
#include <vcpu.h>
|
|
|
|
namespace Fiasco {
|
|
#include <l4/util/util.h>
|
|
}
|
|
|
|
using namespace Fiasco;
|
|
|
|
extern "C" {
|
|
|
|
void l4_sleep(int ms)
|
|
{
|
|
L4lx::Vcpu *vcpu = static_cast<L4lx::Vcpu*>(Genode::Thread_base::myself());
|
|
if (vcpu)
|
|
vcpu->timer()->msleep(ms);
|
|
else {
|
|
static Timer::Connection timer;
|
|
timer.msleep(ms);
|
|
}
|
|
}
|
|
|
|
|
|
void l4_sleep_forever(void)
|
|
{
|
|
for (;;)
|
|
l4_ipc_sleep(L4_IPC_NEVER);
|
|
}
|
|
|
|
}
|