linux-mips
[Top] [All Lists]

[PATCH 35/58] MIPS: lib: csum_partial: Add EVA support

To: <linux-mips@linux-mips.org>
Subject: [PATCH 35/58] MIPS: lib: csum_partial: Add EVA support
From: Markos Chandras <markos.chandras@imgtec.com>
Date: Mon, 27 Jan 2014 20:19:22 +0000
Cc: Markos Chandras <markos.chandras@imgtec.com>
In-reply-to: <1390853985-14246-1-git-send-email-markos.chandras@imgtec.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1390853985-14246-1-git-send-email-markos.chandras@imgtec.com>
Sender: linux-mips-bounce@linux-mips.org
Use EVA specific functions to read and write data to
user address space.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 arch/mips/lib/csum_partial.S | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/arch/mips/lib/csum_partial.S b/arch/mips/lib/csum_partial.S
index 62c8768..2e4825e 100644
--- a/arch/mips/lib/csum_partial.S
+++ b/arch/mips/lib/csum_partial.S
@@ -352,6 +352,19 @@ LEAF(csum_partial)
                .section __ex_table,"a";        \
                PTR     9b, handler;            \
                .previous;                      \
+       /* This is enabled in EVA mode */       \
+       .else;                                  \
+               /* If loading from user or storing to user */   \
+               .if ((\from == USEROP) && (type == LD_INSN)) || \
+                   ((\to == USEROP) && (type == ST_INSN));     \
+9:                     __BUILD_EVA_INSN(insn##e, reg, addr);   \
+                       .section __ex_table,"a";                \
+                       PTR     9b, handler;                    \
+                       .previous;                              \
+               .else;                                          \
+                       /* EVA without exception */             \
+                       insn reg, addr;                         \
+               .endif;                                         \
        .endif
 
 #undef LOAD
@@ -795,7 +808,19 @@ LEAF(csum_partial)
        .endm
 
 LEAF(__csum_partial_copy_kernel)
+#ifndef CONFIG_EVA
 FEXPORT(__csum_partial_copy_to_user)
 FEXPORT(__csum_partial_copy_from_user)
+#endif
 __BUILD_CSUM_PARTIAL_COPY_USER LEGACY_MODE USEROP USEROP 1
 END(__csum_partial_copy_kernel)
+
+#ifdef CONFIG_EVA
+LEAF(__csum_partial_copy_to_user)
+__BUILD_CSUM_PARTIAL_COPY_USER EVA_MODE KERNELOP USEROP 0
+END(__csum_partial_copy_to_user)
+
+LEAF(__csum_partial_copy_from_user)
+__BUILD_CSUM_PARTIAL_COPY_USER EVA_MODE USEROP KERNELOP 0
+END(__csum_partial_copy_from_user)
+#endif
-- 
1.8.5.3



<Prev in Thread] Current Thread [Next in Thread>