1 #ifndef EXMEM_H 2 #define EXMEM_H 3 4 // CHDK exmem 5 6 // Note: used in modules and platform independent code. 7 // Do not add platform dependent stuff in here (#ifdef/#endif compile options or camera dependent values) 8 9 //========================================================== 10 11 // Exmem 12 13 // returned information about an exmem type 14 typedef struct 15 { 16 char *addr; // note: address always includes uncached bit (for now) 17 unsigned int len; 18 } exmem_alloc_info; 19 20 extern unsigned int exmem_type_count; 21 extern char *get_exmem_type_name(unsigned int type); 22 extern int get_exmem_type_status(unsigned int type, exmem_alloc_info *allocinf); 23 24 // allocates UNCACHED exmem region for exmem type 25 // only a single allocation by type can exist at any time, assert is thrown otherwise 26 // allocation must be freed as soon as possible, otherwise normal camera functions might become affected 27 // allocation info is returned in allocinf, if not NULL 28 extern void *exmem_alloc_uncached(unsigned int type, unsigned int size, exmem_alloc_info *allocinf); 29 // frees UNCACHED exmem region 30 // in case allocation was accessed through CPU cache, caller must flush data cache before freeing 31 extern void exmem_free_uncached(unsigned int type); 32 33 #endif