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

Unified Diff: src/trusted/validator/ncvalidate.h

Issue 10024039: Replace kind variable from validator API with Boolean stubout parameter. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Edits 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
Index: src/trusted/validator/ncvalidate.h
diff --git a/src/trusted/validator/ncvalidate.h b/src/trusted/validator/ncvalidate.h
index 48448a17a6d6ce2ba2f34be28c588bfb7408073c..a5e393a8526aed6176262b8e95ebc1beb726b6df 100644
--- a/src/trusted/validator/ncvalidate.h
+++ b/src/trusted/validator/ncvalidate.h
@@ -63,40 +63,9 @@ typedef enum NaClValidationStatus {
NaClValidationFailedSegmentationIssue
} NaClValidationStatus;
-/* Defines possible ways that validation can be applied. */
-typedef enum NaClApplyValidationKind {
- /* This applies the validator. Returns the resulting status
- * of the validation of a code segment.
- * Typically used for sel_ldr.
- */
- NaClApplyCodeValidation,
- /* This applies the validator silently, stubbing out instructions
- * that may not validate with a suitable halt instruction.
- * Note: The return status of NaClValidationSucceeded in this case
- * does not necessarily imply that all illegal instructions have
- * been stubbed out. It is the responsability of the caller to
- * call the validator a second time to see if the stubbed code
- * is valid. Typically used as the first step of a stubout tool
- * (either in sel_ldr or command-line tool).
- */
- NaClApplyValidationDoStubout,
- /* This applies the validator, reporting errors as needed by
- * ncval_annotate. That is, messages of the form:
- * VALIDATOR: XXXXXX: Message
- * where XXXXXX is an instruction address, and Message is
- * an error message. ncval_annotate will then use this
- * information to print out the corresponding instruction
- * using objdump, with the corresponding error message. Returns
- * the resulting status of the validation of a code segment.
- * Typically used to generate input for ncval_annotate.
- */
- NaClApplyValidationAnnotator
-} NaClApplyValidationKind;
-
/* Applies the validator, as defined by sel_ldr. That is, run the
* validator where performance is critical.
* Parameters are:
- * kind - The way the validator should be applied.
* local_cpu: True if local cpu rules should be applied.
* Otherwise, assume no cpu specific rules.
* guest_addr - The virtual pc to assume with the beginning address of the
@@ -105,6 +74,15 @@ typedef enum NaClApplyValidationKind {
* data - The contents of the code segment to be validated.
* size - The size of the code segment to be validated.
* bundle_size - The number of bytes in a code bundle.
+ * stubout_mode - If the validator should stub out illegal instructions.
Mark Seaborn 2012/04/10 19:04:09 'If' -> 'Whether' 'illegal' -> 'forbidden'/'disal
Nick Bray (chromium) 2012/04/10 19:12:40 Done.
+ * This applies the validator silently, stubbing out instructions that
+ * may not validate with a suitable halt instruction. Note: The return
+ * status of NaClValidationSucceeded in this case does not necessarily
+ * imply that all illegal instructions have been stubbed out. It is
+ * the responsability of the caller to call the validator a second
Mark Seaborn 2012/04/10 19:04:09 'responsibility'
Nick Bray (chromium) 2012/04/10 19:12:40 Done.
+ * time to see if the stubbed code is valid. Typically used as the
+ * first step of a stubout tool (either in sel_ldr or command-line
+ * tool).
* readonly_text - If code should be considered read-only.
* cpu_features - The CPU features to support while validating.
* cache - Pointer to NaCl validation cache.
@@ -113,11 +91,11 @@ extern NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidator,
NACL_TARGET_ARCH,
NACL_TARGET_SUBARCH)(
enum NaClSBKind sb_kind,
- NaClApplyValidationKind kind,
uintptr_t guest_addr,
uint8_t *data,
size_t size,
int bundle_size,
+ int stubout_mode,
int readonly_text,
const NaClCPUFeatures *cpu_features,
struct NaClValidationCache *cache);
@@ -126,7 +104,6 @@ extern NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidator,
* Note: This is intentionally separated from ApplyValidator, since it need
* not be performance critical.
* Parameters are:
- * kind - The way the validator should be applied.
* local_cpu: True if local cpu rules should be applied.
* Otherwise, assume no cpu specific rules.
* guest_addr - The virtual pc to assume with the beginning address of the
@@ -141,7 +118,6 @@ extern NaClValidationStatus NACL_SUBARCH_NAME(ApplyValidatorVerbosely,
NACL_TARGET_ARCH,
NACL_TARGET_SUBARCH)(
enum NaClSBKind sb_kind,
- NaClApplyValidationKind kind,
uintptr_t guest_addr,
uint8_t *data,
size_t size,

Powered by Google App Engine
This is Rietveld 408576698