int libmem_foreach_sector_in_range_ex(libmem_driver_handle_t *h,
                                      const libmem_geometry_t *geometry,
                                      uint8_t *range_start,
                                      size_t range_size,
                                      libmem_foreach_sector_fn_t fn,
                                      uint8_t **actual_range_start,
                                      size_t *actual_range_size);

libmem_foreach_sector_in_range_ex is a helper function for iterating through all sectors in a specified geometry that are within a specific address range.

h — A pointer to the handle of the LIBMEM driver.

geometry — A pointer to the NULL terminated geometry description.

range_start — A pointer to the start of the address range.

range_size — The size of the address range in bytes.

fn — The function to call for each sector.

actual_range_start — A pointer to the start of the first sector that is within the address range.

actual_range_size — The combined size of all the sectors that are within the address range.

libmem_foreach_sector_in_range_ex returns — The LIBMEM status result.

This function iterates through all the sectors in the specified geometry and calls a libmem_foreach_sector_fn_t function for each if it is within the specified address range. If any of the calls return a response other than LIBMEM_STATUS_SUCCESS this function will terminate and return the response. This function is essentially the same as libmem_foreach_sector_in_range except it allows a different geometry to be specified to that associated with the driver.