)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1001900,"name":"Katsuhiro Suzuki","email":"katsuhiro@katsuster.net","username":"katsuster"},"change_message_id":"6103829691ae41862b2fd26a6271ce724a904834","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"90d410f8_8585697e","updated":"2021-11-11 10:37:18.000000000","message":"Hello. The patch works fine on my HiFive Unleashed (gdb command log is attached below).\nI\u0027m happy to merge this patch.\n\n(gdb) target remote :3333\nRemote debugging using :3333\n\nThread 1 received signal SIGINT, Interrupt.\n0x0000000000001004 in ?? ()\n\n(gdb) monitor reset halt\nJTAG tap: riscv.cpu tap/device found: 0x20000913 (mfg: 0x489 (SiFive Inc), part: 0x0000, ver: 0x2)\n\n(gdb) monitor flash probe 0\nFound flash device \u0027issi is25wp256d\u0027 (ID 0x0019709d)\nflash \u0027fespi\u0027 found at 0x20000000\n\n(gdb) x/32x 0x20000000\n0x20000000:     0xddccbbaa      0xddccbbaa      0xddccbbaa      0xddccbbaa\n0x20000010:     0xddccbbaa      0xddccbbaa      0xddccbbaa      0xddccbbaa\n0x20000020:     0xddccbbaa      0xddccbbaa      0xddccbbaa      0xddccbbaa\n0x20000030:     0xddccbbaa      0xddccbbaa      0xddccbbaa      0xddccbbaa\n0x20000040:     0xddccbbaa      0xddccbbaa      0xddccbbaa      0xddccbbaa\n0x20000050:     0xddccbbaa      0xddccbbaa      0xddccbbaa      0xddccbbaa\n0x20000060:     0xddccbbaa      0xddccbbaa      0xddccbbaa      0xddccbbaa\n0x20000070:     0xddccbbaa      0xddccbbaa      0xddccbbaa      0xddccbbaa\n\n(gdb) monitor flash erase_address 0x20000000 0x10000\nerased address 0x20000000 (length 65536) in 0.313978s (203.836 KiB/s)\n\n(gdb) x/32x 0x20000000\n0x20000000:     0xffffffff      0xffffffff      0xffffffff      0xffffffff\n0x20000010:     0xffffffff      0xffffffff      0xffffffff      0xffffffff\n0x20000020:     0xffffffff      0xffffffff      0xffffffff      0xffffffff\n0x20000030:     0xffffffff      0xffffffff      0xffffffff      0xffffffff\n0x20000040:     0xffffffff      0xffffffff      0xffffffff      0xffffffff\n0x20000050:     0xffffffff      0xffffffff      0xffffffff      0xffffffff\n0x20000060:     0xffffffff      0xffffffff      0xffffffff      0xffffffff\n0x20000070:     0xffffffff      0xffffffff      0xffffffff      0xffffffff\n","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"dbe68aef1eedc6b6a0add739e06aae8755edad56","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"94ea5dd6_40b5cb6d","updated":"2021-11-18 19:17:26.000000000","message":"I think I\u0027ve addressed all your comments. Thank you for reviewing.","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"8654502849cd7de0988fc046801cf66c4c301949","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d0718504_81e4821e","updated":"2021-11-09 21:38:34.000000000","message":"Looks good to me, didn\u0027t test.\n\nKatsuhiro, could you please test this version?","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1001900,"name":"Katsuhiro Suzuki","email":"katsuhiro@katsuster.net","username":"katsuster"},"change_message_id":"b0caebd5cd79ca863bd9fe320730a0a77beeacb1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"6f106d20_bc0cd778","updated":"2021-11-11 10:48:19.000000000","message":"Oops.. I forgot Code-review +1.","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1001900,"name":"Katsuhiro Suzuki","email":"katsuhiro@katsuster.net","username":"katsuster"},"change_message_id":"c967bedc3935dea13aebccf43398e9a3dab7bba1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"bdd9b947_fdc7b169","updated":"2021-11-10 09:57:05.000000000","message":"Thanks Tomas and Tim for reviewing adn giving patch sets.\nI\u0027ll check on my board. Please wait a moment...","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d492c7465e2933878f9a1e3343bc061b8149e326","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"14c6968a_b0df8163","updated":"2021-11-18 03:02:33.000000000","message":"Tim, please fix couple of very lgiht problems. Thanks","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"89f7dcf26d09fa84803fb68faadc7c22f159a593","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"12754cd9_298bb3ab","updated":"2021-11-24 18:23:07.000000000","message":"Looks like Paul has put together some very helpful TCL scripts, and as Tomas points out, some of that functionality could be done as an algorithm to actually be fast.\n\nI\u0027d really like to see that happen as separate pull requests, though. This one is a nice self-contained improvement and is ready to go. Other discussion should be in the mailing list or on some other pull request.","commit_id":"4193ae2349492a554cf81e6d936db2e155964118"},{"author":{"_account_id":1001937,"name":"Paul Sherman","username":"psherman42"},"change_message_id":"10b220d7ff789e155fe2aae0baf91bd64268fb84","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"1c78a239_4854031a","updated":"2021-11-23 03:42:06.000000000","message":"Not sure if it\u0027s the proper place, but would like to make a suggestion. TCL helper procedures shown below, in this specific example of the SiFive FE310 target and jtag transport like on the HiFive board.\n\n#\n# fe310_rom_load \u003cpgm-name-prefix\u003e [\u003caddr\u003e [no_run]]\n#\n#   Preverifies the target memory to make sure writing is even necessary.\n#   When writing is necessary, prechecks the target memory to make sure\n#   erasing is even necessary.\n#   Determines smallest portion of target memory to work with, for\n#   best programming speed and target memory endurance (lifetime).\n#   Allows for loading only when other than default address specified,\n#   such as when preparing overlay code or non-executable data.\n#\n#   assumes only one target, at position tap position 0, for now.\n#\n#   Typical usage:\n#   openocd -f fe310-g002.cfg -c \"adapter speed 2000\" -c init -c \"fe310_rom_load my_prog\"\\\n#           -c shutdown -c exit\n#   where my_prog-rom.bin has been linked for rom target addresses in the linker .lds script.\n#\n#   --------------------------------------------------------------------\n#   Fixes the following bugs and issues:\n#\n#   [flash erase_check num]\n#   Does not work, and takes a very long time, because of\n#   message \u0027Running slow fallback erase check - add working memory\u0027\n#   All sectors are being tested, not just the ones which will be programmed.\n#   See src/flash/nor/core.c:344 default_flash_mem_blank_check(),\n#   src/flash/nor/core.c:391 default_flash_blank_check(),\n#   src/flash/nor/fespi.c:1077 fespi_flash \u003d { .erase_check\u003ddefault_flash_blank_check; },\n#   Suggest adding member \u0027int is_needed;\u0027 to struct flash_sector (nor/core.h:41)\n#   to make default implementations of blank_check more intelligent.\n#\n#   [flash write_image erase unlock filename offset type]\n#   Does not work, because of\n#   messages \u0027Warn : Failed to write memory via program buffer.\u0027\n#   and \u0027Warn : Failed to write memory via abstract access.\u0027\n#   and also very long running time due to above problem when \u0027erase\u0027 specified.\n#\n#   [program filename preverify verify offset]\n#   Does not work, because of\n#   messages \u0027Warn : Failed to write memory via program buffer.\u0027\n#   and \u0027Warn : Failed to write memory via abstract access.\u0027\n#\n#   [flash verify_image filename offset type]\n#   seems to work okay.\n#   --------------------------------------------------------------------\n#\n\nproc fe310_rom_load { program {addr \"0x20000000\"} {no_run \"\"} } {\n  halt 100  ;# includes wait_halt 100\n\n  # sector size also defined in ...src/flash/nor/core.h:45 (uint32_t) size\n  set secsz [expr 0x1000]  ;# 4K sectors issi is25lp128d, typ. most NOR flash\n  set len [file size ${program}-rom.bin]\n  set endsec [expr (${len}/${secsz})+((${len}-(${len}/${secsz})*${secsz})\u003e0)-1]\n\n  #-----\n  # equivalent implementation in /bin/bash script, for use in, e.g., mk files, is shown below:\n  #$(eval SECSZ\u003d$(shell echo \"ibase\u003d16; 1000\" | bc))\n  #$(eval LEN\u003d$(shell \u003c${PROGRAM}-rom.bin wc -c))\n  #$(eval ENDSEC\u003d$(shell echo \"(${LEN}/${SECSZ})+((${LEN}-(${LEN}/${SECSZ})*${SECSZ})\u003e0)-1\" | bc))\n  #-----\n\n  set erased_value 255  ;# also defined in ...src/flash/nor/core.h:104 (uint8_t) erased_value\n  set is_erased 1\n  for {set i 0} { ($i \u003c\u003d $endsec) \u0026\u0026 $is_erased } {incr i} {\n    riscv.cpu.0 mem2array buf 8 [expr ${addr} + ${secsz} * $i] ${secsz}\n    foreach idx [array names buf] {\n      if {$buf($idx) !\u003d ${erased_value}} {\n        set is_erased 0\n      }\n    }\n  }\n\n  # in case of verify_bank pass, message returned is \u0027contents match\u0027\n  # in case of verify_bank fail, message returned is \u0027contents differ\u0027, diff lines, abrupt exit\n  #\n\n  set rc [catch {flash verify_bank 0 ${program}-rom.bin} err]  ;# trap exit on verify fail\n  if {[expr $rc \u003d\u003d 0]} {\n    echo \"flash device already up to date - nothing to do\"\n  } else {\n    echo [flash protect 0 0 ${endsec} off]\n    if {! $is_erased} {\n      echo [flash erase_sector 0 0 ${endsec}]\n    }\n    echo [flash write_bank 0 ${program}-rom.bin]\n    echo [flash verify_bank 0 ${program}-rom.bin]\n    echo [flash protect 0 0 ${endsec} on]\n  }\n\n  if {[expr [string length $no_run] \u003d\u003d 0]} {\n    resume ${addr}\n  }\n}","commit_id":"4193ae2349492a554cf81e6d936db2e155964118"},{"author":{"_account_id":1001937,"name":"Paul Sherman","username":"psherman42"},"change_message_id":"8c0e337056e9cfe5ab858f984945127ab38a1ded","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"bda9dcf5_fad0a280","updated":"2021-11-23 03:44:40.000000000","message":"Similarly, to make easy for RAM loading, a TCL helper procedure is shown below.\nFeel free to move my comments elsewhere or remove entirely. Great collab here!\n\n#\n# fe310_ram_load \u003cpgm-name-prefix\u003e [\u003caddr\u003e [no_run]]\n#\n#   Preverifies the target memory to make sure writing is even necessary.\n#   Allows for loading only when other than default address specified,\n#   such as when preparing overlay code or non-executable data.\n#\n#   Typical usage:\n#   openocd -f fe310-g002.cfg -c \"adapter speed 2000\" -c init -c \"fe310_ram_load my_prog\"\\\n#           -c shutdown -c exit\n#   where my_prog-ram.bin has been linked for ram target addresses in the linker .lds script.\n\nproc fe310_ram_load { program {addr \"0x80000000\"} {no_run \"\"} } {\n  halt 100  ;# includes wait_halt 100\n\n  # in case of verify_image pass, message returned is \u0027\u0027\n  # in case of verify_image fail, message returned is \u0027contents differ\u0027, diff lines, abrupt exit\n  #\n\n  set rc [catch {verify_image ${program}-ram.bin ${addr} bin} err]  ;# trap exit on verify fail\n  if {[expr $rc \u003d\u003d 0]} {\n    echo \"ram already up to date - nothing to do\"\n  } else {\n    echo [load_image ${program}-ram.bin ${addr} bin]\n    echo [verify_image ${program}-ram.bin ${addr} bin]\n  }\n\n  if {[expr [string length $no_run] \u003d\u003d 0]} {\n    resume ${addr}\n  }\n}","commit_id":"4193ae2349492a554cf81e6d936db2e155964118"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"935f4c09a3f22f74ea75b0a23f7d83aa98c974d7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"4b6422ea_b1c27452","updated":"2021-11-18 19:37:25.000000000","message":"Thanks, Tim","commit_id":"4193ae2349492a554cf81e6d936db2e155964118"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d9b8f3a0692ef40a8886b96f111ccd592b1b7af0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"ebabcc05_c47b51a3","in_reply_to":"12754cd9_298bb3ab","updated":"2021-11-25 12:51:24.000000000","message":"\u003e I\u0027d really like to see that happen as separate pull requests, though.\n\nDon\u0027t worry. My +2 score is still valid.\n\nJust waiting for Paul\u0027s reply to my question:\n\n\u003e #   Does not work, and takes a very long time, because of\n\u003e Does not work or just takes a very long time?","commit_id":"4193ae2349492a554cf81e6d936db2e155964118"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"65d374e45b3698cc2f5a29ecab2cb2c6c0ea9288","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"818cc741_867c8d32","in_reply_to":"1c78a239_4854031a","updated":"2021-11-23 07:13:20.000000000","message":"I understand that working with a huge capacity external flash could be really frustrating. BTW what flash size do you usually work with?\n\n\u003e #   [flash erase_check num]\n\u003e #   Does not work, and takes a very long time, because of\n\nDoes not work or just takes a very long time?\nerase_check could be speed up substantially if somebody implements a target resident algorithm for erase check.\n\n\u003e #   Suggest adding member \u0027int is_needed;\u0027 to struct flash_sector (nor/core.h:41)\n\u003e #   to make default implementations of blank_check more intelligent.\n\nThere is a problem in any kind of caching of target flash (or any memory) state between flash commands:\nas soon as the target runs, it may change the memory contents.\nEven the existing is_erased flag was often misused for such \"smart wear reducing\"\nbut it potentially could make problems.\n\nOn the other hand it would be nice to have flash handling similar to you script directly in \u0027flash write_image\u0027 command - a \u0027preverify\u0027 option which works on sector basis. Any contribution welcomed!","commit_id":"4193ae2349492a554cf81e6d936db2e155964118"}],"src/flash/nor/fespi.c":[{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d492c7465e2933878f9a1e3343bc061b8149e326","unresolved":true,"context_lines":[{"line_number":523,"context_line":"\t\t}"},{"line_number":524,"context_line":"\t}"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"\tint xlen \u003d riscv_xlen(target);"},{"line_number":527,"context_line":"\tstruct working_area *algorithm_wa \u003d NULL;"},{"line_number":528,"context_line":"\tstruct working_area *data_wa \u003d NULL;"},{"line_number":529,"context_line":"\tconst uint8_t *bin;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"9c19f5e1_a69a758a","line":526,"updated":"2021-11-18 03:02:33.000000000","message":"unsigned int","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"dbe68aef1eedc6b6a0add739e06aae8755edad56","unresolved":false,"context_lines":[{"line_number":523,"context_line":"\t\t}"},{"line_number":524,"context_line":"\t}"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"\tint xlen \u003d riscv_xlen(target);"},{"line_number":527,"context_line":"\tstruct working_area *algorithm_wa \u003d NULL;"},{"line_number":528,"context_line":"\tstruct working_area *data_wa \u003d NULL;"},{"line_number":529,"context_line":"\tconst uint8_t *bin;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"d3baf30e_d7bf9d43","line":526,"in_reply_to":"9c19f5e1_a69a758a","updated":"2021-11-18 19:17:26.000000000","message":"Done","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d492c7465e2933878f9a1e3343bc061b8149e326","unresolved":true,"context_lines":[{"line_number":547,"context_line":"\t\t\talgorithm_wa \u003d NULL;"},{"line_number":548,"context_line":""},{"line_number":549,"context_line":"\t\t} else {"},{"line_number":550,"context_line":"\t\t\tdata_wa_size \u003d MIN(target-\u003eworking_area_size - algorithm_wa-\u003esize, count);"},{"line_number":551,"context_line":"\t\t\twhile (1) {"},{"line_number":552,"context_line":"\t\t\t\tif (data_wa_size \u003c 128) {"},{"line_number":553,"context_line":"\t\t\t\t\tLOG_WARNING(\"Couldn\u0027t allocate data working area.\");"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"ef1f6459_185cbd98","line":550,"range":{"start_line":550,"start_character":22,"end_line":550,"end_character":68},"updated":"2021-11-18 03:02:33.000000000","message":"Please use target_get_working_area_avail(target) and ...\n\nEven nicer would be\n\n  data_wa_size \u003d MAX(128, MIN())\n\na then you may also remove the test for size \u003c 128","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"dbe68aef1eedc6b6a0add739e06aae8755edad56","unresolved":false,"context_lines":[{"line_number":547,"context_line":"\t\t\talgorithm_wa \u003d NULL;"},{"line_number":548,"context_line":""},{"line_number":549,"context_line":"\t\t} else {"},{"line_number":550,"context_line":"\t\t\tdata_wa_size \u003d MIN(target-\u003eworking_area_size - algorithm_wa-\u003esize, count);"},{"line_number":551,"context_line":"\t\t\twhile (1) {"},{"line_number":552,"context_line":"\t\t\t\tif (data_wa_size \u003c 128) {"},{"line_number":553,"context_line":"\t\t\t\t\tLOG_WARNING(\"Couldn\u0027t allocate data working area.\");"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"090a2564_20980c90","line":550,"range":{"start_line":550,"start_character":22,"end_line":550,"end_character":68},"in_reply_to":"ef1f6459_185cbd98","updated":"2021-11-18 19:17:26.000000000","message":"working_area_avail() is great. It means I can remove the loop. I don\u0027t understand your comment about removing the \u003c128 test. IIRC that was chosen somewhat as a point where the overhead of setting up the algorithm is so large that overall flashing becomes slower.","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d492c7465e2933878f9a1e3343bc061b8149e326","unresolved":true,"context_lines":[{"line_number":548,"context_line":""},{"line_number":549,"context_line":"\t\t} else {"},{"line_number":550,"context_line":"\t\t\tdata_wa_size \u003d MIN(target-\u003eworking_area_size - algorithm_wa-\u003esize, count);"},{"line_number":551,"context_line":"\t\t\twhile (1) {"},{"line_number":552,"context_line":"\t\t\t\tif (data_wa_size \u003c 128) {"},{"line_number":553,"context_line":"\t\t\t\t\tLOG_WARNING(\"Couldn\u0027t allocate data working area.\");"},{"line_number":554,"context_line":"\t\t\t\t\ttarget_free_working_area(target, algorithm_wa);"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"257594bd_5fba6eb5","line":551,"range":{"start_line":551,"start_character":3,"end_line":551,"end_character":14},"updated":"2021-11-18 03:02:33.000000000","message":"...remove try-fail iteration...","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"dbe68aef1eedc6b6a0add739e06aae8755edad56","unresolved":false,"context_lines":[{"line_number":548,"context_line":""},{"line_number":549,"context_line":"\t\t} else {"},{"line_number":550,"context_line":"\t\t\tdata_wa_size \u003d MIN(target-\u003eworking_area_size - algorithm_wa-\u003esize, count);"},{"line_number":551,"context_line":"\t\t\twhile (1) {"},{"line_number":552,"context_line":"\t\t\t\tif (data_wa_size \u003c 128) {"},{"line_number":553,"context_line":"\t\t\t\t\tLOG_WARNING(\"Couldn\u0027t allocate data working area.\");"},{"line_number":554,"context_line":"\t\t\t\t\ttarget_free_working_area(target, algorithm_wa);"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"23ce46a4_3b84ae6b","line":551,"range":{"start_line":551,"start_character":3,"end_line":551,"end_character":14},"in_reply_to":"257594bd_5fba6eb5","updated":"2021-11-18 19:17:26.000000000","message":"Done","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d492c7465e2933878f9a1e3343bc061b8149e326","unresolved":true,"context_lines":[{"line_number":553,"context_line":"\t\t\t\t\tLOG_WARNING(\"Couldn\u0027t allocate data working area.\");"},{"line_number":554,"context_line":"\t\t\t\t\ttarget_free_working_area(target, algorithm_wa);"},{"line_number":555,"context_line":"\t\t\t\t\talgorithm_wa \u003d NULL;"},{"line_number":556,"context_line":"\t\t\t\t}"},{"line_number":557,"context_line":"\t\t\t\tif (target_alloc_working_area_try(target, data_wa_size, \u0026data_wa) \u003d\u003d"},{"line_number":558,"context_line":"\t\t\t\t\t\tERROR_OK) {"},{"line_number":559,"context_line":"\t\t\t\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"488274f8_f25c6253","line":556,"updated":"2021-11-18 03:02:33.000000000","message":"else should be here or you get allocated data_wa shorter than 128 which memory leaks later","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"dbe68aef1eedc6b6a0add739e06aae8755edad56","unresolved":false,"context_lines":[{"line_number":553,"context_line":"\t\t\t\t\tLOG_WARNING(\"Couldn\u0027t allocate data working area.\");"},{"line_number":554,"context_line":"\t\t\t\t\ttarget_free_working_area(target, algorithm_wa);"},{"line_number":555,"context_line":"\t\t\t\t\talgorithm_wa \u003d NULL;"},{"line_number":556,"context_line":"\t\t\t\t}"},{"line_number":557,"context_line":"\t\t\t\tif (target_alloc_working_area_try(target, data_wa_size, \u0026data_wa) \u003d\u003d"},{"line_number":558,"context_line":"\t\t\t\t\t\tERROR_OK) {"},{"line_number":559,"context_line":"\t\t\t\t\tbreak;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"a600ca56_33f5535c","line":556,"in_reply_to":"488274f8_f25c6253","updated":"2021-11-18 19:17:26.000000000","message":"Done","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d492c7465e2933878f9a1e3343bc061b8149e326","unresolved":true,"context_lines":[{"line_number":554,"context_line":"\t\t\t\t\ttarget_free_working_area(target, algorithm_wa);"},{"line_number":555,"context_line":"\t\t\t\t\talgorithm_wa \u003d NULL;"},{"line_number":556,"context_line":"\t\t\t\t}"},{"line_number":557,"context_line":"\t\t\t\tif (target_alloc_working_area_try(target, data_wa_size, \u0026data_wa) \u003d\u003d"},{"line_number":558,"context_line":"\t\t\t\t\t\tERROR_OK) {"},{"line_number":559,"context_line":"\t\t\t\t\tbreak;"},{"line_number":560,"context_line":"\t\t\t\t}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"b1753391_1b9289aa","line":557,"range":{"start_line":557,"start_character":33,"end_line":557,"end_character":37},"updated":"2021-11-18 03:02:33.000000000","message":"...use target_alloc_working_area() without try suffix","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"dbe68aef1eedc6b6a0add739e06aae8755edad56","unresolved":false,"context_lines":[{"line_number":554,"context_line":"\t\t\t\t\ttarget_free_working_area(target, algorithm_wa);"},{"line_number":555,"context_line":"\t\t\t\t\talgorithm_wa \u003d NULL;"},{"line_number":556,"context_line":"\t\t\t\t}"},{"line_number":557,"context_line":"\t\t\t\tif (target_alloc_working_area_try(target, data_wa_size, \u0026data_wa) \u003d\u003d"},{"line_number":558,"context_line":"\t\t\t\t\t\tERROR_OK) {"},{"line_number":559,"context_line":"\t\t\t\t\tbreak;"},{"line_number":560,"context_line":"\t\t\t\t}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"dfcd1a7e_272a4adc","line":557,"range":{"start_line":557,"start_character":33,"end_line":557,"end_character":37},"in_reply_to":"b1753391_1b9289aa","updated":"2021-11-18 19:17:26.000000000","message":"Done","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"d492c7465e2933878f9a1e3343bc061b8149e326","unresolved":true,"context_lines":[{"line_number":612,"context_line":"\t\t\t\tgoto err;"},{"line_number":613,"context_line":"\t\t\t}"},{"line_number":614,"context_line":""},{"line_number":615,"context_line":"\t\t\tint algorithm_result \u003d buf_get_u64(reg_params[0].value, 0, xlen);"},{"line_number":616,"context_line":"\t\t\tif (algorithm_result !\u003d 0) {"},{"line_number":617,"context_line":"\t\t\t\tLOG_ERROR(\"Algorithm returned error %d\", algorithm_result);"},{"line_number":618,"context_line":"\t\t\t\tretval \u003d ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"485fb447_1c7b69fd","line":615,"range":{"start_line":615,"start_character":3,"end_line":615,"end_character":6},"updated":"2021-11-18 03:02:33.000000000","message":"uint64_t","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"},{"author":{"_account_id":1001242,"name":"Tim Newsome","email":"tim@sifive.com","username":"timsifive"},"change_message_id":"dbe68aef1eedc6b6a0add739e06aae8755edad56","unresolved":false,"context_lines":[{"line_number":612,"context_line":"\t\t\t\tgoto err;"},{"line_number":613,"context_line":"\t\t\t}"},{"line_number":614,"context_line":""},{"line_number":615,"context_line":"\t\t\tint algorithm_result \u003d buf_get_u64(reg_params[0].value, 0, xlen);"},{"line_number":616,"context_line":"\t\t\tif (algorithm_result !\u003d 0) {"},{"line_number":617,"context_line":"\t\t\t\tLOG_ERROR(\"Algorithm returned error %d\", algorithm_result);"},{"line_number":618,"context_line":"\t\t\t\tretval \u003d ERROR_FAIL;"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"195fec1e_2a861098","line":615,"range":{"start_line":615,"start_character":3,"end_line":615,"end_character":6},"in_reply_to":"485fb447_1c7b69fd","updated":"2021-11-18 19:17:26.000000000","message":"Done","commit_id":"30fff5089a1f00ce5e9d6f290032432f6aabe8cc"}]}
