lflash.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #define FLASH_FORMAT_VERSION (1 << 8)
  16. #define FLASH_FORMAT_MASK 0xF00
  17. #ifdef LUA_PACK_TVALUES
  18. #ifdef LUA_NUMBER_INTEGRAL
  19. #error "LUA_PACK_TVALUES is only valid for Floating point builds"
  20. #endif
  21. # define FLASH_SIG_B2 0x04
  22. #else
  23. # define FLASH_SIG_B2 0x00
  24. #endif
  25. # define FLASH_SIG_B2_MASK 0x04
  26. #define FLASH_SIG_ABSOLUTE 0x01
  27. #define FLASH_SIG_IN_PROGRESS 0x08
  28. #define FLASH_SIG (0xfafaa050 | FLASH_FORMAT_VERSION |FLASH_SIG_B2 | FLASH_SIG_B1)
  29. typedef lu_int32 FlashAddr;
  30. typedef struct {
  31. lu_int32 flash_sig; /* a stabdard fingerprint identifying an LFS image */
  32. lu_int32 flash_size; /* Size of LFS image */
  33. FlashAddr mainProto; /* address of main Proto in Proto hierarchy */
  34. FlashAddr pROhash; /* address of ROstrt hash */
  35. lu_int32 nROuse; /* number of elements in ROstrt */
  36. int nROsize; /* size of ROstrt */
  37. lu_int32 fill1; /* reserved */
  38. lu_int32 fill2; /* reserved */
  39. } FlashHeader;
  40. LUAI_FUNC void luaN_init (lua_State *L);
  41. LUAI_FUNC int luaN_flashSetup (lua_State *L);
  42. LUAI_FUNC int luaN_reload_reboot (lua_State *L);
  43. LUAI_FUNC int luaN_index (lua_State *L);
  44. #endif