use RCCE's method to flush the write combining buffers
This commit is contained in:
parent
b0b9b0996e
commit
a4a4c5b9f0
3 changed files with 12 additions and 5 deletions
|
@ -21,6 +21,10 @@
|
|||
#define __ARCH_SVM_H__
|
||||
|
||||
#include <metalsvm/stddef.h>
|
||||
#include <asm/processor.h>
|
||||
#ifdef CONFIG_ROCKCREEK
|
||||
#include <asm/RCCE_lib.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -72,11 +76,13 @@ static inline void svm_invalidate(void)
|
|||
|
||||
static inline void svm_flush(void)
|
||||
{
|
||||
mb();
|
||||
#ifndef SVM_WT
|
||||
#ifdef CONFIG_ROCKCREEK
|
||||
// need to write to another line to make sure the write combine buffer gets flushed
|
||||
*(int *)RCCE_fool_write_combine_buffer = 1;
|
||||
#endif
|
||||
#ifdef SVM_WB
|
||||
flush_cache();
|
||||
#endif
|
||||
//asm volatile ( ".byte 0x0f; .byte 0x0a;\n" ); // CL1FLUSHMB
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -356,7 +356,7 @@ size_t map_region(size_t viraddr, size_t phyaddr, uint32_t npages, uint32_t flag
|
|||
pgt->entries[index] |= PG_MPE;
|
||||
#endif
|
||||
if (flags & MAP_SVM)
|
||||
#ifdef SVM_WT
|
||||
#ifndef SVM_WB
|
||||
pgt->entries[index] |= PG_SVM|PG_PWT;
|
||||
#else
|
||||
pgt->entries[index] |= PG_SVM;
|
||||
|
|
|
@ -228,7 +228,8 @@ int svm_emit_page(size_t phyaddr, int ue)
|
|||
change_page_permissions(viraddr, viraddr+PAGE_SIZE, VMA_NOACCESS|VMA_READ|VMA_CACHEABLE);
|
||||
|
||||
page_owner[pageid] = ue;
|
||||
mb();
|
||||
// need to write to another line to make sure the write combine buffer gets flushed
|
||||
*(int *)RCCE_fool_write_combine_buffer = 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue