|
libflashrom
|
Functions | |
| int | flashrom_flash_probe (struct flashrom_flashctx **flashctx, const struct flashrom_programmer *flashprog, const char *chip_name) __attribute__((deprecated("Use flashrom_flash_probe_v2 instead"))) |
| Probe for a flash chip. More... | |
| int | flashrom_flash_probe_v2 (struct flashrom_flashctx *flashctx, const char ***const all_matched_names, const struct flashrom_programmer *flashprog, const char *chip_name) |
| Probe for a flash chip, v2. More... | |
| size_t | flashrom_flash_getsize (const struct flashrom_flashctx *flashctx) |
| Returns the size of the specified flash chip in bytes. More... | |
| int | flashrom_flash_erase (struct flashrom_flashctx *flashctx) |
| Erase the specified ROM chip. More... | |
| void | flashrom_flash_release (struct flashrom_flashctx *flashctx) |
| Free a flash context. More... | |
| void | flashrom_flag_set (struct flashrom_flashctx *flashctx, enum flashrom_flag flag, bool value) |
| Set a flag in the given flash context. More... | |
| bool | flashrom_flag_get (const struct flashrom_flashctx *flashctx, enum flashrom_flag flag) |
| Return the current value of a flag in the given flash context. More... | |
| bool flashrom_flag_get | ( | const struct flashrom_flashctx * | flashctx, |
| enum flashrom_flag | flag | ||
| ) |
Return the current value of a flag in the given flash context.
| flashctx | Flash context to read from. |
| flag | Flag to be read. |
| void flashrom_flag_set | ( | struct flashrom_flashctx * | flashctx, |
| enum flashrom_flag | flag, | ||
| bool | value | ||
| ) |
Set a flag in the given flash context.
| flashctx | Flash context to alter. |
| flag | Flag that is to be set / cleared. |
| value | Value to set. |
| int flashrom_flash_erase | ( | struct flashrom_flashctx * | flashctx | ) |
Erase the specified ROM chip.
If a layout is set in the given flash context, only included regions will be erased.
| flashctx | The context of the flash chip to erase. |
| size_t flashrom_flash_getsize | ( | const struct flashrom_flashctx * | flashctx | ) |
Returns the size of the specified flash chip in bytes.
| flashctx | The queried flash context. |
| int flashrom_flash_probe | ( | struct flashrom_flashctx ** | flashctx, |
| const struct flashrom_programmer * | flashprog, | ||
| const char * | chip_name | ||
| ) |
Probe for a flash chip.
Probes for a flash chip and returns a flash context, that can be used later with flash chip and image operations, if exactly one matching chip is found.
| [out] | flashctx | Points to a pointer of type struct flashrom_flashctx that will be set if exactly one chip is found. *flashctx has to be freed by the caller with flashrom_flash_release. |
| [in] | flashprog | The flash programmer used to access the chip. |
| [in] | chip_name | Name of a chip to probe for, or NULL to probe for all known chips. |
| int flashrom_flash_probe_v2 | ( | struct flashrom_flashctx * | flashctx, |
| const char ***const | all_matched_names, | ||
| const struct flashrom_programmer * | flashprog, | ||
| const char * | chip_name | ||
| ) |
Probe for a flash chip, v2.
Probes for a flash chip and returns a flash context, that can be used later with flash chip and image operations, if exactly one matching chip is found.
Returns the list of names for all chips that matched, and the count of how many chips matched.
Memory for the list of chips is dynamically allocated according to the number of chips found, and always needs to be freed with flashrom_data_free afterwards (including when no matches found or error happened).
Note that if chip_name param is set, then probing happens only once, only for this one requested chip name. So the number of matches that can be returned in this case will be either 1 or 0 (and -1 for error).
| [out] | flashctx | Points to a struct flashrom_flashctx that will be set if exactly one chip is found. *flashctx has to be freed by the caller with flashrom_flash_release. |
| [out] | all_matched_names | pointer to an array containing the names of all chips that were successfully probed, terminated with a NULL pointer. If no chips are found, the returned array contains a single NULL element. Callers must free the array once unused by calling flashrom_data_free. |
| [in] | flashprog | The flash programmer used to access the chip, currently unused. |
| [in] | chip_name | Name of a chip to probe for, or NULL to probe for all known chips. |
| void flashrom_flash_release | ( | struct flashrom_flashctx * | flashctx | ) |
Free a flash context.
| flashctx | Flash context to free. |
1.8.10