patch-nanojit_CodeAlloc_cpp 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. $OpenBSD: patch-nanojit_CodeAlloc_cpp,v 1.1 2017/01/01 09:29:09 jca Exp $
  2. --- js/src/nanojit/CodeAlloc.cpp.orig Tue Mar 6 15:45:30 2012
  3. +++ js/src/nanojit/CodeAlloc.cpp Fri Dec 30 02:57:57 2016
  4. @@ -242,9 +242,13 @@ namespace nanojit
  5. }
  6. #if defined(AVMPLUS_UNIX) && defined(NANOJIT_ARM)
  7. +#if defined(AVMPLUS_LINUX)
  8. #include <asm/unistd.h>
  9. extern "C" void __clear_cache(char *BEG, char *END);
  10. +#elif defined(__OpenBSD__)
  11. +#include <machine/sysarch.h>
  12. #endif
  13. +#endif
  14. #ifdef AVMPLUS_SPARC
  15. #ifdef __linux__
  16. @@ -318,6 +322,12 @@ extern "C" void sync_instruction_memory(caddr_t v, u_
  17. cacheflush((int)b->start(), (int)b->start()+b->size(), 0);
  18. }
  19. }
  20. + #elif defined(NANOJIT_ARM) && defined(__OpenBSD__)
  21. + void CodeAlloc::flushICache(CodeList* &blocks) {
  22. + for (CodeList *b = blocks; b != 0; b = b->next) {
  23. + arm_sync_icache((u_int)b->start(), (int)b->size());
  24. + }
  25. + }
  26. #else
  27. // fixme: __clear_cache is a libgcc feature, test for libgcc or gcc
  28. void CodeAlloc::flushICache(CodeList* &blocks) {