Wykres commitów

11 Commity (6f934a396ef320ee5ade3de95135818e1683aefd)

Autor SHA1 Wiadomość Data
nightwalker-87 6f934a396e Whitespace cleanup 2020-04-15 16:20:17 +02:00
Slyshyk Oleksiy d040db5585 fixed few potential memory/resource leaks (#803)
also few cppcheck warnings
2019-05-13 16:58:30 +02:00
donmr 27ce268a78 Mem write odd (#730)
* Use local variable for read_result instead of *ret, and fix
calculation of *ret for EOF case.

* Found a problem when reading an odd (%4) number of bytes at the end
of a file.  fread (on stm32) get them (say 3 bytes), then askes for
more.  do_semihosting gets a read return of 0 and tries to write that.
mem_write alters the address to be aligned and overwrites then 3 bytes
from the last read.

This change simply tells mem_write to do nothing if len is 0.

* Fix Issues from Fabien-Chouteau's review of my previous patch in isue #727.

* Revert change to mem_write() so it does not confuse fixes to do_semihosting().

* Add cast to avoid warning.

* Restore change to mem_write to return immeadiately if len == 0.
Add more comments on further possible issues and ways to handle them.
Using a branch to separate this change from others as it may need
more discussion and go on for a while...

* Remove cast of "-1" to uint32_t.  It's now compared to a ssize_t
and the compiler should be fine with that without any cast.
2018-08-01 11:05:31 +02:00
donmr ea98ab7bf2 Fix to cast in changes for SYS_READ. (#731)
* Remove cast of "-1" to uint32_t.  It's now compared to a ssize_t
and the compiler should be fine with that without any cast.
2018-08-01 11:03:35 +02:00
donmr 07a76b01ee Fixes to SYS_READ changes in PR #727 per review. (#729)
* Use local variable for read_result instead of *ret, and fix
calculation of *ret for EOF case.

* Found a problem when reading an odd (%4) number of bytes at the end
of a file.  fread (on stm32) get them (say 3 bytes), then askes for
more.  do_semihosting gets a read return of 0 and tries to write that.
mem_write alters the address to be aligned and overwrites then 3 bytes
from the last read.

This change simply tells mem_write to do nothing if len is 0.

* Fix Issues from Fabien-Chouteau's review of my previous patch in isue #727.

* Revert change to mem_write() so it does not confuse fixes to do_semihosting().

* Add cast to avoid warning.
2018-07-28 11:45:09 +02:00
donmr ca6ecc4cfd semihosting: Use local variable for read_result instead of *ret, and fix calculation of *ret for EOF case (#727) 2018-07-26 18:42:45 +02:00
Slyshyk Oleksiy 3d24377c28 Now able build by MinGW. All warnings were fixed. (#584)
* fix wrong libusb extract command

* update libusb to 1.0.21 under windows

* fix few -Wformat warnings

* add usleep realisation for win32

* Get rid of unused defines in mimgw.h

* fix format warning for mingw

* Add prefix SEMIXOST_ to semihost defines.
Fix redefine warnings of mingw.
2017-04-07 19:17:46 +02:00
Fabien Chouteau f62895b2cf Semihosting: Add support of SYS_READC (#546) 2017-01-31 07:29:44 +01:00
Bertrand Songis e71a2417c3 Compilation fixes (errors / warnings) (#552) 2017-01-30 23:16:36 +01:00
Fabien Chouteau 3a1ab6e3e0 Improve ARM semi-hosting support
This patch adds the following operations:

 - SYS_OPEN
 - SYS_CLOSE
 - SYS_WRITE
 - SYS_READ
 - SYS_ERRNO
 - SYS_REMOVE
 - SYS_SEEK

The use of utility functions mem_read() and mem_write() add an
unnecessary memcpy() call. All buffer transfer could be done directly in
the sl->q_buf data instead of using a temporary transfer buffer.
However, given the relative slowness of target memory transfer, I don't
think that this has a big impact on performances
2016-08-12 15:59:46 +02:00
Fabien Chouteau d0910c66d7 Prototype of ARM semihosting support 2016-08-10 17:28:11 +02:00