053-mcfv4e_brcache_inval.patch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From eba69831e8f35174e2e15e373a66f40dc0be8929 Mon Sep 17 00:00:00 2001
  2. From: Kurt Mahan <[email protected]>
  3. Date: Wed, 14 May 2008 12:23:12 -0600
  4. Subject: [PATCH] Force branch-cache invalidate on task switch.
  5. When finishing a task switch make sure the branch cache
  6. gets invalidated to ensure no stale entries exist for
  7. the next user space.
  8. LTIBName: mcfv4e-brcache-inval
  9. Signed-off-by: Kurt Mahan <[email protected]>
  10. ---
  11. include/asm-m68k/system.h | 15 +++++++++++++++
  12. 1 files changed, 15 insertions(+), 0 deletions(-)
  13. --- a/include/asm-m68k/system.h
  14. +++ b/include/asm-m68k/system.h
  15. @@ -5,9 +5,24 @@
  16. #include <linux/kernel.h>
  17. #include <asm/segment.h>
  18. #include <asm/entry.h>
  19. +#include <asm/cfcache.h>
  20. #ifdef __KERNEL__
  21. +#ifdef CONFIG_COLDFIRE
  22. +#define FLUSH_BC (0x00040000)
  23. +
  24. +#define finish_arch_switch(prev) do { \
  25. + unsigned long tmpreg; \
  26. + asm volatile ( "move.l %2,%0\n" \
  27. + "orl %1,%0\n" \
  28. + "movec %0,%%cacr" \
  29. + : "=&d" (tmpreg) \
  30. + : "id" (FLUSH_BC), "m" (shadow_cacr)); \
  31. + } while(0)
  32. +
  33. +#endif
  34. +
  35. /*
  36. * switch_to(n) should switch tasks to task ptr, first checking that
  37. * ptr isn't the current task, in which case it does nothing. This