summaryrefslogtreecommitdiff
path: root/unix
AgeCommit message (Collapse)Author
2016-01-17extmod/modurandom: Add "urandom" module.Paul Sokolovsky
Seedable and reproducible pseudo-random number generator. Implemented functions are getrandbits(n) (n <= 32) and seed(). The algorithm used is Yasmarang by Ilya Levin: http://www.literatecode.com/yasmarang
2016-01-15unix/modffi: Allow to compile modffi in OBJ_REPR_D mode.Damien George
2016-01-15unix/.gitignore: Add nanbox build output to ignore list.Damien George
2016-01-15unix: Add option to build 64-bit NaN-boxing interpreter.Damien George
Build using: make nanbox
2016-01-11unix: Allow to build coverage build with OBJ_REPR_D.Damien George
2016-01-11unix: Add socket.inet_ntop functionDave Hylands
2016-01-11py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.Damien George
The first argument to the type.make_new method is naturally a uPy type, and all uses of this argument cast it directly to a pointer to a type structure. So it makes sense to just have it a pointer to a type from the very beginning (and a const pointer at that). This patch makes such a change, and removes all unnecessary casting to/from mp_obj_t.
2016-01-11py: Change type signature of builtin funs that take variable or kw args.Damien George
With this patch the n_args parameter is changed type from mp_uint_t to size_t.
2016-01-11py: Change type of .make_new and .call args: mp_uint_t becomes size_t.Damien George
This patch changes the type signature of .make_new and .call object method slots to use size_t for n_args and n_kw (was mp_uint_t. Makes code more efficient when mp_uint_t is larger than a machine word. Doesn't affect ports when size_t and mp_uint_t have the same size.
2016-01-10unix/modtime: strftime(): Support 2nd argument, but as time_t value.Paul Sokolovsky
Instead of struct tm like structure, as required by CPython.
2016-01-03py: Change struct and macro for builtin fun so they can be type checked.Damien George
2016-01-02unix/Makefile: Move include of mpconfigport.mk to before mkenv.mk.Damien George
So that if MICROPY_FORCE_32BIT is set mpconfigport.mk it influences mkenv.mk.
2016-01-02unix/.gitignore: Ignore gcov files.Paul Sokolovsky
2016-01-01unix/unix_mphal: Be sure to wrap dupterm code with MICROPY_PY_OS_DUPTERM.Paul Sokolovsky
2016-01-01unix/unix_mphal: Handle exceptions in call to dupterm's .read().Paul Sokolovsky
2016-01-01extmod/moduos_dupterm: Make mp_uos_dupterm_tx_strn() function reusable.Paul Sokolovsky
Function to actually spool output terminal data to dupterm object.
2016-01-01py: Clean up instantiation of dupterm object.Paul Sokolovsky
To comply with already established scheme for extmod's.
2016-01-01py/mpconfig: Make configuration of dupterm object reusable.Paul Sokolovsky
2016-01-01extmod/moduos_dupterm: Make uos.dupterm() implementation reusable.Paul Sokolovsky
That's just function which sets/gets dup terminal object, and can be easily reused across ports.
2015-12-28unix: Implement uos.dupterm(). Conditional on MICROPY_PY_OS_DUPTERM.Paul Sokolovsky
2015-12-23unix/unix_mphal: Raise KeyboardInterrupt straight from signal handler.Paul Sokolovsky
POSIX doesn't guarantee something like that to work, but it works on any system with careful signal implementation. Roughly, the requirement is that signal handler is executed in the context of the process, its main thread, etc. This is true for Linux. Also tested to work without issues on MacOSX.
2015-12-22unix: Properly cancel REPL input when Ctrl-C is pressed.Damien George
2015-12-18unix: machine_mem improvementsDave Hylands
This basically introduces the MICROPY_MACHINE_MEM_GET_READ_ADDR and MICROPY_MACHINE_MEM_GET_WRITE_ADDR macros. If one of them is not defined, then a default identity function is provided.
2015-12-18ports: Rename "machine" module to "umachine".Paul Sokolovsky
To let unix port implement "machine" functionality on Python level, and keep consistent naming in other ports (baremetal ports will use magic module "symlinking" to still load it on "import machine"). Fixes #1701.
2015-12-18windows: Make keyboard_interrupt_obj available, it's standard feature.Paul Sokolovsky
2015-12-18unix/unix_mphal: Just consistently set sigaction.sa_flags to 0.Paul Sokolovsky
2015-12-17unix/unix_mphal: Properly initialize struct sigaction.Paul Sokolovsky
This solves long-standing non-deterministic bug, which manifested itself on x86 32-bit (at least of reported cases) - segfault on Ctrl+C (i.e. SIGINT).
2015-12-16unix: Change define logic of _DIRENT_HAVE_D_INO to match other macros.Damien George
2015-12-16unix: Add FreeDos targetpohmelie
2015-12-16unix/modos: Fix silly bugs in ilistdir tuple creation.Damien George
2015-12-16unix/modos: Allow to configure use of d_ino using _DIRENT_HAVE_D_INO.Damien George
Ports will need to #define _DIRENT_HAVE_D_INO (0) to disable d_ino use.
2015-12-16uos: Add errno() function to get/set errno value.Paul Sokolovsky
2015-12-14unix/modos: Implement ilistdir().Paul Sokolovsky
ilistdir() returns iterator which yields triples of (name, type, ino) where ino is inode number for entry's data, type of entry (file/dir/etc.), and name of file/dir. listdir() can be easily implemented in terms of this iterator (which is otherwise more efficient in terms of memory use and may save expensive call to stat() for each returned entry). CPython has os.scandir() which also returns an iterator, but it yields more complex objects of DirEntry type. scandir() can also be easily implemented in terms of ilistdir().
2015-12-14unix/modtime: Add strftime() function (only single argument is supported).Paul Sokolovsky
Following "don't rely on FFI for basic functionality" approach.
2015-12-13unix/moduselect: Make configurable with MICROPY_PY_USELECT.Paul Sokolovsky
2015-12-13unix: Move modmachine into unix directoryDave Hylands
This leaves behind the common functionality in extmod/machine_mem.c which can be used by all ports.
2015-12-12unix: Rename "_os" module to "uos" for consistency with baremetal ports.Paul Sokolovsky
2015-12-11unix/moduselect: Implement "one-shot" flag for poll.poll().Paul Sokolovsky
After an I/O event is triggered for fd, event flags are automatically reset, so no further events are reported until new event flags are set. This is an optimization for uasyncio, required to account for coroutine semantics: each coroutine issues explicit read/write async call, and once that trigger, no events should be reported to coroutine, unless it again explicitly requests it. One-shot mode saves one linear scan over the poll array.
2015-12-09unix/modtermios: DJGPP appears to have unicode-capable cc_t type.Paul Sokolovsky
At least it's defined as "unsiged". We don't try to support unicode still, but at least apply workaround for DJGPP build.
2015-12-09unix/modtermios: Provide B57600 and B115200 constants only if defined.Paul Sokolovsky
2015-12-07unix/main: mp_verbose_flag available only if MICROPY_DEBUG_PRINTERS is true.Paul Sokolovsky
Not available for minimal build for example.
2015-12-07py: Add MICROPY_PY_BUILTINS_MIN_MAX, disable for minimal ports.pohmelie
2015-12-05unix/moduselect: register(): Allow to call with duplicate file descriptor.Paul Sokolovsky
Per CPython docs, "Registering a file descriptor that’s already registered is not an error, and has the same effect as registering the descriptor exactly once." https://docs.python.org/3/library/select.html#select.poll.register That's somewhat ambiguous, what's implemented here is that if fd si not yet registered, it is registered. Otherwise, the effect is equivalent to modify() method.
2015-12-04unix/main: Check pending exception at the end of code block execution.Paul Sokolovsky
Usually this checking is done by VM on jump instructions, but for linear sequences of instructions and builtin functions this won't happen. Particular target of this change is long-running builtin functions like time.sleep().
2015-12-03unix/mpconfigport: Typo fix in comment.Paul Sokolovsky
2015-12-02unix/mpconfigport.h: For MICROPY_NO_ALLOCA=1, don't even include alloca.h.Paul Sokolovsky
2015-12-02unix/modtime: sleep(): Return early if KeyboardInterrupt is pendingPaul Sokolovsky
As set by signal handler. This assumes that exception will be raised somewhere else, which so far doesn't happen for single function call. Still, it makes sense to handle that in some common place.
2015-11-30unix/moduselect: Support growing of poll array.Paul Sokolovsky
2015-11-29py: Wrap all obj-ptr conversions in MP_OBJ_TO_PTR/MP_OBJ_FROM_PTR.Damien George
This allows the mp_obj_t type to be configured to something other than a pointer-sized primitive type. This patch also includes additional changes to allow the code to compile when sizeof(mp_uint_t) != sizeof(void*), such as using size_t instead of mp_uint_t, and various casts.
2015-11-29py: Add MP_ROM_* macros and mp_rom_* types and use them.Damien George