flash.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef __FLASH
  2. #define __FLASH
  3. #include <default.h>
  4. #define __EM_findEmptySlot _rom_call(void*,(long,short),15F)
  5. /* Begin Auto-Generated Part */
  6. #define NULL ((void*)0)
  7. #ifndef __HAVE_Bool
  8. #define __HAVE_Bool
  9. enum Bool{FALSE,TRUE};
  10. #endif
  11. #ifndef __HAVE_HANDLE
  12. #define __HAVE_HANDLE
  13. typedef unsigned short HANDLE;
  14. #endif
  15. #ifndef __HAVE_size_t
  16. #define __HAVE_size_t
  17. typedef unsigned long size_t;
  18. #endif
  19. typedef struct{unsigned short len;unsigned long hardwareID;unsigned long hardwareRevision;unsigned long bootMajor;unsigned long bootRevision;unsigned long bootBuild;unsigned long gateArray;unsigned long physDisplayBitsWide;unsigned long physDisplayBitsTall;unsigned long LCDBitsWide;unsigned long LCDBitsTall;}HARDWARE_PARM_BLOCK;
  20. #define EM_abandon _rom_call(void,(HANDLE),15B)
  21. #define EM_blockVerifyErase _rom_call(short,(void*),15D)
  22. #define EM_findEmptySlot(s) (__EM_findEmptySlot((s),0))
  23. #define EM_GC _rom_call(short,(short),160)
  24. #define EM_survey _rom_call(void,(__pulong,__pulong,__pulong,__pulong,__pulong,__pulong),165)
  25. #define EM_write _rom_call(void,(const void*,void*,long),167)
  26. #define FL_addCert _rom_call(unsigned short,(void*,long),169)
  27. #define FL_download _rom_call_attr(void,(long),__attribute__((__noreturn__)),16A)
  28. #define FL_getCert _rom_call(void,(HANDLE*,__pulong,short),16C)
  29. #define FL_getHardwareParmBlock() (MIN_AMS<101&&TIOS_entries<0x3CC?(const void*)"\0\x6\0\0\0\x1":_rom_call(const void*,(void),16B)())
  30. #define FL_getVerNum _rom_call(unsigned short,(void),16D)
  31. #define FL_write _rom_call(void,(const void*,void*,long),171)
  32. #define GetAMSSize() ((*((unsigned long*)(((char*)ROM_base)+0x12002)))+0x49)
  33. #if MIN_AMS>=200
  34. #define FlashMemoryEnd ((unsigned char*const)(_rom_call_addr(43D)))
  35. #define BatTooLowFlash _rom_call(short,(short),434)
  36. #endif
  37. /* End Auto-Generated Part */
  38. #endif