coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
heapmanager.c File Reference
#include <AGESA.h>
#include <amdlib.h>
#include <cbmem.h>
#include <northbridge/amd/agesa/agesa_helper.h>
#include <northbridge/amd/agesa/BiosCallOuts.h>
#include <acpi/acpi.h>
#include <console/console.h>
#include <string.h>
Include dependency graph for heapmanager.c:

Go to the source code of this file.

Data Structures

struct  _BIOS_HEAP_MANAGER
 
struct  _BIOS_BUFFER_NODE
 

Macros

#define BIOS_HEAP_SIZE   0x30000
 
#define BIOS_HEAP_START_ADDRESS   0x010000000
 

Typedefs

typedef struct _BIOS_HEAP_MANAGER BIOS_HEAP_MANAGER
 
typedef struct _BIOS_BUFFER_NODE BIOS_BUFFER_NODE
 

Functions

voidGetHeapBase (void)
 
void EmptyHeap (void)
 
static AGESA_STATUS agesa_AllocateBuffer (BIOS_HEAP_MANAGER *BiosHeapBasePtr, AGESA_BUFFER_PARAMS *AllocParams)
 
static AGESA_STATUS agesa_DeallocateBuffer (BIOS_HEAP_MANAGER *BiosHeapBasePtr, AGESA_BUFFER_PARAMS *AllocParams)
 
static AGESA_STATUS agesa_LocateBuffer (BIOS_HEAP_MANAGER *BiosHeapBasePtr, AGESA_BUFFER_PARAMS *AllocParams)
 
AGESA_STATUS HeapManagerCallout (UINT32 Func, UINTN Data, VOID *ConfigPtr)
 

Macro Definition Documentation

◆ BIOS_HEAP_SIZE

#define BIOS_HEAP_SIZE   0x30000

Definition at line 15 of file heapmanager.c.

◆ BIOS_HEAP_START_ADDRESS

#define BIOS_HEAP_START_ADDRESS   0x010000000

Definition at line 16 of file heapmanager.c.

Typedef Documentation

◆ BIOS_BUFFER_NODE

◆ BIOS_HEAP_MANAGER

Function Documentation

◆ agesa_AllocateBuffer()

static AGESA_STATUS agesa_AllocateBuffer ( BIOS_HEAP_MANAGER BiosHeapBasePtr,
AGESA_BUFFER_PARAMS *  AllocParams 
)
static

◆ agesa_DeallocateBuffer()

static AGESA_STATUS agesa_DeallocateBuffer ( BIOS_HEAP_MANAGER BiosHeapBasePtr,
AGESA_BUFFER_PARAMS *  AllocParams 
)
static

Definition at line 207 of file heapmanager.c.

References AGESA_SUCCESS, _BIOS_BUFFER_NODE::BufferHandle, _BIOS_BUFFER_NODE::BufferSize, memset(), _BIOS_BUFFER_NODE::NextNodeOffset, _BIOS_HEAP_MANAGER::StartOfAllocatedNodes, and _BIOS_HEAP_MANAGER::StartOfFreedNodes.

Referenced by HeapManagerCallout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ agesa_LocateBuffer()

static AGESA_STATUS agesa_LocateBuffer ( BIOS_HEAP_MANAGER BiosHeapBasePtr,
AGESA_BUFFER_PARAMS *  AllocParams 
)
static

◆ EmptyHeap()

void EmptyHeap ( void  )

Definition at line 36 of file heapmanager.c.

References base, BIOS_DEBUG, BIOS_HEAP_SIZE, GetHeapBase(), memset(), and printk.

Referenced by platform_BeforeInitEnv().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHeapBase()

void* GetHeapBase ( void  )

Definition at line 22 of file heapmanager.c.

References acpi_is_wakeup_s3(), BIOS_HEAP_START_ADDRESS, cbmem_find(), and CBMEM_ID_RESUME_SCRATCH.

Referenced by EmptyHeap(), and HeapManagerCallout().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HeapManagerCallout()

AGESA_STATUS HeapManagerCallout ( UINT32  Func,
UINTN  Data,
VOID *  ConfigPtr 
)

Definition at line 352 of file heapmanager.c.

References agesa_AllocateBuffer(), agesa_DeallocateBuffer(), agesa_LocateBuffer(), AGESA_UNSUPPORTED, and GetHeapBase().

Referenced by GetBiosCallout().

Here is the call graph for this function:
Here is the caller graph for this function: