📄 mallocx.h
字号:
/******************************************************************************
**
** COPYRIGHT (C) 2001 Intel Corporation
**
** FILENAME: mallocx.h
**
** PURPOSE: A general purpose implementation of "malloc" and "free".
**
** $Modtime: 3/09/04 10:10a $
**
******************************************************************************/
#ifndef _MALLOCX_H // Only include this header file once!
#define _MALLOCX_H
//#define PAGETABLESIZE (16*1024) // 16k at very top of memory
//#define STACKSIZE (32*1024*4*6) // Next there are 6 separate stacks of 32k words each.
#define RESERVEDTOP (1024*1024) // 1mb
#define RESERVEDBOT (1024*1024) // 1mb for program code + data.
#define MEMORYSTART ((BYTE *)0xA0000000)
#ifdef xlli_SDRAM_SIZE_32_MB
#define MEMORYEND ((BYTE *)0xA1F3C000)
#else
#define MEMORYEND ((BYTE *)0xA3F3C000)
#endif
#define HEAPEND (MEMORYEND - RESERVEDTOP)
#define HEAPADDR (MEMORYSTART + RESERVEDBOT)
#define MEMORYCACHEDBUFFEREDSTART ((BYTE *)0)
#define MEMORYCACHEDSTART ((BYTE *)0x60000000)
/*
*******************************************************************************
* FUNCTION PROTOTYPES
*******************************************************************************
*/
// Initialize the heap.
void mallocxSWInit(void);
// Implements the standard "malloc" function.
PVOID malloc(UINT32 size);
// Free a memory block allocated by malloc or mallocx.
ErrorT free(PVOID pAddr);
// Return the size of an allocated block.
UINT32 mallocSize(PVOID pAddr);
// Get the Cached, Buffered address of an allocated block.
PVOID malloc_cb(PVOID pAddr);
// Get the Cached, Non-Buffered address of an allocated block.
PVOID malloc_cx(PVOID pAddr);
// Get the error code from the last malloc().
ErrorT mallocErr(void);
// Allocate a 16-byte-aligned memory block from the heap.
// Deprecated function!
ErrorT mallocx(UINT32 size, void **virtualAddr, void **physicalAddr);
#define freex(a) free(a) // Deprecated function support.
#endif // _MALLOCX_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -