CHDK_DE Vorschauversion  Trunk Rev. 5163
 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 245 der Datei memmgmt.c.

246 {
247  // get system meminfo, should always be available
248  GetMemInfo(camera_meminfo);
249 // some fields are set to -1 for vxworks cams
250 #if !defined(CAM_DRYOS)
251  camera_meminfo->allocated_peak = 0;
252  camera_meminfo->total_size = 0;
253 #ifdef CAM_NO_MEMPARTINFO
254  // a more useful base value than 0
255  camera_meminfo->free_size = camera_meminfo->free_block_max_size;
256  camera_meminfo->free_block_count = 0;
257  camera_meminfo->allocated_size = 0;
258  camera_meminfo->allocated_count = 0;
259 #endif
260 #endif
261 
262  // these don't make sense to combine
263  camera_meminfo->start_address = camera_meminfo->end_address = 0;
264 
265  cam_meminfo m;
266  if(GetARamInfo(&m)) {
267  combine_meminfo(camera_meminfo,&m);
268  }
269  if(GetExMemInfo(&m)) {
270  combine_meminfo(camera_meminfo,&m);
271  }
272 }
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 1001 der Datei wrappers.c.

1002 {
1003 // Use firmware GetMemInfo function to retrieve info about Canon heap memory allocation
1004 
1005 #if defined(CAM_DRYOS)
1006  // Prior to dryos R39 GetMemInfo returns 9 values, after R39 it returns 10 (all but 1 are used in each case)
1007  int fw_info[10];
1008  extern void _GetMemInfo(int*);
1009  _GetMemInfo(fw_info);
1010 
1011 #if defined(CAM_DRYOS_2_3_R39)
1012  // For newer dryos version copy all 9 used values to CHDK structure
1013  camera_meminfo->start_address = fw_info[0];
1014  camera_meminfo->end_address = fw_info[1];
1015  camera_meminfo->total_size = fw_info[2];
1016  camera_meminfo->allocated_size = fw_info[3];
1017  camera_meminfo->allocated_peak = fw_info[4];
1018  camera_meminfo->allocated_count = fw_info[5];
1019  camera_meminfo->free_size = fw_info[6];
1020  camera_meminfo->free_block_max_size = fw_info[7];
1021  camera_meminfo->free_block_count = fw_info[8];
1022 #else
1023  // For older dryos version copy 8 used values to CHDK structure and calculate missing value
1024  camera_meminfo->start_address = fw_info[0];
1025  camera_meminfo->end_address = fw_info[0] + fw_info[1];
1026  camera_meminfo->total_size = fw_info[1];
1027  camera_meminfo->allocated_size = fw_info[2];
1028  camera_meminfo->allocated_peak = fw_info[3];
1029  camera_meminfo->allocated_count = fw_info[4];
1030  camera_meminfo->free_size = fw_info[5];
1031  camera_meminfo->free_block_max_size = fw_info[6];
1032  camera_meminfo->free_block_count = fw_info[7];
1033 #endif
1034 #else // vxworks
1035 extern int sys_mempart_id;
1036  int fw_info[5];
1037  // -1 for invalid
1038  memset(camera_meminfo,0xFF,sizeof(cam_meminfo));
1039 #ifdef CAM_NO_MEMPARTINFO
1040  camera_meminfo->free_block_max_size = _memPartFindMax(sys_mempart_id);
1041 #else
1042  _memPartInfoGet(sys_mempart_id,fw_info);
1043  // TODO we could fill in start address from _start + MEMISOSIZE, if chdk not in exmem
1044  // these are guessed, look reasonable on a540
1045  camera_meminfo->free_size = fw_info[0];
1046  camera_meminfo->free_block_count = fw_info[1];
1047  camera_meminfo->free_block_max_size = fw_info[2];
1048  camera_meminfo->allocated_size = fw_info[3];
1049  camera_meminfo->allocated_count = fw_info[4];
1050 #endif
1051 #endif
1052 }

Variablen-Dokumentation

const char _end
const char _start