)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"b8ef251b0a50639a6f0147f6ec4786194b6ae578","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d9f0dd76_55f66aab","updated":"2024-05-13 08:47:59.000000000","message":"I\u0027m experimenting with \"coccinelle\" about automatic code changes.\nThe code change proposals in my previous reply could be a nice exercise for this \"coccinelle\" tool.\nLet me know if you agree in the proposal. Then we can see if the tool is really as good as it\u0027s advertised.","commit_id":"d6f647fb487f68de29832e8880872f22d08dea88"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"15c0a59508ac643b3ea650627b8536f611375ef0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"85c26b17_0ce181e1","updated":"2024-05-10 10:31:41.000000000","message":"Thanks for the patch.\nI\u0027m reluctant to add a riscv specific command for this, since all other architectures could benefit from the same.\nPlus, why only read and not also write? We usually keep the two symmetric.\n\nI see in riscv repository that there are only two use cases:\n- ```increment \u003d\u003d 0```;\n- ```increment \u003d\u003d size```.\n\nMy proposal. I know it\u0027s long, so please let me know what you opinion and if you need help to proceed:\n\n1) in one independent patch (this is the long one):\n- modify in ```target_type.h``` the prototype of ```read_memory()```, ```write_memory()```, ```read_phys_memory()``` and ```write_phys_memory()``` by adding a last parameter ```bool addr_autoincr```.\n- still in  ```target_type.h``` define\n```\n#define ADDR_NO_AUTOINCR false\n#define ADDR_AUTOINCR true\n```\n- in ```target.h``` add (I prefer not reusing ERROR_NOT_IMPLEMENTED)\n```\n#define ERROR_TARGET_NOAUTOINCR_NOT_SUPPORTED (-316)\n```\n- in every call of above functions you pass ```ADDR_AUTOINCR``` as last parameter\n- in every implementation of the above functions you add:\n```\n    ..., bool addr_autoincr)\n{\n    if (addr_autoincr \u003d\u003d ADDR_NO_AUTOINCR)\n        return ERROR_TARGET_NOAUTOINCR_NOT_SUPPORTED;\n    ...\n```\n\n2) second patch, in ```target.c``` and probably also ```target.h```, add the four new functions ```target_read_memory_no_addrincr()``` and its similar for write and phys.\n(This to avoid changing the existing four functions ```target_read_memory()``` and similar everywhere in OpenOCD code, too invasive!)\nThe code would be a copy/paste of the existing four functions, just passing ```ADDR_NO_AUTOINCR``` as last parameter to the internally called function.\nAdd in the implementation a check: if the called returns ```ERROR_TARGET_NOAUTOINCR_NOT_SUPPORTED```, then dump a ```LOG_DEBUG()``` and run a loop to execute single operation ```count``` times with ```ADDR_AUTOINCR```.\n\n3) patch to add the flag ```-no-autoincr``` to the commands ```mdX```, ```mwX```, ```read_memory``` and ```write_memory```. The flag is used to select which read/write function to use.\nIn this patch, don\u0027t add the modification to ```target_handle_md_output()``` that doesn\u0027t print the address.\n\n4) patch for riscv that uses the new parameter ```bool addr_autoincr```.\n\nCheck at this point if you really need to modify ```target_handle_md_output()```.\nI think that you can use the command ```read_memory``` instead of ```mdX```.","commit_id":"d6f647fb487f68de29832e8880872f22d08dea88"},{"author":{"_account_id":1002269,"name":"Bernhard Rosenkränzer","display_name":"Bernhard \"bero\" Rosenkränzer","email":"bero@baylibre.com","username":"bero","status":"BayLibre"},"change_message_id":"5684520754ff6c5c954d21b77cbee3ca27f549f9","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"985360e6_562cfa13","updated":"2024-05-09 17:01:02.000000000","message":"The style complaints that cause jenkins to fail are not introduced by this patch (merely exposed by it touching a few lines that already have \"unsigned\" parameters).","commit_id":"d6f647fb487f68de29832e8880872f22d08dea88"},{"author":{"_account_id":1002269,"name":"Bernhard Rosenkränzer","display_name":"Bernhard \"bero\" Rosenkränzer","email":"bero@baylibre.com","username":"bero","status":"BayLibre"},"change_message_id":"9f4a637e3cfe04c08dcf2a05064d7e719604592a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"f6a6b3e1_da882fe6","updated":"2024-06-02 17:44:49.000000000","message":"[sorry, got confused by Gerrit\u0027s UI, I thought I had actually sent those comments earlier but they were just drafts]","commit_id":"d6f647fb487f68de29832e8880872f22d08dea88"},{"author":{"_account_id":1002269,"name":"Bernhard Rosenkränzer","display_name":"Bernhard \"bero\" Rosenkränzer","email":"bero@baylibre.com","username":"bero","status":"BayLibre"},"change_message_id":"9f4a637e3cfe04c08dcf2a05064d7e719604592a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"3b229864_af570d0a","in_reply_to":"85c26b17_0ce181e1","updated":"2024-06-02 17:44:49.000000000","message":"The reason for submitting the patch as it is was that we\u0027re trying to(finally) get the bits from the riscv fork upstream to move further work on openocd directly to the upstream project -- so I\u0027m getting the bits that are in the riscv tree ready for upstreaming without modifying them too much.\n\nI agree that it\u0027s a much better solution to make this target independent though, will revise the patch (and temporarily return NOAUTOINCR_NOT_SUPPORTED for other targets) as suggested.\n\nMore coming, some of which will likely have similar issues.","commit_id":"d6f647fb487f68de29832e8880872f22d08dea88"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"15c0a59508ac643b3ea650627b8536f611375ef0","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"f80bbb7a_fb9788b1","in_reply_to":"985360e6_562cfa13","updated":"2024-05-10 10:31:41.000000000","message":"For this checkpatch issue, simply replace ```unsigned``` with ```unsigned int``` in the line you have modified.\nWe should run an automatic replacement in all the project, but I\u0027m afraid this will break patches pending in gerrit. Better going ahead fixing it while adding new code.","commit_id":"d6f647fb487f68de29832e8880872f22d08dea88"},{"author":{"_account_id":1002269,"name":"Bernhard Rosenkränzer","display_name":"Bernhard \"bero\" Rosenkränzer","email":"bero@baylibre.com","username":"bero","status":"BayLibre"},"change_message_id":"9f4a637e3cfe04c08dcf2a05064d7e719604592a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"e17a173e_3fbcb9d0","in_reply_to":"d9f0dd76_55f66aab","updated":"2024-06-02 17:44:49.000000000","message":"I\u0027ve never used coccinelle, but it certainly sounds interesting.\nBut I\u0027m almost done making the changes manually on this one. There\u0027s a few more changes from the riscv tree that will have similar issues, maybe one of those will be the best one to use coccinelle","commit_id":"d6f647fb487f68de29832e8880872f22d08dea88"},{"author":{"_account_id":1002269,"name":"Bernhard Rosenkränzer","display_name":"Bernhard \"bero\" Rosenkränzer","email":"bero@baylibre.com","username":"bero","status":"BayLibre"},"change_message_id":"9f4a637e3cfe04c08dcf2a05064d7e719604592a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"fe6f622a_d079c274","in_reply_to":"f80bbb7a_fb9788b1","updated":"2024-06-02 17:44:49.000000000","message":"Ack","commit_id":"d6f647fb487f68de29832e8880872f22d08dea88"}]}
