hw: set pages shareable in SMP systems only

Fixes #1181
This commit is contained in:
Stefan Kalkowski 2014-06-24 14:38:12 +02:00 committed by Norman Feske
parent db45a0d10d
commit 1c99ee951a
4 changed files with 10 additions and 4 deletions

View File

@ -22,6 +22,7 @@
/* base-hw includes */ /* base-hw includes */
#include <page_flags.h> #include <page_flags.h>
#include <page_slab.h> #include <page_slab.h>
#include <processor_driver.h>
namespace Arm namespace Arm
{ {
@ -184,7 +185,7 @@ class Arm::Section_table
access_t v = access_permission_bits<Small_page>(flags); access_t v = access_permission_bits<Small_page>(flags);
v |= memory_region_attr<Small_page>(flags); v |= memory_region_attr<Small_page>(flags);
v |= Ng::bits(!flags.global); v |= Ng::bits(!flags.global);
v |= S::bits(1); v |= S::bits(Processor_driver::is_smp());
v |= Pa::masked(pa); v |= Pa::masked(pa);
Descriptor::type(v, Descriptor::SMALL_PAGE); Descriptor::type(v, Descriptor::SMALL_PAGE);
return v; return v;
@ -447,7 +448,7 @@ class Arm::Section_table
access_t v = access_permission_bits<Section>(flags); access_t v = access_permission_bits<Section>(flags);
v |= memory_region_attr<Section>(flags); v |= memory_region_attr<Section>(flags);
v |= Domain::bits(DOMAIN); v |= Domain::bits(DOMAIN);
v |= S::bits(1); v |= S::bits(Processor_driver::is_smp());
v |= Ng::bits(!flags.global); v |= Ng::bits(!flags.global);
v |= Pa::masked(pa); v |= Pa::masked(pa);
Descriptor::type(v, Descriptor::SECTION); Descriptor::type(v, Descriptor::SECTION);

View File

@ -699,6 +699,11 @@ namespace Arm
base = base & LINE_ALIGNM_MASK; base = base & LINE_ALIGNM_MASK;
for (; base < top; base += LINE_SIZE) { Icimvau::write(base); } for (; base < top; base += LINE_SIZE) { Icimvau::write(base); }
} }
/**
* Return true if the processor support multiple cores
*/
static bool is_smp() { return PROCESSORS > 1; }
}; };
} }

View File

@ -182,7 +182,7 @@ namespace Arm_v6
static void start_secondary_processors(void * const ip) static void start_secondary_processors(void * const ip)
{ {
if (PROCESSORS > 1) { PERR("multiprocessing not implemented"); } if (is_smp()) { PERR("multiprocessing not implemented"); }
} }
/** /**

View File

@ -359,7 +359,7 @@ namespace Arm_v7
*/ */
static void start_secondary_processors(void * const ip) static void start_secondary_processors(void * const ip)
{ {
if (PROCESSORS > 1) { if (is_smp()) {
Genode::Board::secondary_processors_ip(ip); Genode::Board::secondary_processors_ip(ip);
data_synchronization_barrier(); data_synchronization_barrier();
asm volatile ("sev\n"); asm volatile ("sev\n");