CHDK_DE Vorschauversion  Trunk Rev. 5272
 Alle Datenstrukturen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
meminfo.h-Dateireferenz
+ Dieser Graph zeigt, welche Datei direkt oder indirekt diese Datei enthält:

gehe zum Quellcode dieser Datei

Datenstrukturen

struct  cam_meminfo
 

Funktionen

void GetMemInfo (cam_meminfo *)
 
int GetExMemInfo (cam_meminfo *)
 
int GetARamInfo (cam_meminfo *)
 
void GetCombinedMemInfo (cam_meminfo *)
 
int core_get_free_memory ()
 

Variablen

const char _start
 
const char _end
 

Dokumentation der Funktionen

int core_get_free_memory ( )

Definiert in Zeile 84 der Datei main.c.

85 {
86  cam_meminfo camera_meminfo;
87  GetCombinedMemInfo(&camera_meminfo);
88  return camera_meminfo.free_block_max_size;
89 }
int GetARamInfo ( cam_meminfo )

Definiert in Zeile 222 der Datei memmgmt.c.

223 {
224  return chdk_meminfo(&aram_heap, camera_meminfo);
225 }
void GetCombinedMemInfo ( cam_meminfo )

Definiert in Zeile 255 der Datei memmgmt.c.

256 {
257  // get system meminfo, should always be available
258  GetMemInfo(camera_meminfo);
259 // some fields are set to -1 for vxworks cams
260 #if !defined(CAM_DRYOS)
261  camera_meminfo->allocated_peak = 0;
262  camera_meminfo->total_size = 0;
263 #ifdef CAM_NO_MEMPARTINFO
264  // a more useful base value than 0
265  camera_meminfo->free_size = camera_meminfo->free_block_max_size;
266  camera_meminfo->free_block_count = 0;
267  camera_meminfo->allocated_size = 0;
268  camera_meminfo->allocated_count = 0;
269 #endif
270 #endif
271 
272  // these don't make sense to combine
273  camera_meminfo->start_address = camera_meminfo->end_address = 0;
274 
275  cam_meminfo m;
276  if(GetARamInfo(&m)) {
277  combine_meminfo(camera_meminfo,&m);
278  }
279  if(GetExMemInfo(&m)) {
280  combine_meminfo(camera_meminfo,&m);
281  }
282 }
int GetExMemInfo ( cam_meminfo )

Definiert in Zeile 191 der Datei memmgmt.c.

192 {
193  return chdk_meminfo(&exmem_heap, camera_meminfo);
194 }
void GetMemInfo ( cam_meminfo )

Definiert in Zeile 1058 der Datei wrappers.c.

1059 {
1060 // Use firmware GetMemInfo function to retrieve info about Canon heap memory allocation
1061 
1062 #if defined(CAM_DRYOS)
1063  // Prior to dryos R39 GetMemInfo returns 9 values, after R39 it returns 10 (all but 1 are used in each case)
1064  int fw_info[10];
1065  extern void _GetMemInfo(int*);
1066  _GetMemInfo(fw_info);
1067 
1068 #if defined(CAM_DRYOS_2_3_R39)
1069  // For newer dryos version copy all 9 used values to CHDK structure
1070  camera_meminfo->start_address = fw_info[0];
1071  camera_meminfo->end_address = fw_info[1];
1072  camera_meminfo->total_size = fw_info[2];
1073  camera_meminfo->allocated_size = fw_info[3];
1074  camera_meminfo->allocated_peak = fw_info[4];
1075  camera_meminfo->allocated_count = fw_info[5];
1076  camera_meminfo->free_size = fw_info[6];
1077  camera_meminfo->free_block_max_size = fw_info[7];
1078  camera_meminfo->free_block_count = fw_info[8];
1079 #else
1080  // For older dryos version copy 8 used values to CHDK structure and calculate missing value
1081  camera_meminfo->start_address = fw_info[0];
1082  camera_meminfo->end_address = fw_info[0] + fw_info[1];
1083  camera_meminfo->total_size = fw_info[1];
1084  camera_meminfo->allocated_size = fw_info[2];
1085  camera_meminfo->allocated_peak = fw_info[3];
1086  camera_meminfo->allocated_count = fw_info[4];
1087  camera_meminfo->free_size = fw_info[5];
1088  camera_meminfo->free_block_max_size = fw_info[6];
1089  camera_meminfo->free_block_count = fw_info[7];
1090 #endif
1091 #else // vxworks
1092 extern int sys_mempart_id;
1093  int fw_info[5];
1094  // -1 for invalid
1095  memset(camera_meminfo,0xFF,sizeof(cam_meminfo));
1097 #ifdef CAM_NO_MEMPARTINFO
1098  camera_meminfo->free_block_max_size = _memPartFindMax(sys_mempart_id);
1099 #else
1100  _memPartInfoGet(sys_mempart_id,fw_info);
1101  // TODO we could fill in start address from _start + MEMISOSIZE, if chdk not in exmem
1102  // these are guessed, look reasonable on a540
1103  camera_meminfo->free_size = fw_info[0];
1104  camera_meminfo->free_block_count = fw_info[1];
1105  camera_meminfo->free_block_max_size = fw_info[2];
1106  camera_meminfo->allocated_size = fw_info[3];
1107  camera_meminfo->allocated_count = fw_info[4];
1108 #endif
1110  }
1111 #endif
1112 }

Variablen-Dokumentation

const char _end
const char _start