Linux Kernel
3.7.1
|
#include <linux/kernel.h>
#include <linux/module.h>
#include <asm/octeon/cvmx.h>
#include <asm/octeon/cvmx-spinlock.h>
#include <asm/octeon/cvmx-bootmem.h>
Go to the source code of this file.
Macros | |
#define | NEXT_OFFSET 0 |
#define | SIZE_OFFSET 8 |
#define NEXT_OFFSET 0 |
Definition at line 53 of file cvmx-bootmem.c.
#define SIZE_OFFSET 8 |
Definition at line 54 of file cvmx-bootmem.c.
Frees a block to the bootmem allocator list. This must be used with care, as the size provided must match the size of the block that was allocated, or the list will become corrupted.
IMPORTANT: This is only intended to be used as part of named block frees and initial population of the free memory list.
Returns 1 on success, 0 on failure
Definition at line 398 of file cvmx-bootmem.c.
Allocate a block of memory from the free list that was passed to the application by the bootloader. This is an allocate-only algorithm, so freeing memory is not possible.
: Size in bytes of block to allocate : Alignment required - must be power of 2
Returns pointer to block of memory, NULL on error
Definition at line 96 of file cvmx-bootmem.c.
Allocate a block of memory from the free list that was passed to the application by the bootloader at a specific address. This is an allocate-only algorithm, so freeing memory is not possible. Allocation will fail if memory cannot be allocated at the specified address.
: Size in bytes of block to allocate : Physical address to allocate memory at. If this memory is not available, the allocation fails. : Alignment required - must be power of 2 Returns pointer to block of memory, NULL on error
Definition at line 89 of file cvmx-bootmem.c.
Definition at line 122 of file cvmx-bootmem.c.
Definition at line 115 of file cvmx-bootmem.c.
void* cvmx_bootmem_alloc_named_range | ( | uint64_t | size, |
uint64_t | min_addr, | ||
uint64_t | max_addr, | ||
uint64_t | align, | ||
char * | name | ||
) |
Definition at line 101 of file cvmx-bootmem.c.
void* cvmx_bootmem_alloc_range | ( | uint64_t | size, |
uint64_t | alignment, | ||
uint64_t | min_addr, | ||
uint64_t | max_addr | ||
) |
Allocate a block of memory from the free list that was passed to the application by the bootloader within a specified address range. This is an allocate-only algorithm, so freeing memory is not possible. Allocation will fail if memory cannot be allocated in the requested range.
: Size in bytes of block to allocate : defines the minimum address of the range : defines the maximum address of the range : Alignment required - must be power of 2 Returns pointer to block of memory, NULL on error
Definition at line 76 of file cvmx-bootmem.c.
|
read |
Definition at line 133 of file cvmx-bootmem.c.
Definition at line 128 of file cvmx-bootmem.c.
Initialize the boot alloc memory structures. This is normally called inside of cvmx_user_app_init()
: Address of the free memory list
Definition at line 149 of file cvmx-bootmem.c.
Locks the bootmem allocator. This is useful in certain situations where multiple allocations must be made without being interrupted. This should be used with the CVMX_BOOTMEM_FLAG_NO_LOCKING flag.
Definition at line 139 of file cvmx-bootmem.c.
int64_t cvmx_bootmem_phy_alloc | ( | uint64_t | req_size, |
uint64_t | address_min, | ||
uint64_t | address_max, | ||
uint64_t | alignment, | ||
uint32_t | flags | ||
) |
Allocates a block of physical memory from the free list, at (optional) requested address and alignment.
: size of region to allocate. All requests are rounded up to be a multiple CVMX_BOOTMEM_ALIGNMENT_SIZE bytes size
: Minimum address that block can occupy.
: Specifies the maximum address_min (inclusive) that the allocation can use.
: Requested alignment of the block. If this alignment cannot be met, the allocation fails. This must be a power of 2. (Note: Alignment of CVMX_BOOTMEM_ALIGNMENT_SIZE bytes is required, and internally enforced. Requested alignments of less than CVMX_BOOTMEM_ALIGNMENT_SIZE are set to CVMX_BOOTMEM_ALIGNMENT_SIZE.)
: Flags to control options for the allocation.
Returns physical address of block allocated, or -1 on failure
Definition at line 185 of file cvmx-bootmem.c.
int64_t cvmx_bootmem_phy_named_block_alloc | ( | uint64_t | size, |
uint64_t | min_addr, | ||
uint64_t | max_addr, | ||
uint64_t | alignment, | ||
char * | name, | ||
uint32_t | flags | ||
) |
Allocates a named block of physical memory from the free list, at (optional) requested address and alignment.
size | size of region to allocate. All requests are rounded up to be a multiple CVMX_BOOTMEM_ALIGNMENT_SIZE bytes size |
min_addr | Minimum address that block can occupy. |
max_addr | Specifies the maximum address_min (inclusive) that the allocation can use. |
alignment | Requested alignment of the block. If this alignment cannot be met, the allocation fails. This must be a power of 2. (Note: Alignment of CVMX_BOOTMEM_ALIGNMENT_SIZE bytes is required, and internally enforced. Requested alignments of less than CVMX_BOOTMEM_ALIGNMENT_SIZE are set to CVMX_BOOTMEM_ALIGNMENT_SIZE.) |
name | name to assign to named block |
flags | Flags to control options for the allocation. |
Definition at line 617 of file cvmx-bootmem.c.
|
read |
Definition at line 522 of file cvmx-bootmem.c.
Definition at line 573 of file cvmx-bootmem.c.
Unlocks the bootmem allocator. This is useful in certain situations where multiple allocations must be made without being interrupted. This should be used with the CVMX_BOOTMEM_FLAG_NO_LOCKING flag.
Definition at line 144 of file cvmx-bootmem.c.
EXPORT_SYMBOL | ( | cvmx_bootmem_alloc_named | ) |
EXPORT_SYMBOL | ( | cvmx_bootmem_find_named_block | ) |