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_random.c | |
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_random.c')
-rw-r--r-- | lib/intel_allocator_random.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/intel_allocator_random.c b/lib/intel_allocator_random.c index d804e331..3d9a78f1 100644 --- a/lib/intel_allocator_random.c +++ b/lib/intel_allocator_random.c @@ -45,12 +45,14 @@ static void intel_allocator_random_get_address_range(struct intel_allocator *ial static uint64_t intel_allocator_random_alloc(struct intel_allocator *ial, uint32_t handle, uint64_t size, - uint64_t alignment) + uint64_t alignment, + enum allocator_strategy strategy) { struct intel_allocator_random *ialr = ial->priv; uint64_t offset; (void) handle; + (void) strategy; /* randomize the address, we try to avoid relocations */ do { |