section.c
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:2k
- #include <stdio.h>
- #include "stdevice.h" /* for ST20_INTERNAL_MEMORY_SIZE */
- #include "gendef.h"
- #include "section.h"
- static unsigned char InternalMemory[ST20_INTERNAL_MEMORY_SIZE - 1200];/*720B*/
- static unsigned char SystemMemory[SYSTEM_SIZE];
- static unsigned char NcacheMemory[NCACHE_SIZE];
- #pragma ST_section (InternalMemory, "internal_section")
- #pragma ST_section (SystemMemory, "system_section")
- #pragma ST_section (NcacheMemory, "ncache_section")
- static ST_Partition_t TheInternalPartition;
- static ST_Partition_t TheSystemPartition;
- static ST_Partition_t TheNcachePartition;
- ST_Partition_t *InternalPartition = &TheInternalPartition;
- ST_Partition_t *SystemPartition = &TheSystemPartition;
- ST_Partition_t *NcachePartition = &TheNcachePartition;
- ST_Partition_t *internal_partition = &TheInternalPartition;
- ST_Partition_t *system_partition = &TheSystemPartition;
- ST_Partition_t *ncache_partition = &TheNcachePartition;
- #define DEMUX_SIZE (64*1024*4) +(64*1024)
- static unsigned char DemuxMemory[DEMUX_SIZE];
- #pragma ST_section (DemuxMemory, "demux_section")
- static ST_Partition_t TheDemuxPartition;
- ST_Partition_t *DemuxPartition = &TheDemuxPartition;
- ST_ErrorCode_t KB_SECTIONSetup(void)
- {
- if(partition_init_simple(&TheInternalPartition, (U8 *)InternalMemory, sizeof(InternalMemory))!=0)
- printf("nInternal partition create failed");
- if(partition_init_heap( &TheSystemPartition, (U8 *)SystemMemory, sizeof(SystemMemory))!=0)
- printf("nSystem partition create failed");
- if(partition_init_heap( &TheNcachePartition, (U8 *)NcacheMemory , sizeof(NcacheMemory))!=0)
- printf("nNcache partition create failed");
- if(partition_init_heap( &TheDemuxPartition, (U8 *)DemuxMemory , sizeof(DemuxMemory))!=0)
- printf("nDemux partition create failed");
-
- #ifdef REPORT_TO_CONSOLE
- Print("Size of InternalMemory:0x%08xn",ST20_INTERNAL_MEMORY_SIZE - 1200);
- Print("Size of SystemMemory:0x%08xn",SYSTEM_SIZE);
- Print("Size of NcacheMemory:0x%08xn",NCACHE_SIZE);
- Print("KB_SECTIONSetup()=ST_NO_ERRORn");
- #endif
- return ( ST_NO_ERROR );
- }
- /* EOF */