]> xenbits.xensource.com Git - people/julieng/linux-arm.git/commitdiff
arm64/lib: Add an helper to free memory allocated by the ASID allocator
authorJulien Grall <julien.grall@arm.com>
Tue, 16 Jul 2019 16:26:08 +0000 (17:26 +0100)
committerJulien Grall <julien.grall@arm.com>
Wed, 24 Jul 2019 16:18:24 +0000 (17:18 +0100)
Some users of the ASID allocator (e.g VMID) may require to free any
resource if the initialization fail. So introduce a function allows to
free any memory allocated by the ASID allocator.

Signed-off-by: Julien Grall <julien.grall@arm.com>
---
    Changes in v3:
        - Patch added

arch/arm64/include/asm/lib_asid.h
arch/arm64/lib/asid.c

index c18e9eca500ed60c2e5e1f40432443f1441e67ab..ff78865a6823cdd2f2d7a26e79eadb5f57bd165a 100644 (file)
@@ -74,4 +74,6 @@ int asid_allocator_init(struct asid_info *info,
                        u32 bits, unsigned int asid_per_ctxt,
                        void (*flush_cpu_ctxt_cb)(void));
 
+void asid_allocator_free(struct asid_info *info);
+
 #endif
index 0b3a99c4aed4ab74aff048d7d63b5ba3d4fd5cf0..d23f0df656c11038103f0e9dc09de34b9e5ea7b3 100644 (file)
@@ -183,3 +183,8 @@ int asid_allocator_init(struct asid_info *info,
 
        return 0;
 }
+
+void asid_allocator_free(struct asid_info *info)
+{
+       kfree(info->map);
+}