root/tools/ghidra_scripts/datatypes/fw_functions.h

/* [<][>][^][v][top][bottom][index][help] */
   1 /*
   2 function prototypes for ghidra
   3 initially based on lowelevel.h
   4 manually adjusted / updated
   5 
   6 Some adjustments
   7 * CHDK lowlevel names  start _, stubs names do not
   8 * long switched to int, identical on our platform
   9 * removed extern
  10 * add __stdcall functions, tells Ghidra to use normal ARM calling convention
  11 * explicit void for void function args
  12 * platform specific ifdefs removed except where prototypes vary by platform
  13 * Use some known types e.g. __stat instead of void *
  14 * some synchroniztaion object (eventflag, messagequeue) changed to int instead of void *
  15 
  16 Note
  17 Some functions already defined in Ghidra generic libc are also defined here
  18 
  19 required defines
  20 DryOS cams:
  21 -DCAM_DRYOS_REL=<PLATFORMOSVER from makefile.inc
  22 Some later DryOS and early vxworks
  23 -DCAM_3ARG_DebugAssert=1
  24 Ixus 30 / 40
  25 -DVX_OLD_PTP=1
  26 
  27 All (ghidra default)
  28 -D__builtin_va_list=void *
  29 
  30 ONLY functions that have different signatures in different versions should be
  31 under ifdefs. Functions that only exist on some firmware can safely be present
  32 without ifdefs.
  33 */
  34 #ifndef FW_FUNCTIONS_H
  35 #define FW_FUNCTIONS_H
  36 #include "fw_types.h"
  37 #include "ptp_handlers.h"
  38 #ifdef CAM_DRYOS_REL
  39 __stdcall int * GetSystemTime(int *t);
  40 #else
  41 __stdcall int GetSystemTime(void);
  42 #endif
  43 __stdcall int GetZoomLensCurrentPosition(void);
  44 __stdcall int GetZoomLensCurrentPoint(void);
  45 __stdcall int MoveZoomLensWithPoint(short *pos);
  46 __stdcall int SetZoomActuatorSpeedPercent(short *perc);
  47 __stdcall int GetFocusLensCurrentPosition(void);
  48 __stdcall int GetFocusLensSubjectDistance(void);
  49 __stdcall int GetFocusLensSubjectDistanceFromLens(void);
  50 __stdcall void MoveFocusLensToDistance(short *dist);
  51 __stdcall int MoveIrisWithAv(short*);
  52 __stdcall void PutInNdFilter(void);
  53 __stdcall void PutOutNdFilter(void);
  54 __stdcall short get_nd_value(void);
  55 __stdcall short get_current_nd_value(void);
  56 __stdcall int GetCurrentShutterSpeed(void);
  57 __stdcall int GetCurrentAvValue(void);
  58 __stdcall int get_current_deltasv(void);
  59 __stdcall int GetCurrentDriveBaseSvValue(void);
  60 __stdcall short GetUsableMinAv(void);
  61 __stdcall short GetUsableMaxAv(void);
  62 __stdcall int GetCurrentTargetDistance(void);
  63 __stdcall int GetPropertyCase(int opt_id, void *buf, int bufsize);
  64 __stdcall int SetPropertyCase(int opt_id, void *buf, int bufsize);
  65 __stdcall short PTM_GetCurrentItem(int id);
  66 __stdcall int IsStrobeChargeCompleted(void);
  67 __stdcall int VbattGet(void);
  68 __stdcall int GetBatteryTemperature(void);
  69 __stdcall int GetCCDTemperature(void);
  70 __stdcall int GetOpticalTemperature(void);
  71 #ifdef CAM_DRYOS_REL
  72 __stdcall int GetAdChValue(int);
  73 #else
  74 __stdcall int GetAdChValue(int*);
  75 #endif
  76 __stdcall void PT_PlaySound(short , void*, int unk);
  77 __stdcall void RefreshPhysicalScreen(int f);
  78 __stdcall void Unmount_FileSystem(void);
  79 __stdcall void Mount_FileSystem(void);
  80 __stdcall void SleepTask(int msec);
  81 __stdcall int CreateTask (const char *name, int prio, int stack_size, void *entry, int parm /*?*/);
  82 __stdcall void ExitTask(void);
  83 __stdcall int taskNameToId(char* taskName); // VxWorks only, task's name first letter must be 't', maximum 10 chars total
  84 __stdcall const char * taskName(int taskID); // VxWorks only for now
  85 __stdcall int taskIdListGet(int *idlist,int max); // VxWorks only for now
  86 __stdcall void taskSuspend(int taskId);
  87 __stdcall void taskResume(int taskId);
  88 __stdcall int errnoOfTaskGet(int tid);
  89 
  90 __stdcall int SetEventFlag(int flag, int what);
  91 __stdcall int CheckAnyEventFlag(int flag, int mask, int *res);
  92 __stdcall int GetEventFlagValue(int flag, int *res);
  93 
  94 __stdcall int ReceiveMessageQueue(int msgq, int *dst, int unk1 /* probably timeout */);
  95 
  96 /* Canon stuff with nonoriginal naming */
  97 __stdcall int GetParameterData(int id, void *buf, int size);
  98 __stdcall int SetParameterData(int id, void *buf, int size);
  99 __stdcall void MakeSDCardBootable(int driveno);
 100 __stdcall void UpdateMBROnFlash(int driveno, int offset, char *str);
 101 
 102 /* standard C library */
 103 __stdcall int creat (const char *name, int flags);
 104 __stdcall int open (const char *name, int flags, int mode );
 105 __stdcall int close (int fd);
 106 __stdcall int write (int fd, const void *buffer, int nbytes);
 107 __stdcall int read (int fd, void *buffer, int nbytes);
 108 __stdcall int lseek (int fd, int offset, int whence);
 109 __stdcall int mkdir(const char *dirname);
 110 
 111 __stdcall int Open (const char *name, int flags, int mode );
 112 __stdcall int Close (int fd);
 113 __stdcall int Write (int fd, const void *buffer, int nbytes);
 114 __stdcall int Read (int fd, void *buffer, int nbytes);
 115 // alias to lseek
 116 //int Lseek (int fd, int offset, int whence);
 117 __stdcall int Remove(const char *name);
 118 
 119 __stdcall FILE * Fopen_Fut(const char *filename, const char *mode);
 120 __stdcall int Fclose_Fut(FILE *f);
 121 __stdcall int Fread_Fut(void *buf, int elsize, int count, FILE *f);
 122 __stdcall int Fwrite_Fut(const void *buf, int elsize, int count, FILE *f);
 123 __stdcall int Fseek_Fut(FILE *f, int offset, int whence);
 124 __stdcall int Fflush_Fut(FILE *f);
 125 __stdcall int Feof_Fut(FILE *f);
 126 __stdcall int Fflush_Fut(FILE *f);
 127 __stdcall char * Fgets_Fut(char *buf, int n, FILE *f);
 128 __stdcall int RenameFile_Fut(const char *oldname, const char *newname);
 129 __stdcall int DeleteFile_Fut(const char *name);
 130 __stdcall int MakeDirectory_Fut(const char *name,int unk);
 131 __stdcall int DeleteDirectory_Fut(const char *name);
 132 
 133 __stdcall int isdigit(int c);
 134 __stdcall int isspace(int c);
 135 __stdcall int isalpha(int c);
 136 __stdcall int isupper(int c);
 137 __stdcall int islower(int c);
 138 __stdcall int ispunct(int c);
 139 __stdcall int isxdigit(int c);
 140 
 141 __stdcall int strlen(const char *s);
 142 __stdcall int strcmp(const char *s1, const char *s2);
 143 __stdcall int strncmp(const char *s1, const char *s2, int n);
 144 __stdcall char * strchr(const char *s, int c);
 145 __stdcall char * strcpy(char *dest, const char *src);
 146 __stdcall char * strncpy(char *dest, const char *src, int n);
 147 __stdcall char * strcat(char *dest, const char *app);
 148 __stdcall char * strrchr(const char *s, int c);
 149 __stdcall char * strpbrk(const char *s, const char *accept);
 150 
 151 __stdcall int strtol(const char *nptr, char **endptr, int base);
 152 __stdcall unsigned strtoul(const char *nptr, char **endptr, int base);
 153 // DRYOS: this function is called by strtol (mode=1) and strtoul (mode=0)
 154 // easier to match with sig finder
 155 __stdcall int strtolx(const char *nptr, char **endptr, int base, int mode);
 156 
 157 __stdcall int tolower(int c);
 158 __stdcall int toupper(int c);
 159 
 160 __stdcall int vsprintf(char *buf, const char *fmt, __builtin_va_list va_list);
 161 
 162 /**
 163  * No STUBS!
 164  * You can't use these two directly from THUMB code (core), only from platform.
 165  */
 166 //int fprintf(FILE *fd, char*buf, ...);
 167 //int printf(char *buf, ...);
 168 
 169 __stdcall void * malloc(int size);
 170 __stdcall void free(void *p);
 171 __stdcall void * AllocateUncacheableMemory(int size);
 172 __stdcall void FreeUncacheableMemory(void *p);
 173 
 174 __stdcall void * memchr(const void *s, int c, int n);
 175 __stdcall void * memcpy(void *dest, const void *src, int n);
 176 __stdcall void * memset(void *s, int c, int n);
 177 __stdcall int memcmp(const void *s1, const void *s2, int n);
 178 
 179 __stdcall void qsort (void * _base, int _nelem, int _size, int (* _cmp)(const void * _e1, const void * _e2));
 180 
 181 /* VxWorks */
 182 __stdcall int taskLock(void);
 183 __stdcall int taskUnlock(void);
 184 __stdcall int taskCreateHookAdd (void *createHook);
 185 __stdcall int taskDeleteHookAdd (void *deleteHook);
 186 __stdcall int iosDevAdd(void*,void*,int);
 187 __stdcall int iosDevDelete(void*);
 188 __stdcall int iosDrvInstall(void*,void*,void*,void*,void*,void*,void*);
 189 
 190 /* synchronization objects */
 191 __stdcall int TakeSemaphore(int sem, int timeout);
 192 __stdcall void GiveSemaphore(int sem);
 193 
 194 /* misc */
 195 __stdcall int kbd_p1_f(void);
 196 __stdcall void kbd_p2_f(void);
 197 __stdcall void kbd_pwr_on(void);
 198 __stdcall void kbd_pwr_off(void);
 199 __stdcall void kbd_read_keys_r2(int *p);
 200 
 201 __stdcall void kbd_fetch_data(int *dst);
 202 
 203 __stdcall void UniqueLedOn(void *addr, int brightness);
 204 __stdcall void UniqueLedOff(void *addr);
 205 //struct led_control {int led_num; int action; int brightness; int blink_count;};
 206 __stdcall int PostLEDMessage(struct led_control *);
 207 __stdcall int LEDDrive(int led, int action);
 208 
 209 
 210 __stdcall int LockMainPower(void);
 211 __stdcall int UnlockMainPower(void);
 212 __stdcall void SetAutoShutdownTime(int t);
 213 
 214 /*
 215 The following two functions post an event such as button press, switch change, cable connection change.
 216 event:
 217   A number identifying the event. This number may vary between camera models.
 218   See levent.c and levent.h for methods to identify events by name.
 219 unk:
 220   Unknown value, usually 0 in canon code. For jogdial messages, this is number of clicks.
 221 return value:
 222   Unknown, possibly void.
 223 */
 224 __stdcall int  PostLogicalEventForNotPowerType(int event, int unk);
 225 __stdcall int  PostLogicalEventToUI(int event, int unk);
 226 /*
 227 Used in the canon code to modify the generation or delivery of events. For example, Canon
 228 mode override code sets 1 on the desired dial position, and zero on all others.
 229 event: as described above for PostLogicalEvent*
 230 state: if 1, the event will be generated/delivered as normal. If 0, the event is disabled/blocked.
 231 */
 232 __stdcall void SetLogicalEventActive(unsigned event, unsigned state);
 233 /* Somehow related to the above. Normally 0, set to 1 for script mode */
 234 __stdcall void SetScriptMode(unsigned mode);
 235 
 236 
 237 /* math */
 238 __stdcall int rand(void);
 239 __stdcall void srand(unsigned int seed);
 240 
 241 __stdcall double _log(double x);
 242 __stdcall double _log10(double x);
 243 __stdcall double _pow(double x, double y);
 244 __stdcall double _sqrt(double x);
 245 
 246 /* time */
 247 __stdcall int utime(const char *file, void *newTimes);
 248 __stdcall unsigned int time(/*time_t*/ unsigned int *timer);
 249 __stdcall void * localtime(const /*time_t*/ unsigned int * tod);
 250 __stdcall void * LocalTime(const /*time_t*/ unsigned int * tod, void * t_m); // DRYOS
 251 __stdcall int strftime(char *s, unsigned int maxsize, const char *format, const /*struct tm*/ void *timp);
 252 __stdcall /*time_t*/ int mktime(/*struct tm*/ void *timp); // VXWORKS
 253 __stdcall /*time_t*/ int mktime_ext(void *tim_extp); // DRYOS, doesn't take a struct tm *
 254 __stdcall int SetDate(void *setdate_p); // expects ptr to year, month, day, hour, min, sec, not compatible with tm
 255                                       // appears to return non-DST adjusted time
 256 
 257 #if CAM_DRYOS_REL >= 39
 258 __stdcall int SetFileTimeStamp(const char *file_path, int time1, int time2);
 259 __stdcall int SetFileAttributes(const char *fn, int attr);
 260 #else
 261 __stdcall int SetFileTimeStamp(int fd, int time1, int time2);
 262 __stdcall void SetFileAttributes(int fd, int attr);
 263 #endif
 264 
 265 /* file */
 266 __stdcall int   stat(const char *name, __stat *pStat);
 267 __stdcall unsigned int GetDrive_ClusterSize(int drive);
 268 __stdcall unsigned int GetDrive_TotalClusters(int drive);
 269 __stdcall unsigned int GetDrive_FreeClusters(int drive);
 270 __stdcall int WriteSDCard(unsigned int drive, unsigned int start_sect, unsigned int num_sect, void *buf);
 271 
 272 __stdcall void UnsetZoomForMovie(void);
 273 __stdcall void TurnOffMic(void);
 274 __stdcall void TurnOnMic(void);
 275 
 276 __stdcall void MakeAFScan(int*, int);
 277 __stdcall void ExpCtrlTool_StartContiAE(int, int);
 278 __stdcall void ExpCtrlTool_StopContiAE(int, int);
 279 
 280 __stdcall int some_flag_for_af_scan;
 281 __stdcall int parameter_for_af_scan;
 282 __stdcall short SetAE_ShutterSpeed(short* tv);
 283 
 284 __stdcall void EnterToCompensationEVF(void);
 285 __stdcall void ExitFromCompensationEVF(void);
 286 
 287 __stdcall void TurnOnBackLight(void);
 288 __stdcall void TurnOffBackLight(void);
 289 __stdcall void TurnOnDisplay(void);
 290 __stdcall void TurnOffDisplay(void);
 291 
 292 __stdcall void DoAELock(void);
 293 __stdcall void UnlockAE(void);
 294 __stdcall void DoAFLock(void);
 295 __stdcall void UnlockAF(void);
 296 __stdcall void MFOn(void);
 297 __stdcall void MFOff(void);
 298 __stdcall void PT_MFOn(void);
 299 __stdcall void PT_MFOff(void);
 300 __stdcall void SS_MFOn(void);
 301 __stdcall void SS_MFOff(void);
 302 
 303 __stdcall int EngDrvRead(int gpio_reg);
 304 
 305 __stdcall int apex2us(int);
 306 
 307 __stdcall void ScreenLock(void);
 308 __stdcall void SetCurrentCaptureModeType(void);
 309 __stdcall unsigned ExecuteEventProcedure(const char *name, ...);
 310 // known in CHDK as RefreshPhysicalScreen
 311 //void ScreenUnLock(void);
 312 
 313 // 7 calls functions and sets some MMIOs, but doesn't disable caches and actually restart
 314 // 3 skips one function call on some cameras, but does restart
 315 __stdcall void Restart(unsigned option);
 316 
 317 // boot an fir/fi2 file
 318 __stdcall void reboot_fw_update(const char* bootfile);
 319 
 320 // PTP
 321 __stdcall int add_ptp_handler(int opcode, ptp_handler handler, int unk);
 322 __stdcall void set_control_event(int);
 323 __stdcall void PB2Rec(void);
 324 
 325 #if CAM_DRYOS_REL < 54
 326 __stdcall void Rec2PB(void);
 327 #else
 328 __stdcall void Rec2PB(int event);
 329 #endif
 330 __stdcall int get_ptp_buf_size(int slot);
 331 __stdcall char * get_ptp_file_buf(void);
 332 
 333 // dryos + some vxworks only takes 3 params in reality
 334 // on some vxworks the function that is easy to match with sig finder takes an additional param,
 335 // set to zero in the real AllocateExMem
 336 // versions that don't expect a 4th param will just ignore it
 337 __stdcall void * exmem_alloc(unsigned int pool_id,unsigned int size,int unk,int unk2);
 338 
 339 // exmem
 340 __stdcall void * exmem_ualloc(unsigned int type, unsigned int size, void *allocinf);
 341 __stdcall void exmem_ufree(unsigned int type);
 342 
 343 // vxworks only
 344 // used on a few cameras that don't have memPartInfoGet, see CAM_NO_MEMPARTINFO
 345 __stdcall int memPartFindMax(int mempart_id);
 346 __stdcall int memPartInfoGet(int mempart_id,int *info);
 347 
 348 __stdcall void GPS_UpdateData(void);
 349 
 350 // gathered from places other than lowlevel
 351 // generic/wrappers.c
 352 __stdcall void PT_MoveDigitalZoomToWide(void);
 353 __stdcall void MoveOpticalZoomAt(long pt,int speed);
 354 __stdcall int closedir(void *d);
 355 __stdcall int get_fstype(int);
 356 __stdcall void *OpenFastDir(const char* name);
 357 __stdcall int ReadFastDir(void *d, void* dd);
 358 __stdcall void *opendir(const char* name);
 359 __stdcall void *readdir(void *d);
 360 __stdcall void GetMemInfo(int*);
 361 __stdcall int SetHPTimerAfterNow(int delay, int(*good_cb)(int, int), int(*bad_cb)(int, int), int );
 362 __stdcall int CancelHPTimer(int);
 363 __stdcall void EnableHDMIPower(void);
 364 __stdcall void DisableISDriveError(void);
 365 #if CAM_3ARG_DebugAssert
 366 __stdcall void DebugAssert(int x, char *file, int line);
 367 // some cams with 3 arg form also have 2 arg
 368 __stdcall void DebugAssert2(char *file, int line);
 369 #else
 370 __stdcall void DebugAssert(char *file, int line);
 371 #endif
 372 __stdcall int CreateBinarySemaphore(char *name, int v);
 373 __stdcall void SetVideoOutType(int vt);
 374 __stdcall int GetVideoOutType(void);
 375 __stdcall void LogCameraEvent(int level, const char *fmt, ...);
 376 
 377 
 378 // common in platform lib.c
 379 __stdcall void transfer_src_overlay(int which);
 380 __stdcall int GetVRAMHPixelsSize(void);
 381 __stdcall int GetVRAMVPixelsSize(void);
 382 
 383 // kbd.c
 384 __stdcall void GetKbdState(int *phsw);
 385 __stdcall int get_dial_hw_position(int dial);
 386 
 387 // platform / shooting.c
 388 __stdcall void GetImageFolder(char * out,int filecount,int flags,int time);
 389 
 390 // other (sigs etc) - many not tested, may not be 100% correct
 391 __stdcall void * wrapped_malloc(int size);
 392 __stdcall void * malloc_strictly(int size);
 393 __stdcall int TakeSemaphoreStrictly(int sem, int timeout, const char *file, int line);
 394 __stdcall int DeleteSemaphore(int sem);
 395 __stdcall int CreateTaskStrictly (const char *name, int prio, int stack_size,int (*entry)(), int parm /*?*/);
 396 __stdcall int CreateEventFlag(const char *name/*?*/, int v);
 397 __stdcall int CreateEventFlagStrictly(const char *name/*?*/, int v);
 398 __stdcall int CreateBinarySemaphoreStrictly(const char *name, int v);
 399 __stdcall int CreateCountingSemaphore(const char *name, int v);
 400 __stdcall int CreateCountingSemaphoreStrictly(const char *name, int v);
 401 __stdcall int createsemaphore_low(int v,int type, const char *name);
 402 __stdcall int DeleteMessageQueue(int msgq);
 403 __stdcall void dry_memcpy(void *dst, void *src, int n);
 404 __stdcall void bzero(void *p, int n);
 405 __stdcall void memset32(void *p, int n, int v);
 406 __stdcall char *sprintf_FW(char *p, const char *fmt,...);
 407 __stdcall int takesemaphore_low(int sem, int *t);
 408 __stdcall int givesemaphore_low(int sem);
 409 __stdcall void DisableDispatch(void);
 410 __stdcall void EnableDispatch(void);
 411 __stdcall int GetSemaphoreValue(int sem, int *p);
 412 __stdcall int ClearEventFlag(int flag, int what);
 413 __stdcall int TryTakeSemaphore(int sem);
 414 __stdcall int WaitForAnyEventFlag(int flag, int what, int timeout);
 415 __stdcall int ExportToEventProcedure_FW(const char *name, int (*func)());
 416 #ifdef CAM_DRYOS_REL
 417 // vx cams may identify 2 arg version as RegisterEventProcedure
 418 __stdcall int RegisterEventProcedure(const char *name, int (*func)(), int (*func2)());
 419 #endif
 420 __stdcall int RegisterEventProcedure_FW(const char *name, int (*func)());
 421 __stdcall int RegisterEventProcedure_alt1(const char *name, int (*func)());
 422 __stdcall int RegisterEventProcedure_alt2(const char *name, int (*func)());
 423 __stdcall int RegisterEventProcTable(const eventproc_table_entry *defs);
 424 __stdcall int RegisterEventProcTable_alt(const eventproc_table_entry *defs);
 425 __stdcall unsigned ExecuteEventProcedure_FW(const char *name,...);
 426 __stdcall int UnRegisterEventProcedure(const char *name);
 427 __stdcall int CreateTask_low(int (*entry)(),int parm, int unk1, int stack_size, int prio, int unk2, const char *name);
 428 __stdcall int DeleteEventFlag(int flag);
 429 __stdcall int CheckAllEventFlag(int flag, int mask, int *res);
 430 __stdcall int WaitForAllEventFlag(int flag, int what, int timeout);
 431 __stdcall int RegisterInterruptHandler(const char *name, int int_num, int (*int_handler)(),int unk);
 432 __stdcall int CreateMessageQueue(const char *name/*?*/, int unk/*size? Flags?*/);
 433 __stdcall int CreateMessageQueueStrictly(const char *name/*?*/, int unk/*size? Flags?*/);
 434 __stdcall int TryReceiveMessageQueue(int msgq, int *dst);
 435 __stdcall int PostMessageQueue(int msgq,int val,int timeout);
 436 __stdcall int TryPostMessageQueue(int msgq,int val);
 437 __stdcall int GetNumberOfPostedMessages(int msgq,int *res);
 438 
 439 // lower level file IO functions for the *_Fut system
 440 __stdcall FILE * fopen_low(const char *filename, const char *mode);
 441 __stdcall int fclose_low(FILE *f);
 442 __stdcall int fread_low(void *buf, int elsize, int count, FILE *f);
 443 __stdcall int fwrite_low(const void *buf, int elsize, int count, FILE *f);
 444 __stdcall int fseek_low(FILE *f, int offset, int whence);
 445 __stdcall int fflush_low(FILE *f);
 446 __stdcall int feof_low(FILE *f);
 447 __stdcall int fflush_low(FILE *f);
 448 __stdcall char * fgets_low(char *buf, int n, FILE *f);
 449 // called at the start of most fut functions, checks path and takes fileio_semaphore
 450 __stdcall int fut_prepare(const char *name, int unk);
 451 // called at the end of most fut functions, gives fileio_semaphore
 452 __stdcall int fut_finish(int unk);
 453 // even lower level flush, called by _Fut functions, does actual Write
 454 __stdcall int fut_flush(FILE *f);
 455 
 456 __stdcall void set_assert_handler(void (*assert_handler)());
 457 __stdcall void set_exception_handler(void (*exception_handler)());
 458 __stdcall void set_panic_handler(void (*panic_handler)());
 459 
 460 __stdcall int *get_self_task_errno_pointer(void);
 461 __stdcall int get_self_task_id(void);
 462 __stdcall int get_task_properties(int task_id, void *task_props);
 463 __stdcall void dry_error_printf(const char *fmt,...);
 464 __stdcall int CreateTask_alt(const char *name, int prio, int stack_size, void *entry, int parm /*?*/,int core /*?*/);
 465 __stdcall int CreateTaskStrictly_alt(const char *name, int prio, int stack_size,int (*entry)(), int parm /*?*/,int core /*?*/);
 466 
 467 __stdcall int is_movie_recording(void);
 468 
 469 // dryos underlying function, return value is status not time
 470 __stdcall int _GetSystemTime(int *t);
 471 __stdcall unsigned GetSRAndDisableInterrupt(void); //note this actually only returns interrupt mask bit
 472 __stdcall void SetSR(unsigned sr_int_bit); // and this only sets it
 473 
 474 __stdcall int cache_flush_range(int is_data, void *addr, unsigned size); // dry <=52 on pre-digic 6
 475 __stdcall void dcache_flush_range(void *addr, unsigned size); // dry >52, or d6/d7
 476 __stdcall void dcache_clean_range(void *addr, unsigned size); // dry >52, or d6/d7
 477 __stdcall void icache_flush_range(void *addr, unsigned size); // dry >52, or d6/d7
 478 __stdcall void dcache_clean_flush_and_disable(void);
 479 __stdcall void dcache_flush_and_enable(void);
 480 __stdcall void data_synchronization_barrier(void);
 481 
 482 __stdcall void *heap_alloc(void *heap, unsigned size); // used by malloc and other heaps
 483 __stdcall void heap_free(void *heap, void *p);
 484 
 485 __stdcall mzrm_msg * mzrm_createmsg(mzrm_context *ctx, int unk, int msg_type, int payload_size);
 486 __stdcall int mzrm_sendmsg(mzrm_context *ctx, mzrm_msg *msg);
 487 __stdcall void GraphicSystemCoreFinish(void);
 488 __stdcall int GraphicSystemCoreFinish_helper(void);
 489 __stdcall void zicokick_copy(void *dst, void *src, unsigned size);
 490 __stdcall void zicokick_start(void);
 491 
 492 __stdcall void *umalloc_strictly(unsigned size);
 493 __stdcall void dry_memset(void *dst, unsigned n, int c);
 494 __stdcall void dry_memzero(void *dst, unsigned n);
 495 // like dry_memcpy but additional logic for small n and unaligned
 496 __stdcall void dry_memcpy_bytes(void *dst, void *src, unsigned n);
 497 // handles overlap(?)
 498 __stdcall void dry_memmove_bytes(void *dst, void *src, unsigned n);
 499 
 500 __stdcall int GetRomID(void *adr, int unk);
 501 
 502 __stdcall int init_task_error(const char *msg);
 503 __stdcall int dry_panic(int module, int panic_code);
 504 __stdcall int dry_panic_low(int module, int panic_code); // d7 does the actual panic print in a lower level function
 505 
 506 __stdcall void dry_con_printf(const char *fmt,...); // printf to UART
 507 
 508 __stdcall int AcquireRecursiveLock(int lock,int timeout/*?*/);
 509 __stdcall int AcquireRecursiveLockStrictly(int lock,int timeout/*?*/,const char *file, int line);
 510 __stdcall int strstr(const char *s1, const char *s2);
 511 
 512 __stdcall void cameracon_set_state(int state);
 513 __stdcall int cameracon_get_state(void);
 514 
 515 __stdcall int IsControlEventActive_FW(int event);
 516 __stdcall controller_t *CreateController_FW(controller_fn *fn, void *controller_data);
 517 __stdcall int DeleteController_FW(controller_t *controller);
 518 __stdcall int MoveControllerToTopOfZOrder_FW(controller_t *controller);
 519 __stdcall int CtrlMan_ChangeZOrder_FW(controller_t *controller,int order);
 520 __stdcall controller_t *GetSelfControllerHandle_FW(void);
 521 
 522 __stdcall int IsWirelessConnect(void); // returns 1 if wireless active (from scanning for AP to PTP/IP disconnect)
 523 
 524 // on dryos 43+, ui_malloc calls through a pointer in the data segment
 525 // _default is the default value of the pointer, other is the function that calls through the pointer
 526 __stdcall void *ui_malloc(unsigned size);
 527 __stdcall void *ui_malloc_default(unsigned size);
 528 __stdcall void ui_free(void *p);
 529 __stdcall void ui_free_default(void *p);
 530 __stdcall void *pvm_malloc(void *pool, unsigned size);
 531 __stdcall void pvm_free(void *pool, void *p);
 532 __stdcall void pvm_get_largest_free_block_size_ptr(void *pool, unsigned *free_size);
 533 __stdcall int pvm_get_largest_free_block_size(void *pool);
 534 __stdcall void *pvm_init_pool(void *mem, unsigned size);
 535 __stdcall PTM_RestoreUIProperty_FW(int id, void *buf, int size); // normally calls GetParameterData
 536 #endif
 537 

/* [<][>][^][v][top][bottom][index][help] */