1*1da177e4SLinus Torvalds /* 2*1da177e4SLinus Torvalds * Generic __div64_32 wrapper for __xdiv64_32. 3*1da177e4SLinus Torvalds */ 4*1da177e4SLinus Torvalds 5*1da177e4SLinus Torvalds #include <linux/types.h> 6*1da177e4SLinus Torvalds 7*1da177e4SLinus Torvalds extern u64 __xdiv64_32(u64 n, u32 d); 8*1da177e4SLinus Torvalds 9*1da177e4SLinus Torvalds u64 __div64_32(u64 *xp, u32 y) 10*1da177e4SLinus Torvalds { 11*1da177e4SLinus Torvalds u64 rem; 12*1da177e4SLinus Torvalds u64 q = __xdiv64_32(*xp, y); 13*1da177e4SLinus Torvalds 14*1da177e4SLinus Torvalds rem = *xp - q * y; 15*1da177e4SLinus Torvalds *xp = q; 16*1da177e4SLinus Torvalds 17*1da177e4SLinus Torvalds return rem; 18*1da177e4SLinus Torvalds } 19*1da177e4SLinus Torvalds 20