| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /* | 7 /* |
| 8 * NaCl Simple/secure ELF loader (NaCl SEL). | 8 * NaCl Simple/secure ELF loader (NaCl SEL). |
| 9 * | 9 * |
| 10 * NOTE: This header is ALSO included by assembler files and hence | 10 * NOTE: This header is ALSO included by assembler files and hence |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 # define NACL_SYSARGS_FIX (NACL_USERRET_FIX + 0x4) | 155 # define NACL_SYSARGS_FIX (NACL_USERRET_FIX + 0x4) |
| 156 # define NACL_SYSCALLRET_FIX (NACL_USERRET_FIX + 0x4) | 156 # define NACL_SYSCALLRET_FIX (NACL_USERRET_FIX + 0x4) |
| 157 /* | 157 /* |
| 158 * System V Application Binary Interface, Intel386 Architcture | 158 * System V Application Binary Interface, Intel386 Architcture |
| 159 * Processor Supplement, section 3-10, says stack alignment is | 159 * Processor Supplement, section 3-10, says stack alignment is |
| 160 * 4-bytes, but gcc-generated code can require 16-byte alignment | 160 * 4-bytes, but gcc-generated code can require 16-byte alignment |
| 161 * (depending on compiler flags in force) for SSE instructions, so we | 161 * (depending on compiler flags in force) for SSE instructions, so we |
| 162 * must do so here as well. | 162 * must do so here as well. |
| 163 */ | 163 */ |
| 164 # define NACL_STACK_ALIGN_MASK (0xf) | 164 # define NACL_STACK_ALIGN_MASK (0xf) |
| 165 # define NACL_STACK_GETS_ARG (1) |
| 166 # define NACL_STACK_PAD_BELOW_ALIGN (4) |
| 165 | 167 |
| 166 # elif NACL_BUILD_SUBARCH == 64 | 168 # elif NACL_BUILD_SUBARCH == 64 |
| 167 # define NACL_USERRET_FIX (0x8) | 169 # define NACL_USERRET_FIX (0x8) |
| 168 # define NACL_SYSARGS_FIX (-0x18) | 170 # define NACL_SYSARGS_FIX (-0x18) |
| 169 # define NACL_SYSCALLRET_FIX (0x10) | 171 # define NACL_SYSCALLRET_FIX (0x10) |
| 170 /* | 172 /* |
| 171 * System V Application Binary Interface, AMD64 Architecture Processor | 173 * System V Application Binary Interface, AMD64 Architecture Processor |
| 172 * Supplement, at http://www.x86-64.org/documentation/abi.pdf, section | 174 * Supplement, at http://www.x86-64.org/documentation/abi.pdf, section |
| 173 * 3.2.2 discusses stack alignment. | 175 * 3.2.2 discusses stack alignment. |
| 174 */ | 176 */ |
| 175 # define NACL_STACK_ALIGN_MASK (0xf) | 177 # define NACL_STACK_ALIGN_MASK (0xf) |
| 178 # define NACL_STACK_GETS_ARG (0) |
| 179 # define NACL_STACK_PAD_BELOW_ALIGN (8) |
| 176 # else /* NACL_BUILD_SUBARCH */ | 180 # else /* NACL_BUILD_SUBARCH */ |
| 177 # error Unknown platform! | 181 # error Unknown platform! |
| 178 # endif /* NACL_BUILD_SUBARCH */ | 182 # endif /* NACL_BUILD_SUBARCH */ |
| 179 | 183 |
| 180 #elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm | 184 #elif NACL_ARCH(NACL_BUILD_ARCH) == NACL_arm |
| 181 | 185 |
| 182 # define NACL_HALT mov pc, #0 | 186 # define NACL_HALT mov pc, #0 |
| 183 /* 16-byte bundles, 256MB code segment*/ | 187 /* 16-byte bundles, 256MB code segment*/ |
| 184 # define NACL_CONTROL_FLOW_MASK 0xF000000F | 188 # define NACL_CONTROL_FLOW_MASK 0xF000000F |
| 185 | 189 |
| 186 # define NACL_DATA_FLOW_MASK 0xC0000000 | 190 # define NACL_DATA_FLOW_MASK 0xC0000000 |
| 187 | 191 |
| 188 # define NACL_USERRET_FIX (0x4) | 192 # define NACL_USERRET_FIX (0x4) |
| 189 # define NACL_SYSARGS_FIX (NACL_USERRET_FIX + 0x4) | 193 # define NACL_SYSARGS_FIX (NACL_USERRET_FIX + 0x4) |
| 190 # define NACL_SYSCALLRET_FIX (NACL_USERRET_FIX + 0x4) | 194 # define NACL_SYSCALLRET_FIX (NACL_USERRET_FIX + 0x4) |
| 191 /* | 195 /* |
| 192 * See ARM Procedure Call Standard, ARM IHI 0042D, section 5.2.1.2. | 196 * See ARM Procedure Call Standard, ARM IHI 0042D, section 5.2.1.2. |
| 193 * http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042a/IHI0042A_aapcs.pdf | 197 * http://infocenter.arm.com/help/topic/com.arm.doc.ihi0042a/IHI0042A_aapcs.pdf |
| 194 * -- the "public" stack alignment is required to be 8 bytes, | 198 * -- the "public" stack alignment is required to be 8 bytes, |
| 195 */ | 199 */ |
| 196 # define NACL_STACK_ALIGN_MASK (0x7) | 200 # define NACL_STACK_ALIGN_MASK (0x7) |
| 201 # define NACL_STACK_GETS_ARG (0) |
| 202 # define NACL_STACK_PAD_BELOW_ALIGN (0) |
| 197 | 203 |
| 198 /* TODO(robertm): unify this with NACL_BLOCK_SHIFT */ | 204 /* TODO(robertm): unify this with NACL_BLOCK_SHIFT */ |
| 199 /* 16 byte bundles */ | 205 /* 16 byte bundles */ |
| 200 # define NACL_ARM_BUNDLE_SIZE_LOG 4 | 206 # define NACL_ARM_BUNDLE_SIZE_LOG 4 |
| 201 | 207 |
| 202 /* | 208 /* |
| 203 * NOTE: Used by various assembler files, needs to be | 209 * NOTE: Used by various assembler files, needs to be |
| 204 * synchronized with NaClThreadContext | 210 * synchronized with NaClThreadContext |
| 205 */ | 211 */ |
| 206 # define NACL_CALLEE_SAVE_LIST {r4, r5, r6, r7, r8, r9, r10, fp, sp} | 212 # define NACL_CALLEE_SAVE_LIST {r4, r5, r6, r7, r8, r9, r10, fp, sp} |
| 207 | 213 |
| 208 | 214 |
| 209 | 215 |
| 210 #else /* NACL_ARCH(NACL_BUILD_ARCH) */ | 216 #else /* NACL_ARCH(NACL_BUILD_ARCH) */ |
| 211 | 217 |
| 212 # error Unknown platform! | 218 # error Unknown platform! |
| 213 | 219 |
| 214 #endif /* NACL_ARCH(NACL_BUILD_ARCH) */ | 220 #endif /* NACL_ARCH(NACL_BUILD_ARCH) */ |
| 215 | 221 |
| 216 | 222 |
| 217 #endif /* NATIVE_CLIENT_SERVICE_RUNTIME_NACL_CONFIG_H_ */ | 223 #endif /* NATIVE_CLIENT_SERVICE_RUNTIME_NACL_CONFIG_H_ */ |
| OLD | NEW |