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

Unified Diff: src/trusted/validator_ragel/unreviewed/dfa_validate_64.c

Issue 10070010: validator_ragel: Link into TCB, use under env var (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: revert introducing extra empty line Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/validator_ragel/unreviewed/dfa_validate_32.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+}
« no previous file with comments | « src/trusted/validator_ragel/unreviewed/dfa_validate_32.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698