| 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_SRC_TRUSTED_VALIDATOR_X86_64_NCVALIDATE_H_ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_64_NCVALIDATE_H_ |
| 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_64_NCVALIDATE_H_ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_64_NCVALIDATE_H_ |
| 9 | 9 |
| 10 /* Defines helper functions for implementing the ApplyValidator API | 10 /* Defines helper functions for implementing the ApplyValidator API |
| 11 * for the x86-64 architecture. | 11 * for the x86-64 architecture. |
| 12 */ | 12 */ |
| 13 | 13 |
| 14 /* Creates a validator state and initializes it. Returns | 14 /* Creates a validator state and initializes it. Returns |
| 15 * NaClValidationSucceeded if successful. Otherwise, it returns | 15 * NaClValidationSucceeded if successful. Otherwise, it returns |
| 16 * status describing reason for failure. | 16 * status describing reason for failure. |
| 17 * Paramters are: | 17 * Paramters are: |
| 18 * guest_addr: The pc address to use. | 18 * guest_addr: The pc address to use. |
| 19 * data - The contents of the code segment to be validated. | 19 * data - The contents of the code segment to be validated. |
| 20 * size - The size of the code segment to be validated. | 20 * size - The size of the code segment to be validated. |
| 21 * bundle_size - The number of bytes in a code bundle. | 21 * bundle_size - The number of bytes in a code bundle. |
| 22 * local_cpu: True if local cpu rules should be applied. | 22 * local_cpu: True if local cpu rules should be applied. |
| 23 * Otherwise, assume no cpu specific rules. | 23 * Otherwise, assume no cpu specific rules. |
| 24 * vstate_ptr - Pointer to be set to allocated validator | 24 * vstate_ptr - Pointer to be set to allocated validator |
| 25 * state if succeeded (NULL otherwise).o | 25 * state if succeeded (NULL otherwise).o |
| 26 */ | 26 */ |
| 27 NaClValidationStatus NaClValidatorSetup_x86_64( | 27 NaClValidationStatus NaClValidatorSetup_x86_64( |
| 28 uintptr_t guest_addr, | 28 uintptr_t guest_addr, |
| 29 size_t size, | 29 size_t size, |
| 30 int bundle_size, | |
| 31 int readonly_text, | 30 int readonly_text, |
| 32 const NaClCPUFeaturesX86 *cpu_features, | 31 const NaClCPUFeaturesX86 *cpu_features, |
| 33 struct NaClValidatorState** vstate_ptr); | 32 struct NaClValidatorState** vstate_ptr); |
| 34 | 33 |
| 35 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_64_NCVALIDATE_H_ */ | 34 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_64_NCVALIDATE_H_ */ |
| OLD | NEW |