mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
xen/grant-table: Add an helper to iterate over a specific number of grants
With the 64KB page granularity support on ARM64, a Linux page may be split accross multiple grant. Currently we have the helper gnttab_foreach_grant_in_grant to break a Linux page based on an offset and a len, but it doesn't fit when we only have a number of grants in hand. Introduce a new helper which take an array of Linux page and a number of grant and will figure out the address of each grant. Signed-off-by: Julien Grall <[email protected]> Signed-off-by: David Vrabel <[email protected]>
This commit is contained in:
parent
9cce2914e2
commit
f73314b281
2 changed files with 28 additions and 0 deletions
|
|
@ -264,6 +264,12 @@ static inline void gnttab_for_one_grant(struct page *page, unsigned int offset,
|
|||
gnttab_foreach_grant_in_range(page, offset, len, fn, data);
|
||||
}
|
||||
|
||||
/* Get @nr_grefs grants from an array of page and call fn for each grant */
|
||||
void gnttab_foreach_grant(struct page **pages,
|
||||
unsigned int nr_grefs,
|
||||
xen_grant_fn_t fn,
|
||||
void *data);
|
||||
|
||||
/* Get the number of grant in a specified region
|
||||
*
|
||||
* start: Offset from the beginning of the first page
|
||||
|
|
|
|||
Loading…
Reference in a new issue