Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/mips/include Define SLJIT_CACHE_FLUSH() for mips.



details:   https://anonhg.NetBSD.org/src/rev/9c3e7c3eded6
branches:  trunk
changeset: 330810:9c3e7c3eded6
user:      alnsn <alnsn%NetBSD.org@localhost>
date:      Tue Jul 22 19:54:55 2014 +0000

description:
Define SLJIT_CACHE_FLUSH() for mips.

diffstat:

 sys/arch/mips/include/sljitarch.h |  22 +++++++++++++++++++---
 1 files changed, 19 insertions(+), 3 deletions(-)

diffs (39 lines):

diff -r 53525a83bb90 -r 9c3e7c3eded6 sys/arch/mips/include/sljitarch.h
--- a/sys/arch/mips/include/sljitarch.h Tue Jul 22 18:14:25 2014 +0000
+++ b/sys/arch/mips/include/sljitarch.h Tue Jul 22 19:54:55 2014 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: sljitarch.h,v 1.3 2013/11/17 12:01:58 alnsn Exp $      */
+/*     $NetBSD: sljitarch.h,v 1.4 2014/07/22 19:54:55 alnsn Exp $      */
 
 /*-
- * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * Copyright (c) 2012,2014 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,8 +29,24 @@
 #ifndef _MIPS_SLJITARCH_H
 #define _MIPS_SLJITARCH_H
 
-#ifndef _LP64
+#ifdef _LP64
+#define SLJIT_CONFIG_MIPS_64 1
+#else
 #define SLJIT_CONFIG_MIPS_32 1
 #endif
 
+#include <sys/types.h>
+
+#ifdef _KERNEL
+#include <mips/cache.h>
+
+#define SLJIT_CACHE_FLUSH(from, to) mips_icache_sync_range( \
+       (vaddr_t)(from), (vsize_t)((const char *)(to) - (const char *)(from)))
+#else
+#include <mips/cachectl.h>
+
+#define SLJIT_CACHE_FLUSH(from, to) \
+       (void)_cacheflush((void*)(from), (size_t)((to) - (from)), ICACHE)
 #endif
+
+#endif



Home | Main Index | Thread Index | Old Index