OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 25 matching lines...) Expand all Loading... |
36 | 36 |
37 .type pushAllRegisters, %function | 37 .type pushAllRegisters, %function |
38 .global pushAllRegisters | 38 .global pushAllRegisters |
39 .hidden pushAllRegisters | 39 .hidden pushAllRegisters |
40 #ifdef __thumb__ | 40 #ifdef __thumb__ |
41 /* In THUMB Mode jump to ARM stub via bx to ensure CPU mode switch. | 41 /* In THUMB Mode jump to ARM stub via bx to ensure CPU mode switch. |
42 * FIXME: This trampoline is provided to workaround bugs in | 42 * FIXME: This trampoline is provided to workaround bugs in |
43 * the THUMB/ARM interworking that appear in the component build. | 43 * the THUMB/ARM interworking that appear in the component build. |
44 * When these issues are resolved this stub can be removed. | 44 * When these issues are resolved this stub can be removed. |
45 */ | 45 */ |
| 46 .align 2 |
46 .code 16 | 47 .code 16 |
47 .thumb_func | 48 .thumb_func |
48 pushAllRegisters: | 49 pushAllRegisters: |
49 adr r3, pushAllRegistersARM | 50 adr r3, pushAllRegistersARM |
50 bx r3 | 51 bx r3 |
51 | 52 |
52 .type pushAllRegistersARM, %function | 53 .type pushAllRegistersARM, %function |
53 .hidden pushAllRegistersARM | 54 .hidden pushAllRegistersARM |
| 55 .align 4 |
54 .code 32 | 56 .code 32 |
55 pushAllRegistersARM: | 57 pushAllRegistersARM: |
56 #else | 58 #else |
57 /* ARM Mode */ | 59 /* ARM Mode */ |
| 60 .align 4 |
| 61 .code 32 |
58 pushAllRegisters: | 62 pushAllRegisters: |
59 #endif | 63 #endif |
60 /* Push all callee-saved registers and save return address. */ | 64 /* Push all callee-saved registers and save return address. */ |
61 push {r4-r11, lr} | 65 push {r4-r11, lr} |
62 /* Pass the two first arguments unchanged (r0, r1) | 66 /* Pass the two first arguments unchanged (r0, r1) |
63 * and pass the stack pointer after pushing callee-saved | 67 * and pass the stack pointer after pushing callee-saved |
64 * registers to the callback function. | 68 * registers to the callback function. |
65 */ | 69 */ |
66 mov r3, r2 | 70 mov r3, r2 |
67 mov r2, sp | 71 mov r2, sp |
68 blx r3 | 72 blx r3 |
69 /* Discard all the registers, and pop lr into pc which returns | 73 /* Discard all the registers, and pop lr into pc which returns |
70 * and switches mode if needed. | 74 * and switches mode if needed. |
71 */ | 75 */ |
72 add sp, sp, #32 | 76 add sp, sp, #32 |
73 pop {pc} | 77 pop {pc} |
OLD | NEW |