2012-10-23 17:12:09 +02:00
|
|
|
/*
|
2012-12-03 17:21:35 +01:00
|
|
|
* \brief CPU driver for core
|
2012-10-23 17:12:09 +02:00
|
|
|
* \author Martin stein
|
|
|
|
* \date 2011-11-03
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2011-2017 Genode Labs GmbH
|
2012-10-23 17:12:09 +02:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 13:23:52 +01:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2012-10-23 17:12:09 +02:00
|
|
|
*/
|
|
|
|
|
2017-04-12 10:06:29 +02:00
|
|
|
#ifndef _CORE__SPEC__ARM_V7__CPU_SUPPORT_H_
|
|
|
|
#define _CORE__SPEC__ARM_V7__CPU_SUPPORT_H_
|
2012-10-23 17:12:09 +02:00
|
|
|
|
|
|
|
/* core includes */
|
2014-07-15 14:51:27 +02:00
|
|
|
#include <spec/arm/cpu_support.h>
|
2012-10-23 17:12:09 +02:00
|
|
|
|
2017-04-12 11:19:23 +02:00
|
|
|
namespace Genode { struct Arm_v7_cpu; }
|
2014-07-09 12:03:17 +02:00
|
|
|
|
2015-03-27 13:55:03 +01:00
|
|
|
|
2017-04-12 11:19:23 +02:00
|
|
|
struct Genode::Arm_v7_cpu : Arm_cpu
|
2014-07-09 12:03:17 +02:00
|
|
|
{
|
2018-11-26 11:18:57 +01:00
|
|
|
/**
|
|
|
|
* Returns whether this cpu implements the multiprocessor extensions
|
|
|
|
*/
|
|
|
|
static bool multi_processor()
|
|
|
|
{
|
|
|
|
static bool mp = Mpidr::Me::get(Mpidr::read());
|
|
|
|
return mp;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Invalidate TLB for given address space id
|
|
|
|
*/
|
|
|
|
static void invalidate_tlb(unsigned asid)
|
|
|
|
{
|
|
|
|
if (multi_processor()) {
|
|
|
|
if (asid) Tlbiasidis::write(asid);
|
|
|
|
else Tlbiallis::write(0);
|
|
|
|
} else Arm_cpu::invalidate_tlb(asid);
|
|
|
|
}
|
2014-07-09 12:03:17 +02:00
|
|
|
};
|
2012-10-23 17:12:09 +02:00
|
|
|
|
2017-04-12 10:06:29 +02:00
|
|
|
#endif /* _CORE__SPEC__ARM_V7__CPU_SUPPORT_H_ */
|