1
0
Fork 0
remarkable-linux/include
Roman Zippel 2418f4f28f introduce explicit signed/unsigned 64bit divide
The current do_div doesn't explicitly say that it's unsigned and the signed
counterpart is missing, which is e.g.  needed when dealing with time values.

This introduces 64bit signed/unsigned divide functions which also attempts to
cleanup the somewhat awkward calling API, which often requires the use of
temporary variables for the dividend.  To avoid the need for temporary
variables everywhere for the remainder, each divide variant also provides a
version which doesn't return the remainder.

Each architecture can now provide optimized versions of these function,
otherwise generic fallback implementations will be used.

As an example I provided an alternative for the current x86 divide, which
avoids the asm casts and using an union allows gcc to generate better code.
It also avoids the upper divde in a few more cases, where the result is known
(i.e.  upper quotient is zero).

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-05-01 08:03:58 -07:00
..
acpi ACPICA: update Intel copyright 2008-04-23 23:00:13 -04:00
asm-alpha kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-arm pxafb: preliminary smart panel interface support 2008-04-30 08:29:32 -07:00
asm-avr32 kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-blackfin kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-cris kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-frv frv: unbreak misalignment handling changes 2008-05-01 08:03:58 -07:00
asm-generic remove __KERNEL__ tests of unexported headers under asm-generic/ 2008-04-30 08:29:54 -07:00
asm-h8300 kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-ia64 asm-*/futex.h should include linux/uaccess.h 2008-04-30 08:29:52 -07:00
asm-m32r kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-m68k kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-m68knommu kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-mips asm-*/futex.h should include linux/uaccess.h 2008-04-30 08:29:52 -07:00
asm-mn10300 kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-parisc asm-*/futex.h should include linux/uaccess.h 2008-04-30 08:29:52 -07:00
asm-powerpc asm-*/futex.h should include linux/uaccess.h 2008-04-30 08:29:52 -07:00
asm-ppc [RAPIDIO] Move include/asm-ppc/rio.h to asm-powerpc 2008-04-29 19:40:27 +10:00
asm-s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-30 08:45:48 -07:00
asm-sh asm-*/futex.h should include linux/uaccess.h 2008-04-30 08:29:52 -07:00
asm-sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-04-30 08:46:16 -07:00
asm-sparc64 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2008-04-30 08:46:16 -07:00
asm-um kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-v850 kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
asm-x86 introduce explicit signed/unsigned 64bit divide 2008-05-01 08:03:58 -07:00
asm-xtensa kernel: Move arches to use common unaligned access 2008-04-29 08:06:27 -07:00
crypto [CRYPTO] aes: Export generic setkey 2008-04-21 10:19:34 +08:00
keys KEYS: Fix the comment to match the file name in rxrpc-type.h. 2008-04-21 22:43:55 +00:00
linux introduce explicit signed/unsigned 64bit divide 2008-05-01 08:03:58 -07:00
math-emu
media Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb 2008-04-29 14:53:40 -07:00
mtd UBI: make ubi-header.h local 2008-04-17 11:31:58 +03:00
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-04-30 08:45:48 -07:00
pcmcia
rdma IB: expand ib_umem_get() prototype 2008-04-29 08:06:12 -07:00
rxrpc
scsi IB/iser: Count FMR alignment violations per session 2008-04-29 13:46:52 -07:00
sound [ALSA] Add MPU401_INFO_NO_ACK bitflag 2008-04-29 19:01:56 +02:00
video fbdev: platforming hecubafb and n411 2008-04-28 08:58:41 -07:00
xen xen: add balloon driver 2008-04-24 23:57:33 +02:00
Kbuild