CHDK_DE Vorschauversion  Trunk Rev. 5830
 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 85 der Datei main.c.

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

Definiert in Zeile 226 der Datei memmgmt.c.

227 {
228  return chdk_meminfo(&aram_heap, camera_meminfo);
229 }
void GetCombinedMemInfo ( cam_meminfo )

Definiert in Zeile 259 der Datei memmgmt.c.

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

Definiert in Zeile 195 der Datei memmgmt.c.

196 {
197  return chdk_meminfo(&exmem_heap, camera_meminfo);
198 }
void GetMemInfo ( cam_meminfo )

Definiert in Zeile 1111 der Datei wrappers.c.

1112 {
1113 // Use firmware GetMemInfo function to retrieve info about Canon heap memory allocation
1114 
1115 #if defined(CAM_DRYOS)
1116  // Prior to dryos R39 GetMemInfo returns 9 values, after R39 it returns 10 (all but 1 are used in each case)
1117  int fw_info[10];
1118  extern void _GetMemInfo(int*);
1119  _GetMemInfo(fw_info);
1120 
1121 #if defined(CAM_DRYOS_2_3_R39)
1122  // For newer dryos version copy all 9 used values to CHDK structure
1123  camera_meminfo->start_address = fw_info[0];
1124  camera_meminfo->end_address = fw_info[1];
1125  camera_meminfo->total_size = fw_info[2];
1126  camera_meminfo->allocated_size = fw_info[3];
1127  camera_meminfo->allocated_peak = fw_info[4];
1128  camera_meminfo->allocated_count = fw_info[5];
1129  camera_meminfo->free_size = fw_info[6];
1130  camera_meminfo->free_block_max_size = fw_info[7];
1131  camera_meminfo->free_block_count = fw_info[8];
1132 #else
1133  // For older dryos version copy 8 used values to CHDK structure and calculate missing value
1134  camera_meminfo->start_address = fw_info[0];
1135  camera_meminfo->end_address = fw_info[0] + fw_info[1];
1136  camera_meminfo->total_size = fw_info[1];
1137  camera_meminfo->allocated_size = fw_info[2];
1138  camera_meminfo->allocated_peak = fw_info[3];
1139  camera_meminfo->allocated_count = fw_info[4];
1140  camera_meminfo->free_size = fw_info[5];
1141  camera_meminfo->free_block_max_size = fw_info[6];
1142  camera_meminfo->free_block_count = fw_info[7];
1143 #endif
1144 #else // vxworks
1145  extern int sys_mempart_id;
1146  // -1 for invalid
1147  memset(camera_meminfo,0xFF,sizeof(cam_meminfo));
1149 #ifdef CAM_NO_MEMPARTINFO
1150  camera_meminfo->free_block_max_size = _memPartFindMax(sys_mempart_id);
1151 #else
1152  int fw_info[5];
1153  _memPartInfoGet(sys_mempart_id,fw_info);
1154  // TODO we could fill in start address from _start + MEMISOSIZE, if chdk not in exmem
1155  // these are guessed, look reasonable on a540
1156  camera_meminfo->free_size = fw_info[0];
1157  camera_meminfo->free_block_count = fw_info[1];
1158  camera_meminfo->free_block_max_size = fw_info[2];
1159  camera_meminfo->allocated_size = fw_info[3];
1160  camera_meminfo->allocated_count = fw_info[4];
1161 #endif
1163  }
1164 #endif
1165 }

Variablen-Dokumentation

const char _end
const char _start