Lines Matching refs:seg
190 bool osSegmentSetSize(struct Segment *seg, uint32_t size);
196 static inline int32_t osSegmentGetSize(const struct Segment *seg) in osSegmentGetSize() argument
198 return seg ? seg->size[0] | (seg->size[1] << 8) | (seg->size[2] << 16) : SEG_SIZE_INVALID; in osSegmentGetSize()
201 static inline uint32_t osSegmentGetState(const struct Segment *seg) in osSegmentGetState() argument
203 return seg ? seg->state : SEG_STATE_INVALID; in osSegmentGetState()
206 static inline struct AppHdr *osSegmentGetData(const struct Segment *seg) in osSegmentGetData() argument
208 return (struct AppHdr*)(&seg[1]); in osSegmentGetData()
218 static inline uint32_t osSegmentGetCrc(const struct Segment *seg) in osSegmentGetCrc() argument
220 struct SegmentFooter *footer = (struct SegmentFooter *)(((uint8_t*)seg) + in osSegmentGetCrc()
221 ((osSegmentGetSize(seg) + 3) & ~3) + sizeof(*seg)); in osSegmentGetCrc()
230 static inline const struct Segment *osSegmentSizeGetNext(const struct Segment *seg, uint32_t size) in osSegmentSizeGetNext() argument
232 struct Segment *next = (struct Segment *)(((uint8_t*)seg) + in osSegmentSizeGetNext()
234 sizeof(*seg) in osSegmentSizeGetNext()
236 return seg ? next : NULL; in osSegmentSizeGetNext()
239 static inline const struct Segment *osSegmentGetNext(const struct Segment *seg) in osSegmentGetNext() argument
241 return osSegmentSizeGetNext(seg, osSegmentGetSize(seg)); in osSegmentGetNext()
256 struct Segment *seg = osGetSegment(app); in osAppSegmentCalcCrcResidue() local
257 uint32_t size = osSegmentSizeAlignedWithFooter(osSegmentGetSize(seg)); in osAppSegmentCalcCrcResidue()
261 crc = soft_crc32((uint8_t*)seg, size + sizeof(*seg), ~0); in osAppSegmentCalcCrcResidue()
270 const struct Segment *seg; member
277 const struct Segment *seg = it->shared; in osSegmentIteratorNext() local
278 const struct Segment *next = seg < it->sharedEnd ? osSegmentGetNext(seg) : it->sharedEnd; in osSegmentIteratorNext()
281 it->seg = seg; in osSegmentIteratorNext()
283 return seg < it->sharedEnd; in osSegmentIteratorNext()