2018-02-13 22:26:56 +01:00
|
|
|
/*
|
|
|
|
** lflashe.h
|
|
|
|
** See Copyright Notice in lua.h
|
|
|
|
*/
|
|
|
|
|
2019-04-05 17:01:45 +02:00
|
|
|
#ifndef lflash_h
|
2018-02-13 22:26:56 +01:00
|
|
|
#define lflash_h
|
|
|
|
|
|
|
|
#include "lobject.h"
|
|
|
|
#include "lstate.h"
|
|
|
|
#include "lzio.h"
|
|
|
|
|
2018-06-22 23:29:16 +02:00
|
|
|
#ifdef LUA_NUMBER_INTEGRAL
|
2018-04-19 17:27:47 +02:00
|
|
|
# define FLASH_SIG_B1 0x02
|
|
|
|
#else
|
|
|
|
# define FLASH_SIG_B1 0x00
|
|
|
|
#endif
|
2018-09-29 15:57:51 +02:00
|
|
|
#define FLASH_FORMAT_VERSION (1 << 8)
|
|
|
|
#define FLASH_FORMAT_MASK 0xF00
|
2018-04-19 17:27:47 +02:00
|
|
|
#ifdef LUA_PACK_TVALUES
|
2018-06-22 23:29:16 +02:00
|
|
|
#ifdef LUA_NUMBER_INTEGRAL
|
2019-02-17 19:26:29 +01:00
|
|
|
#error "LUA_PACK_TVALUES is only valid for Floating point builds"
|
2018-04-19 17:27:47 +02:00
|
|
|
#endif
|
|
|
|
# define FLASH_SIG_B2 0x04
|
|
|
|
#else
|
|
|
|
# define FLASH_SIG_B2 0x00
|
|
|
|
#endif
|
2018-09-29 15:57:51 +02:00
|
|
|
# define FLASH_SIG_B2_MASK 0x04
|
2018-04-19 17:27:47 +02:00
|
|
|
#define FLASH_SIG_ABSOLUTE 0x01
|
|
|
|
#define FLASH_SIG_IN_PROGRESS 0x08
|
2018-09-29 15:57:51 +02:00
|
|
|
#define FLASH_SIG (0xfafaa050 | FLASH_FORMAT_VERSION |FLASH_SIG_B2 | FLASH_SIG_B1)
|
2018-02-13 22:26:56 +01:00
|
|
|
|
|
|
|
typedef lu_int32 FlashAddr;
|
|
|
|
typedef struct {
|
|
|
|
lu_int32 flash_sig; /* a stabdard fingerprint identifying an LFS image */
|
|
|
|
lu_int32 flash_size; /* Size of LFS image */
|
|
|
|
FlashAddr mainProto; /* address of main Proto in Proto hierarchy */
|
|
|
|
FlashAddr pROhash; /* address of ROstrt hash */
|
|
|
|
lu_int32 nROuse; /* number of elements in ROstrt */
|
|
|
|
int nROsize; /* size of ROstrt */
|
|
|
|
lu_int32 fill1; /* reserved */
|
|
|
|
lu_int32 fill2; /* reserved */
|
|
|
|
} FlashHeader;
|
|
|
|
|
|
|
|
LUAI_FUNC void luaN_init (lua_State *L);
|
|
|
|
#endif
|
|
|
|
|