Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Side by Side Diff: src/trusted/validator_x86/nccopycode.h

Issue 10134056: Refactor the process of choosing validators. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: tweaks for win64 Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011 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_SRC_TRUSTED_VALIDATOR_X86_NCCOPYCODE_H_ 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCCOPYCODE_H_
8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCCOPYCODE_H_ 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCCOPYCODE_H_
9 9
10 #include "native_client/src/trusted/validator/x86/types_memory_model.h" 10 /* Copies a single instruction, avoiding the possibility of other threads
11 11 * executing a partially changed instruction.
12 #if NACL_TARGET_SUBARCH == 32
13 /* Copies code from src to dest in a thread safe way, returns 1 on success,
14 * returns 0 on error. This will likely assert on error to avoid partially
15 * copied code or undefined state.
16 */ 12 */
17 int NCCopyCode(uint8_t *dst, uint8_t *src, NaClPcAddress vbase, 13 int NaClCopyInstructionX86(uint8_t *dst, uint8_t *src, uint8_t sz);
18 size_t sz, int bundle_size);
19
20 #elif NACL_TARGET_SUBARCH == 64
21 /* Copies code from src to dest in a thread safe way, returns 1 on success,
22 * returns 0 on error. This will likely assert on error to avoid partially
23 * copied code or undefined state.
24 */
25 int NaClCopyCodeIter(uint8_t *dst, uint8_t *src,
26 NaClPcAddress vbase, size_t size);
27 #else
28 #error "Unknown Platform"
29 #endif
30 14
31 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_COPYCODE_H_ */ 15 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_COPYCODE_H_ */
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698