aboutsummaryrefslogtreecommitdiff
path: root/unix
AgeCommit message (Collapse)Author
2015-09-26unix/modjni: call_method(): If name doesn't match, cleanup via goto next_method.Paul Sokolovsky
2015-09-26unix/modjni: Need to really use per-rettype Call*Method functions.Paul Sokolovsky
2015-09-24unix/modjni: new_jobject(): Handle null reference.Paul Sokolovsky
2015-09-23unix/modjni: Factor out is_object_type().Paul Sokolovsky
2015-09-22unix/modffi.c: cast first to intptr_t when casting from/to pointerVicente Olivert Riera
This fixes errors like these ones: modffi.c: In function 'return_ffi_value': modffi.c:143:29: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] const char *s = (const char *)val; ^ modffi.c:162:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] return (mp_obj_t)val; ^ modffi.c: In function 'ffifunc_call': modffi.c:358:25: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] values[i] = (ffi_arg)a; ^ modffi.c:373:25: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] values[i] = (ffi_arg)s; ^ modffi.c:381:25: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] values[i] = (ffi_arg)bufinfo.buf; ^ modffi.c:384:25: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] values[i] = (ffi_arg)p->func; ^ These errors can be highlighted when building micropython from MIPS64 n32 because ffi_arg is 64-bit wide and the pointers on MIPS64 n32 are 32-bit wide, so it's trying to case an integer to a pointer (or vice-versa) of a different size. We should cast first the pointer (or the integer) to a pointer sized integer (intptr_t) to fix that problem. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
2015-09-22unix/modjni: Move type analysis logic to new_jobject(), for reuse.Paul Sokolovsky
2015-09-21unix/modjni: Support for subscripting of Java lists (r/o so far).Paul Sokolovsky
2015-09-20unix/modjni: jvalue2py: Handle boolean.Paul Sokolovsky
2015-09-19unix: Use MICROPY_HAL_H macro for header inclusion.Alex March
Follow the same format as other ports using the macro to include the HAL header.
2015-09-19unix/modjni: py2jvalue: Pass jobject's down to Java.Paul Sokolovsky
So far, no signature check is done (TODO).
2015-09-18unix/modjni: py2jvalue: Handle both int and long java types (with TODO for ↵Paul Sokolovsky
long).
2015-09-17unix/modjni: jvalue2py: Handle class-containing jvalues.Paul Sokolovsky
2015-09-16unix/modjni: Add env() module function.Paul Sokolovsky
Useful to load native method libraries not loaded by VM (as happens on Android).
2015-09-15py/objslice: Make slice attributes (start/stop/step) readable.Tom Soulanille
Configurable with MICROPY_PY_BUILTINS_SLICE_ATTRS. Disabled by default.
2015-09-15unix/modjni: Return any object type value as a jobject.Paul Sokolovsky
2015-09-14unix/modjni: Return Java null as Python None.Paul Sokolovsky
2015-09-14unix/modjni: Support static methods.Paul Sokolovsky
2015-09-13unix/modjni: Factor out new_jobject(), jvalue2py() functions.Paul Sokolovsky
2015-09-12unix: Enable REPL auto-indent.Damien George
2015-09-12unix/modjni: Factor out py2jvalue() function.Paul Sokolovsky
2015-09-11unix/modjni: "jni" module to interface to JNI-compliant JavaVM.Paul Sokolovsky
This includes Android Dalvik VM for example. Example usage: import jni System = jni.cls("java/lang/System") System.out.println("Hello, Java!")
2015-09-03tests: Add tests to improve coverage of objstr.c.Damien George
2015-08-31modffi: dlsym() doesn't set errno, so use ENOENT for OSError.Paul Sokolovsky
This may be a bit confusing, as ENOENT is often rendered as "No such file or directory", but any other code would be only more confusing.
2015-08-30unix: Allow to build libffi from source and link against it.Paul Sokolovsky
Linking against local libffi (and other libs in future) is triggered by "make MICROPY_STANDALONE=1". Before that, dependent libs should be built with "make deplibs".
2015-08-29py: Treat -m32 flag as part of CC, LD, etc.Paul Sokolovsky
Indeed, this flag efectively selects architecture target, and must consistently apply to all compiles and links, including 3rd-party libraries, unlike CFLAGS, which have MicroPython-specific setting.
2015-08-22unix: Bump default heap size to 1MB (2MB on 64-bit systems).Paul Sokolovsky
2015-08-20py: Add MICROPY_PY_BUILTINS_FILTER, disable for minimal ports.Paul Sokolovsky
Saves 320 bytes on x86.
2015-08-13py: Add stream_tell method, and use for unix and stmhal file tell.blmorris
2015-08-05unix/mpconfigport.h: set MICROPY_PY_SYS_PLATFORM to "darwin" if compiled on OSXblmorris
This change allows micropython to return the same value as CPython for sys.platform
2015-07-26lib/mp-readline: Add emacs-style control characters for cursor movement.Tom Soulanille
Disabled by default. Adds 108 bytes to Thumb2 arch when enabled.
2015-07-15unix: modsocket: Implement inet_pton() in preference of inet_aton().Paul Sokolovsky
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.
2015-07-14unix: modsocket: Implement recvfrom().Paul Sokolovsky
Required to implement UDP servers.
2015-07-12unix: modsocket: Implement sendto().Paul Sokolovsky
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.
2015-07-11unix: socket.getaddrinfo: Port is unsigned value.Paul Sokolovsky
Treating it as signed lead to buffer overflow for ports >= 32768.
2015-07-10unix: socket.getaddrinfo: Accept family & socktype arguments.Paul Sokolovsky
This usually allows to get just a single address entry.
2015-07-08modmachine: Implement physical memory access using /dev/mem (Linux, etc).Paul Sokolovsky
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.
2015-06-21unix: Add O_WRONLY | O_CREAT to open call when opening file for append ("a").Ari Suutari
To comply with Python semantics.
2015-06-20py: Use a wrapper to explicitly check self argument of builtin methods.Damien George
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.
2015-06-04unix: Allow to cat a script into stdin from the command line.Damien George
See issue #1306.
2015-06-03unix: Update .gitignore; now ignores coverage build.Damien George
2015-06-03unix: Prepare upip frozen modules under build/.Paul Sokolovsky
2015-06-03unix: Uncompress upip tarball to build directory.Paul Sokolovsky
2015-06-02unix: Include upip as fronzen modules inside the standard interpreter.Paul Sokolovsky
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.
2015-05-30unix: Print an extra newline to the output on ctrl-Dstijn
This assures the terminal prints it's prompt on a fresh line instead of appending it to the uPy prompt after exit.
2015-05-30unix: minimal: Don't use readline support.Paul Sokolovsky
After switching to builtin readline support, "minimal" no longer builds, and minimal doesn't really need readline support.
2015-05-30unix: Allow to override default sys.path value.Paul Sokolovsky
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).
2015-05-28tests: Add special tests to test mp_printf function to improve coverage.Damien George
2015-05-27unix: Add option to use uPy readline, and enable by default.Damien George
This gets uPy readline working with unix port, with tab completion and history. GNU readline is still supported, configure using MICROPY_USE_READLINE variable.
2015-05-27unix: Factor out stdio and ctrl-C code to unix_mphal.c file.Damien George
2015-05-17Revert "unix: Include stdio.h to allow easy debugging with printf()."Paul Sokolovsky
This reverts commit 8fbabab1a80efa8b9c0654f63b2157d8f8299955. Turned to cause problems on MacOSX.