summaryrefslogtreecommitdiff
path: root/unix
AgeCommit message (Collapse)Author
2016-08-07py/objstr: Make .partition()/.rpartition() methods configurable.Paul Sokolovsky
Default is disabled, enabled for unix port. Saves 600 bytes on x86.
2016-08-07unix/moduselect: Allow poll.register(), etc. accept fd-like objects.Paul Sokolovsky
This includes file and socket objects, backed by Unix file descriptor. This improves compatibility with stmhal's uselect (and convenience of use), though not completely: return value from poll.poll() is still raw file descriptor.
2016-08-06unix: Enable websocket module.Paul Sokolovsky
2016-07-31unix/Makefile: And note why btree module is disabled for coverage build.Paul Sokolovsky
2016-07-30py/mpconfig.h: Add MICROPY_STREAMS_POSIX_API setting.Paul Sokolovsky
To filter out even prototypes of mp_stream_posix_*() functions, which require POSIX types like ssize_t & off_t, which may be not available in some ports.
2016-07-28unix/file: Use generic stream flush() method.Paul Sokolovsky
2016-07-27unix/file: fdfile_ioctl(): Fix argument to check_fd_is_open().Paul Sokolovsky
2016-07-27unix/file: ioctl(): Check that file is open before operations.Paul Sokolovsky
2016-07-27unix/file: Implement MP_STREAM_FLUSH ioctl.Paul Sokolovsky
2016-07-26unix/mpconfigport.h: Include stdio.h by default.Paul Sokolovsky
This allows to use printf() in a any source file with unix port, for quick debugging.
2016-07-22unix: Enable MICROPY_PY_STR_BYTES_CMP_WARN.Paul Sokolovsky
Also, fix a warning text (remove "duplicate" BytesWarning).
2016-07-21unix: Disable MICROPY_GC_ALLOC_THRESHOLD for minimal build.Paul Sokolovsky
2016-07-16unix: Cache libaxtls.a in local build dir.Paul Sokolovsky
Allows to build the library variant for other ports in parallel.
2016-07-13extmod/modussl_axtls: Further changes to allow alternative SSL modules.Paul Sokolovsky
Make variable MICROPY_SSL_AXTLS=1 should be defined to activate modussl_axtls and link with -laxtls.
2016-07-11unix/mpthreadport: Adjust minimum thread stack, and stack limit check.Damien George
The minimum thread stack size is set by pthreads (16k bytes) so we must use that value for our minimum. The stack limit check is also adjusted to work correctly for 32-bit builds.
2016-07-09unix: Disable the GIL to improve performance of non-thread code.Damien George
Threading support is still very new so stay conservative at this point and enable threading without the GIL. This requires users to protect concurrent access of mutatable Python objects (eg lists) with locks at the Python level (something you should probably do anyway). The advantage is that there is less of a performance hit for non-threaded code, because the VM does not need to constantly release/acquire the GIL. In the future the GIL will be made more efficient. There is also room to improve the efficiency of non-GIL code by not using mutex's if there is only one thread active.
2016-07-09unix/main: When preparing sys.path, allocate exact strings on uPy heap.Paul Sokolovsky
Due to the way modern compilers work (allocating space for stack vars once at tha start of function, and deallocating once on exit from), using intermediate stack buffer of big size caused blockage of 4K (PATH_MAX) on stack for the entire duration of MicroPython execution.
2016-07-08unix/main: Improve help for -X options a bit.Paul Sokolovsky
2016-07-08unix/main: Error out on unknown value of suffix in -X heapsize= option.Paul Sokolovsky
E.g. -X heapsize=16Kfoo, -X heapsize=1G will lead to error.
2016-07-03unix/mpconfigport_minimal.h: Allow to print a string within 1KB of heap.Paul Sokolovsky
By adjusting parser allocation policy.
2016-07-03unix/Makefile: Make "minimal" build be minimal again.Paul Sokolovsky
2016-07-02unix: Enable btree module.Paul Sokolovsky
But disable it for coverage build, as its extra warninsg aren't compatible with K&R C BerkeleyDB uses.
2016-06-28py/modthread: Allow to properly set the stack limit of a thread.Damien George
We rely on the port setting and adjusting the stack size so there is enough room to recover from hitting the stack limit.
2016-06-28unix/modtime: Release the GIL when sleeping.Damien George
2016-06-28unix/mpthreadport: Suppress compiler warning about unused arguments.Damien George
2016-06-28unix/gccollect: Provide declaration of exported function.Damien George
2016-06-28unix/mpthreadport: Use SA_SIGINFO for GC signal handler.Damien George
SA_SIGINFO allows the signal handler to access more information about the signal, especially useful in a threaded environment. The extra information is not currently used but it may prove useful in the future.
2016-06-28unix: Implement garbage collection with threading.Damien George
This patch allows any given thread to do a proper garbage collection and scan all the pointers of all active threads.
2016-06-28unix/file: If write syscall returns because of EINTR then try again.Damien George
As per PEP-475.
2016-06-28py/modthread: Implement lock object, for creating a mutex.Damien George
2016-06-28py/modthread: Add stack_size() function.Damien George
2016-06-28unix: Add basic thread support using pthreads.Damien George
Has the ability to create new threads.
2016-06-28py: Add MP_STATE_THREAD to hold state specific to a given thread.Damien George
2016-06-27unix: Fix Makefile to handle gc-sections linker flags on Mac OS.Martin Müller
The linker flag --gc-sections is not available on the linker used on Mac OS X which results in an error when linking micropython on Mac OS X. Therefore move this option to the LDFLAGS_ARCH variable on non Darwin systems. According to http://stackoverflow.com/a/17710056 the equivalent to --gc-sections is -dead_strip thus this option is used for the LDFLAGS_ARCH on Darwin systems.
2016-06-19unix/modmachine: Enable time_pulse_us() function.Paul Sokolovsky
2016-06-18unix/modmachine: Include PinBase class.Paul Sokolovsky
2016-06-18all: Rename mp_obj_type_t::stream_p to protocol.Paul Sokolovsky
It's now used for more than just stream protocol (e.g. pin protocol), so don't use false names.
2016-06-18unix: Disable FatFs VFS for normal build, keep enabled for coverage.Paul Sokolovsky
It's enabled mostly for unit testing, and we do that in full with coverage build.
2016-06-18unix/alloc: Make coverage build and its overzealous warnings happy.Paul Sokolovsky
2016-06-18unix/alloc: Add option to use uPy's alloc-exec implementation even for libffi.Paul Sokolovsky
When built for Linux, libffi includes very bloated and workaround exec-alloc implementation required to work around SELinux and other "sekuritee" features which real people don't use. MicroPython has own alloc-exec implementation, used to alloc memory for @micropython.native code. With this option enabled, uPy's implementation will override libffi's. This saves 11K on x86_64 (and that accounts for more than half of the libffi code size). TODO: Possibly, we want to refactor this option to allow either use uPy's implementation even for libffi, or allow to use libffi's implementation even for uPy.
2016-06-18unix/Makefile: libffi: Build with -Os.Paul Sokolovsky
Also try to use -fno-exceptions. Other options taken from libffi's configure defaults.
2016-06-17unix: Move "utime" module config to C level instead of make level.Paul Sokolovsky
2016-06-17unix: Time to build with --gc-sections.Paul Sokolovsky
This actually saves "only" 6K for x86_64 build, as we're still more or less careful to #ifdef unneeded code. But relying on --gc-sections in a "lazy" manner would allow to make #ifdef'ing less pervasive (not suggested right away, but an option for the future).
2016-06-16unix: Deprecate support for GNU Readline (MICROPY_USE_READLINE=2).Paul Sokolovsky
MicroPython own readline implementation is superior now by providing automatic indentation and completion (completion for GNU Readline was never implemented). MICROPY_USE_READLINE=2 also wasn't build for a long time and probably broken. If GNU Readline is still beneficial for some cases, it can be achieved with external wrappers like "rlwrap" (there will be the same level of functionality, as again, there never was deep integration, like completion support).
2016-06-16unix/mpconfigport_minimal.h: Clearly mark where user-define config ends.Paul Sokolovsky
TODO: Do the same for other config files.
2016-06-16unix: Unbreak "minimal" target by disabling FatFs.Paul Sokolovsky
Was broken since introduction of FatFs support.
2016-06-15py/mpconfig.h: MP_NOINLINE is universally useful, move from unix port.Paul Sokolovsky
2016-05-31extmod/vfs_fat.c: Add vfs.stat().Robert HH
The call to stat() returns a 10 element tuple consistent to the os.stat() call. At the moment, the only relevant information returned are file type and file size.
2016-05-28unix/Makefile: "make axtls": Automatically fetch submodules if missing.Paul Sokolovsky
Try to emulate "you can build without reading instructions" behavior as far as possible.
2016-05-28unix/mpconfigport.mk: Document MICROPY_STANDALONE make-level option.Paul Sokolovsky
Avoid using system libraries, use copies bundled with MicroPython as submodules (currently affects only libffi, other dependencies either already used as bundled-only (axtls), or can't be bundled (so far), like libjni).