section.c
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:2k
源码类别:

DVD

开发平台:

C/C++

  1. #include <stdio.h>
  2. #include "stdevice.h"   /* for ST20_INTERNAL_MEMORY_SIZE */
  3. #include "gendef.h" 
  4. #include "section.h" 
  5. static unsigned char   InternalMemory[ST20_INTERNAL_MEMORY_SIZE - 1200];/*720B*/
  6. static unsigned char   SystemMemory[SYSTEM_SIZE];
  7. static unsigned char   NcacheMemory[NCACHE_SIZE];
  8. #pragma ST_section (InternalMemory, "internal_section")
  9. #pragma ST_section (SystemMemory,   "system_section")
  10. #pragma ST_section (NcacheMemory,  "ncache_section")
  11. static ST_Partition_t  TheInternalPartition;
  12. static ST_Partition_t  TheSystemPartition;
  13. static ST_Partition_t  TheNcachePartition;
  14. ST_Partition_t  *InternalPartition = &TheInternalPartition;
  15. ST_Partition_t  *SystemPartition   = &TheSystemPartition;
  16. ST_Partition_t  *NcachePartition   = &TheNcachePartition;
  17. ST_Partition_t *internal_partition = &TheInternalPartition;
  18. ST_Partition_t *system_partition   = &TheSystemPartition;
  19. ST_Partition_t *ncache_partition   = &TheNcachePartition;
  20. #define DEMUX_SIZE     (64*1024*4)  +(64*1024)
  21. static unsigned char   DemuxMemory[DEMUX_SIZE];
  22. #pragma ST_section (DemuxMemory,   "demux_section")
  23. static ST_Partition_t  TheDemuxPartition;
  24. ST_Partition_t  *DemuxPartition    = &TheDemuxPartition;
  25. ST_ErrorCode_t KB_SECTIONSetup(void)
  26. {
  27.     if(partition_init_simple(&TheInternalPartition, (U8 *)InternalMemory, sizeof(InternalMemory))!=0)
  28. printf("nInternal partition create failed");
  29.     if(partition_init_heap(  &TheSystemPartition,   (U8 *)SystemMemory,   sizeof(SystemMemory))!=0)
  30. printf("nSystem partition create failed");
  31.     if(partition_init_heap(  &TheNcachePartition,   (U8 *)NcacheMemory ,  sizeof(NcacheMemory))!=0)
  32. printf("nNcache partition create failed");
  33. if(partition_init_heap(  &TheDemuxPartition,   (U8 *)DemuxMemory ,  sizeof(DemuxMemory))!=0)
  34. printf("nDemux partition create failed");
  35.     #ifdef REPORT_TO_CONSOLE
  36.         Print("Size of InternalMemory:0x%08xn",ST20_INTERNAL_MEMORY_SIZE - 1200);
  37.         Print("Size of SystemMemory:0x%08xn",SYSTEM_SIZE);
  38.         Print("Size of NcacheMemory:0x%08xn",NCACHE_SIZE);
  39.        Print("KB_SECTIONSetup()=ST_NO_ERRORn");
  40.     #endif
  41.     return ( ST_NO_ERROR );
  42. }
  43. /* EOF */