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

87 {
88  cam_meminfo camera_meminfo;
89  GetCombinedMemInfo(&camera_meminfo);
90  return camera_meminfo.free_block_max_size;
91 }
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 1101 der Datei wrappers.c.

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

Variablen-Dokumentation

const char _end
const char _start