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

Unified Diff: src/trusted/validator/x86/testing/enuminsts/input_tester.h

Issue 9861030: Modify enuminsts to be able to communicate matched instructions accross (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: Created 8 years, 9 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
Index: src/trusted/validator/x86/testing/enuminsts/input_tester.h
===================================================================
--- src/trusted/validator/x86/testing/enuminsts/input_tester.h (revision 0)
+++ src/trusted/validator/x86/testing/enuminsts/input_tester.h (revision 0)
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+/*
+ * input_tester.h
+ * Implements a decoder that matches the instructions read from stdin.
+ */
+
+#ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_TESTING_ENUMINSTS_INPUT_TESTER_H_
+#define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_TESTING_ENUMINSTS_INPUT_TESTER_H_
+
+#include "native_client/src/trusted/validator/x86/testing/enuminsts/enuminsts.h"
+
+/* Defines a reader that reads instruction byte sequences from stdin
+ * (one per line). '#' denotes the beginning of a comment, and spaces
+ * are allowed between (hexidecimal) bytes. If an input line is just whitespace,
+ * it is skipped and the next line is read. Communicates with the input decoder
+ * (see below) so that they process the same sequence of instructions.
+ * Argument:
+ * ibytes - An array to put the sequence of read bytes into.
+ * Returns:
+ * The number of bytes put into ibytes. If zero, there is no more input.
+ */
+extern int ReadAnInstruction(uint8_t ibytes[NACL_ENUM_MAX_INSTRUCTION_BYTES]);
+
+/* Defines an input decoder for instructions read from stdin. */
+extern NaClEnumeratorDecoder* RegisterInputDecoder();
+
+#endif // NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_TESTING_ENUMINSTS_INPUT_TESTER_H_

Powered by Google App Engine
This is Rietveld 408576698