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

Unified Diff: src/trusted/service_runtime/sel_ldr.h

Issue 10134056: Refactor the process of choosing validators. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: The actual refactoring 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/service_runtime/sel_ldr.h
diff --git a/src/trusted/service_runtime/sel_ldr.h b/src/trusted/service_runtime/sel_ldr.h
index b2d4a6879cc2fe09d724127d7f229140ad3d341b..6e56c97c38e63033dbc5a877f43479c1f2bc682b 100644
--- a/src/trusted/service_runtime/sel_ldr.h
+++ b/src/trusted/service_runtime/sel_ldr.h
@@ -54,6 +54,7 @@
#include "native_client/src/trusted/service_runtime/name_service/name_service.h"
#include "native_client/src/trusted/validator/cpufeatures.h"
+#include "native_client/src/trusted/validator/validation_status.h"
EXTERN_C_BEGIN
@@ -98,6 +99,43 @@ enum NaClDebugExceptionHandlerState {
typedef int (*NaClAttachDebugExceptionHandlerFunc)(void *info, size_t size);
#endif
+/* Function type for applying a Validator.
+ * This function is a part of NaCl Validator API: trusted/validator/ncvalidate.h
+ */
+typedef NaClValidationStatus (*NaClValidateFunc) (
Nick Bray 2012/04/25 20:57:42 This is part of the validator interface, not part
pasko-google - do not use 2012/04/26 15:17:01 Done.
+ uintptr_t guest_addr,
+ uint8_t *data,
+ size_t size,
+ int stubout_mode,
+ int readonly_text,
+ const NaClCPUFeatures *cpu_features,
+ struct NaClValidationCache *cache);
+
+/* Function type for applying a Validator to copy code from an existing code
+ * segment to a new code segment.
+ * This function is a part of NaCl Validator API: trusted/validator/ncvalidate.h
+ */
+typedef NaClValidationStatus (*NaClValidateCopyFunc) (
+ uintptr_t guest_addr,
+ uint8_t *data_old,
+ uint8_t *data_new,
+ size_t size,
+ const NaClCPUFeatures *cpu_features);
+
+/* Function type for applying a Validator on small updates to previously
+ * validated code segments.
+ * This function is a part of NaCl Validator API: trusted/validator/ncvalidate.h
+ */
+typedef NaClValidationStatus (*NaClValidateCodeReplacementFunc) (
+ uintptr_t guest_addr,
+ uint8_t *data_old,
+ uint8_t *data_new,
+ size_t size,
+ const NaClCPUFeatures *cpu_features);
+
+/* Make a messy choice for validating functions and record it in NaClApp. */
+void NaClSelectValidator(struct NaClApp *nap);
+
struct NaClApp {
/*
* public, user settable prior to app start.
@@ -355,7 +393,11 @@ struct NaClApp {
enum NaClDebugExceptionHandlerState debug_exception_handler_state;
NaClAttachDebugExceptionHandlerFunc attach_debug_exception_handler_func;
#endif
- int enable_dfa_validator;
+
+ /* Functions for applying validation. */
+ NaClValidateFunc validate_func;
Nick Bray 2012/04/25 20:57:42 I was envisioning these functions in a separate (b
pasko-google - do not use 2012/04/26 15:17:01 well, I thought about this same possibility at fir
Nick Bray 2012/04/27 00:41:30 Yeah, the deref chain isn't pretty, but I figured
+ NaClValidateCopyFunc validate_copy_func;
+ NaClValidateCodeReplacementFunc validate_code_replacement_func;
};

Powered by Google App Engine
This is Rietveld 408576698