OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 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 #ifndef NATIVE_CLIENT_TESTS_COMMON_REGISTER_SET_H_ | 7 #ifndef NATIVE_CLIENT_TESTS_COMMON_REGISTER_SET_H_ |
8 #define NATIVE_CLIENT_TESTS_COMMON_REGISTER_SET_H_ | 8 #define NATIVE_CLIENT_TESTS_COMMON_REGISTER_SET_H_ |
9 | 9 |
10 #include "native_client/src/include/nacl/nacl_exception.h" | 10 #include "native_client/src/include/nacl/nacl_exception.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
233 | 233 |
234 # define REGS_SAVER_FUNC_NOPROTO(def_func, callee_func) \ | 234 # define REGS_SAVER_FUNC_NOPROTO(def_func, callee_func) \ |
235 void callee_func(struct NaClSignalContext *regs); \ | 235 void callee_func(struct NaClSignalContext *regs); \ |
236 __asm__( \ | 236 __asm__( \ |
237 ".pushsection .text, \"ax\", @progbits\n" \ | 237 ".pushsection .text, \"ax\", @progbits\n" \ |
238 ".p2align 5\n" \ | 238 ".p2align 5\n" \ |
239 ".global " #def_func "\n"\ | 239 ".global " #def_func "\n"\ |
240 #def_func ":\n" \ | 240 #def_func ":\n" \ |
241 /* Push most of "struct NaClSignalContext" in reverse order. */ \ | 241 /* Push most of "struct NaClSignalContext" in reverse order. */ \ |
242 "push $0\n" /* Leave space for flags */ \ | 242 "push $0\n" /* Leave space for flags */ \ |
243 "push $" #def_func "\n" /* Fill out prog_ctr with known value */ \ | 243 "push $" #def_func "@got\n" /* Fill out prog_ctr with known value */ \ |
Junichi Uekawa
2014/09/09 12:23:58
This works around having relocation in code, but w
Junichi Uekawa
2014/09/09 15:28:03
Looking at try results of course it does, but then
| |
244 "push %edi\n" \ | 244 "push %edi\n" \ |
245 "push %esi\n" \ | 245 "push %esi\n" \ |
246 "push %ebp\n" \ | 246 "push %ebp\n" \ |
247 "push %esp\n" \ | 247 "push %esp\n" \ |
248 "push %ebx\n" \ | 248 "push %ebx\n" \ |
249 "push %edx\n" \ | 249 "push %edx\n" \ |
250 "push %ecx\n" \ | 250 "push %ecx\n" \ |
251 "push %eax\n" \ | 251 "push %eax\n" \ |
252 /* Save flags. */ \ | 252 /* Save flags. */ \ |
253 SAVE_X86_FLAGS_INTO_REG("%eax") \ | 253 SAVE_X86_FLAGS_INTO_REG("%eax") \ |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
441 void RegsUnsetNonCalleeSavedRegisters(struct NaClSignalContext *regs); | 441 void RegsUnsetNonCalleeSavedRegisters(struct NaClSignalContext *regs); |
442 | 442 |
443 /* | 443 /* |
444 * For a function called with register state |regs|, extract the first | 444 * For a function called with register state |regs|, extract the first |
445 * argument. This is useful for a function entry point defined by | 445 * argument. This is useful for a function entry point defined by |
446 * REGS_SAVER_FUNC. | 446 * REGS_SAVER_FUNC. |
447 */ | 447 */ |
448 uintptr_t RegsGetArg1(const struct NaClSignalContext *regs); | 448 uintptr_t RegsGetArg1(const struct NaClSignalContext *regs); |
449 | 449 |
450 #endif | 450 #endif |
OLD | NEW |