Lines Matching refs:sctx
323 struct sb_section_ctx *sctx = ictx->sect_head; in sb_encrypt_sb_sections_header() local
328 while (sctx) { in sb_encrypt_sb_sections_header()
329 shdr = &sctx->payload; in sb_encrypt_sb_sections_header()
336 sctx = sctx->sect; in sb_encrypt_sb_sections_header()
397 struct sb_section_ctx *sctx = ictx->sect_head; in sb_encrypt_image() local
399 while (sctx) { in sb_encrypt_image()
400 cctx = sctx->cmd_head; in sb_encrypt_image()
421 sctx = sctx->sect; in sb_encrypt_image()
712 struct sb_section_ctx *sctx; in sb_build_section() local
719 sctx = calloc(1, sizeof(*sctx)); in sb_build_section()
720 if (!sctx) in sb_build_section()
745 sctx->boot = bootable; in sb_build_section()
747 shdr = &sctx->payload; in sb_build_section()
771 ictx->sect_head = sctx; in sb_build_section()
772 ictx->sect_tail = sctx; in sb_build_section()
774 ictx->sect_tail->sect = sctx; in sb_build_section()
775 ictx->sect_tail = sctx; in sb_build_section()
781 free(sctx); in sb_build_section()
787 struct sb_section_ctx *sctx = ictx->sect_tail; in sb_build_command_nop() local
808 if (!sctx->cmd_head) { in sb_build_command_nop()
809 sctx->cmd_head = cctx; in sb_build_command_nop()
810 sctx->cmd_tail = cctx; in sb_build_command_nop()
812 sctx->cmd_tail->cmd = cctx; in sb_build_command_nop()
813 sctx->cmd_tail = cctx; in sb_build_command_nop()
822 struct sb_section_ctx *sctx = ictx->sect_tail; in sb_build_command_tag() local
852 if (!sctx->cmd_head) { in sb_build_command_tag()
853 sctx->cmd_head = cctx; in sb_build_command_tag()
854 sctx->cmd_tail = cctx; in sb_build_command_tag()
856 sctx->cmd_tail->cmd = cctx; in sb_build_command_tag()
857 sctx->cmd_tail = cctx; in sb_build_command_tag()
866 struct sb_section_ctx *sctx = ictx->sect_tail; in sb_build_command_load() local
1021 if (!sctx->cmd_head) { in sb_build_command_load()
1022 sctx->cmd_head = cctx; in sb_build_command_load()
1023 sctx->cmd_tail = cctx; in sb_build_command_load()
1025 sctx->cmd_tail->cmd = cctx; in sb_build_command_load()
1026 sctx->cmd_tail = cctx; in sb_build_command_load()
1039 struct sb_section_ctx *sctx = ictx->sect_tail; in sb_build_command_fill() local
1118 if (!sctx->cmd_head) { in sb_build_command_fill()
1119 sctx->cmd_head = cctx; in sb_build_command_fill()
1120 sctx->cmd_tail = cctx; in sb_build_command_fill()
1122 sctx->cmd_tail->cmd = cctx; in sb_build_command_fill()
1123 sctx->cmd_tail = cctx; in sb_build_command_fill()
1137 struct sb_section_ctx *sctx = ictx->sect_tail; in sb_build_command_jump_call() local
1209 if (!sctx->cmd_head) { in sb_build_command_jump_call()
1210 sctx->cmd_head = cctx; in sb_build_command_jump_call()
1211 sctx->cmd_tail = cctx; in sb_build_command_jump_call()
1213 sctx->cmd_tail->cmd = cctx; in sb_build_command_jump_call()
1214 sctx->cmd_tail = cctx; in sb_build_command_jump_call()
1239 struct sb_section_ctx *sctx = ictx->sect_tail; in sb_build_command_mode() local
1299 if (!sctx->cmd_head) { in sb_build_command_mode()
1300 sctx->cmd_head = cctx; in sb_build_command_mode()
1301 sctx->cmd_tail = cctx; in sb_build_command_mode()
1303 sctx->cmd_tail->cmd = cctx; in sb_build_command_mode()
1304 sctx->cmd_tail = cctx; in sb_build_command_mode()
1356 struct sb_section_ctx *sctx = ictx->sect_head; in sb_postfill_image_header() local
1369 while (sctx) { in sb_postfill_image_header()
1370 hdr->image_blocks += sctx->size / SB_BLOCK_SIZE; in sb_postfill_image_header()
1371 sctx = sctx->sect; in sb_postfill_image_header()
1411 struct sb_section_ctx *sctx = ictx->sect_head; in sb_fixup_sections_and_tags() local
1417 while (sctx) { in sb_fixup_sections_and_tags()
1418 shdr = &sctx->payload; in sb_fixup_sections_and_tags()
1428 cctx = sctx->cmd_head; in sb_fixup_sections_and_tags()
1443 sctx = sctx->sect; in sb_fixup_sections_and_tags()
1903 struct sb_section_ctx *sctx, FILE *fp) in sb_verify_commands() argument
1911 while (tsize < sctx->size) { in sb_verify_commands()
1915 if (!sctx->cmd_head) { in sb_verify_commands()
1916 sctx->cmd_head = cctx; in sb_verify_commands()
1917 sctx->cmd_tail = cctx; in sb_verify_commands()
1919 sctx->cmd_tail->cmd = cctx; in sb_verify_commands()
1920 sctx->cmd_tail = cctx; in sb_verify_commands()
1947 struct sb_section_ctx *sctx; in sb_verify_sections_cmds() local
1954 sctx = calloc(1, sizeof(*sctx)); in sb_verify_sections_cmds()
1955 if (!sctx) in sb_verify_sections_cmds()
1958 ictx->sect_head = sctx; in sb_verify_sections_cmds()
1959 ictx->sect_tail = sctx; in sb_verify_sections_cmds()
1961 ictx->sect_tail->sect = sctx; in sb_verify_sections_cmds()
1962 ictx->sect_tail = sctx; in sb_verify_sections_cmds()
1965 size = fread(&sctx->payload, 1, sizeof(sctx->payload), fp); in sb_verify_sections_cmds()
1966 if (size != sizeof(sctx->payload)) { in sb_verify_sections_cmds()
1984 sctx = ictx->sect_head; in sb_verify_sections_cmds()
1985 while (sctx) { in sb_verify_sections_cmds()
1986 shdr = &sctx->payload; in sb_verify_sections_cmds()
1989 sctx->boot = 1; in sb_verify_sections_cmds()
1993 sctx->size = (shdr->section_size * SB_BLOCK_SIZE) + in sb_verify_sections_cmds()
1996 shdr->section_number, bootable, sctx->size); in sb_verify_sections_cmds()
2008 ret = sb_verify_commands(ictx, sctx, fp); in sb_verify_sections_cmds()
2012 sctx = sctx->sect; in sb_verify_sections_cmds()
2137 struct sb_section_ctx *sctx = ictx->sect_head, *s_head; in sb_free_image() local
2141 while (sctx) { in sb_free_image()
2142 s_head = sctx; in sb_free_image()
2143 c_head = sctx->cmd_head; in sb_free_image()
2153 sctx = sctx->sect; in sb_free_image()
2254 struct sb_section_ctx *sctx; in sb_build_image() local
2266 sctx = ictx->sect_head; in sb_build_image()
2267 while (sctx) { in sb_build_image()
2268 size += sctx->size; in sb_build_image()
2269 sctx = sctx->sect; in sb_build_image()
2280 sctx = ictx->sect_head; in sb_build_image()
2281 while (sctx) { in sb_build_image()
2282 memcpy(iptr, &sctx->payload, sizeof(struct sb_sections_header)); in sb_build_image()
2284 sctx = sctx->sect; in sb_build_image()
2290 sctx = ictx->sect_head; in sb_build_image()
2291 while (sctx) { in sb_build_image()
2292 cctx = sctx->cmd_head; in sb_build_image()
2307 sctx = sctx->sect; in sb_build_image()