Synopsis
int libmem_get_sector_number(uint8_t *start,
                             const libmem_geometry_t *geometry,
                             const uint8_t *p);
Description

libmem_get_sector_number is a helper function that returns the sector number of an address within a specified geometry.

start — A pointer to the start address of the geometry desribed by geometry.

geometry — A pointer to the NULL terminated geometry description.

p — A pointer to the address to determine the sector number of.

libmem_get_sector_number returns — The sector number or -1 if the address is not located within the described geometry.