initialize atomic counters and enable Lubashevsky barrier
This commit is contained in:
parent
d24958f8b1
commit
9e286a567e
1 changed files with 19 additions and 2 deletions
|
@ -161,10 +161,26 @@ int svm_init(void)
|
|||
if (!RCCE_IAM)
|
||||
memset((void*)page_owner, 0x00, OWNER_SIZE);
|
||||
|
||||
// initialize svm barrier
|
||||
incregs = (volatile atomic_increg_t*) map_region(0, 0xF900E000, 2, MAP_KERNEL_SPACE|MAP_NO_CACHE);
|
||||
if (BUILTIN_EXPECT(!incregs, 0)) {
|
||||
flags = irq_nested_disable();
|
||||
RCCE_shfree((t_vcharp) phyaddr);
|
||||
irq_nested_enable(flags);
|
||||
return -ENOMEM;
|
||||
}
|
||||
kprintf("Map atomic counters at 0x%x\n", incregs);
|
||||
|
||||
// iRCCE is not thread save => disable interrupts
|
||||
flags = irq_nested_disable();
|
||||
RCCE_barrier(&RCCE_COMM_WORLD);
|
||||
RCCE_flag_alloc(&release);
|
||||
irq_nested_enable(flags);
|
||||
|
||||
/* INIT: yafbarrier */
|
||||
incregs[AIREG1].initializer = 0;
|
||||
incregs[AIREG2].initializer = 0;
|
||||
|
||||
RCCE_barrier(&RCCE_COMM_WORLD);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -426,7 +442,8 @@ int svm_barrier(uint32_t type)
|
|||
svm_invalidate();
|
||||
}
|
||||
|
||||
#if 0
|
||||
#if 1
|
||||
// Lubachevsky barrier with flags
|
||||
index = !index;
|
||||
if (incregs[AIREG1].counter > (comm->size - 2)) {
|
||||
incregs[AIREG1].initializer = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue