CHDK_DE Vorschauversion  Trunk Rev. 5540
 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 1087 der Datei wrappers.c.

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

Variablen-Dokumentation

const char _end
const char _start