]> rtime.felk.cvut.cz Git - hercules2020/hercules-compiler.git/blob - debian/patches/Guard-architecture-dependent-code-with-#ifdefs.patch
f8ff4d5ff6c2ef23e4733b35a472a61527d96a9d
[hercules2020/hercules-compiler.git] / debian / patches / Guard-architecture-dependent-code-with-#ifdefs.patch
1 Description: libpremnotify-cpu: Guard architecture dependent code with #ifdefs
2  This allows compiling "placeholder" version of the library for other
3  architecures.
4  .
5 Author: Michal Sojka <michal.sojka@cvut.cz>
6
7 ---
8 The information above should follow the Patch Tagging Guidelines, please
9 checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
10 are templates for supplementary fields that you might want to add:
11
12 Origin: <vendor|upstream|other>, <url of original patch>
13 Bug: <url in upstream bugtracker>
14 Bug-Debian: https://bugs.debian.org/<bugnumber>
15 Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
16 Forwarded: <no|not-needed|url proving that it has been forwarded>
17 Reviewed-By: <name and email of someone who approved the patch>
18 Last-Update: 2018-11-06
19
20 --- a/HerculesCompiler/libpremnotify/libpremnotify-cpu.c
21 +++ b/HerculesCompiler/libpremnotify/libpremnotify-cpu.c
22 @@ -141,16 +141,20 @@
23  
24  
25  // This function should prefetch the provided pointer.
26 -void __prem_prefetch(void * ptr, int isRead) { 
27 -    //if(isRead) 
28 -        //__asm__ __volatile__("prfm pldl2keep, %a0\n" : : "p" (ptr)); 
29 -    //else 
30 -        //__asm__ __volatile__("prfm pstl2keep, %a0\n" : : "p" (ptr)); 
31 +void __prem_prefetch(void * ptr, int isRead) {
32 +#if defined(__aarch64__)
33 +     if(isRead)
34 +         __asm__ __volatile__("prfm pldl2keep, %a0\n" : : "p" (ptr));
35 +     else
36 +         __asm__ __volatile__("prfm pstl2keep, %a0\n" : : "p" (ptr));
37 +#endif
38  }
39  
40  
41  // This function should evict the provided pointer from the cache.
42  void __prem_evict(void * ptr) {
43 -    //__asm__ __volatile__("dc civac, %0\n" : : "r" (ptr) : "memory");
44 +#if defined(__aarch64__)
45 +     __asm__ __volatile__("dc civac, %0\n" : : "r" (ptr) : "memory");
46 +#endif
47  }
48