]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
efi_loader: add comments to memory functions
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Mon, 4 Dec 2017 19:52:41 +0000 (20:52 +0100)
committerAlexander Graf <agraf@suse.de>
Mon, 22 Jan 2018 22:09:12 +0000 (23:09 +0100)
Add comments describing memory functions.

Fix the formatting of a function declaration.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>
lib/efi_loader/efi_memory.c

index 0aa3e0881d43ec1d451897ab76ffdbd673d49f82..aaf64421a395d2d7ff6ea4060f52fc33090db15a 100644 (file)
@@ -275,6 +275,15 @@ static uint64_t efi_find_free_memory(uint64_t len, uint64_t max_addr)
        return 0;
 }
 
+/*
+ * Allocate memory pages.
+ *
+ * @type               type of allocation to be performed
+ * @memory_type                usage type of the allocated memory
+ * @pages              number of pages to be allocated
+ * @memory             allocated memory
+ * @return             status code
+ */
 efi_status_t efi_allocate_pages(int type, int memory_type,
                                efi_uintn_t pages, uint64_t *memory)
 {
@@ -338,6 +347,13 @@ void *efi_alloc(uint64_t len, int memory_type)
        return NULL;
 }
 
+/*
+ * Free memory pages.
+ *
+ * @memory     start of the memory area to be freed
+ * @pages      number of pages to be freed
+ * @return     status code
+ */
 efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
 {
        uint64_t r = 0;
@@ -351,8 +367,15 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
        return EFI_NOT_FOUND;
 }
 
-efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size,
-                              void **buffer)
+/*
+ * Allocate memory from pool.
+ *
+ * @pool_type  type of the pool from which memory is to be allocated
+ * @size       number of bytes to be allocated
+ * @buffer     allocated memory
+ * @return     status code
+ */
+efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer)
 {
        efi_status_t r;
        efi_physical_addr_t t;
@@ -375,6 +398,12 @@ efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size,
        return r;
 }
 
+/*
+ * Free memory from pool.
+ *
+ * @buffer     start of memory to be freed
+ * @return     status code
+ */
 efi_status_t efi_free_pool(void *buffer)
 {
        efi_status_t r;
@@ -392,6 +421,17 @@ efi_status_t efi_free_pool(void *buffer)
        return r;
 }
 
+/*
+ * Get map describing memory usage.
+ *
+ * @memory_map_size    on entry the size, in bytes, of the memory map buffer,
+ *                     on exit the size of the copied memory map
+ * @memory_map         buffer to which the memory map is written
+ * @map_key            key for the memory map
+ * @descriptor_size    size of an individual memory descriptor
+ * @descriptor_version version number of the memory descriptor structure
+ * @return             status code
+ */
 efi_status_t efi_get_memory_map(efi_uintn_t *memory_map_size,
                                struct efi_mem_desc *memory_map,
                                efi_uintn_t *map_key,