From a27d2baa0c1a2ec70f47ea9199b1dd6762c8a349 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 21 Oct 2008 07:00:00 -0700 Subject: Initial Contribution --- libc/kernel/arch-arm/asm/div64.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 libc/kernel/arch-arm/asm/div64.h (limited to 'libc/kernel/arch-arm/asm/div64.h') diff --git a/libc/kernel/arch-arm/asm/div64.h b/libc/kernel/arch-arm/asm/div64.h new file mode 100644 index 0000000..c03a0e4 --- /dev/null +++ b/libc/kernel/arch-arm/asm/div64.h @@ -0,0 +1,27 @@ +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + **************************************************************************** + ****************************************************************************/ +#ifndef __ASM_ARM_DIV64 +#define __ASM_ARM_DIV64 + +#include + +#ifdef __ARMEB__ +#define __xh "r0" +#define __xl "r1" +#else +#define __xl "r0" +#define __xh "r1" +#endif + +#define do_div(n,base) ({ register unsigned int __base asm("r4") = base; register unsigned long long __n asm("r0") = n; register unsigned long long __res asm("r2"); register unsigned int __rem asm(__xh); asm( __asmeq("%0", __xh) __asmeq("%1", "r2") __asmeq("%2", "r0") __asmeq("%3", "r4") "bl __do_div64" : "=r" (__rem), "=r" (__res) : "r" (__n), "r" (__base) : "ip", "lr", "cc"); n = __res; __rem; }) + +#endif -- cgit v1.1