summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm/include/asm/div64.h
blob: 9b6d2dd79777910780bbc5d8a93592bfc133cf1b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* Public domain. */

#ifndef _ASM_DIV64_H
#define _ASM_DIV64_H

#include <sys/types.h>

#define do_div(n, base) ({				\
	uint32_t __base = (base);			\
	uint32_t __rem = ((uint64_t)(n)) % __base;	\
	(n) = ((uint64_t)(n)) / __base;			\
	__rem;						\
})

#endif