Changed most references to crc/csum -> cksum
The reason for this is to move away from the idea that littlefs is strictly bound to CRCs and make the code more welcoming to other checksum types, such as SHA256, etc. Of course, changing the name doesn't really do anything. littlefs actually _is_ strictly bound to CRCs in a couple ways that other filesystems aren't. These would need to have workarounds for other checksum types: - We leverage the parity-preserving nature of (some) CRCs to not have to also calculate the parity of metadata in rbyd commits. - We leverage the linearity of CRCs to retroactively flip the perturb bit in the cksum tag without needing to recalculate the checksum. Though the fact we need to do this is because of how we use parity above, so this may just not be needed for non-CRC checksums. - The plans for global-CRCs (not yet implemented) rely heavily on the mathematical properties of CRC polynomials. This doesn't mean global-CRCs can't work with other checksums, you would just need to find a different type of polynomial.
This commit is contained in:
@@ -385,30 +385,30 @@ static int lfsr_bd_read(lfs_t *lfs,
|
|||||||
block, off, buffer, size);
|
block, off, buffer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO merge lfsr_bd_readcsum/lfsr_bd_csum somehow?
|
// TODO merge lfsr_bd_readcksum/lfsr_bd_cksum somehow?
|
||||||
static int lfsr_bd_readcsum(lfs_t *lfs,
|
static int lfsr_bd_readcksum(lfs_t *lfs,
|
||||||
lfs_block_t block, lfs_off_t off, lfs_size_t hint,
|
lfs_block_t block, lfs_off_t off, lfs_size_t hint,
|
||||||
void *buffer, lfs_size_t size,
|
void *buffer, lfs_size_t size,
|
||||||
uint32_t *csum_) {
|
uint32_t *cksum_) {
|
||||||
int err = lfsr_bd_read(lfs, block, off, hint, buffer, size);
|
int err = lfsr_bd_read(lfs, block, off, hint, buffer, size);
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
*csum_ = lfs_crc32c(*csum_, buffer, size);
|
*cksum_ = lfs_crc32c(*cksum_, buffer, size);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lfsr_bd_csum(lfs_t *lfs,
|
static int lfsr_bd_cksum(lfs_t *lfs,
|
||||||
lfs_block_t block, lfs_off_t off, lfs_size_t hint, lfs_size_t size,
|
lfs_block_t block, lfs_off_t off, lfs_size_t hint, lfs_size_t size,
|
||||||
uint32_t *crc_) {
|
uint32_t *cksum_) {
|
||||||
// check for in-bounds
|
// check for in-bounds
|
||||||
if (off+size > lfs->cfg->block_size) {
|
if (off+size > lfs->cfg->block_size) {
|
||||||
return LFS_ERR_RANGE;
|
return LFS_ERR_RANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return lfs_bd_crc32c(lfs, &lfs->pcache, &lfs->rcache, hint,
|
return lfs_bd_crc32c(lfs, &lfs->pcache, &lfs->rcache, hint,
|
||||||
block, off, size, crc_);
|
block, off, size, cksum_);
|
||||||
}
|
}
|
||||||
|
|
||||||
static lfs_scmp_t lfsr_bd_cmp(lfs_t *lfs,
|
static lfs_scmp_t lfsr_bd_cmp(lfs_t *lfs,
|
||||||
@@ -426,7 +426,7 @@ static lfs_scmp_t lfsr_bd_cmp(lfs_t *lfs,
|
|||||||
// program data with optional checksum
|
// program data with optional checksum
|
||||||
static int lfsr_bd_prog(lfs_t *lfs, lfs_block_t block, lfs_off_t off,
|
static int lfsr_bd_prog(lfs_t *lfs, lfs_block_t block, lfs_off_t off,
|
||||||
const void *buffer, lfs_size_t size,
|
const void *buffer, lfs_size_t size,
|
||||||
uint32_t *csum_) {
|
uint32_t *cksum_) {
|
||||||
// check for in-bounds
|
// check for in-bounds
|
||||||
if (off+size > lfs->cfg->block_size) {
|
if (off+size > lfs->cfg->block_size) {
|
||||||
lfs_cache_zero(lfs, &lfs->pcache);
|
lfs_cache_zero(lfs, &lfs->pcache);
|
||||||
@@ -440,8 +440,8 @@ static int lfsr_bd_prog(lfs_t *lfs, lfs_block_t block, lfs_off_t off,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// optional checksum
|
// optional checksum
|
||||||
if (csum_) {
|
if (cksum_) {
|
||||||
*csum_ = lfs_crc32c(*csum_, buffer, size);
|
*cksum_ = lfs_crc32c(*cksum_, buffer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -455,7 +455,7 @@ static int lfsr_bd_sync(lfs_t *lfs) {
|
|||||||
// be an optional ifdef?
|
// be an optional ifdef?
|
||||||
static int lfsr_bd_progvalidate(lfs_t *lfs, lfs_block_t block, lfs_off_t off,
|
static int lfsr_bd_progvalidate(lfs_t *lfs, lfs_block_t block, lfs_off_t off,
|
||||||
const void *buffer, lfs_size_t size,
|
const void *buffer, lfs_size_t size,
|
||||||
uint32_t *csum_) {
|
uint32_t *cksum_) {
|
||||||
// check for in-bounds
|
// check for in-bounds
|
||||||
if (off+size > lfs->cfg->block_size) {
|
if (off+size > lfs->cfg->block_size) {
|
||||||
lfs_cache_zero(lfs, &lfs->pcache);
|
lfs_cache_zero(lfs, &lfs->pcache);
|
||||||
@@ -468,8 +468,8 @@ static int lfsr_bd_progvalidate(lfs_t *lfs, lfs_block_t block, lfs_off_t off,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (csum_) {
|
if (cksum_) {
|
||||||
*csum_ = lfs_crc32c(*csum_, buffer, size);
|
*cksum_ = lfs_crc32c(*cksum_, buffer, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -629,8 +629,8 @@ enum lfsr_tag_type {
|
|||||||
LFSR_TAG_ALTBGT = 0x6000,
|
LFSR_TAG_ALTBGT = 0x6000,
|
||||||
LFSR_TAG_ALTRGT = 0x7000,
|
LFSR_TAG_ALTRGT = 0x7000,
|
||||||
|
|
||||||
LFSR_TAG_CRC = 0x2000,
|
LFSR_TAG_CKSUM = 0x2000,
|
||||||
LFSR_TAG_FCRC = 0x2100,
|
LFSR_TAG_FCKSUM = 0x2100,
|
||||||
|
|
||||||
// in-device only
|
// in-device only
|
||||||
LFSR_TAG_MOVE = 0x0800,
|
LFSR_TAG_MOVE = 0x0800,
|
||||||
@@ -916,7 +916,7 @@ static inline void lfsr_tag_trim2(
|
|||||||
static lfs_ssize_t lfsr_bd_readtag(lfs_t *lfs,
|
static lfs_ssize_t lfsr_bd_readtag(lfs_t *lfs,
|
||||||
lfs_block_t block, lfs_off_t off, lfs_size_t hint,
|
lfs_block_t block, lfs_off_t off, lfs_size_t hint,
|
||||||
lfsr_tag_t *tag_, lfs_size_t *weight_, lfs_size_t *size_,
|
lfsr_tag_t *tag_, lfs_size_t *weight_, lfs_size_t *size_,
|
||||||
uint32_t *csum_) {
|
uint32_t *cksum_) {
|
||||||
// read the largest possible tag size
|
// read the largest possible tag size
|
||||||
uint8_t tag_buf[LFSR_TAG_DSIZE];
|
uint8_t tag_buf[LFSR_TAG_DSIZE];
|
||||||
lfs_size_t tag_dsize = lfs_min32(LFSR_TAG_DSIZE, lfs->cfg->block_size-off);
|
lfs_size_t tag_dsize = lfs_min32(LFSR_TAG_DSIZE, lfs->cfg->block_size-off);
|
||||||
@@ -933,7 +933,7 @@ static lfs_ssize_t lfsr_bd_readtag(lfs_t *lfs,
|
|||||||
| ((lfsr_tag_t)tag_buf[1] << 0);
|
| ((lfsr_tag_t)tag_buf[1] << 0);
|
||||||
ssize_t d = 2;
|
ssize_t d = 2;
|
||||||
|
|
||||||
if (csum_) {
|
if (cksum_) {
|
||||||
// on-disk, the tags valid bit must reflect the parity of the
|
// on-disk, the tags valid bit must reflect the parity of the
|
||||||
// preceding data, fortunately for crc32c, this is the same as the
|
// preceding data, fortunately for crc32c, this is the same as the
|
||||||
// parity of the crc
|
// parity of the crc
|
||||||
@@ -941,7 +941,7 @@ static lfs_ssize_t lfsr_bd_readtag(lfs_t *lfs,
|
|||||||
// note we need to do this before leb128 decoding as we may not have
|
// note we need to do this before leb128 decoding as we may not have
|
||||||
// valid leb128 if we're erased, but we shouldn't treat a truncated
|
// valid leb128 if we're erased, but we shouldn't treat a truncated
|
||||||
// leb128 here as corruption
|
// leb128 here as corruption
|
||||||
if ((tag >> 15) != (lfs_popc(*csum_) & 1)) {
|
if ((tag >> 15) != (lfs_popc(*cksum_) & 1)) {
|
||||||
return LFS_ERR_INVAL;
|
return LFS_ERR_INVAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -968,9 +968,9 @@ static lfs_ssize_t lfsr_bd_readtag(lfs_t *lfs,
|
|||||||
return LFS_ERR_CORRUPT;
|
return LFS_ERR_CORRUPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// optionally crc
|
// optional checksum
|
||||||
if (csum_) {
|
if (cksum_) {
|
||||||
*csum_ = lfs_crc32c(*csum_, tag_buf, d);
|
*cksum_ = lfs_crc32c(*cksum_, tag_buf, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
// save what we found, clearing the valid bit from the tag, note we
|
// save what we found, clearing the valid bit from the tag, note we
|
||||||
@@ -984,13 +984,13 @@ static lfs_ssize_t lfsr_bd_readtag(lfs_t *lfs,
|
|||||||
static lfs_ssize_t lfsr_bd_progtag(lfs_t *lfs,
|
static lfs_ssize_t lfsr_bd_progtag(lfs_t *lfs,
|
||||||
lfs_block_t block, lfs_off_t off,
|
lfs_block_t block, lfs_off_t off,
|
||||||
lfsr_tag_t tag, lfs_size_t weight, lfs_size_t size,
|
lfsr_tag_t tag, lfs_size_t weight, lfs_size_t size,
|
||||||
uint32_t *csum_) {
|
uint32_t *cksum_) {
|
||||||
// check for underflow issues
|
// check for underflow issues
|
||||||
LFS_ASSERT(weight < 0x80000000);
|
LFS_ASSERT(weight < 0x80000000);
|
||||||
LFS_ASSERT(size < 0x80000000);
|
LFS_ASSERT(size < 0x80000000);
|
||||||
|
|
||||||
// make sure to include the parity of the current crc
|
// make sure to include the parity of the current crc
|
||||||
tag |= (lfs_popc(*csum_) & 1) << 15;
|
tag |= (lfs_popc(*cksum_) & 1) << 15;
|
||||||
|
|
||||||
// encode into a be16 and pair of leb128s
|
// encode into a be16 and pair of leb128s
|
||||||
uint8_t tag_buf[LFSR_TAG_DSIZE];
|
uint8_t tag_buf[LFSR_TAG_DSIZE];
|
||||||
@@ -1010,7 +1010,7 @@ static lfs_ssize_t lfsr_bd_progtag(lfs_t *lfs,
|
|||||||
}
|
}
|
||||||
d += d_;
|
d += d_;
|
||||||
|
|
||||||
int err = lfsr_bd_prog(lfs, block, off, &tag_buf, d, csum_);
|
int err = lfsr_bd_prog(lfs, block, off, &tag_buf, d, cksum_);
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -1184,7 +1184,7 @@ static lfs_scmp_t lfsr_data_namecmp(lfs_t *lfs, lfsr_data_t data,
|
|||||||
static int lfsr_bd_progdata(lfs_t *lfs,
|
static int lfsr_bd_progdata(lfs_t *lfs,
|
||||||
lfs_block_t block, lfs_off_t off,
|
lfs_block_t block, lfs_off_t off,
|
||||||
lfsr_data_t data,
|
lfsr_data_t data,
|
||||||
uint32_t *csum_) {
|
uint32_t *cksum_) {
|
||||||
if (lfsr_data_ondisk(data)) {
|
if (lfsr_data_ondisk(data)) {
|
||||||
// TODO byte-level copies have been a pain point, works for prototyping
|
// TODO byte-level copies have been a pain point, works for prototyping
|
||||||
// but can this be better? configurable? leverage
|
// but can this be better? configurable? leverage
|
||||||
@@ -1200,7 +1200,7 @@ static int lfsr_bd_progdata(lfs_t *lfs,
|
|||||||
|
|
||||||
err = lfsr_bd_prog(lfs, block, off+i,
|
err = lfsr_bd_prog(lfs, block, off+i,
|
||||||
&dat, 1,
|
&dat, 1,
|
||||||
csum_);
|
cksum_);
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -1218,7 +1218,7 @@ static int lfsr_bd_progdata(lfs_t *lfs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int err = lfsr_bd_prog(lfs, block, off,
|
int err = lfsr_bd_prog(lfs, block, off,
|
||||||
did_buf, did_dsize, csum_);
|
did_buf, did_dsize, cksum_);
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -1229,7 +1229,7 @@ static int lfsr_bd_progdata(lfs_t *lfs,
|
|||||||
|
|
||||||
int err = lfsr_bd_prog(lfs, block, off,
|
int err = lfsr_bd_prog(lfs, block, off,
|
||||||
data.buf.buffer, lfsr_data_size(data),
|
data.buf.buffer, lfsr_data_size(data),
|
||||||
csum_);
|
cksum_);
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -1429,24 +1429,24 @@ typedef struct lfsr_attr {
|
|||||||
//#endif
|
//#endif
|
||||||
|
|
||||||
|
|
||||||
// fcrc on-disk encoding
|
// fcksum on-disk encoding
|
||||||
typedef struct lfsr_fcrc {
|
typedef struct lfsr_fcksum {
|
||||||
uint32_t crc;
|
uint32_t cksum;
|
||||||
lfs_size_t size;
|
lfs_size_t size;
|
||||||
} lfsr_fcrc_t;
|
} lfsr_fcksum_t;
|
||||||
|
|
||||||
// 1 leb128 + 1 crc32c => 9 bytes (worst case)
|
// 1 leb128 + 1 crc32c => 9 bytes (worst case)
|
||||||
#define LFSR_FCRC_DSIZE (5+4)
|
#define LFSR_FCKSUM_DSIZE (5+4)
|
||||||
|
|
||||||
static lfs_ssize_t lfsr_fcrc_todisk(lfs_t *lfs, const lfsr_fcrc_t *fcrc,
|
static lfs_ssize_t lfsr_fcksum_todisk(lfs_t *lfs, const lfsr_fcksum_t *fcksum,
|
||||||
uint8_t buffer[static LFSR_FCRC_DSIZE]) {
|
uint8_t buffer[static LFSR_FCKSUM_DSIZE]) {
|
||||||
(void)lfs;
|
(void)lfs;
|
||||||
lfs_ssize_t d = 0;
|
lfs_ssize_t d = 0;
|
||||||
|
|
||||||
lfs_tole32_(fcrc->crc, &buffer[d]);
|
lfs_tole32_(fcksum->cksum, &buffer[d]);
|
||||||
d += 4;
|
d += 4;
|
||||||
|
|
||||||
lfs_ssize_t d_ = lfs_toleb128(fcrc->size, &buffer[d], 5);
|
lfs_ssize_t d_ = lfs_toleb128(fcksum->size, &buffer[d], 5);
|
||||||
if (d_ < 0) {
|
if (d_ < 0) {
|
||||||
return d_;
|
return d_;
|
||||||
}
|
}
|
||||||
@@ -1455,16 +1455,16 @@ static lfs_ssize_t lfsr_fcrc_todisk(lfs_t *lfs, const lfsr_fcrc_t *fcrc,
|
|||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
static lfs_ssize_t lfsr_fcrc_fromdisk(lfs_t *lfs, lfsr_fcrc_t *fcrc,
|
static lfs_ssize_t lfsr_fcksum_fromdisk(lfs_t *lfs, lfsr_fcksum_t *fcksum,
|
||||||
lfsr_data_t data) {
|
lfsr_data_t data) {
|
||||||
lfs_ssize_t d = 0;
|
lfs_ssize_t d = 0;
|
||||||
lfs_ssize_t d_ = lfsr_data_readle32(lfs, data, d, &fcrc->crc);
|
lfs_ssize_t d_ = lfsr_data_readle32(lfs, data, d, &fcksum->cksum);
|
||||||
if (d_ < 0) {
|
if (d_ < 0) {
|
||||||
return d_;
|
return d_;
|
||||||
}
|
}
|
||||||
d += d_;
|
d += d_;
|
||||||
|
|
||||||
d_ = lfsr_data_readleb128(lfs, data, d, &fcrc->size);
|
d_ = lfsr_data_readleb128(lfs, data, d, &fcksum->size);
|
||||||
if (d_ < 0) {
|
if (d_ < 0) {
|
||||||
return d_;
|
return d_;
|
||||||
}
|
}
|
||||||
@@ -1776,7 +1776,7 @@ static bool lfsr_rbyd_isfetched(const lfsr_rbyd_t *rbyd) {
|
|||||||
|
|
||||||
// allocate an rbyd block
|
// allocate an rbyd block
|
||||||
static int lfsr_rbyd_alloc(lfs_t *lfs, lfsr_rbyd_t *rbyd) {
|
static int lfsr_rbyd_alloc(lfs_t *lfs, lfsr_rbyd_t *rbyd) {
|
||||||
*rbyd = (lfsr_rbyd_t){.weight=0, .trunk=0, .off=0, .crc=0};
|
*rbyd = (lfsr_rbyd_t){.weight=0, .trunk=0, .off=0, .cksum=0};
|
||||||
int err = lfs_alloc(lfs, &rbyd->block);
|
int err = lfs_alloc(lfs, &rbyd->block);
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
@@ -1792,10 +1792,10 @@ static int lfsr_rbyd_alloc(lfs_t *lfs, lfsr_rbyd_t *rbyd) {
|
|||||||
|
|
||||||
static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
||||||
lfs_block_t block, lfs_size_t trunk) {
|
lfs_block_t block, lfs_size_t trunk) {
|
||||||
// checksum the revision count to get the crc started
|
// checksum the revision count to get the cksum started
|
||||||
uint32_t crc = 0;
|
uint32_t cksum = 0;
|
||||||
int err = lfsr_bd_csum(lfs, block, 0, lfs->cfg->block_size,
|
int err = lfsr_bd_cksum(lfs, block, 0, lfs->cfg->block_size,
|
||||||
sizeof(uint32_t), &crc);
|
sizeof(uint32_t), &cksum);
|
||||||
if (err) {
|
if (err) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
@@ -1804,7 +1804,7 @@ static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
rbyd->off = 0;
|
rbyd->off = 0;
|
||||||
rbyd->trunk = 0;
|
rbyd->trunk = 0;
|
||||||
|
|
||||||
// temporary state until we validate a crc
|
// temporary state until we validate a cksum
|
||||||
lfs_off_t off = sizeof(uint32_t);
|
lfs_off_t off = sizeof(uint32_t);
|
||||||
lfs_off_t trunk_ = 0;
|
lfs_off_t trunk_ = 0;
|
||||||
bool wastrunk = false;
|
bool wastrunk = false;
|
||||||
@@ -1812,18 +1812,18 @@ static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
lfs_size_t weight_ = 0;
|
lfs_size_t weight_ = 0;
|
||||||
|
|
||||||
// assume unerased until proven otherwise
|
// assume unerased until proven otherwise
|
||||||
lfsr_fcrc_t fcrc;
|
lfsr_fcksum_t fcksum;
|
||||||
bool hasfcrc = false;
|
bool hasfcksum = false;
|
||||||
bool maybeerased = false;
|
bool maybeerased = false;
|
||||||
|
|
||||||
// scan tags, checking valid bits, crcs, etc
|
// scan tags, checking valid bits, cksums, etc
|
||||||
while (off < lfs->cfg->block_size && (!trunk || rbyd->off <= trunk)) {
|
while (off < lfs->cfg->block_size && (!trunk || rbyd->off <= trunk)) {
|
||||||
lfsr_tag_t tag;
|
lfsr_tag_t tag;
|
||||||
lfs_size_t weight__;
|
lfs_size_t weight__;
|
||||||
lfs_size_t size;
|
lfs_size_t size;
|
||||||
lfs_ssize_t d = lfsr_bd_readtag(lfs,
|
lfs_ssize_t d = lfsr_bd_readtag(lfs,
|
||||||
block, off, lfs->cfg->block_size,
|
block, off, lfs->cfg->block_size,
|
||||||
&tag, &weight__, &size, &crc);
|
&tag, &weight__, &size, &cksum);
|
||||||
if (d < 0) {
|
if (d < 0) {
|
||||||
if (d == LFS_ERR_INVAL || d == LFS_ERR_CORRUPT) {
|
if (d == LFS_ERR_INVAL || d == LFS_ERR_CORRUPT) {
|
||||||
maybeerased = maybeerased && d == LFS_ERR_INVAL;
|
maybeerased = maybeerased && d == LFS_ERR_INVAL;
|
||||||
@@ -1838,11 +1838,11 @@ static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// not an end-of-commit crc
|
// not an end-of-commit cksum
|
||||||
if (!lfsr_tag_isalt(tag) && lfsr_tag_suptype(tag) != LFSR_TAG_CRC) {
|
if (!lfsr_tag_isalt(tag) && lfsr_tag_suptype(tag) != LFSR_TAG_CKSUM) {
|
||||||
// crc the entry, hopefully leaving it in the cache
|
// cksum the entry, hopefully leaving it in the cache
|
||||||
err = lfsr_bd_csum(lfs, block, off, lfs->cfg->block_size, size,
|
err = lfsr_bd_cksum(lfs, block, off, lfs->cfg->block_size, size,
|
||||||
&crc);
|
&cksum);
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err == LFS_ERR_CORRUPT) {
|
if (err == LFS_ERR_CORRUPT) {
|
||||||
break;
|
break;
|
||||||
@@ -1850,11 +1850,11 @@ static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
// found an fcrc? save for later
|
// found an fcksum? save for later
|
||||||
if (tag == LFSR_TAG_FCRC) {
|
if (tag == LFSR_TAG_FCKSUM) {
|
||||||
uint8_t fcrc_buf[LFSR_FCRC_DSIZE];
|
uint8_t fcksum_buf[LFSR_FCKSUM_DSIZE];
|
||||||
err = lfsr_bd_read(lfs, block, off, lfs->cfg->block_size,
|
err = lfsr_bd_read(lfs, block, off, lfs->cfg->block_size,
|
||||||
fcrc_buf, lfs_min32(size, LFSR_FCRC_DSIZE));
|
fcksum_buf, lfs_min32(size, LFSR_FCKSUM_DSIZE));
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err == LFS_ERR_CORRUPT) {
|
if (err == LFS_ERR_CORRUPT) {
|
||||||
break;
|
break;
|
||||||
@@ -1862,48 +1862,48 @@ static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
lfs_ssize_t fcrc_dsize = lfsr_fcrc_fromdisk(lfs, &fcrc,
|
lfs_ssize_t fcksum_dsize = lfsr_fcksum_fromdisk(lfs, &fcksum,
|
||||||
LFSR_DATA_BUF(fcrc_buf,
|
LFSR_DATA_BUF(fcksum_buf,
|
||||||
lfs_min32(size, LFSR_FCRC_DSIZE)));
|
lfs_min32(size, LFSR_FCKSUM_DSIZE)));
|
||||||
if (fcrc_dsize < 0 && fcrc_dsize != LFS_ERR_CORRUPT) {
|
if (fcksum_dsize < 0 && fcksum_dsize != LFS_ERR_CORRUPT) {
|
||||||
return fcrc_dsize;
|
return fcksum_dsize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore malformed fcrcs
|
// ignore malformed fcksums
|
||||||
hasfcrc = (fcrc_dsize != LFS_ERR_CORRUPT);
|
hasfcksum = (fcksum_dsize != LFS_ERR_CORRUPT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// is an end-of-commit crc
|
// is an end-of-commit cksum
|
||||||
} else if (!lfsr_tag_isalt(tag)) {
|
} else if (!lfsr_tag_isalt(tag)) {
|
||||||
uint32_t crc_ = 0;
|
uint32_t cksum_ = 0;
|
||||||
err = lfsr_bd_read(lfs, block, off, lfs->cfg->block_size,
|
err = lfsr_bd_read(lfs, block, off, lfs->cfg->block_size,
|
||||||
&crc_, sizeof(uint32_t));
|
&cksum_, sizeof(uint32_t));
|
||||||
if (err) {
|
if (err) {
|
||||||
if (err == LFS_ERR_CORRUPT) {
|
if (err == LFS_ERR_CORRUPT) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
crc_ = lfs_fromle32_(&crc_);
|
cksum_ = lfs_fromle32_(&cksum_);
|
||||||
|
|
||||||
if (crc != crc_) {
|
if (cksum != cksum_) {
|
||||||
// uh oh, crcs don't match
|
// uh oh, cksums don't match
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// toss our crc into the filesystem seed for
|
// toss our cksum into the filesystem seed for
|
||||||
// pseudorandom numbers, note we use another crc here
|
// pseudorandom numbers, note we use another cksum here
|
||||||
// as a collection function because it is sufficiently
|
// as a collection function because it is sufficiently
|
||||||
// random and convenient
|
// random and convenient
|
||||||
lfs->seed = lfs_crc32c(lfs->seed, &crc, sizeof(uint32_t));
|
lfs->seed = lfs_crc32c(lfs->seed, &cksum, sizeof(uint32_t));
|
||||||
|
|
||||||
// fcrc appears valid so far
|
// fcksum appears valid so far
|
||||||
maybeerased = hasfcrc;
|
maybeerased = hasfcksum;
|
||||||
hasfcrc = false;
|
hasfcksum = false;
|
||||||
|
|
||||||
// save what we've found so far
|
// save what we've found so far
|
||||||
rbyd->off = off + size;
|
rbyd->off = off + size;
|
||||||
rbyd->crc = crc;
|
rbyd->cksum = cksum;
|
||||||
rbyd->trunk = trunk_;
|
rbyd->trunk = trunk_;
|
||||||
rbyd->weight = weight;
|
rbyd->weight = weight;
|
||||||
}
|
}
|
||||||
@@ -1925,7 +1925,7 @@ static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
// NOTE we can't check for overflow/underflow here because we
|
// NOTE we can't check for overflow/underflow here because we
|
||||||
// may be overeagerly parsing an invalid commit, it's ok for
|
// may be overeagerly parsing an invalid commit, it's ok for
|
||||||
// this to overflow/underflow as long as we throw it out later
|
// this to overflow/underflow as long as we throw it out later
|
||||||
// on a bad crc
|
// on a bad cksum
|
||||||
weight_ += weight__;
|
weight_ += weight__;
|
||||||
|
|
||||||
// end of trunk?
|
// end of trunk?
|
||||||
@@ -1949,18 +1949,18 @@ static int lfsr_rbyd_fetch(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
// did we end on a valid commit? we may have an erased block
|
// did we end on a valid commit? we may have an erased block
|
||||||
bool erased = false;
|
bool erased = false;
|
||||||
if (maybeerased && rbyd->off % lfs->cfg->prog_size == 0) {
|
if (maybeerased && rbyd->off % lfs->cfg->prog_size == 0) {
|
||||||
// check for an fcrc matching the next prog's erased state, if
|
// check for an fcksum matching the next prog's erased state, if
|
||||||
// this failed most likely a previous prog was interrupted, we
|
// this failed most likely a previous prog was interrupted, we
|
||||||
// need a new erase
|
// need a new erase
|
||||||
uint32_t fcrc_ = 0;
|
uint32_t fcksum_ = 0;
|
||||||
int err = lfsr_bd_csum(lfs, rbyd->block, rbyd->off, 0, fcrc.size,
|
int err = lfsr_bd_cksum(lfs, rbyd->block, rbyd->off, 0, fcksum.size,
|
||||||
&fcrc_);
|
&fcksum_);
|
||||||
if (err && err != LFS_ERR_CORRUPT) {
|
if (err && err != LFS_ERR_CORRUPT) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
// found beginning of erased part?
|
// found beginning of erased part?
|
||||||
erased = (fcrc_ == fcrc.crc);
|
erased = (fcksum_ == fcksum.cksum);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!erased) {
|
if (!erased) {
|
||||||
@@ -2104,7 +2104,7 @@ static int lfsr_rbyd_appendrev(lfs_t *lfs, lfsr_rbyd_t *rbyd, uint32_t rev) {
|
|||||||
uint8_t rev_buf[sizeof(uint32_t)];
|
uint8_t rev_buf[sizeof(uint32_t)];
|
||||||
lfs_tole32_(rev, &rev_buf);
|
lfs_tole32_(rev, &rev_buf);
|
||||||
int err = lfsr_bd_prog(lfs, rbyd->block, rbyd->off,
|
int err = lfsr_bd_prog(lfs, rbyd->block, rbyd->off,
|
||||||
&rev_buf, sizeof(uint32_t), &rbyd->crc);
|
&rev_buf, sizeof(uint32_t), &rbyd->cksum);
|
||||||
if (err) {
|
if (err) {
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
@@ -2135,7 +2135,7 @@ static int lfsr_rbyd_p_flush(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
|
|
||||||
lfs_ssize_t d = lfsr_bd_progtag(lfs, rbyd->block, rbyd->off,
|
lfs_ssize_t d = lfsr_bd_progtag(lfs, rbyd->block, rbyd->off,
|
||||||
alt, weight, jump,
|
alt, weight, jump,
|
||||||
&rbyd->crc);
|
&rbyd->cksum);
|
||||||
if (d < 0) {
|
if (d < 0) {
|
||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
@@ -2707,7 +2707,7 @@ leaf:;
|
|||||||
(lfsr_tag_isrm(tag) ? LFSR_TAG_NULL : lfsr_tag_key(tag)),
|
(lfsr_tag_isrm(tag) ? LFSR_TAG_NULL : lfsr_tag_key(tag)),
|
||||||
upper_rid - lower_rid - 1 + delta,
|
upper_rid - lower_rid - 1 + delta,
|
||||||
lfsr_data_size(data),
|
lfsr_data_size(data),
|
||||||
&rbyd->crc);
|
&rbyd->cksum);
|
||||||
if (d < 0) {
|
if (d < 0) {
|
||||||
err = d;
|
err = d;
|
||||||
goto failed;
|
goto failed;
|
||||||
@@ -2716,7 +2716,7 @@ leaf:;
|
|||||||
|
|
||||||
// don't forget the data!
|
// don't forget the data!
|
||||||
err = lfsr_bd_progdata(lfs, rbyd->block, rbyd->off, data,
|
err = lfsr_bd_progdata(lfs, rbyd->block, rbyd->off, data,
|
||||||
&rbyd->crc);
|
&rbyd->cksum);
|
||||||
if (err) {
|
if (err) {
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
@@ -2901,7 +2901,7 @@ static int lfsr_rbyd_compact(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
// write the tag
|
// write the tag
|
||||||
lfs_ssize_t d = lfsr_bd_progtag(lfs, rbyd->block, rbyd->off,
|
lfs_ssize_t d = lfsr_bd_progtag(lfs, rbyd->block, rbyd->off,
|
||||||
tag, weight, lfsr_data_size(data),
|
tag, weight, lfsr_data_size(data),
|
||||||
&rbyd->crc);
|
&rbyd->cksum);
|
||||||
if (d < 0) {
|
if (d < 0) {
|
||||||
err = d;
|
err = d;
|
||||||
goto failed;
|
goto failed;
|
||||||
@@ -2910,7 +2910,7 @@ static int lfsr_rbyd_compact(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
|
|
||||||
// and the data
|
// and the data
|
||||||
err = lfsr_bd_progdata(lfs, rbyd->block, rbyd->off, data,
|
err = lfsr_bd_progdata(lfs, rbyd->block, rbyd->off, data,
|
||||||
&rbyd->crc);
|
&rbyd->cksum);
|
||||||
if (err) {
|
if (err) {
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
@@ -2976,7 +2976,7 @@ static int lfsr_rbyd_compact(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
LFSR_TAG_ALTLE(false, lfsr_tag_key(trunk_tag)),
|
LFSR_TAG_ALTLE(false, lfsr_tag_key(trunk_tag)),
|
||||||
trunk_weight,
|
trunk_weight,
|
||||||
rbyd->off - trunk_off,
|
rbyd->off - trunk_off,
|
||||||
&rbyd->crc);
|
&rbyd->cksum);
|
||||||
if (d < 0) {
|
if (d < 0) {
|
||||||
err = d;
|
err = d;
|
||||||
goto failed;
|
goto failed;
|
||||||
@@ -2987,7 +2987,7 @@ static int lfsr_rbyd_compact(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
// terminate with a null tag
|
// terminate with a null tag
|
||||||
lfs_ssize_t d = lfsr_bd_progtag(lfs, rbyd->block, rbyd->off,
|
lfs_ssize_t d = lfsr_bd_progtag(lfs, rbyd->block, rbyd->off,
|
||||||
LFSR_TAG_NULL, 0, 0,
|
LFSR_TAG_NULL, 0, 0,
|
||||||
&rbyd->crc);
|
&rbyd->cksum);
|
||||||
if (d < 0) {
|
if (d < 0) {
|
||||||
err = d;
|
err = d;
|
||||||
goto failed;
|
goto failed;
|
||||||
@@ -3082,32 +3082,32 @@ static int lfsr_rbyd_commit(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
|
|
||||||
// align to the next prog unit
|
// align to the next prog unit
|
||||||
//
|
//
|
||||||
// this gets a bit complicated as we have two types of crcs:
|
// this gets a bit complicated as we have two types of cksums:
|
||||||
//
|
//
|
||||||
// - 9-word crc with fcrc to check following prog (middle of block)
|
// - 9-word cksum with fcksum to check following prog (middle of block)
|
||||||
// - fcrc tag type => 2 byte le16
|
// - fcksum tag type => 2 byte le16
|
||||||
// - fcrc tag rid => 1 byte leb128
|
// - fcksum tag rid => 1 byte leb128
|
||||||
// - fcrc tag size => 1 byte leb128 (worst case)
|
// - fcksum tag size => 1 byte leb128 (worst case)
|
||||||
// - fcrc crc => 4 byte le32
|
// - fcksum crc32c => 4 byte le32
|
||||||
// - fcrc size => 5 byte leb128 (worst case)
|
// - fcksum size => 5 byte leb128 (worst case)
|
||||||
// - crc tag type => 2 byte le16
|
// - cksum tag type => 2 byte le16
|
||||||
// - crc tag rid => 1 byte leb128
|
// - cksum tag rid => 1 byte leb128
|
||||||
// - crc tag size => 5 byte leb128 (worst case)
|
// - cksum tag size => 5 byte leb128 (worst case)
|
||||||
// - crc crc => 4 byte le32
|
// - cksum crc32c => 4 byte le32
|
||||||
// => 25 bytes total
|
// => 25 bytes total
|
||||||
//
|
//
|
||||||
// - 4-word crc with no following prog (end of block)
|
// - 4-word cksum with no following prog (end of block)
|
||||||
// - crc tag type => 2 byte le16
|
// - cksum tag type => 2 byte le16
|
||||||
// - crc tag rid => 1 byte leb128
|
// - cksum tag rid => 1 byte leb128
|
||||||
// - crc tag size => 5 byte leb128 (worst case)
|
// - cksum tag size => 5 byte leb128 (worst case)
|
||||||
// - crc crc => 4 byte le32
|
// - cksum crc32c => 4 byte le32
|
||||||
// => 12 bytes total
|
// => 12 bytes total
|
||||||
//
|
//
|
||||||
lfs_off_t aligned = lfs_alignup(
|
lfs_off_t aligned = lfs_alignup(
|
||||||
rbyd_.off + 2+1+1+4+5 + 2+1+5+4,
|
rbyd_.off + 2+1+1+4+5 + 2+1+5+4,
|
||||||
lfs->cfg->prog_size);
|
lfs->cfg->prog_size);
|
||||||
|
|
||||||
// space for fcrc?
|
// space for fcksum?
|
||||||
uint8_t perturb = 0;
|
uint8_t perturb = 0;
|
||||||
if (aligned < lfs->cfg->block_size) {
|
if (aligned < lfs->cfg->block_size) {
|
||||||
// read the leading byte in case we need to change the expected
|
// read the leading byte in case we need to change the expected
|
||||||
@@ -3119,21 +3119,21 @@ static int lfsr_rbyd_commit(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
// find the expected fcrc, don't bother avoiding a reread of the
|
// find the expected fcksum, don't bother avoiding a reread of the
|
||||||
// perturb byte, as it should still be in our cache
|
// perturb byte, as it should still be in our cache
|
||||||
lfsr_fcrc_t fcrc = {.crc=0, .size=lfs->cfg->prog_size};
|
lfsr_fcksum_t fcksum = {.cksum=0, .size=lfs->cfg->prog_size};
|
||||||
err = lfsr_bd_csum(lfs, rbyd_.block, aligned, lfs->cfg->prog_size,
|
err = lfsr_bd_cksum(lfs, rbyd_.block, aligned, lfs->cfg->prog_size,
|
||||||
lfs->cfg->prog_size,
|
lfs->cfg->prog_size,
|
||||||
&fcrc.crc);
|
&fcksum.cksum);
|
||||||
if (err && err != LFS_ERR_CORRUPT) {
|
if (err && err != LFS_ERR_CORRUPT) {
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t fcrc_buf[LFSR_FCRC_DSIZE];
|
uint8_t fcksum_buf[LFSR_FCKSUM_DSIZE];
|
||||||
lfs_size_t fcrc_dsize = lfsr_fcrc_todisk(lfs, &fcrc, fcrc_buf);
|
lfs_size_t fcksum_dsize = lfsr_fcksum_todisk(lfs, &fcksum, fcksum_buf);
|
||||||
lfs_ssize_t d = lfsr_bd_progtag(lfs, rbyd_.block, rbyd_.off,
|
lfs_ssize_t d = lfsr_bd_progtag(lfs, rbyd_.block, rbyd_.off,
|
||||||
LFSR_TAG_FCRC, 0, fcrc_dsize,
|
LFSR_TAG_FCKSUM, 0, fcksum_dsize,
|
||||||
&rbyd_.crc);
|
&rbyd_.cksum);
|
||||||
if (d < 0) {
|
if (d < 0) {
|
||||||
err = d;
|
err = d;
|
||||||
goto failed;
|
goto failed;
|
||||||
@@ -3141,52 +3141,52 @@ static int lfsr_rbyd_commit(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
rbyd_.off += d;
|
rbyd_.off += d;
|
||||||
|
|
||||||
err = lfsr_bd_prog(lfs, rbyd_.block, rbyd_.off,
|
err = lfsr_bd_prog(lfs, rbyd_.block, rbyd_.off,
|
||||||
fcrc_buf, fcrc_dsize, &rbyd_.crc);
|
fcksum_buf, fcksum_dsize, &rbyd_.cksum);
|
||||||
if (err) {
|
if (err) {
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
rbyd_.off += fcrc_dsize;
|
rbyd_.off += fcksum_dsize;
|
||||||
|
|
||||||
// at least space for a crc?
|
// at least space for a cksum?
|
||||||
} else if (rbyd_.off + 2+1+5+4 <= lfs->cfg->block_size) {
|
} else if (rbyd_.off + 2+1+5+4 <= lfs->cfg->block_size) {
|
||||||
// note this implicitly marks the rbyd as unerased
|
// note this implicitly marks the rbyd as unerased
|
||||||
aligned = lfs->cfg->block_size;
|
aligned = lfs->cfg->block_size;
|
||||||
|
|
||||||
// not even space for a crc? we can't finish the commit
|
// not even space for a cksum? we can't finish the commit
|
||||||
} else {
|
} else {
|
||||||
err = LFS_ERR_RANGE;
|
err = LFS_ERR_RANGE;
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// build end-of-commit crc
|
// build end-of-commit cksum
|
||||||
//
|
//
|
||||||
// note padding-size depends on leb-encoding depends on padding-size, to
|
// note padding-size depends on leb-encoding depends on padding-size, to
|
||||||
// get around this catch-22 we just always write a fully-expanded leb128
|
// get around this catch-22 we just always write a fully-expanded leb128
|
||||||
// encoding
|
// encoding
|
||||||
uint8_t crc_buf[2+1+5+4];
|
uint8_t cksum_buf[2+1+5+4];
|
||||||
crc_buf[0] = (LFSR_TAG_CRC >> 8) | ((lfs_popc(rbyd_.crc) & 1) << 7);
|
cksum_buf[0] = (LFSR_TAG_CKSUM >> 8) | ((lfs_popc(rbyd_.cksum) & 1) << 7);
|
||||||
crc_buf[1] = 0;
|
cksum_buf[1] = 0;
|
||||||
crc_buf[2] = 0;
|
cksum_buf[2] = 0;
|
||||||
|
|
||||||
lfs_off_t padding = aligned - (rbyd_.off + 2+1+5);
|
lfs_off_t padding = aligned - (rbyd_.off + 2+1+5);
|
||||||
crc_buf[3] = 0x80 | (0x7f & (padding >> 0));
|
cksum_buf[3] = 0x80 | (0x7f & (padding >> 0));
|
||||||
crc_buf[4] = 0x80 | (0x7f & (padding >> 7));
|
cksum_buf[4] = 0x80 | (0x7f & (padding >> 7));
|
||||||
crc_buf[5] = 0x80 | (0x7f & (padding >> 14));
|
cksum_buf[5] = 0x80 | (0x7f & (padding >> 14));
|
||||||
crc_buf[6] = 0x80 | (0x7f & (padding >> 21));
|
cksum_buf[6] = 0x80 | (0x7f & (padding >> 21));
|
||||||
crc_buf[7] = 0x00 | (0x7f & (padding >> 28));
|
cksum_buf[7] = 0x00 | (0x7f & (padding >> 28));
|
||||||
|
|
||||||
rbyd_.crc = lfs_crc32c(rbyd_.crc, crc_buf, 2+1+5);
|
rbyd_.cksum = lfs_crc32c(rbyd_.cksum, cksum_buf, 2+1+5);
|
||||||
// we can't let the next tag appear as valid, so intentionally perturb the
|
// we can't let the next tag appear as valid, so intentionally perturb the
|
||||||
// commit if this happens, note parity(crc(m)) == parity(m) with crc32c,
|
// commit if this happens, note parity(crc(m)) == parity(m) with crc32c,
|
||||||
// so we can really change any bit to make this happen, we've reserved a bit
|
// so we can really change any bit to make this happen, we've reserved a bit
|
||||||
// in crc tags just for this purpose
|
// in cksum tags just for this purpose
|
||||||
if ((lfs_popc(rbyd_.crc) & 1) == (perturb >> 7)) {
|
if ((lfs_popc(rbyd_.cksum) & 1) == (perturb >> 7)) {
|
||||||
crc_buf[1] ^= 0x01;
|
cksum_buf[1] ^= 0x01;
|
||||||
rbyd_.crc ^= 0x68032cc8; // note crc(a ^ b) == crc(a) ^ crc(b)
|
rbyd_.cksum ^= 0x68032cc8; // note crc(a ^ b) == crc(a) ^ crc(b)
|
||||||
}
|
}
|
||||||
lfs_tole32_(rbyd_.crc, &crc_buf[2+1+5]);
|
lfs_tole32_(rbyd_.cksum, &cksum_buf[2+1+5]);
|
||||||
|
|
||||||
err = lfsr_bd_prog(lfs, rbyd_.block, rbyd_.off, crc_buf, 2+1+5+4, NULL);
|
err = lfsr_bd_prog(lfs, rbyd_.block, rbyd_.off, cksum_buf, 2+1+5+4, NULL);
|
||||||
if (err) {
|
if (err) {
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
@@ -3199,19 +3199,19 @@ static int lfsr_rbyd_commit(lfs_t *lfs, lfsr_rbyd_t *rbyd,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// succesful commit, check checksum to make sure
|
// succesful commit, check checksum to make sure
|
||||||
uint32_t crc_ = rbyd->crc;
|
uint32_t cksum_ = rbyd->cksum;
|
||||||
err = lfsr_bd_csum(lfs, rbyd_.block, rbyd->off, 0,
|
err = lfsr_bd_cksum(lfs, rbyd_.block, rbyd->off, 0,
|
||||||
rbyd_.off-4 - rbyd->off,
|
rbyd_.off-4 - rbyd->off,
|
||||||
&crc_);
|
&cksum_);
|
||||||
if (err) {
|
if (err) {
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rbyd_.crc != crc_) {
|
if (rbyd_.cksum != cksum_) {
|
||||||
// oh no, something went wrong
|
// oh no, something went wrong
|
||||||
LFS_ERROR("Rbyd corrupted during commit "
|
LFS_ERROR("Rbyd corrupted during commit "
|
||||||
"(block=0x%"PRIx32", 0x%08"PRIx32" != 0x%08"PRIx32")",
|
"(block=0x%"PRIx32", 0x%08"PRIx32" != 0x%08"PRIx32")",
|
||||||
rbyd_.block, rbyd_.crc, crc_);
|
rbyd_.block, rbyd_.cksum, cksum_);
|
||||||
err = LFS_ERR_CORRUPT;
|
err = LFS_ERR_CORRUPT;
|
||||||
goto failed;
|
goto failed;
|
||||||
}
|
}
|
||||||
@@ -3529,7 +3529,7 @@ static lfs_ssize_t lfsr_branch_todisk(lfs_t *lfs, const lfsr_rbyd_t *branch,
|
|||||||
(void)lfs;
|
(void)lfs;
|
||||||
lfs_ssize_t d = 0;
|
lfs_ssize_t d = 0;
|
||||||
|
|
||||||
lfs_tole32_(branch->crc, &buffer[d]);
|
lfs_tole32_(branch->cksum, &buffer[d]);
|
||||||
d += 4;
|
d += 4;
|
||||||
|
|
||||||
lfs_ssize_t d_ = lfs_toleb128(branch->weight, &buffer[d], 5);
|
lfs_ssize_t d_ = lfs_toleb128(branch->weight, &buffer[d], 5);
|
||||||
@@ -3560,7 +3560,7 @@ static lfs_ssize_t lfsr_branch_fromdisk(lfs_t *lfs, lfsr_rbyd_t *branch,
|
|||||||
branch->off = 0;
|
branch->off = 0;
|
||||||
|
|
||||||
lfs_ssize_t d = 0;
|
lfs_ssize_t d = 0;
|
||||||
lfs_ssize_t d_ = lfsr_data_readle32(lfs, data, d, &branch->crc);
|
lfs_ssize_t d_ = lfsr_data_readle32(lfs, data, d, &branch->cksum);
|
||||||
if (d_ < 0) {
|
if (d_ < 0) {
|
||||||
return d_;
|
return d_;
|
||||||
}
|
}
|
||||||
@@ -5365,7 +5365,7 @@ static int lfsr_mdir_compact_(lfs_t *lfs, lfsr_mdir_t *mdir_,
|
|||||||
mdir_->u.r.rbyd.weight = 0;
|
mdir_->u.r.rbyd.weight = 0;
|
||||||
mdir_->u.r.rbyd.trunk = 0;
|
mdir_->u.r.rbyd.trunk = 0;
|
||||||
mdir_->u.r.rbyd.off = 0;
|
mdir_->u.r.rbyd.off = 0;
|
||||||
mdir_->u.r.rbyd.crc = 0;
|
mdir_->u.r.rbyd.cksum = 0;
|
||||||
|
|
||||||
// erase, preparing for compact
|
// erase, preparing for compact
|
||||||
err = lfsr_bd_erase(lfs, mdir_->u.r.rbyd.block);
|
err = lfsr_bd_erase(lfs, mdir_->u.r.rbyd.block);
|
||||||
@@ -6472,22 +6472,22 @@ static int lfsr_mtree_traversal_next(lfs_t *lfs,
|
|||||||
if (err == LFS_ERR_CORRUPT) {
|
if (err == LFS_ERR_CORRUPT) {
|
||||||
LFS_ERROR("Corrupted rbyd during mtree traversal "
|
LFS_ERROR("Corrupted rbyd during mtree traversal "
|
||||||
"(0x%"PRIx32".%"PRIx32", 0x%08"PRIx32")",
|
"(0x%"PRIx32".%"PRIx32", 0x%08"PRIx32")",
|
||||||
branch->block, branch->trunk, branch->crc);
|
branch->block, branch->trunk, branch->cksum);
|
||||||
}
|
}
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
// test that our branch's crc matches what's expected
|
// test that our branch's cksum matches what's expected
|
||||||
//
|
//
|
||||||
// it should be noted it's very unlikely for this to be hit without
|
// it should be noted it's very unlikely for this to be hit without
|
||||||
// the above fetch failing since it includes both an internal
|
// the above fetch failing since it includes both an internal
|
||||||
// crc check and trunk check
|
// cksum check and trunk check
|
||||||
if (branch_.crc != branch->crc) {
|
if (branch_.cksum != branch->cksum) {
|
||||||
LFS_ERROR("Checksum mismatch during mtree traversal "
|
LFS_ERROR("Checksum mismatch during mtree traversal "
|
||||||
"(0x%"PRIx32".%"PRIx32", "
|
"(0x%"PRIx32".%"PRIx32", "
|
||||||
"0x%08"PRIx32" != 0x%08"PRIx32")",
|
"0x%08"PRIx32" != 0x%08"PRIx32")",
|
||||||
branch->block, branch->trunk,
|
branch->block, branch->trunk,
|
||||||
branch_.crc, branch->crc);
|
branch_.cksum, branch->cksum);
|
||||||
return LFS_ERR_CORRUPT;
|
return LFS_ERR_CORRUPT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6579,7 +6579,7 @@ cycle_detect:;
|
|||||||
//
|
//
|
||||||
// - 7-bit major_version => 1 byte leb128 (worst case)
|
// - 7-bit major_version => 1 byte leb128 (worst case)
|
||||||
// - 7-bit minor_version => 1 byte leb128 (worst case)
|
// - 7-bit minor_version => 1 byte leb128 (worst case)
|
||||||
// - 7-bit csum_type => 1 byte leb128 (worst case)
|
// - 7-bit cksum_type => 1 byte leb128 (worst case)
|
||||||
// - 7-bit flags => 1 byte leb128 (worst case)
|
// - 7-bit flags => 1 byte leb128 (worst case)
|
||||||
// - 32-bit block_size => 5 byte leb128 (worst case)
|
// - 32-bit block_size => 5 byte leb128 (worst case)
|
||||||
// - 32-bit block_count => 5 byte leb128 (worst case)
|
// - 32-bit block_count => 5 byte leb128 (worst case)
|
||||||
@@ -6603,7 +6603,7 @@ static lfs_ssize_t lfsr_superconfig_todisk(lfs_t *lfs,
|
|||||||
buffer[0] = LFS_DISK_VERSION_MAJOR;
|
buffer[0] = LFS_DISK_VERSION_MAJOR;
|
||||||
// on-disk minor version
|
// on-disk minor version
|
||||||
buffer[1] = LFS_DISK_VERSION_MINOR;
|
buffer[1] = LFS_DISK_VERSION_MINOR;
|
||||||
// on-disk csum type
|
// on-disk cksum type
|
||||||
buffer[2] = 2;
|
buffer[2] = 2;
|
||||||
// on-disk flags
|
// on-disk flags
|
||||||
buffer[3] = 0;
|
buffer[3] = 0;
|
||||||
@@ -6771,9 +6771,9 @@ static int lfsr_mountinited(lfs_t *lfs) {
|
|||||||
return LFS_ERR_INVAL;
|
return LFS_ERR_INVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check the on-disk csum type
|
// check the on-disk cksum type
|
||||||
uint32_t csum_type;
|
uint32_t cksum_type;
|
||||||
d_ = lfsr_data_readleb128(lfs, data, d, &csum_type);
|
d_ = lfsr_data_readleb128(lfs, data, d, &cksum_type);
|
||||||
// treat any leb128 overflows as out-of-range values
|
// treat any leb128 overflows as out-of-range values
|
||||||
if (d_ < 0 && d_ != LFS_ERR_CORRUPT) {
|
if (d_ < 0 && d_ != LFS_ERR_CORRUPT) {
|
||||||
return d_;
|
return d_;
|
||||||
@@ -6782,10 +6782,10 @@ static int lfsr_mountinited(lfs_t *lfs) {
|
|||||||
d += d_;
|
d += d_;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (d_ == LFS_ERR_CORRUPT || csum_type != 2) {
|
if (d_ == LFS_ERR_CORRUPT || cksum_type != 2) {
|
||||||
LFS_ERROR("Incompatible csum type 0x%"PRIx32
|
LFS_ERROR("Incompatible cksum type 0x%"PRIx32
|
||||||
" (!= 0x%"PRIx32")",
|
" (!= 0x%"PRIx32")",
|
||||||
(d_ == LFS_ERR_CORRUPT ? (uint32_t)-1 : csum_type),
|
(d_ == LFS_ERR_CORRUPT ? (uint32_t)-1 : cksum_type),
|
||||||
2);
|
2);
|
||||||
return LFS_ERR_INVAL;
|
return LFS_ERR_INVAL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ typedef struct lfsr_rbyd {
|
|||||||
// off>=block_size => rbyd not erased/needs compaction
|
// off>=block_size => rbyd not erased/needs compaction
|
||||||
lfs_off_t trunk;
|
lfs_off_t trunk;
|
||||||
lfs_off_t off;
|
lfs_off_t off;
|
||||||
uint32_t crc;
|
uint32_t cksum;
|
||||||
// note this lines up with arrays of redundant blocks in lfsr_mdir_t
|
// note this lines up with arrays of redundant blocks in lfsr_mdir_t
|
||||||
lfs_block_t block;
|
lfs_block_t block;
|
||||||
} lfsr_rbyd_t;
|
} lfsr_rbyd_t;
|
||||||
@@ -395,7 +395,7 @@ typedef struct lfsr_mdir {
|
|||||||
lfs_size_t weight;
|
lfs_size_t weight;
|
||||||
lfs_off_t trunk;
|
lfs_off_t trunk;
|
||||||
lfs_off_t off;
|
lfs_off_t off;
|
||||||
uint32_t crc;
|
uint32_t cksum;
|
||||||
lfs_block_t blocks[2];
|
lfs_block_t blocks[2];
|
||||||
} m;
|
} m;
|
||||||
struct {
|
struct {
|
||||||
|
|||||||
+21
-21
@@ -29,8 +29,8 @@ TAG_DID = 0x0307
|
|||||||
TAG_UATTR = 0x0400
|
TAG_UATTR = 0x0400
|
||||||
TAG_SATTR = 0x0500
|
TAG_SATTR = 0x0500
|
||||||
TAG_ALT = 0x4000
|
TAG_ALT = 0x4000
|
||||||
TAG_CRC = 0x2000
|
TAG_CKSUM = 0x2000
|
||||||
TAG_FCRC = 0x2100
|
TAG_FCKSUM = 0x2100
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -98,16 +98,16 @@ def fromtag(data):
|
|||||||
return tag>>15, tag&0x7fff, weight, size, 2+d+d_
|
return tag>>15, tag&0x7fff, weight, size, 2+d+d_
|
||||||
|
|
||||||
def frombtree(data):
|
def frombtree(data):
|
||||||
crc = fromle32(data)
|
cksum = fromle32(data)
|
||||||
w, d1 = fromleb128(data[4:])
|
w, d1 = fromleb128(data[4:])
|
||||||
trunk, d2 = fromleb128(data[4+d1:])
|
trunk, d2 = fromleb128(data[4+d1:])
|
||||||
block, d3 = fromleb128(data[4+d1+d2:])
|
block, d3 = fromleb128(data[4+d1+d2:])
|
||||||
return w, trunk, block, crc
|
return w, trunk, block, cksum
|
||||||
|
|
||||||
def popc(x):
|
def popc(x):
|
||||||
return bin(x).count('1')
|
return bin(x).count('1')
|
||||||
|
|
||||||
def xxd(data, width=16, crc=False):
|
def xxd(data, width=16):
|
||||||
for i in range(0, len(data), width):
|
for i in range(0, len(data), width):
|
||||||
yield '%-*s %-*s' % (
|
yield '%-*s %-*s' % (
|
||||||
3*width,
|
3*width,
|
||||||
@@ -167,13 +167,13 @@ def tagrepr(tag, w, size, off=None):
|
|||||||
tag & 0xff,
|
tag & 0xff,
|
||||||
' w%d' % w if w else '',
|
' w%d' % w if w else '',
|
||||||
size)
|
size)
|
||||||
elif (tag & 0xff00) == TAG_CRC:
|
elif (tag & 0xff00) == TAG_CKSUM:
|
||||||
return 'crc%x%s %d' % (
|
return 'cksum%x%s %d' % (
|
||||||
1 if tag & 0x1 else 0,
|
1 if tag & 0x1 else 0,
|
||||||
' 0x%x' % w if w > 0 else '',
|
' 0x%x' % w if w > 0 else '',
|
||||||
size)
|
size)
|
||||||
elif tag == TAG_FCRC:
|
elif tag == TAG_FCKSUM:
|
||||||
return 'fcrc%s %d' % (
|
return 'fcksum%s %d' % (
|
||||||
' 0x%x' % w if w > 0 else '',
|
' 0x%x' % w if w > 0 else '',
|
||||||
size)
|
size)
|
||||||
elif tag & 0x4000:
|
elif tag & 0x4000:
|
||||||
@@ -249,8 +249,8 @@ class Rbyd:
|
|||||||
|
|
||||||
# fetch the rbyd
|
# fetch the rbyd
|
||||||
rev = fromle32(data[0:4])
|
rev = fromle32(data[0:4])
|
||||||
crc = 0
|
cksum = 0
|
||||||
crc_ = crc32c(data[0:4])
|
cksum_ = crc32c(data[0:4])
|
||||||
off = 0
|
off = 0
|
||||||
j_ = 4
|
j_ = 4
|
||||||
trunk_ = 0
|
trunk_ = 0
|
||||||
@@ -262,25 +262,25 @@ class Rbyd:
|
|||||||
trunkoff = None
|
trunkoff = None
|
||||||
while j_ < len(data) and (not trunk or off <= trunk):
|
while j_ < len(data) and (not trunk or off <= trunk):
|
||||||
v, tag, w, size, d = fromtag(data[j_:])
|
v, tag, w, size, d = fromtag(data[j_:])
|
||||||
if v != (popc(crc_) & 1):
|
if v != (popc(cksum_) & 1):
|
||||||
break
|
break
|
||||||
crc_ = crc32c(data[j_:j_+d], crc_)
|
cksum_ = crc32c(data[j_:j_+d], cksum_)
|
||||||
j_ += d
|
j_ += d
|
||||||
if not tag & 0x4000 and j_ + size > len(data):
|
if not tag & 0x4000 and j_ + size > len(data):
|
||||||
break
|
break
|
||||||
|
|
||||||
# take care of crcs
|
# take care of cksums
|
||||||
if not tag & 0x4000:
|
if not tag & 0x4000:
|
||||||
if (tag & 0xff00) != TAG_CRC:
|
if (tag & 0xff00) != TAG_CKSUM:
|
||||||
crc_ = crc32c(data[j_:j_+size], crc_)
|
cksum_ = crc32c(data[j_:j_+size], cksum_)
|
||||||
# found a crc?
|
# found a cksum?
|
||||||
else:
|
else:
|
||||||
crc__ = fromle32(data[j_:j_+4])
|
cksum__ = fromle32(data[j_:j_+4])
|
||||||
if crc_ != crc__:
|
if cksum_ != cksum__:
|
||||||
break
|
break
|
||||||
# commit what we have
|
# commit what we have
|
||||||
off = trunkoff if trunkoff else j_ + size
|
off = trunkoff if trunkoff else j_ + size
|
||||||
crc = crc_
|
cksum = cksum_
|
||||||
trunk_ = trunk__
|
trunk_ = trunk__
|
||||||
weight = weight_
|
weight = weight_
|
||||||
|
|
||||||
@@ -554,7 +554,7 @@ def main(disk, roots=None, *,
|
|||||||
if branch is not None and (
|
if branch is not None and (
|
||||||
not depth or depth_ < depth):
|
not depth or depth_ < depth):
|
||||||
tag, j, d, data = branch
|
tag, j, d, data = branch
|
||||||
w_, trunk, block, crc = frombtree(data)
|
w_, trunk, block, cksum = frombtree(data)
|
||||||
rbyd = Rbyd.fetch(f, block_size, block, trunk)
|
rbyd = Rbyd.fetch(f, block_size, block, trunk)
|
||||||
|
|
||||||
# corrupted? bail here so we can keep traversing the tree
|
# corrupted? bail here so we can keep traversing the tree
|
||||||
|
|||||||
+25
-25
@@ -30,8 +30,8 @@ TAG_DID = 0x0307
|
|||||||
TAG_UATTR = 0x0400
|
TAG_UATTR = 0x0400
|
||||||
TAG_SATTR = 0x0500
|
TAG_SATTR = 0x0500
|
||||||
TAG_ALT = 0x4000
|
TAG_ALT = 0x4000
|
||||||
TAG_CRC = 0x2000
|
TAG_CKSUM = 0x2000
|
||||||
TAG_FCRC = 0x2100
|
TAG_FCKSUM = 0x2100
|
||||||
|
|
||||||
|
|
||||||
# parse some rbyd addr encodings
|
# parse some rbyd addr encodings
|
||||||
@@ -107,16 +107,16 @@ def frommdir(data):
|
|||||||
return blocks
|
return blocks
|
||||||
|
|
||||||
def frombtree(data):
|
def frombtree(data):
|
||||||
crc = fromle32(data)
|
cksum = fromle32(data)
|
||||||
w, d1 = fromleb128(data[4:])
|
w, d1 = fromleb128(data[4:])
|
||||||
trunk, d2 = fromleb128(data[4+d1:])
|
trunk, d2 = fromleb128(data[4+d1:])
|
||||||
block, d3 = fromleb128(data[4+d1+d2:])
|
block, d3 = fromleb128(data[4+d1+d2:])
|
||||||
return w, trunk, block, crc
|
return w, trunk, block, cksum
|
||||||
|
|
||||||
def popc(x):
|
def popc(x):
|
||||||
return bin(x).count('1')
|
return bin(x).count('1')
|
||||||
|
|
||||||
def xxd(data, width=16, crc=False):
|
def xxd(data, width=16):
|
||||||
for i in range(0, len(data), width):
|
for i in range(0, len(data), width):
|
||||||
yield '%-*s %-*s' % (
|
yield '%-*s %-*s' % (
|
||||||
3*width,
|
3*width,
|
||||||
@@ -176,13 +176,13 @@ def tagrepr(tag, w, size, off=None):
|
|||||||
tag & 0xff,
|
tag & 0xff,
|
||||||
' w%d' % w if w else '',
|
' w%d' % w if w else '',
|
||||||
size)
|
size)
|
||||||
elif (tag & 0xff00) == TAG_CRC:
|
elif (tag & 0xff00) == TAG_CKSUM:
|
||||||
return 'crc%x%s %d' % (
|
return 'cksum%x%s %d' % (
|
||||||
1 if tag & 0x1 else 0,
|
1 if tag & 0x1 else 0,
|
||||||
' 0x%x' % w if w > 0 else '',
|
' 0x%x' % w if w > 0 else '',
|
||||||
size)
|
size)
|
||||||
elif tag == TAG_FCRC:
|
elif tag == TAG_FCKSUM:
|
||||||
return 'fcrc%s %d' % (
|
return 'fcksum%s %d' % (
|
||||||
' 0x%x' % w if w > 0 else '',
|
' 0x%x' % w if w > 0 else '',
|
||||||
size)
|
size)
|
||||||
elif tag & 0x4000:
|
elif tag & 0x4000:
|
||||||
@@ -255,8 +255,8 @@ class Rbyd:
|
|||||||
|
|
||||||
# fetch the rbyd
|
# fetch the rbyd
|
||||||
rev = fromle32(data[0:4])
|
rev = fromle32(data[0:4])
|
||||||
crc = 0
|
cksum = 0
|
||||||
crc_ = crc32c(data[0:4])
|
cksum_ = crc32c(data[0:4])
|
||||||
off = 0
|
off = 0
|
||||||
j_ = 4
|
j_ = 4
|
||||||
trunk_ = 0
|
trunk_ = 0
|
||||||
@@ -268,25 +268,25 @@ class Rbyd:
|
|||||||
trunkoff = None
|
trunkoff = None
|
||||||
while j_ < len(data) and (not trunk or off <= trunk):
|
while j_ < len(data) and (not trunk or off <= trunk):
|
||||||
v, tag, w, size, d = fromtag(data[j_:])
|
v, tag, w, size, d = fromtag(data[j_:])
|
||||||
if v != (popc(crc_) & 1):
|
if v != (popc(cksum_) & 1):
|
||||||
break
|
break
|
||||||
crc_ = crc32c(data[j_:j_+d], crc_)
|
cksum_ = crc32c(data[j_:j_+d], cksum_)
|
||||||
j_ += d
|
j_ += d
|
||||||
if not tag & 0x4000 and j_ + size > len(data):
|
if not tag & 0x4000 and j_ + size > len(data):
|
||||||
break
|
break
|
||||||
|
|
||||||
# take care of crcs
|
# take care of cksums
|
||||||
if not tag & 0x4000:
|
if not tag & 0x4000:
|
||||||
if (tag & 0xff00) != TAG_CRC:
|
if (tag & 0xff00) != TAG_CKSUM:
|
||||||
crc_ = crc32c(data[j_:j_+size], crc_)
|
cksum_ = crc32c(data[j_:j_+size], cksum_)
|
||||||
# found a crc?
|
# found a cksum?
|
||||||
else:
|
else:
|
||||||
crc__ = fromle32(data[j_:j_+4])
|
cksum__ = fromle32(data[j_:j_+4])
|
||||||
if crc_ != crc__:
|
if cksum_ != cksum__:
|
||||||
break
|
break
|
||||||
# commit what we have
|
# commit what we have
|
||||||
off = trunkoff if trunkoff else j_ + size
|
off = trunkoff if trunkoff else j_ + size
|
||||||
crc = crc_
|
cksum = cksum_
|
||||||
trunk_ = trunk__
|
trunk_ = trunk__
|
||||||
weight = weight_
|
weight = weight_
|
||||||
|
|
||||||
@@ -440,7 +440,7 @@ class Rbyd:
|
|||||||
if branch is not None and (
|
if branch is not None and (
|
||||||
not depth or depth_ < depth):
|
not depth or depth_ < depth):
|
||||||
tag, j, d, data = branch
|
tag, j, d, data = branch
|
||||||
w_, trunk, block, crc = frombtree(data)
|
w_, trunk, block, cksum = frombtree(data)
|
||||||
rbyd = Rbyd.fetch(f, block_size, block, trunk)
|
rbyd = Rbyd.fetch(f, block_size, block, trunk)
|
||||||
|
|
||||||
# corrupted? bail here so we can keep traversing the tree
|
# corrupted? bail here so we can keep traversing the tree
|
||||||
@@ -457,7 +457,7 @@ class Rbyd:
|
|||||||
# have mtree?
|
# have mtree?
|
||||||
done, rid, tag, w, j, d, data, _ = self.lookup(-1, TAG_MTREE)
|
done, rid, tag, w, j, d, data, _ = self.lookup(-1, TAG_MTREE)
|
||||||
if not done and rid == -1 and tag == TAG_MTREE:
|
if not done and rid == -1 and tag == TAG_MTREE:
|
||||||
w, trunk, block, crc = frombtree(data)
|
w, trunk, block, cksum = frombtree(data)
|
||||||
mtree = Rbyd.fetch(f, block_size, block, trunk)
|
mtree = Rbyd.fetch(f, block_size, block, trunk)
|
||||||
# corrupted?
|
# corrupted?
|
||||||
if not mtree:
|
if not mtree:
|
||||||
@@ -544,7 +544,7 @@ class Rbyd:
|
|||||||
# update our bid
|
# update our bid
|
||||||
bid += rid - (w-1)
|
bid += rid - (w-1)
|
||||||
|
|
||||||
w_, trunk, block, crc = frombtree(data)
|
w_, trunk, block, cksum = frombtree(data)
|
||||||
rbyd = Rbyd.fetch(f, block_size, block, trunk)
|
rbyd = Rbyd.fetch(f, block_size, block, trunk)
|
||||||
|
|
||||||
# found best match
|
# found best match
|
||||||
@@ -556,7 +556,7 @@ class Rbyd:
|
|||||||
# have mtree?
|
# have mtree?
|
||||||
done, rid, tag, w, j, d, data, _ = self.lookup(-1, TAG_MTREE)
|
done, rid, tag, w, j, d, data, _ = self.lookup(-1, TAG_MTREE)
|
||||||
if not done and rid == -1 and tag == TAG_MTREE:
|
if not done and rid == -1 and tag == TAG_MTREE:
|
||||||
w, trunk, block, crc = frombtree(data)
|
w, trunk, block, cksum = frombtree(data)
|
||||||
mtree = Rbyd.fetch(f, block_size, block, trunk)
|
mtree = Rbyd.fetch(f, block_size, block, trunk)
|
||||||
# corrupted?
|
# corrupted?
|
||||||
if not mtree:
|
if not mtree:
|
||||||
@@ -830,7 +830,7 @@ def main(disk, mroots=None, *,
|
|||||||
mtree = None
|
mtree = None
|
||||||
done, rid, tag, w, j, d, data, _ = mroot.lookup(-1, TAG_MTREE)
|
done, rid, tag, w, j, d, data, _ = mroot.lookup(-1, TAG_MTREE)
|
||||||
if not done and rid == -1 and tag == TAG_MTREE:
|
if not done and rid == -1 and tag == TAG_MTREE:
|
||||||
w, trunk, block, crc = frombtree(data)
|
w, trunk, block, cksum = frombtree(data)
|
||||||
mtree = Rbyd.fetch(f, block_size, block, trunk)
|
mtree = Rbyd.fetch(f, block_size, block, trunk)
|
||||||
|
|
||||||
mweight = w
|
mweight = w
|
||||||
|
|||||||
+23
-23
@@ -29,8 +29,8 @@ TAG_DID = 0x0307
|
|||||||
TAG_UATTR = 0x0400
|
TAG_UATTR = 0x0400
|
||||||
TAG_SATTR = 0x0500
|
TAG_SATTR = 0x0500
|
||||||
TAG_ALT = 0x4000
|
TAG_ALT = 0x4000
|
||||||
TAG_CRC = 0x2000
|
TAG_CKSUM = 0x2000
|
||||||
TAG_FCRC = 0x2100
|
TAG_FCKSUM = 0x2100
|
||||||
|
|
||||||
|
|
||||||
# parse some rbyd addr encodings
|
# parse some rbyd addr encodings
|
||||||
@@ -106,16 +106,16 @@ def frommdir(data):
|
|||||||
return blocks
|
return blocks
|
||||||
|
|
||||||
def frombtree(data):
|
def frombtree(data):
|
||||||
crc = fromle32(data)
|
cksum = fromle32(data)
|
||||||
w, d1 = fromleb128(data[4:])
|
w, d1 = fromleb128(data[4:])
|
||||||
trunk, d2 = fromleb128(data[4+d1:])
|
trunk, d2 = fromleb128(data[4+d1:])
|
||||||
block, d3 = fromleb128(data[4+d1+d2:])
|
block, d3 = fromleb128(data[4+d1+d2:])
|
||||||
return w, trunk, block, crc
|
return w, trunk, block, cksum
|
||||||
|
|
||||||
def popc(x):
|
def popc(x):
|
||||||
return bin(x).count('1')
|
return bin(x).count('1')
|
||||||
|
|
||||||
def xxd(data, width=16, crc=False):
|
def xxd(data, width=16):
|
||||||
for i in range(0, len(data), width):
|
for i in range(0, len(data), width):
|
||||||
yield '%-*s %-*s' % (
|
yield '%-*s %-*s' % (
|
||||||
3*width,
|
3*width,
|
||||||
@@ -175,13 +175,13 @@ def tagrepr(tag, w, size, off=None):
|
|||||||
tag & 0xff,
|
tag & 0xff,
|
||||||
' w%d' % w if w else '',
|
' w%d' % w if w else '',
|
||||||
size)
|
size)
|
||||||
elif (tag & 0xff00) == TAG_CRC:
|
elif (tag & 0xff00) == TAG_CKSUM:
|
||||||
return 'crc%x%s %d' % (
|
return 'cksum%x%s %d' % (
|
||||||
1 if tag & 0x1 else 0,
|
1 if tag & 0x1 else 0,
|
||||||
' 0x%x' % w if w > 0 else '',
|
' 0x%x' % w if w > 0 else '',
|
||||||
size)
|
size)
|
||||||
elif tag == TAG_FCRC:
|
elif tag == TAG_FCKSUM:
|
||||||
return 'fcrc%s %d' % (
|
return 'fcksum%s %d' % (
|
||||||
' 0x%x' % w if w > 0 else '',
|
' 0x%x' % w if w > 0 else '',
|
||||||
size)
|
size)
|
||||||
elif tag & 0x4000:
|
elif tag & 0x4000:
|
||||||
@@ -257,8 +257,8 @@ class Rbyd:
|
|||||||
|
|
||||||
# fetch the rbyd
|
# fetch the rbyd
|
||||||
rev = fromle32(data[0:4])
|
rev = fromle32(data[0:4])
|
||||||
crc = 0
|
cksum = 0
|
||||||
crc_ = crc32c(data[0:4])
|
cksum_ = crc32c(data[0:4])
|
||||||
off = 0
|
off = 0
|
||||||
j_ = 4
|
j_ = 4
|
||||||
trunk_ = 0
|
trunk_ = 0
|
||||||
@@ -270,25 +270,25 @@ class Rbyd:
|
|||||||
trunkoff = None
|
trunkoff = None
|
||||||
while j_ < len(data) and (not trunk or off <= trunk):
|
while j_ < len(data) and (not trunk or off <= trunk):
|
||||||
v, tag, w, size, d = fromtag(data[j_:])
|
v, tag, w, size, d = fromtag(data[j_:])
|
||||||
if v != (popc(crc_) & 1):
|
if v != (popc(cksum_) & 1):
|
||||||
break
|
break
|
||||||
crc_ = crc32c(data[j_:j_+d], crc_)
|
cksum_ = crc32c(data[j_:j_+d], cksum_)
|
||||||
j_ += d
|
j_ += d
|
||||||
if not tag & 0x4000 and j_ + size > len(data):
|
if not tag & 0x4000 and j_ + size > len(data):
|
||||||
break
|
break
|
||||||
|
|
||||||
# take care of crcs
|
# take care of cksums
|
||||||
if not tag & 0x4000:
|
if not tag & 0x4000:
|
||||||
if (tag & 0xff00) != TAG_CRC:
|
if (tag & 0xff00) != TAG_CKSUM:
|
||||||
crc_ = crc32c(data[j_:j_+size], crc_)
|
cksum_ = crc32c(data[j_:j_+size], cksum_)
|
||||||
# found a crc?
|
# found a cksum?
|
||||||
else:
|
else:
|
||||||
crc__ = fromle32(data[j_:j_+4])
|
cksum__ = fromle32(data[j_:j_+4])
|
||||||
if crc_ != crc__:
|
if cksum_ != cksum__:
|
||||||
break
|
break
|
||||||
# commit what we have
|
# commit what we have
|
||||||
off = trunkoff if trunkoff else j_ + size
|
off = trunkoff if trunkoff else j_ + size
|
||||||
crc = crc_
|
cksum = cksum_
|
||||||
trunk_ = trunk__
|
trunk_ = trunk__
|
||||||
weight = weight_
|
weight = weight_
|
||||||
|
|
||||||
@@ -531,7 +531,7 @@ class Rbyd:
|
|||||||
if branch is not None and (
|
if branch is not None and (
|
||||||
not depth or depth_ < depth):
|
not depth or depth_ < depth):
|
||||||
tag, j, d, data = branch
|
tag, j, d, data = branch
|
||||||
w_, trunk, block, crc = frombtree(data)
|
w_, trunk, block, cksum = frombtree(data)
|
||||||
rbyd = Rbyd.fetch(f, block_size, block, trunk)
|
rbyd = Rbyd.fetch(f, block_size, block, trunk)
|
||||||
|
|
||||||
# corrupted? bail here so we can keep traversing the tree
|
# corrupted? bail here so we can keep traversing the tree
|
||||||
@@ -805,7 +805,7 @@ def main(disk, mroots=None, *,
|
|||||||
if not args.get('depth') or mdepth < args.get('depth'):
|
if not args.get('depth') or mdepth < args.get('depth'):
|
||||||
done, rid, tag, w, j, d, data, _ = mroot.lookup(-1, TAG_MTREE)
|
done, rid, tag, w, j, d, data, _ = mroot.lookup(-1, TAG_MTREE)
|
||||||
if not done and rid == -1 and tag == TAG_MTREE:
|
if not done and rid == -1 and tag == TAG_MTREE:
|
||||||
w, trunk, block, crc = frombtree(data)
|
w, trunk, block, cksum = frombtree(data)
|
||||||
mtree = Rbyd.fetch(f, block_size, block, trunk)
|
mtree = Rbyd.fetch(f, block_size, block, trunk)
|
||||||
|
|
||||||
mweight = w
|
mweight = w
|
||||||
@@ -1474,7 +1474,7 @@ def main(disk, mroots=None, *,
|
|||||||
if not args.get('depth') or mdepth < args.get('depth'):
|
if not args.get('depth') or mdepth < args.get('depth'):
|
||||||
done, rid, tag, w, j, d, data, _ = mroot.lookup(-1, TAG_MTREE)
|
done, rid, tag, w, j, d, data, _ = mroot.lookup(-1, TAG_MTREE)
|
||||||
if not done and rid == -1 and tag == TAG_MTREE:
|
if not done and rid == -1 and tag == TAG_MTREE:
|
||||||
w, trunk, block, crc = frombtree(data)
|
w, trunk, block, cksum = frombtree(data)
|
||||||
mtree = Rbyd.fetch(f, block_size, block, trunk)
|
mtree = Rbyd.fetch(f, block_size, block, trunk)
|
||||||
|
|
||||||
# traverse entries
|
# traverse entries
|
||||||
|
|||||||
+32
-32
@@ -38,8 +38,8 @@ TAG_DID = 0x0307
|
|||||||
TAG_UATTR = 0x0400
|
TAG_UATTR = 0x0400
|
||||||
TAG_SATTR = 0x0500
|
TAG_SATTR = 0x0500
|
||||||
TAG_ALT = 0x4000
|
TAG_ALT = 0x4000
|
||||||
TAG_CRC = 0x2000
|
TAG_CKSUM = 0x2000
|
||||||
TAG_FCRC = 0x2100
|
TAG_FCKSUM = 0x2100
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ def fromtag(data):
|
|||||||
def popc(x):
|
def popc(x):
|
||||||
return bin(x).count('1')
|
return bin(x).count('1')
|
||||||
|
|
||||||
def xxd(data, width=16, crc=False):
|
def xxd(data, width=16):
|
||||||
for i in range(0, len(data), width):
|
for i in range(0, len(data), width):
|
||||||
yield '%-*s %-*s' % (
|
yield '%-*s %-*s' % (
|
||||||
3*width,
|
3*width,
|
||||||
@@ -169,13 +169,13 @@ def tagrepr(tag, w, size, off=None):
|
|||||||
tag & 0xff,
|
tag & 0xff,
|
||||||
' w%d' % w if w else '',
|
' w%d' % w if w else '',
|
||||||
size)
|
size)
|
||||||
elif (tag & 0xff00) == TAG_CRC:
|
elif (tag & 0xff00) == TAG_CKSUM:
|
||||||
return 'crc%x%s %d' % (
|
return 'cksum%x%s %d' % (
|
||||||
1 if tag & 0x1 else 0,
|
1 if tag & 0x1 else 0,
|
||||||
' 0x%x' % w if w > 0 else '',
|
' 0x%x' % w if w > 0 else '',
|
||||||
size)
|
size)
|
||||||
elif tag == TAG_FCRC:
|
elif tag == TAG_FCKSUM:
|
||||||
return 'fcrc%s %d' % (
|
return 'fcksum%s %d' % (
|
||||||
' 0x%x' % w if w > 0 else '',
|
' 0x%x' % w if w > 0 else '',
|
||||||
size)
|
size)
|
||||||
elif tag & 0x4000:
|
elif tag & 0x4000:
|
||||||
@@ -194,7 +194,7 @@ def tagrepr(tag, w, size, off=None):
|
|||||||
def dbg_log(data, block_size, rev, off, weight, *,
|
def dbg_log(data, block_size, rev, off, weight, *,
|
||||||
color=False,
|
color=False,
|
||||||
**args):
|
**args):
|
||||||
crc = crc32c(data[0:4])
|
cksum = crc32c(data[0:4])
|
||||||
|
|
||||||
# preprocess jumps
|
# preprocess jumps
|
||||||
if args.get('jumps'):
|
if args.get('jumps'):
|
||||||
@@ -444,20 +444,20 @@ def dbg_log(data, block_size, rev, off, weight, *,
|
|||||||
|
|
||||||
j = j_
|
j = j_
|
||||||
v, tag, w, size, d = fromtag(data[j_:])
|
v, tag, w, size, d = fromtag(data[j_:])
|
||||||
if v != (popc(crc) & 1):
|
if v != (popc(cksum) & 1):
|
||||||
notes.append('v!=%x' % (popc(crc) & 1))
|
notes.append('v!=%x' % (popc(cksum) & 1))
|
||||||
crc = crc32c(data[j_:j_+d], crc)
|
cksum = crc32c(data[j_:j_+d], cksum)
|
||||||
j_ += d
|
j_ += d
|
||||||
|
|
||||||
# take care of crcs
|
# take care of cksums
|
||||||
if not tag & 0x4000:
|
if not tag & 0x4000:
|
||||||
if (tag & 0xff00) != TAG_CRC:
|
if (tag & 0xff00) != TAG_CKSUM:
|
||||||
crc = crc32c(data[j_:j_+size], crc)
|
cksum = crc32c(data[j_:j_+size], cksum)
|
||||||
# found a crc?
|
# found a cksum?
|
||||||
else:
|
else:
|
||||||
crc_ = fromle32(data[j_:j_+4])
|
cksum_ = fromle32(data[j_:j_+4])
|
||||||
if crc != crc_:
|
if cksum != cksum_:
|
||||||
notes.append('crc!=%08x' % crc)
|
notes.append('cksum!=%08x' % cksum)
|
||||||
j_ += size
|
j_ += size
|
||||||
|
|
||||||
# evaluate trunks
|
# evaluate trunks
|
||||||
@@ -499,7 +499,7 @@ def dbg_log(data, block_size, rev, off, weight, *,
|
|||||||
else ''))
|
else ''))
|
||||||
|
|
||||||
# show in-device representation, including some extra
|
# show in-device representation, including some extra
|
||||||
# crc/parity info
|
# cksum/parity info
|
||||||
if args.get('device'):
|
if args.get('device'):
|
||||||
print('%s%8s %*s%*s %-47s %08x %x%s' % (
|
print('%s%8s %*s%*s %-47s %08x %x%s' % (
|
||||||
'\x1b[90m' if color and j >= off else '',
|
'\x1b[90m' if color and j >= off else '',
|
||||||
@@ -514,8 +514,8 @@ def dbg_log(data, block_size, rev, off, weight, *,
|
|||||||
for i in range(min(m.ceil(size/4), 3)))[:23]
|
for i in range(min(m.ceil(size/4), 3)))[:23]
|
||||||
if not args.get('no_truncate')
|
if not args.get('no_truncate')
|
||||||
and not tag & 0x4000 else ''),
|
and not tag & 0x4000 else ''),
|
||||||
crc,
|
cksum,
|
||||||
popc(crc) & 1,
|
popc(cksum) & 1,
|
||||||
'\x1b[m' if color and j >= off else ''))
|
'\x1b[m' if color and j >= off else ''))
|
||||||
|
|
||||||
# show on-disk encoding of tags
|
# show on-disk encoding of tags
|
||||||
@@ -852,8 +852,8 @@ def main(disk, blocks=None, *,
|
|||||||
# first figure out which block as the most recent revision
|
# first figure out which block as the most recent revision
|
||||||
def fetch(data, trunk):
|
def fetch(data, trunk):
|
||||||
rev = fromle32(data[0:4])
|
rev = fromle32(data[0:4])
|
||||||
crc = 0
|
cksum = 0
|
||||||
crc_ = crc32c(data[0:4])
|
cksum_ = crc32c(data[0:4])
|
||||||
off = 0
|
off = 0
|
||||||
j_ = 4
|
j_ = 4
|
||||||
trunk_ = 0
|
trunk_ = 0
|
||||||
@@ -865,25 +865,25 @@ def main(disk, blocks=None, *,
|
|||||||
trunkoff = None
|
trunkoff = None
|
||||||
while j_ < len(data) and (not trunk or off <= trunk):
|
while j_ < len(data) and (not trunk or off <= trunk):
|
||||||
v, tag, w, size, d = fromtag(data[j_:])
|
v, tag, w, size, d = fromtag(data[j_:])
|
||||||
if v != (popc(crc_) & 1):
|
if v != (popc(cksum_) & 1):
|
||||||
break
|
break
|
||||||
crc_ = crc32c(data[j_:j_+d], crc_)
|
cksum_ = crc32c(data[j_:j_+d], cksum_)
|
||||||
j_ += d
|
j_ += d
|
||||||
if not tag & 0x4000 and j_ + size > len(data):
|
if not tag & 0x4000 and j_ + size > len(data):
|
||||||
break
|
break
|
||||||
|
|
||||||
# take care of crcs
|
# take care of cksums
|
||||||
if not tag & 0x4000:
|
if not tag & 0x4000:
|
||||||
if (tag & 0xff00) != TAG_CRC:
|
if (tag & 0xff00) != TAG_CKSUM:
|
||||||
crc_ = crc32c(data[j_:j_+size], crc_)
|
cksum_ = crc32c(data[j_:j_+size], cksum_)
|
||||||
# found a crc?
|
# found a cksum?
|
||||||
else:
|
else:
|
||||||
crc__ = fromle32(data[j_:j_+4])
|
cksum__ = fromle32(data[j_:j_+4])
|
||||||
if crc_ != crc__:
|
if cksum_ != cksum__:
|
||||||
break
|
break
|
||||||
# commit what we have
|
# commit what we have
|
||||||
off = trunkoff if trunkoff else j_ + size
|
off = trunkoff if trunkoff else j_ + size
|
||||||
crc = crc_
|
cksum = cksum_
|
||||||
trunk_ = trunk__
|
trunk_ = trunk__
|
||||||
weight = weight_
|
weight = weight_
|
||||||
|
|
||||||
|
|||||||
+94
-94
@@ -22,7 +22,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -53,7 +53,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -85,7 +85,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -118,7 +118,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -228,7 +228,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -340,7 +340,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -419,7 +419,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -500,7 +500,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -563,7 +563,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -628,7 +628,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -707,7 +707,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -850,7 +850,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -1021,7 +1021,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -1192,7 +1192,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -1371,7 +1371,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -1578,7 +1578,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -1744,7 +1744,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -1931,7 +1931,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2022,7 +2022,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2103,7 +2103,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2192,7 +2192,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2287,7 +2287,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2359,7 +2359,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2430,7 +2430,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2540,7 +2540,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2602,7 +2602,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2714,7 +2714,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2864,7 +2864,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -2958,7 +2958,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -3107,7 +3107,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -3342,7 +3342,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -3430,7 +3430,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -3553,7 +3553,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -3661,7 +3661,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -3808,7 +3808,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -3969,7 +3969,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -4071,7 +4071,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -4164,7 +4164,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -4270,7 +4270,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -4382,7 +4382,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -4474,7 +4474,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -4561,7 +4561,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -4629,7 +4629,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -4863,7 +4863,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -5124,7 +5124,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -5238,7 +5238,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -5342,7 +5342,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -5508,7 +5508,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -5685,7 +5685,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -5795,7 +5795,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -5904,7 +5904,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -6032,7 +6032,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -6226,7 +6226,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -6350,7 +6350,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -6441,7 +6441,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -6580,7 +6580,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -6736,7 +6736,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -6862,7 +6862,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -7108,7 +7108,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -7262,7 +7262,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -7452,7 +7452,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -7576,7 +7576,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -7714,7 +7714,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -7828,7 +7828,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -7961,7 +7961,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -8103,7 +8103,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -8260,7 +8260,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -8366,7 +8366,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -8603,7 +8603,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -8712,7 +8712,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -8798,7 +8798,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -8883,7 +8883,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -9555,7 +9555,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -9811,7 +9811,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -9922,7 +9922,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -10043,7 +10043,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -10169,7 +10169,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -10304,7 +10304,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -10452,7 +10452,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -10578,7 +10578,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -10713,7 +10713,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -10860,7 +10860,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -11013,7 +11013,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -11189,7 +11189,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -11340,7 +11340,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -11535,7 +11535,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -11622,7 +11622,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -11759,7 +11759,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -11898,7 +11898,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -11986,7 +11986,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -12131,7 +12131,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -12278,7 +12278,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -12364,7 +12364,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
@@ -12503,7 +12503,7 @@ code = '''
|
|||||||
lfsr_rbyd_t init_rbyd = {
|
lfsr_rbyd_t init_rbyd = {
|
||||||
.block = 0,
|
.block = 0,
|
||||||
.off = 0,
|
.off = 0,
|
||||||
.crc = 0,
|
.cksum = 0,
|
||||||
.trunk = 0,
|
.trunk = 0,
|
||||||
.weight = 0,
|
.weight = 0,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user