efb80e7e09
Currently we're hacking libs-y to include libgcc.a, but this has unforeseen consequences since the userspace libgcc is linked with fpregs enabled. We need the kernel to stop using fpregs in an uncontrolled manner to implement lazy fpu state saves. Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
32 lines
409 B
C
32 lines
409 B
C
#include "libgcc.h"
|
|
|
|
u32 __udivmodsi4(u32 num, u32 den, u32 * rem_p)
|
|
{
|
|
u32 quot = 0, qbit = 1;
|
|
|
|
if (den == 0) {
|
|
BUG();
|
|
}
|
|
|
|
/* Left-justify denominator and count shift */
|
|
while ((s32) den >= 0) {
|
|
den <<= 1;
|
|
qbit <<= 1;
|
|
}
|
|
|
|
while (qbit) {
|
|
if (den <= num) {
|
|
num -= den;
|
|
quot += qbit;
|
|
}
|
|
den >>= 1;
|
|
qbit >>= 1;
|
|
}
|
|
|
|
if (rem_p)
|
|
*rem_p = num;
|
|
|
|
return quot;
|
|
}
|
|
EXPORT_SYMBOL(__udivmodsi4);
|