From 5718e5428d36f1f76c0a2fbcc2ed94b0e0b2a398 Mon Sep 17 00:00:00 2001 From: theraven Date: Tue, 18 Oct 2011 14:28:56 +0000 Subject: [PATCH] Add block trampolines for ARM (need a bit more testing...) --- block_trampolines.S | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/block_trampolines.S b/block_trampolines.S index e9d5ea9..b89182d 100644 --- a/block_trampolines.S +++ b/block_trampolines.S @@ -51,6 +51,19 @@ next_line2: mov %ebx, 8(%esp) # Store the block pointer in the first argument jmp *-13(%eax) # Call the block function __objc_block_trampoline_end_sret: +#elif __arm__ +__objc_block_trampoline: + mov r12, pc # Save entry program counter + mov r1, r0 # Move self over _cmd + ldr r0, [r12, #-12] # Load the block pointer over self + ldr pc, [r12, #-16] # Jump to the block function +__objc_block_trampoline_end: +__objc_block_trampoline_sret: + mov r12, pc # Save the program counter + mov r2, r1 # Move self over _cmd + ldr r1, [r12, #-12] # Load the block pointer over self + ldr pc, [r12, #-16] # Jump to the block function +__objc_block_trampoline_end_sret: #else #warning imp_implementationWithBlock() not implemented for your architecture __objc_block_trampoline: