patch-2.3.43 linux/include/asm-ia64/div64.h
Next file: linux/include/asm-ia64/dma.h
Previous file: linux/include/asm-ia64/delay.h
Back to the patch index
Back to the overall index
-  Lines: 21
-  Date:
Sun Feb  6 18:42:40 2000
-  Orig file: 
v2.3.42/linux/include/asm-ia64/div64.h
-  Orig date: 
Wed Dec 31 16:00:00 1969
diff -u --recursive --new-file v2.3.42/linux/include/asm-ia64/div64.h linux/include/asm-ia64/div64.h
@@ -0,0 +1,20 @@
+#ifndef _ASM_IA64_DIV64_H
+#define _ASM_IA64_DIV64_H
+
+/*
+ * Copyright (C) 1999 Hewlett-Packard Co
+ * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ *
+ * vsprintf uses this to divide a 64-bit integer N by a small integer BASE.
+ * This is incredibly hard on IA-64...
+ */
+
+#define do_div(n,base)						\
+({								\
+	int _res;						\
+	_res = ((unsigned long) (n)) % (unsigned) (base);	\
+	(n) = ((unsigned long) (n)) / (unsigned) (base);	\
+	_res;							\
+})
+
+#endif /* _ASM_IA64_DIV64_H */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)