diff options
author | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2021-04-02 11:15:39 +0200 |
---|---|---|
committer | Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> | 2021-04-13 15:44:38 +0200 |
commit | 35b7416e7f458ad7aa61af2a840982db1d2dd451 (patch) | |
tree | ea2ee1fc13067340cd7a25104796a4636f8ed0e0 /lib/intel_allocator.h | |
parent | 572dfb13332ac607b8cd8eba73a3a58db3fe948b (diff) |
lib/intel_allocator: Add alloc function which allows passing strategy argument
To use spinners with no-reloc we need to alloc offsets for them
from already opened allocator. As we don't know what strategy
is chosen for open (likely HIGH_TO_LOW for SIMPLE allocator) we
want to overwrite it for spinners (there's expectation they
will reside on low addresses).
Extend allocator API adding intel_allocator_alloc_with_strategy()
to support spinners rewriting.
v2: add change in api_intel_allocator test to compile properly
whole series.
Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/intel_allocator.h')
-rw-r--r-- | lib/intel_allocator.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/intel_allocator.h b/lib/intel_allocator.h index 9b7bd090..c14f57b4 100644 --- a/lib/intel_allocator.h +++ b/lib/intel_allocator.h @@ -141,7 +141,8 @@ struct intel_allocator { void (*get_address_range)(struct intel_allocator *ial, uint64_t *startp, uint64_t *endp); uint64_t (*alloc)(struct intel_allocator *ial, uint32_t handle, - uint64_t size, uint64_t alignment); + uint64_t size, uint64_t alignment, + enum allocator_strategy strategy); bool (*is_allocated)(struct intel_allocator *ial, uint32_t handle, uint64_t size, uint64_t alignment); bool (*reserve)(struct intel_allocator *ial, @@ -181,9 +182,14 @@ bool intel_allocator_close(uint64_t allocator_handle); void intel_allocator_get_address_range(uint64_t allocator_handle, uint64_t *startp, uint64_t *endp); uint64_t __intel_allocator_alloc(uint64_t allocator_handle, uint32_t handle, - uint64_t size, uint64_t alignment); + uint64_t size, uint64_t alignment, + enum allocator_strategy strategy); uint64_t intel_allocator_alloc(uint64_t allocator_handle, uint32_t handle, uint64_t size, uint64_t alignment); +uint64_t intel_allocator_alloc_with_strategy(uint64_t allocator_handle, + uint32_t handle, + uint64_t size, uint64_t alignment, + enum allocator_strategy strategy); bool intel_allocator_free(uint64_t allocator_handle, uint32_t handle); bool intel_allocator_is_allocated(uint64_t allocator_handle, uint32_t handle, uint64_t size, uint64_t offset); |