summaryrefslogtreecommitdiff
path: root/unix
AgeCommit message (Collapse)Author
2014-08-24py: Fix bug where GC collected native/viper/asm function data.Damien George
Because (for Thumb) a function pointer has the LSB set, pointers to dynamic functions in RAM (eg native, viper or asm functions) were not being traced by the GC. This patch is a comprehensive fix for this. Addresses issue #820.
2014-08-24unix, modtermios: Make it properly configurable; fix spelling mistake.Damien George
2014-08-23modtermios: Add "termios" unix module, subset of CPython's.Paul Sokolovsky
Also provides setraw() function from "tty" module (which in CPython is implemented in Python). The idea here is that 95% of "termios" module usage is to set raw mode to allow access to normal serial devices. Then, instead of exporting gazillion termios symbols, it's better to implement it in C, and export minimal number of symbols (mostly baud rates and drain values).
2014-08-18Merge pull request #796 from turbinenreiter/makeinstallPaul Sokolovsky
unix: Added install/uninstall
2014-08-16py: Put SystemExit in builtin namespace.Damien George
Also fix unix port so that SystemExit with no arg exits with value 0.
2014-08-13modzlibd: Decompress part of "zlib" module, based on miniz tinfl.c .Paul Sokolovsky
2014-08-11added install/uninstallSebastian Plamauer
2014-08-10modsocket: .recv() returns bytes object.Paul Sokolovsky
2014-08-04Put call to qstr_init and mp_init_emergency_exc_buf in mp_init.Damien George
qstr_init is always called exactly before mp_init, so makes sense to just have mp_init call it. Similarly with mp_init_emergency_exception_buf. Doing this makes the ports simpler and less error prone (ie they can no longer forget to call these).
2014-07-31py: Make MP_OBJ_NEW_SMALL_INT cast arg to mp_int_t itself.Damien George
Addresses issue #724.
2014-07-29Merge pull request #738 from dhylands/except-argsDamien George
Add support for storing args during an exception raised by an irq.
2014-07-28py: Implement __file__ attribute for modules.Paul Sokolovsky
2014-07-27py: Change stream protocol API: fns return uint; is_text for text.Damien George
2014-07-25Add support for storing args during an exception raised by an irq.Dave Hylands
The user code should call micropython.alloc_emergency_exception_buf(size) where size is the size of the buffer used to print the argument passed to the exception. With the test code from #732, and a call to micropython.alloc_emergenncy_exception_buf(100) the following error is now printed: ```python >>> import heartbeat_irq Uncaught exception in Timer(4) interrupt handler Traceback (most recent call last): File "0://heartbeat_irq.py", line 14, in heartbeat_cb NameError: name 'led' is not defined ```
2014-07-19Merge pull request #757 from stinos/windows-fsyncDamien George
Add fsync for windows, i.e. _commit. See dce8876
2014-07-19py: Add stream reading of n unicode chars; unicode support by default.Damien George
With unicode enabled, this patch allows reading a fixed number of characters from text-mode streams; eg file.read(5) will read 5 unicode chars, which can made of more than 5 bytes. For an ASCII stream (ie no chars > 127) it only needs to do 1 read. If there are lots of non-ASCII chars in a stream, then it needs multiple reads of the underlying object. Adds a new test for this case. Enables unicode support by default on unix and stmhal ports.
2014-07-16Add fsync for windows, i.e. _commit. See dce8876stijn
2014-07-13unix: file: No fsync() on Windows.v1.2Paul Sokolovsky
2014-07-13unix: file: Implement .flush() method.Paul Sokolovsky
This method apparently should be part of stream interface.
2014-07-13unix: Allow to disable MICROPY_EMIT_X64 from commandline.Paul Sokolovsky
emitnative in particular requires nlr_* to be real functions, so doesn't compile with MICROPY_NLR_SETJMP=1.
2014-07-09moductypes: Foreign data interface module, roughly based on ctype ideas.Paul Sokolovsky
But much smaller and memory-efficient. Uses Python builtin data structures (dict, tuple, int) to describe structure layout.
2014-07-03py: Implement sys.maxsize, standard way to check platform "bitness".Paul Sokolovsky
Implementing it as a static constant is a bit peculiar and require cooperation from long int implementation.
2014-07-03Rename machine_(u)int_t to mp_(u)int_t.Damien George
See discussion in issue #50.
2014-07-01stackctrl: Add "mp_" prefix.Paul Sokolovsky
2014-07-01modffi: Add special 'C' code for passing a callback function pointer.Paul Sokolovsky
2014-06-29Merge pull request #730 from stinos/windows-mpconfigPaul Sokolovsky
windows: Sync mpconfigport.h with the unix' version
2014-06-29modffi: Support short types.Paul Sokolovsky
2014-06-29windows: Sync mpconfigport.h with the unix' versionstijn
- rearrange/add definitions that were not there so it's easier to compare both - use MICROPY_PY_SYS_PLATFORM in main.c since it's available anyway - define EWOULDBLOCK, it is missing from ingw32
2014-06-28unix: Fix mpconfig.h not being included before misc.hstijn
This fixes count_lead_ones in misc.h not compiling due to unknown types
2014-06-28unix, stmhal: Add option for STR_UNICODE to mpconfigport.h.Damien George
Unicode is disabled by default for now, since FileIO.read(n) is currently not implemented for text-mode files, and this is an often function.
2014-06-27py: Move stack_ctrl_init() to mp_init().Paul Sokolovsky
As stack checking is enabled by default, ports which don't call stack_ctrl_init() are broken now (report RuntimeError on startup). Save them trouble and just init stack control framework in interpreter init.
2014-06-27Merge pull request #717 from stinos/dead-codePaul Sokolovsky
unix: Remove unused CTRL-D definition
2014-06-27py: Add portable framework to query/check C stack usage.Paul Sokolovsky
Such mechanism is important to get stable Python functioning, because Python function calling is handled with C stack. The idea is to sprinkle STACK_CHECK() calls in places where there can be C recursion. TODO: Add more STACK_CHECK()'s.
2014-06-25unix: Remove unused CTRL-D definitionstijn
2014-06-24Merge pull request #690 from stinos/msvc-gcPaul Sokolovsky
msvc: Enable GC
2014-06-24modsocket: Fix uClibc detection.Paul Sokolovsky
2014-06-24unix: Dump default heap size in usage message.Paul Sokolovsky
2014-06-22unix: Don't error out on #warning directive.Paul Sokolovsky
2014-06-22modsocket: Workaround uClibc issue with numeric port for getaddrinfo().Paul Sokolovsky
It sucks to workaround this on uPy side, but upgrading not upgradable embedded systems sucks even more.
2014-06-22modsocket: Add call to freeaddrinfo().Paul Sokolovsky
2014-06-22unix: uClibc doesn't like NULL as a buffer arg to realpath().Paul Sokolovsky
So, allocate one explicitly.
2014-06-22gc: Use simple cast instead of union to silence compilerstijn
2014-06-22windows: Enable GC and implement bss start and end symbolsstijn
The pointers to the bss section are acquired in init.c() by inspecting the PE header. Works for msvc and mingw.
2014-06-22py: Support arm and thumb ARM ISAs, in addition to thumb2.Paul Sokolovsky
These changes were tested with QEMU, and by few people of real hardware.
2014-06-20unix: Allow to override MICROPY_GCREGS_SETJMP from cmdline.Paul Sokolovsky
2014-06-20unix: Add CFLAGS_EXTRA & LDFLAGS_EXTRA for command line usage.Paul Sokolovsky
The idea is that it should be possible to pass any additional params for experimentation without need to patch sources (and without need to deviate from or repeat baseline options).
2014-06-20unix: Refactor order file munging fo MacOSX.Paul Sokolovsky
2014-06-20unix: Group CFLAGS related stuff together.Paul Sokolovsky
2014-06-20unix: Allow to override compiler warning options without touching the rest.Paul Sokolovsky
Some people want to enable even more warnings. Let them do it without putting burden on everyone. Some people vice versa think that current settings should be relaxed. In this regard, -Werror is the most problematic, it disallows to use #warning directive, and disallows to pass configuration settings on make command lines. Again, until decided how to deal with these globally, allow to work around these problems locally.
2014-06-19Prefix ARRAY_SIZE with micropython prefix MP_Emmanuel Blot