[T106][ZXW-22]7520V3SCV2.01.01.02P42U09_VEC_V0.8_AP_VEC origin source commit
Change-Id: Ic6e05d89ecd62fc34f82b23dcf306c93764aec4b
diff --git a/boot/common/src/loader/cpu/m0/udivmodsi4.c b/boot/common/src/loader/cpu/m0/udivmodsi4.c
new file mode 100755
index 0000000..c556a50
--- /dev/null
+++ b/boot/common/src/loader/cpu/m0/udivmodsi4.c
@@ -0,0 +1,27 @@
+
+unsigned long udivmodsi4(unsigned long num, unsigned long den, int modwanted)
+{
+ unsigned long bits = 1;
+ unsigned long ret = 0;
+ unsigned long tmpnum = num;
+ unsigned long tmpden = den;
+
+ while (tmpden < tmpnum && bits && !(tmpden & (1L<<31)))
+ {
+ tmpden <<=1;
+ bits <<=1;
+ }
+ while (bits)
+ {
+ if (tmpnum >= tmpden)
+ {
+ tmpnum -= tmpden;
+ ret |= bits;
+ }
+ bits >>=1;
+ tmpden >>=1;
+ }
+ if (modwanted) return tmpnum;
+
+ return ret;
+}