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