Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2009 The Native Client Authors. All rights reserved. | 2 * Copyright 2009 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
| 4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_ITER_H__ | 7 #ifndef NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_ITER_H__ |
| 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_ITER_H__ | 8 #define NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_ITER_H__ |
| 9 | 9 |
| 10 /* | 10 /* |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 * vbase - The virtual address associated with the beginning of the code | 188 * vbase - The virtual address associated with the beginning of the code |
| 189 * segment. | 189 * segment. |
| 190 * sz - The number of bytes in the code segment. | 190 * sz - The number of bytes in the code segment. |
| 191 * state - The validator state to use while validating. | 191 * state - The validator state to use while validating. |
| 192 */ | 192 */ |
| 193 void NaClValidateSegment(uint8_t* mbase, | 193 void NaClValidateSegment(uint8_t* mbase, |
| 194 NaClPcAddress vbase, | 194 NaClPcAddress vbase, |
| 195 NaClMemorySize sz, | 195 NaClMemorySize sz, |
| 196 NaClValidatorState* state); | 196 NaClValidatorState* state); |
| 197 | 197 |
| 198 /* Validate a segment for dynamic code replacement | |
|
bsy
2010/11/11 21:27:21
/*
* comment text starts on this line, not above.
petr
2010/11/12 18:11:06
Done.
| |
| 199 * Checks if code at mbase_old can be replaced with code at mbase_new | |
| 200 * Note that mbase_old was validated when it was inserted originally. | |
| 201 * If validation fails, state->validates_ok will be set to false. | |
| 202 * Parameters: | |
| 203 * mbase_old - The address of the beginning of the code segment to be | |
| 204 * replaced | |
| 205 * mbase_new - The address of the code segment that replaces the old | |
| 206 * segment | |
| 207 * vbase - Virtual address that is associated with both segments | |
| 208 * size - Length of the code segments (the segments must be of the same | |
| 209 * size) | |
| 210 * state - The validator state to use while validating *new* segment | |
| 211 */ | |
| 212 void NaClValidateSegmentPair(uint8_t *mbase_old, | |
| 213 uint8_t *mbase_new, | |
| 214 NaClPcAddress vbase, | |
| 215 size_t size, | |
| 216 struct NaClValidatorState *state); | |
| 217 | |
| 198 /* Returns true if the validator hasn't found any problems with the validated | 218 /* Returns true if the validator hasn't found any problems with the validated |
| 199 * code segments. | 219 * code segments. |
| 200 * Parameters: | 220 * Parameters: |
| 201 * state - The validator state used to validate code segments. | 221 * state - The validator state used to validate code segments. |
| 202 * Returns: | 222 * Returns: |
| 203 * true only if no problems have been found. | 223 * true only if no problems have been found. |
| 204 */ | 224 */ |
| 205 Bool NaClValidatesOk(NaClValidatorState* state); | 225 Bool NaClValidatesOk(NaClValidatorState* state); |
| 206 | 226 |
| 207 /* Cleans up and returns the memory created by the corresponding | 227 /* Cleans up and returns the memory created by the corresponding |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 343 void NaClValidatorInstMessage(int level, | 363 void NaClValidatorInstMessage(int level, |
| 344 NaClValidatorState* state, | 364 NaClValidatorState* state, |
| 345 NaClInstState* inst, | 365 NaClInstState* inst, |
| 346 const char* format, | 366 const char* format, |
| 347 ...) ATTRIBUTE_FORMAT_PRINTF(4, 5); | 367 ...) ATTRIBUTE_FORMAT_PRINTF(4, 5); |
| 348 | 368 |
| 349 /* Returns true if the validator should quit due to previous errors. */ | 369 /* Returns true if the validator should quit due to previous errors. */ |
| 350 Bool NaClValidatorQuit(NaClValidatorState* state); | 370 Bool NaClValidatorQuit(NaClValidatorState* state); |
| 351 | 371 |
| 352 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_ITER_H__ */ | 372 #endif /* NATIVE_CLIENT_SRC_TRUSTED_VALIDATOR_X86_NCVALIDATE_ITER_H__ */ |
| OLD | NEW |