div64.h 555 B

12345678910111213141516171819202122232425
  1. /*
  2. * include/asm-xtensa/div64.h
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file "COPYING" in the main directory of this archive
  6. * for more details.
  7. *
  8. * Copyright (C) 2001 - 2005 Tensilica Inc.
  9. */
  10. #ifndef _XTENSA_DIV64_H
  11. #define _XTENSA_DIV64_H
  12. #include <linux/types.h>
  13. #define do_div(n,base) ({ \
  14. int __res = n % ((unsigned int) base); \
  15. n /= (unsigned int) base; \
  16. __res; })
  17. static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor)
  18. {
  19. return dividend / divisor;
  20. }
  21. #endif