| Index: src/trusted/validator_ragel/unreviewed/dfa_validate_64.c
|
| diff --git a/src/trusted/validator_ragel/unreviewed/dfa_validate_64.c b/src/trusted/validator_ragel/unreviewed/dfa_validate_64.c
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ca380da2a55667bf9602b8ba17aeab714911a9f2
|
| --- /dev/null
|
| +++ b/src/trusted/validator_ragel/unreviewed/dfa_validate_64.c
|
| @@ -0,0 +1,49 @@
|
| +/*
|
| + * Copyright (c) 2012 The Native Client Authors. All rights reserved.
|
| + * Use of this source code is governed by a BSD-style license that can be
|
| + * found in the LICENSE file.
|
| + */
|
| +
|
| +/* Implement the ApplyDfaValidator API for the x86-64 architecture. */
|
| +#include <assert.h>
|
| +#include "native_client/src/shared/platform/nacl_log.h"
|
| +#include "native_client/src/trusted/validator/ncvalidate.h"
|
| +#include "native_client/src/trusted/validator/validation_cache.h"
|
| +#include "native_client/src/trusted/validator_ragel/unreviewed/validator.h"
|
| +
|
| +/* Be sure the correct compile flags are defined for this. */
|
| +#if NACL_ARCH(NACL_TARGET_ARCH) != NACL_x86
|
| +# error("Can't compile, target is for x86-64")
|
| +#else
|
| +# if NACL_TARGET_SUBARCH != 64
|
| +# error("Can't compile, target is for x86-64")
|
| +# endif
|
| +#endif
|
| +
|
| +static void ProcessError(const uint8_t *ptr, void *userdata) {
|
| + UNREFERENCED_PARAMETER(ptr);
|
| + UNREFERENCED_PARAMETER(userdata);
|
| +}
|
| +
|
| +NaClValidationStatus NACL_SUBARCH_NAME(ApplyDfaValidator, x86, 64) (
|
| + uintptr_t guest_addr,
|
| + uint8_t *data,
|
| + size_t size,
|
| + int stubout_mode,
|
| + int readonly_text,
|
| + const NaClCPUFeaturesX86 *cpu_features,
|
| + struct NaClValidationCache *cache) {
|
| + UNREFERENCED_PARAMETER(guest_addr);
|
| + UNREFERENCED_PARAMETER(cache);
|
| +
|
| + if (stubout_mode || readonly_text) {
|
| + return NaClValidationFailedNotImplemented;
|
| + }
|
| + if (!NaClArchSupported(cpu_features)) {
|
| + return NaClValidationFailedCpuNotSupported;
|
| + }
|
| + if (ValidateChunkAMD64(data, size, ProcessError, 0) == 0) {
|
| + return NaClValidationSucceeded;
|
| + }
|
| + return NaClValidationFailed;
|
| +}
|
|
|