summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authordgilbert <dgilbert@us.ibm.com>2011-07-28 16:42:28 -0500
committerDouglas R. Gilbert <dgilbert@us.ibm.com>2011-08-17 14:22:39 -0500
commitc56648379cde6ea3bcfac07923bb560734c6e16f (patch)
tree81ee3d5abaa130d0f1e36e038c3a344e11f55ce0 /src/lib
parent20b03fdaeb7414fdf9d43634976ca1ab5fbac7f1 (diff)
downloadtalos-hostboot-c56648379cde6ea3bcfac07923bb560734c6e16f.tar.gz
talos-hostboot-c56648379cde6ea3bcfac07923bb560734c6e16f.zip
Virtual File System module load and unload
Change-Id: Iaa6a256a8a15ac48bfba5bc1cab292c5ac246166 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/253 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/syscall_mm.C32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/syscall_mm.C b/src/lib/syscall_mm.C
index 187cdced2..ba527073f 100644
--- a/src/lib/syscall_mm.C
+++ b/src/lib/syscall_mm.C
@@ -1,5 +1,6 @@
#include <sys/syscall.h>
#include <sys/mm.h>
+#include <arch/ppc.H>
using namespace Systemcalls;
@@ -10,3 +11,34 @@ int mm_alloc_block(msg_q_t mq,void* va,uint64_t size)
{
return (int64_t)_syscall3(MM_ALLOC_BLOCK, mq, va, (void*)size);
}
+
+
+/*
+ * Call to flush out the instruction cache
+ * From the PowerPC ISA book II, section 1.8
+ * Instruction Storage
+ */
+void mm_icache_invalidate(void * i_addr, size_t i_cpu_word_count)
+{
+ // Make sure 8 byte boundary
+ uint64_t addr = (uint64_t)i_addr & ~0x7ull;
+ uint64_t * dest = (uint64_t*)addr;
+
+ for(size_t i = 0; i < i_cpu_word_count; ++i)
+ {
+ dcbst(dest);
+ ++dest;
+ }
+
+ lwsync();
+
+ dest = (uint64_t*)addr;
+ for(size_t i = 0; i < i_cpu_word_count; ++i)
+ {
+ icbi(dest);
+ ++dest;
+ }
+
+ isync();
+}
+
OpenPOWER on IntegriCloud