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

Unified Diff: src/trusted/validator/x86/ncval_seg_sfi/ncdecode.h

Issue 10134056: Refactor the process of choosing validators. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: rebased, added a todo for NaClCopyCode Created 8 years, 6 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/ncval_seg_sfi/ncdecode.h
diff --git a/src/trusted/validator/x86/ncval_seg_sfi/ncdecode.h b/src/trusted/validator/x86/ncval_seg_sfi/ncdecode.h
index 186f3d515f898ca44ccae85b2e8c8f7abbf090e4..cf4f87663e00c93d0fc469ec76fa70c8182ec931 100644
--- a/src/trusted/validator/x86/ncval_seg_sfi/ncdecode.h
+++ b/src/trusted/validator/x86/ncval_seg_sfi/ncdecode.h
@@ -14,6 +14,7 @@
#define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVAL_SEG_SFI_NCDECODE_H_
#include "native_client/src/shared/utils/types.h"
+#include "native_client/src/trusted/validator/ncvalidate.h"
#include "native_client/src/trusted/validator/x86/error_reporter.h"
#include "native_client/src/trusted/validator/x86/ncinstbuffer.h"
#include "native_client/src/trusted/validator/x86/x86_insts.h"
@@ -385,6 +386,11 @@ typedef struct NCDecoderStatePair {
/* The (virtual method) action to apply to each instruction. */
NCDecoderStatePairAction action_fn;
+
+ /* Utility function that copies a single instruction in memory, can be used in
+ * actions.
+ */
+ NaClCopyInstructionFunc copy_func;
} NCDecoderStatePair;
/*
@@ -398,9 +404,11 @@ typedef struct NCDecoderStatePair {
* Note: Constructors of subclasses of NCDecoderStatePair should
* call this constructor first, to initialize the decoder pair fields.
*/
-extern void NCDecoderStatePairConstruct(NCDecoderStatePair* tthis,
- NCDecoderState* old_dstate,
- NCDecoderState* new_dstate);
+extern void NCDecoderStatePairConstruct(
+ NCDecoderStatePair* tthis,
+ NCDecoderState* old_dstate,
+ NCDecoderState* new_dstate,
+ const NaClCopyInstructionFunc copy_func);
/*
* Decode the memory segments in each instruction state, applying

Powered by Google App Engine
This is Rietveld 408576698