linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Sun, 23 Jan 2005 23:14:33 +0000
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/01/23 23:14:27

Modified files:
        include/asm-mips: prefetch.h 

Log message:
        A bunch of macros to make use of prefetching in assembler code in a
        halfway readable way.

diff -urN linux/include/asm-mips/prefetch.h linux/include/asm-mips/prefetch.h
--- linux/include/asm-mips/prefetch.h   2004/03/05 02:18:22     1.3
+++ linux/include/asm-mips/prefetch.h   2005/01/23 23:14:27     1.4
@@ -8,6 +8,8 @@
 #ifndef __ASM_PREFETCH_H
 #define __ASM_PREFETCH_H
 
+#include <linux/config.h>
+
 /*
  * R5000 and RM5200 implements pref and prefx instructions but they're nops, so
  * rather than wasting time we pretend these processors don't support
@@ -41,4 +43,46 @@
 #define Pref_WriteBackInvalidate       25
 #define Pref_PrepareForStore           30
 
+#ifdef __ASSEMBLY__
+
+       .macro  __pref hint addr
+#ifdef CONFIG_CPU_HAS_PREFETCH
+       pref    \hint, \addr
+#endif
+       .endm
+
+       .macro  pref_load addr
+       __pref  Pref_Load, \addr
+       .endm
+
+       .macro  pref_store addr
+       __pref  Pref_Store, \addr
+       .endm
+
+       .macro  pref_load_streamed addr
+       __pref  Pref_LoadStreamed, \addr
+       .endm
+
+       .macro  pref_store_streamed addr
+       __pref  Pref_StoreStreamed, \addr
+       .endm
+
+       .macro  pref_load_retained addr
+       __pref  Pref_LoadRetained, \addr
+       .endm
+
+       .macro  pref_store_retained addr
+       __pref  Pref_StoreRetained, \addr
+       .endm
+
+       .macro  pref_wback_inv addr
+       __pref  Pref_WriteBackInvalidate, \addr
+       .endm
+
+       .macro  pref_prepare_for_store addr
+       __pref  Pref_PrepareForStore, \addr
+       .endm
+
+#endif
+
 #endif /* __ASM_PREFETCH_H */

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