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

Unified Diff: src/trusted/validator_x86/ncvalidate_iter.h

Issue 3975001: Dynamic code modification support for x64 NaCl modules... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 10 years, 1 month 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_x86/nccopycode.c ('k') | src/trusted/validator_x86/ncvalidate_iter.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/validator_x86/ncvalidate_iter.h
===================================================================
--- src/trusted/validator_x86/ncvalidate_iter.h (revision 3669)
+++ src/trusted/validator_x86/ncvalidate_iter.h (working copy)
@@ -195,6 +195,27 @@
NaClMemorySize sz,
NaClValidatorState* state);
+/*
+ * Validate a segment for dynamic code replacement
+ * Checks if code at mbase_old can be replaced with code at mbase_new
+ * Note that mbase_old was validated when it was inserted originally.
+ * If validation fails, state->validates_ok will be set to false.
+ * Parameters:
+ * mbase_old - The address of the beginning of the code segment to be
+ * replaced
+ * mbase_new - The address of the code segment that replaces the old
+ * segment
+ * vbase - Virtual address that is associated with both segments
+ * size - Length of the code segments (the segments must be of the same
+ * size)
+ * state - The validator state to use while validating *new* segment
+ */
+void NaClValidateSegmentPair(uint8_t *mbase_old,
+ uint8_t *mbase_new,
+ NaClPcAddress vbase,
+ size_t size,
+ struct NaClValidatorState *state);
+
/* Returns true if the validator hasn't found any problems with the validated
* code segments.
* Parameters:
@@ -346,6 +367,22 @@
const char* format,
...) ATTRIBUTE_FORMAT_PRINTF(4, 5);
+/* Prints out a validator message and two given instructions.
+ * Parameters:
+ * level - The level of the message, as defined in nacl_log.h
+ * state - The validator state that detected the error.
+ * inst1 - The first instruction to be printed.
+ * inst2 - The second instruction to be printed.
+ * format - The format string of the message to print.
+ * ... - arguments to the format string.
+ */
+void NaClValidatorTwoInstMessage(int level,
+ NaClValidatorState* state,
+ NaClInstState* inst1,
+ NaClInstState* inst2,
+ const char* format,
+ ...) ATTRIBUTE_FORMAT_PRINTF(5, 6);
+
/* Returns true if the validator should quit due to previous errors. */
Bool NaClValidatorQuit(NaClValidatorState* state);
« no previous file with comments | « src/trusted/validator_x86/nccopycode.c ('k') | src/trusted/validator_x86/ncvalidate_iter.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698