summaryrefslogtreecommitdiffstatshomepage
path: root/unix
Commit message (Collapse)AuthorAge
* lib/mp-readline: Add emacs-style control characters for cursor movement.Tom Soulanille2015-07-26
| | | | Disabled by default. Adds 108 bytes to Thumb2 arch when enabled.
* unix: modsocket: Implement inet_pton() in preference of inet_aton().Paul Sokolovsky2015-07-15
| | | | | | | | inet_pton supports both ipv4 and ipv6 addresses. Interface is also extensible for other address families, but underlying libc inet_pton() function isn't really extensible (e.g., it doesn't return length of binary address, i.e. it's really hardcoded to AF_INET and AF_INET6). But anyway, on Python side, we could extend it to support other addresses.
* unix: modsocket: Implement recvfrom().Paul Sokolovsky2015-07-14
| | | | Required to implement UDP servers.
* unix: modsocket: Implement sendto().Paul Sokolovsky2015-07-12
| | | | | | | | | sendto() turns out to be mandatory function to work with UDP. It may seem that connect(addr) + send() would achieve the same effect, but what connect() appears to do is to set source address filter on a socket to its argument. Then everything falls apart: socket sends to a broad-/multi-cast address, but reply is sent from real peer address, which doesn't match filter set by connect(), so local socket never sees a reply.
* unix: socket.getaddrinfo: Port is unsigned value.Paul Sokolovsky2015-07-11
| | | | Treating it as signed lead to buffer overflow for ports >= 32768.
* unix: socket.getaddrinfo: Accept family & socktype arguments.Paul Sokolovsky2015-07-10
| | | | This usually allows to get just a single address entry.
* modmachine: Implement physical memory access using /dev/mem (Linux, etc).Paul Sokolovsky2015-07-08
| | | | | | | | | | This requires root access. And on recent Linux kernels, with CONFIG_STRICT_DEVMEM option enabled, only address ranges listed in /proc/iomem can be accessed. The above compiled-time option can be however overriden with boot-time option "iomem=relaxed". This also removed separate read/write paths - there unlikely would be a case when they're different.
* unix: Add O_WRONLY | O_CREAT to open call when opening file for append ("a").Ari Suutari2015-06-21
| | | | To comply with Python semantics.
* py: Use a wrapper to explicitly check self argument of builtin methods.Damien George2015-06-20
| | | | | | | | | | | | | | | Previous to this patch a call such as list.append(1, 2) would lead to a seg fault. This is because list.append is a builtin method and the first argument to such methods is always assumed to have the correct type. Now, when a builtin method is extracted like this it is wrapped in a checker object which checks the the type of the first argument before calling the builtin function. This feature is contrelled by MICROPY_BUILTIN_METHOD_CHECK_SELF_ARG and is enabled by default. See issue #1216.
* unix: Allow to cat a script into stdin from the command line.Damien George2015-06-04
| | | | See issue #1306.
* unix: Update .gitignore; now ignores coverage build.Damien George2015-06-03
|
* unix: Prepare upip frozen modules under build/.Paul Sokolovsky2015-06-03
|
* unix: Uncompress upip tarball to build directory.Paul Sokolovsky2015-06-03
|
* unix: Include upip as fronzen modules inside the standard interpreter.Paul Sokolovsky2015-06-02
| | | | | | | | | MicroPython doesn't come with standard library included, so it is important to be able to easily install needed package in a seamless manner. Bundling package manager (upip) inside an executable solves this issue. upip is bundled only with standard executable, not "minimal" or "fast" builds.
* unix: Print an extra newline to the output on ctrl-Dstijn2015-05-30
| | | | | This assures the terminal prints it's prompt on a fresh line instead of appending it to the uPy prompt after exit.
* unix: minimal: Don't use readline support.Paul Sokolovsky2015-05-30
| | | | | After switching to builtin readline support, "minimal" no longer builds, and minimal doesn't really need readline support.
* unix: Allow to override default sys.path value.Paul Sokolovsky2015-05-30
| | | | | | | Using MICROPY_PY_SYS_PATH_DEFAULT macro define. A usecase is building a distribution package, which should not have user home path by default in sys.path. In such case, MICROPY_PY_SYS_PATH_DEFAULT can be defined on make command-line (using CFLAGS_EXTRA).
* tests: Add special tests to test mp_printf function to improve coverage.Damien George2015-05-28
|
* unix: Add option to use uPy readline, and enable by default.Damien George2015-05-27
| | | | | | This gets uPy readline working with unix port, with tab completion and history. GNU readline is still supported, configure using MICROPY_USE_READLINE variable.
* unix: Factor out stdio and ctrl-C code to unix_mphal.c file.Damien George2015-05-27
|
* Revert "unix: Include stdio.h to allow easy debugging with printf()."Paul Sokolovsky2015-05-17
| | | | | This reverts commit 8fbabab1a80efa8b9c0654f63b2157d8f8299955. Turned to cause problems on MacOSX.
* unix: Add some extra coverage tests for vstr and attrtuple.Damien George2015-05-12
|
* unix: Include stdio.h to allow easy debugging with printf().Paul Sokolovsky2015-05-10
|
* unix: Print unhandled exception to stderr, like CPython does.Paul Sokolovsky2015-05-10
|
* unix: Fix thumb2 vs arm native emitter auto-detection.Paul Sokolovsky2015-05-08
| | | | Make thumb2 have priority over arm.
* unix: Make extra-coverage function callable from Python scripts.Damien George2015-05-08
| | | | | This allows the output of the extra-coverage tests to be checked using the normal run-tests script.
* unix: Add special function to improve coverage.Damien George2015-05-08
| | | | | | The function and corresponding command-line option are only enabled for the coverage build. They are used to exercise uPy features that can't be properly tested by Python scripts.
* modbuiltins: Add NotImplemented builtin constant.Paul Sokolovsky2015-05-04
| | | | | | | | | | | | From https://docs.python.org/3/library/constants.html#NotImplemented : "Special value which should be returned by the binary special methods (e.g. __eq__(), __lt__(), __add__(), __rsub__(), etc.) to indicate that the operation is not implemented with respect to the other type; may be returned by the in-place binary special methods (e.g. __imul__(), __iand__(), etc.) for the same purpose. Its truth value is true." Some people however appear to abuse it to mean "no value" when None is a legitimate value (don't do that).
* modmachine: Add new module to access hardware, starting with physical memory.Paul Sokolovsky2015-05-04
| | | | | Refactored from "stm" module, provides mem8, mem16, mem32 objects with array subscript syntax.
* unix/modffi.c: get_buffer is allowed to return NULL if len=0.Damien George2015-05-01
| | | | | This is consistent with the logic in mp_get_buffer, and the code here is an inlined version of that function.
* py: Replace py-version.sh with makeversionhdr.py, written in Python.Damien George2015-04-28
| | | | Also rename py-version.h to mpversion.h for consistency with mpconfig.h.
* unix/modffi: Support passing float/double args.Damien George2015-04-28
|
* modsys: Add basic sys.exc_info() implementation.Paul Sokolovsky2015-04-25
| | | | | | The implementation is very basic and non-compliant and provided solely for CPython compatibility. The function itself is bad Python2 heritage, its usage is discouraged.
* py: Overhaul and simplify printf/pfenv mechanism.Damien George2015-04-16
| | | | | | | | | | | | | | | | | | | | | | Previous to this patch the printing mechanism was a bit of a tangled mess. This patch attempts to consolidate printing into one interface. All (non-debug) printing now uses the mp_print* family of functions, mainly mp_printf. All these functions take an mp_print_t structure as their first argument, and this structure defines the printing backend through the "print_strn" function of said structure. Printing from the uPy core can reach the platform-defined print code via two paths: either through mp_sys_stdout_obj (defined pert port) in conjunction with mp_stream_write; or through the mp_plat_print structure which uses the MP_PLAT_PRINT_STRN macro to define how string are printed on the platform. The former is only used when MICROPY_PY_IO is defined. With this new scheme printing is generally more efficient (less layers to go through, less arguments to pass), and, given an mp_print_t* structure, one can call mp_print_str for efficiency instead of mp_printf("%s", ...). Code size is also reduced by around 200 bytes on Thumb2 archs.
* input.c: Fix line-endings after recent changes.Paul Sokolovsky2015-04-10
|
* unix: Automatically fix incompatible readline build options.stijn2015-04-09
|
* py: Add MICROPY_PY_BUILTINS_REVERSED, disable for minimal ports.Paul Sokolovsky2015-04-07
|
* py: Add MICROPY_PY_BUILTINS_ENUMERATE, disable for minimal ports.Paul Sokolovsky2015-04-06
|
* objstr: Add .splitlines() method.Paul Sokolovsky2015-04-04
| | | | | | | | | splitlines() occurs ~179 times in CPython3 standard library, so was deemed worthy to implement. The method has subtle semantic differences from just .split("\n"). It is also defined as working for any end-of-line combination, but this is currently not implemented - it works only with LF line-endings (which should be OK for text strings on any platforms, but not OK for bytes).
* unix: Add stackless config settings, for easy access.Paul Sokolovsky2015-04-03
|
* py: Add optional support for descriptors' __get__ and __set__ methods.stijn2015-03-26
| | | | Disabled by default. Enabled on unix and windows ports.
* unix: Remove -Wdouble-promotion from main build, and 2 from coverage.Damien George2015-03-22
| | | | | The 2 removed from coverage build are: -Wredundant-decls and -Wstrict-prototypes.
* unix: Bump stack limit and adjust for 64-bitness.Paul Sokolovsky2015-03-21
| | | | Without that, "import http.client" failed due to max recursion.
* py: Allow retrieving a function's __name__.stijn2015-03-20
| | | | Disabled by default. Enabled on unix and stmhal ports.
* unix: When using separate obj output dirs, make -B is no longer relevant.Paul Sokolovsky2015-03-21
|
* unix: Move compiler warnings from production build to coverage build.Damien George2015-03-20
|
* py: Implement core of OrderedDict type.Paul Sokolovsky2015-03-20
| | | | | | | | | | | | Given that there's already support for "fixed table" maps, which are essentially ordered maps, the implementation of OrderedDict just extends "fixed table" maps by adding an "is ordered" flag and add/remove operations, and reuses 95% of objdict code, just making methods tolerant to both dict and OrderedDict. Some things are missing so far, like CPython-compatible repr and comparison. OrderedDict is Disabled by default; enabled on unix and stmhal ports.
* unix: Enable extra compiler warnings.Damien George2015-03-19
| | | | To address issue #699.
* py: Add MICROPY_COMP_{DOUBLE,TRIPLE}_TUPLE_ASSIGN config options.Damien George2015-03-14
| | | | | | These allow to fine-tune the compiler to select whether it optimises tuple assignments of the form a, b = c, d and a, b, c = d, e, f. Sensible defaults are provided.
* unix: Support readline history saving to file, improves interactive usage.Paul Sokolovsky2015-03-13
|