| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 #include "native_client/src/trusted/service_runtime/nacl_config.h" | 32 #include "native_client/src/trusted/service_runtime/nacl_config.h" |
| 33 | 33 |
| 34 /* | 34 /* |
| 35 * This code is patched into trampoline region, in the pre-last slot (the last | 35 * This code is patched into trampoline region, in the pre-last slot (the last |
| 36 * slot is occupied by the springboard). This code is used by the nacl module | 36 * slot is occupied by the springboard). This code is used by the nacl module |
| 37 * for obtaining a pointer to its TLS region. A function __aeabi_read_tp in nacl | 37 * for obtaining a pointer to its TLS region. A function __aeabi_read_tp in nacl |
| 38 * libc must be tweaked to jump to the trampoline slot with this code. | 38 * libc must be tweaked to jump to the trampoline slot with this code. |
| 39 */ | 39 */ |
| 40 | 40 |
| 41 .globl IDENTIFIER(NaClReadTP_start) | 41 .globl IDENTIFIER(NaClReadTP_start) |
| 42 .globl IDENTIFIER(NaClReadTP_end) | 42 HIDDEN(NaClReadTP_start) |
| 43 | |
| 44 IDENTIFIER(NaClReadTP_start): | 43 IDENTIFIER(NaClReadTP_start): |
| 45 | 44 |
| 46 /* r9 keeps the TLS_IDX which is concatenation of a tdb pointer and index in | 45 /* r9 keeps the TLS_IDX which is concatenation of a tdb pointer and index in |
| 47 * nacl_thread/nacl_user/nacl_sys arrays. The higher 20 bits are for tdb | 46 * nacl_thread/nacl_user/nacl_sys arrays. The higher 20 bits are for tdb |
| 48 * address and the lower 12 keep the index. | 47 * address and the lower 12 keep the index. |
| 49 * The first word of the tdb points to the tls are for the thread. | 48 * The first word of the tdb points to the tls are for the thread. |
| 50 * | 49 * |
| 51 * This code is copied into nacl module address space by | 50 * This code is copied into nacl module address space by |
| 52 * sel_ldr_arm::NaClLoadTlsHook() | 51 * sel_ldr_arm::NaClLoadTlsHook() |
| 53 * The target location is just below NACL_TRAMPOLINE_END | 52 * The target location is just below NACL_TRAMPOLINE_END |
| 54 * | 53 * |
| 55 * NOTE: A copy of this code also exists in the arm startup under | 54 * NOTE: A copy of this code also exists in the arm startup under |
| 56 * the arm eabi name __aeabi_read_tp() | 55 * the arm eabi name __aeabi_read_tp() |
| 57 */ | 56 */ |
| 58 mov r0, r9, lsr #NACL_PAGESHIFT | 57 mov r0, r9, lsr #NACL_PAGESHIFT |
| 59 lsl r0, #NACL_PAGESHIFT | 58 lsl r0, #NACL_PAGESHIFT |
| 60 #if !defined(DANGEROUS_DEBUG_MODE_DISABLE_INNER_SANDBOX) | 59 #if !defined(DANGEROUS_DEBUG_MODE_DISABLE_INNER_SANDBOX) |
| 61 bic lr, lr, #0xF000000F | 60 bic lr, lr, #0xF000000F |
| 62 #endif | 61 #endif |
| 63 bx lr | 62 bx lr |
| 64 | 63 |
| 64 .globl IDENTIFIER(NaClReadTP_end) |
| 65 HIDDEN(NaClReadTP_end) |
| 65 IDENTIFIER(NaClReadTP_end): | 66 IDENTIFIER(NaClReadTP_end): |
| 66 | |
| OLD | NEW |