oprofile-0.9.4-001-avr32-enable-lookup_dcookie.patch 986 B

123456789101112131415161718192021222324
  1. Index: oprofile-0.9.4/daemon/opd_cookie.c
  2. ===================================================================
  3. --- oprofile-0.9.4.orig/daemon/opd_cookie.c 2008-07-25 16:00:17.000000000 +0200
  4. +++ oprofile-0.9.4/daemon/opd_cookie.c 2008-07-25 16:00:20.000000000 +0200
  5. @@ -78,6 +78,19 @@
  6. (unsigned long)(cookie & 0xffffffff),
  7. (unsigned long)(cookie >> 32), buf, size);
  8. }
  9. +#elif (defined(__avr32__))
  10. +static inline int lookup_dcookie(cookie_t cookie, char * buf, size_t size)
  11. +{
  12. + /* On avr32, the first 64bit arg (cookie) is expected to be in
  13. + * r11(MSW)/r10(LSW) which normally hold arg 2 and arg 3. The second arg
  14. + * (buf) is then expected to be in r12 which normally holds the first
  15. + * arg. Third arg (size) is at the right position.
  16. + */
  17. + return syscall(__NR_lookup_dcookie, buf,
  18. + (unsigned long)(cookie >> 32),
  19. + (unsigned long)(cookie & 0xffffffff),
  20. + size);
  21. +}
  22. #else
  23. static inline int lookup_dcookie(cookie_t cookie, char * buf, size_t size)
  24. {