lflash.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. ** lflashe.h
  3. ** See Copyright Notice in lua.h
  4. */
  5. #if defined(LUA_FLASH_STORE) && !defined(lflash_h)
  6. #define lflash_h
  7. #include "lobject.h"
  8. #include "lstate.h"
  9. #include "lzio.h"
  10. #ifdef LUA_NUMBER_INTEGRAL
  11. # define FLASH_SIG_B1 0x02
  12. #else
  13. # define FLASH_SIG_B1 0x00
  14. #endif
  15. #ifdef LUA_PACK_TVALUES
  16. #ifdef LUA_NUMBER_INTEGRAL
  17. #error "LUA_PACK_TVALUES is only valid for Floating point builds"
  18. #endif
  19. # define FLASH_SIG_B2 0x04
  20. #else
  21. # define FLASH_SIG_B2 0x00
  22. #endif
  23. #define FLASH_SIG_ABSOLUTE 0x01
  24. #define FLASH_SIG_IN_PROGRESS 0x08
  25. #define FLASH_SIG (0xfafaaf50 | FLASH_SIG_B2 | FLASH_SIG_B1)
  26. typedef lu_int32 FlashAddr;
  27. typedef struct {
  28. lu_int32 flash_sig; /* a stabdard fingerprint identifying an LFS image */
  29. lu_int32 flash_size; /* Size of LFS image */
  30. FlashAddr mainProto; /* address of main Proto in Proto hierarchy */
  31. FlashAddr pROhash; /* address of ROstrt hash */
  32. lu_int32 nROuse; /* number of elements in ROstrt */
  33. int nROsize; /* size of ROstrt */
  34. lu_int32 fill1; /* reserved */
  35. lu_int32 fill2; /* reserved */
  36. } FlashHeader;
  37. LUAI_FUNC void luaN_init (lua_State *L);
  38. LUAI_FUNC int luaN_flashSetup (lua_State *L);
  39. LUAI_FUNC int luaN_reload_reboot (lua_State *L);
  40. LUAI_FUNC int luaN_index (lua_State *L);
  41. #endif