Chris Zankel | 9a8fd55 | 2005-06-23 22:01:26 -0700 | [diff] [blame] | 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 | |
| 11 | #ifndef _XTENSA_DIV64_H |
| 12 | #define _XTENSA_DIV64_H |
| 13 | |
Stephen Hemminger | 3927f2e | 2007-03-25 19:54:23 -0700 | [diff] [blame] | 14 | #include <linux/types.h> |
| 15 | |
Chris Zankel | 9a8fd55 | 2005-06-23 22:01:26 -0700 | [diff] [blame] | 16 | #define do_div(n,base) ({ \ |
| 17 | int __res = n % ((unsigned int) base); \ |
| 18 | n /= (unsigned int) base; \ |
| 19 | __res; }) |
| 20 | |
Stephen Hemminger | 3927f2e | 2007-03-25 19:54:23 -0700 | [diff] [blame] | 21 | static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor) |
| 22 | { |
| 23 | return dividend / divisor; |
| 24 | } |
Chris Zankel | 9a8fd55 | 2005-06-23 22:01:26 -0700 | [diff] [blame] | 25 | #endif |