--- a/kernel/eka/common/arm/carray.cia Tue Jun 15 15:02:48 2010 +0100
+++ b/kernel/eka/common/arm/carray.cia Tue Jun 15 19:10:20 2010 +0100
@@ -82,6 +82,7 @@
EXPORT_C __NAKED__ TInt RPointerArrayBase::Find(const TAny* /*anEntry*/, TGeneralIdentityRelation /*anIdentity*/) const
{
+ __EH_FNSTART
asm("stmfd sp!, {r4-r8,lr} ");
__EH_FRAME_PUSH2(r4-r8,lr)
asm("ldmia r0, {r4,r5} "); // r4=iCount, r5=iEntries
@@ -103,16 +104,17 @@
asm("ptr_find2_return: "); // return r6
asm("mov r0, r6 ");
__POPRET("r4-r8,");
+ __EH_FNEND
}
-EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearchSigned(TInt /*anEntry*/, TInt& /*anIndex*/) const
+EXPORT_C TInt RPointerArrayBase::BinarySearchSigned(TInt anEntry, TInt& anIndex) const
{
- asm("mov r3, #0 ");
- // fall through
+ return RPointerArrayBase::BinarySearchSigned(anEntry, anIndex, 0);
}
EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearchSigned(TInt /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
asm("stmfd sp!, {r4-r6,lr} ");
__EH_FRAME_PUSH2(r4-r6,lr)
asm("mov r6, r2 "); // r6=&anIndex
@@ -160,16 +162,17 @@
asm("bne 3b "); // if not, V=0 (left from subs), N=1 for last, 0 for first, Z=0 => LAST->LT FIRST->GT
asm("mov r2, r12 "); // if so, r2 = mid
__JUMP(,lr); // and return with r0 = 0
+ __EH_FNEND
}
-EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearchUnsigned(TUint /*anEntry*/, TInt& /*anIndex*/) const
+EXPORT_C TInt RPointerArrayBase::BinarySearchUnsigned(TUint anEntry, TInt& anIndex) const
{
- asm("mov r3, #0 ");
- // fall through
+ return RPointerArrayBase::BinarySearchUnsigned(anEntry, anIndex, 0);
}
EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearchUnsigned(TUint /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
asm("stmfd sp!, {r4-r6,lr} ");
__EH_FRAME_PUSH2(r4-r6,lr)
asm("mov r6, r2 "); // r6=&anIndex
@@ -218,10 +221,12 @@
asm("bne 3b "); // if not ANY, branch back
asm("mov r2, r12 "); // if ANY, r2 = mid
__JUMP(,lr); // and return with r0 = 0
+ __EH_FNEND
}
EXPORT_C __NAKED__ TInt RPointerArrayBase::BinarySearch(const TAny* /*anEntry*/, TInt& /*anIndex*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
asm("stmfd sp!, {r2,r4-r11,lr} "); // store &anIndex, r4-r11, lr
__EH_FRAME_ADDRESS(sp,4)
__EH_FRAME_PUSH2(r4-r11,lr)
@@ -282,16 +287,17 @@
asm("2: ");
asm("mov r5, r8 "); // if ANY, r8 = mid
__JUMP(,r9); // and return with r0 = 0, Z=1
+ __EH_FNEND
}
-EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsqSigned(TInt /*anEntry*/) const
+EXPORT_C TInt RPointerArrayBase::FindIsqSigned(TInt anEntry) const
{
- asm("mov r2, #0 ");
- // fall through
+ return RPointerArrayBase::FindIsqSigned(anEntry, 0);
}
EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsqSigned(TInt /*anEntry*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
#ifdef __EABI__
// sp needs correct alignment
asm("stmfd sp!, {r4-r6,lr} ");
@@ -308,16 +314,17 @@
#else
__POPRET("r4,r5,");
#endif
+ __EH_FNEND
}
-EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsqUnsigned(TUint /*anEntry*/) const
+EXPORT_C TInt RPointerArrayBase::FindIsqUnsigned(TUint anEntry) const
{
- asm("mov r2, #0 ");
- // fall through
+ return RPointerArrayBase::FindIsqUnsigned(anEntry, 0);
}
EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsqUnsigned(TUint /*anEntry*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
#ifdef __EABI__
// sp needs correct alignment
asm("stmfd sp!, {r4-r6,lr} ");
@@ -334,17 +341,17 @@
#else
__POPRET("r4,r5,");
#endif
+ __EH_FNEND
}
-EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsq(const TAny* /*anEntry*/, TGeneralLinearOrder /*anOrder*/) const
+EXPORT_C TInt RPointerArrayBase::FindIsq(const TAny* anEntry, TGeneralLinearOrder anOrder) const
{
- asm("mov r3, #0 ");
- // fall through
+ return RPointerArrayBase::FindIsq(anEntry, anOrder, 0);
}
EXPORT_C __NAKED__ TInt RPointerArrayBase::FindIsq(const TAny* /*anEntry*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const
{
-
+ __EH_FNSTART
asm("stmfd sp!, {r3-r11,lr} ");
__EH_FRAME_PUSH2(r4-r6,lr)
asm("ldmia r0, {r5,r6} "); // r5=count, r6=iEntries
@@ -354,11 +361,13 @@
asm("bl BinarySearchPointers ");
asm("moveq r0, r5 "); // if match, r0=match index
__POPRET("r3-r11,");
+ __EH_FNEND
}
#ifndef __KERNEL_MODE__
EXPORT_C __NAKED__ void RPointerArrayBase::HeapSortSigned()
{
+ __EH_FNSTART
#ifdef __EABI__
asm("stmfd sp!, {r4-r10,lr} ");
__EH_FRAME_PUSH2(r4-r10,lr)
@@ -420,6 +429,7 @@
asm("bgt hss_loop_start2 ");
asm("str r7, [r5, #0] ");
__JUMP(,lr);
+ __EH_FNEND
}
EXPORT_C __NAKED__ void RPointerArrayBase::HeapSortUnsigned()
@@ -492,6 +502,7 @@
#ifndef __KERNEL_MODE__
EXPORT_C __NAKED__ void RPointerArrayBase::HeapSort(TGeneralLinearOrder /*anOrder*/)
{
+ __EH_FNSTART
asm("stmfd sp!, {r3-r11,lr} ");
// r3 is caller save
__EH_FRAME_ADDRESS(sp,4)
@@ -553,6 +564,7 @@
asm("bgt hsp_loop_start2 ");
asm("str r7, [r5, #0] ");
__JUMP(,r11);
+ __EH_FNEND
}
#endif // __KERNEL_MODE__
@@ -623,6 +635,7 @@
EXPORT_C __NAKED__ TInt RArrayBase::Find(const TAny* /*anEntry*/, TGeneralIdentityRelation /*anIdentity*/) const
{
+ __EH_FNSTART
asm("stmfd sp!, {r4-r10,lr} "); // save r4-r10,lr
__EH_FRAME_PUSH2(r4-r10,lr)
asm("ldmia r0, {r4,r5,r6} "); // r4=count, r5=iEntries, r6=iEntrySize
@@ -644,16 +657,17 @@
asm("simple_find2_return: ");
asm("sub r0, r7, r4 "); // index=count-r4
__POPRET("r4-r10,");
+ __EH_FNEND
}
-EXPORT_C __NAKED__ TInt RArrayBase::BinarySearchSigned(const TAny* /*anEntry*/, TInt& /*anIndex*/) const
+EXPORT_C TInt RArrayBase::BinarySearchSigned(const TAny* anEntry, TInt& anIndex) const
{
- asm("mov r3, #0 ");
- // fall through
+ return RArrayBase::BinarySearchSigned(anEntry, anIndex, 0);
}
EXPORT_C __NAKED__ TInt RArrayBase::BinarySearchSigned(const TAny* /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
asm("stmfd sp!, {r4-r8,lr} ");
__EH_FRAME_PUSH2(r4-r8,lr)
asm("mov r8, r2 "); // r8=&anIndex
@@ -709,16 +723,17 @@
asm("bne 3b "); // if not, V=0 (left from subs), N=1 for last, 0 for first, Z=0 => LAST->LT FIRST->GT
asm("mov r2, r12 "); // if so, r2 = mid
__JUMP(,lr); // and return with r0 = 0
+ __EH_FNEND
}
-EXPORT_C __NAKED__ TInt RArrayBase::BinarySearchUnsigned(const TAny* /*anEntry*/, TInt& /*anIndex*/) const
+EXPORT_C TInt RArrayBase::BinarySearchUnsigned(const TAny* anEntry, TInt& anIndex) const
{
- asm("mov r3, #0 ");
- // fall through
+ return RArrayBase::BinarySearchUnsigned(anEntry, anIndex, 0);
}
EXPORT_C __NAKED__ TInt RArrayBase::BinarySearchUnsigned(const TAny* /*anEntry*/, TInt& /*anIndex*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
asm("stmfd sp!, {r4-r8,lr} ");
__EH_FRAME_PUSH2(r4-r8,lr)
asm("mov r8, r2 "); // r8=&anIndex
@@ -775,10 +790,12 @@
asm("bne 3b "); // if not ANY, branch back
asm("mov r2, r12 "); // if ANY, r2 = mid
__JUMP(,lr); // and return with r0 = 0
+ __EH_FNEND
}
EXPORT_C __NAKED__ TInt RArrayBase::BinarySearch(const TAny* /*anEntry*/, TInt& /*anIndex*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
asm("stmfd sp!, {r3-r11,lr} ");
// r3 is caller save
__EH_FRAME_ADDRESS(sp,4)
@@ -836,16 +853,17 @@
asm("2: ");
asm("mov r5, r8 "); // if ANY, r8 = mid
__POPRET("r2,"); // and return with r0 = 0, Z=1
+ __EH_FNEND
}
-EXPORT_C __NAKED__ TInt RArrayBase::FindIsqSigned(const TAny* /*anEntry*/) const
+EXPORT_C TInt RArrayBase::FindIsqSigned(const TAny* anEntry) const
{
- asm("mov r2, #0 ");
- // fall through
+ return RArrayBase::FindIsqSigned(anEntry, 0);
}
EXPORT_C __NAKED__ TInt RArrayBase::FindIsqSigned(const TAny* /*anEntry*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
#ifdef __EABI__
// sp needs to be aligned correctly
asm("stmfd sp!, {r4-r8,lr} ");
@@ -869,16 +887,17 @@
#else
__POPRET("r4-r7,");
#endif
+ __EH_FNEND
}
-EXPORT_C __NAKED__ TInt RArrayBase::FindIsqUnsigned(const TAny* /*anEntry*/) const
+EXPORT_C TInt RArrayBase::FindIsqUnsigned(const TAny* anEntry) const
{
- asm("mov r2, #0 ");
- // fall through
+ return RArrayBase::FindIsqUnsigned(anEntry, 0);
}
EXPORT_C __NAKED__ TInt RArrayBase::FindIsqUnsigned(const TAny* /*anEntry*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
#ifdef __EABI__
// sp needs to be aligned correctly
asm("stmfd sp!, {r4-r8,lr} ");
@@ -902,16 +921,17 @@
#else
__POPRET("r4-r7,");
#endif
+ __EH_FNEND
}
-EXPORT_C __NAKED__ TInt RArrayBase::FindIsq(const TAny* /*anEntry*/, TGeneralLinearOrder /*anOrder*/) const
+EXPORT_C TInt RArrayBase::FindIsq(const TAny* anEntry, TGeneralLinearOrder anOrder) const
{
- asm("mov r3, #0 ");
- // fall through
+ return RArrayBase::FindIsq(anEntry, anOrder, 0);
}
EXPORT_C __NAKED__ TInt RArrayBase::FindIsq(const TAny* /*anEntry*/, TGeneralLinearOrder /*anOrder*/, TInt /*aMode*/) const
{
+ __EH_FNSTART
asm("stmfd sp!, {r3-r11,lr} ");
// r3 is caller save
__EH_FRAME_ADDRESS(sp,4)
@@ -924,11 +944,13 @@
asm("bl BinarySearchEntries ");
asm("moveq r0, r5 "); // if match r0=index
__POPRET("r3-r11,");
+ __EH_FNEND
}
#ifndef __KERNEL_MODE__
EXPORT_C __NAKED__ void RArrayBase::HeapSortSigned()
{
+ __EH_FNSTART
#ifdef __EABI__
// need sp aligned correctly
asm("stmfd sp!, {r3-r11,lr} ");
@@ -1017,10 +1039,12 @@
asm("bl wordmove "); // entry[0]=[sp]
asm("add sp, sp, r10 "); // free temporary stack space
__JUMP(,r7);
+ __EH_FNEND
}
EXPORT_C __NAKED__ void RArrayBase::HeapSortUnsigned()
{
+ __EH_FNSTART
#ifdef __EABI__
// need sp aligned correctly
asm("stmfd sp!, {r3-r11,lr} ");
@@ -1109,10 +1133,12 @@
asm("bl wordmove "); // entry[0]=[sp]
asm("add sp, sp, r10 "); // free temporary stack space
__JUMP(,r7);
+ __EH_FNEND
}
EXPORT_C __NAKED__ void RArrayBase::HeapSort(TGeneralLinearOrder anOrder)
{
+ __EH_FNSTART
#ifdef __EABI__
// need sp aligned correctly
asm("stmfd sp!, {r3-r11,lr} ");
@@ -1204,6 +1230,7 @@
asm("bl wordmove "); // entry[0]=[sp]
asm("ldr sp, [sp, r10] "); // restore stack pointer, freeing temporary stack space
__POPRET("");
+ __EH_FNEND
}
#endif // __KERNEL_MODE__
#endif // __ARRAY_MACHINE_CODED__