📄 sections.c
字号:
/* ----------------------------------------------------------------------------
File name : sections.c
Description: setup partition sections.
COPYRIGHT (C) 2004 STMicroelectronics
---------------------------------------------------------------------------- */
/* Includes --------------------------------------------------------------- */
#ifdef REPORT_TO_CONSOLE
#include <stdio.h>
#endif
#include "stdevice.h" /* for ST20_INTERNAL_MEMORY_SIZE */
#include "stboot.h"
#include "sections.h"
/* Definitions ------------------------------------------------------------ */
//#define SYSTEM_PARTITION_SIZE 0x228000 /*2.15 mb */
//#define SYSTEM_PARTITION_SIZE 0x220000 /*2.15 mb */
//#define SYSTEM_PARTITION_SIZE 0x210000 /*2.15 mb */
#define SYSTEM_PARTITION_SIZE 0x1B0000 /*2.15 mb */
//#define SYSTEM_PARTITION_SIZE 0x180000 /*2.15 mb */
#ifdef MEM_COMFIG_SIZE_128MByte//
#if defined(CREATE_NCACHE_2)
#define NCACHE_PARTITION_SIZE (0x1000000+0x3000000+0xE00000) /*16mb+64mb*/
#define NCACHE2_PARTITION_SIZE 0x200000
#else
#define NCACHE_PARTITION_SIZE 0x1000000+0x4000000 /*16mb+64mb*/
#endif
#else
#define NCACHE_PARTITION_SIZE 0x1000000 /*16mb */
#endif
#define DATA_PARTITION_SIZE 0x1
#define INTERNAL_PARTITION_SIZE (ST20_INTERNAL_MEMORY_SIZE-1200)
unsigned char InternalBlock [INTERNAL_PARTITION_SIZE];
#pragma ST_section (InternalBlock, "internal_section")
unsigned char SystemBlock [SYSTEM_PARTITION_SIZE];
#pragma ST_section (SystemBlock, "system_section")
#ifdef MEM_COMFIG_SIZE_128MByte//DDRAM 128 Mbyte Config 20070105
#if defined(CREATE_NCACHE_2)
unsigned char NcacheBlock[];
unsigned char NcacheBlock2[];
#else
unsigned char NcacheBlock[];
#endif
#else
unsigned char NcacheBlock [NCACHE_PARTITION_SIZE];
#endif
#pragma ST_section (NcacheBlock, "ncache_section")
#if defined(CREATE_NCACHE_2)
#pragma ST_section (NcacheBlock2, "ncache_section2")
#endif
unsigned char DataBlock [DATA_PARTITION_SIZE];
#pragma ST_section (DataBlock, "data_section")
/* This is to avoid a linker warning */
static unsigned char internal_block_noinit[1];
#pragma ST_section ( internal_block_noinit, "internal_section_noinit")
static unsigned char system_block_noinit[1];
#pragma ST_section ( system_block_noinit, "system_section_noinit")
static ST_Partition_t TheInternalPartition;
static ST_Partition_t TheSystemPartition;
static ST_Partition_t TheNcachePartition;
static ST_Partition_t TheDataPartition;
ST_Partition_t *InternalPartition = &TheInternalPartition;
ST_Partition_t *NcachePartition = &TheNcachePartition;
ST_Partition_t *SystemPartition = &TheSystemPartition;
ST_Partition_t *DriverPartition = &TheSystemPartition;
ST_Partition_t *DataPartition = &TheDataPartition;
/* PTI/OS20 */
ST_Partition_t *internal_partition = &TheInternalPartition;
ST_Partition_t *system_partition = &TheSystemPartition;
ST_Partition_t *ncache_partition = &TheNcachePartition;
#if defined(CREATE_NCACHE_2)
static ST_Partition_t TheNcachePartition2;
ST_Partition_t *NcachePartition2 = &TheNcachePartition2;
ST_Partition_t *ncache_partition2 = &TheNcachePartition2;
#endif
/* Functions -------------------------------------------------------------- */
/*------------------------------------------------------------------------
* Function : SECTIONS_Setup
* setup partition sections;
* Input : None
* Output :
* Return : Error Code
* ----------------------------------------------------------------------*/
ST_ErrorCode_t SECTIONS_Setup(void)
{
/* Avoid warning at compile time */
internal_block_noinit[0] = 0;
system_block_noinit[0] = 0;
(void) partition_init_simple (&TheInternalPartition, InternalBlock,sizeof(InternalBlock));
(void) partition_init_heap (&TheSystemPartition, SystemBlock,sizeof(SystemBlock));
(void) partition_init_heap (&TheNcachePartition, NcacheBlock,(NCACHE_PARTITION_SIZE));
(void) partition_init_heap (&TheDataPartition, DataBlock,sizeof(DataBlock));
#if defined(CREATE_NCACHE_2)
(void) partition_init_heap (&TheNcachePartition2, NcacheBlock2,(NCACHE2_PARTITION_SIZE));
#endif
#ifdef REPORT_TO_CONSOLE
LOCAL_PRINT(("SECTIONS_Setup()=OK\n"));
#endif
return ( ST_NO_ERROR );
}
/* EOF */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -