summaryrefslogtreecommitdiffstatshomepage
path: root/unix
diff options
context:
space:
mode:
Diffstat (limited to 'unix')
-rw-r--r--unix/gccollect.c4
-rw-r--r--unix/main.c6
-rw-r--r--unix/modffi.c7
-rw-r--r--unix/modos.c2
-rw-r--r--unix/modtime.c2
-rw-r--r--unix/mpconfigport.h1
6 files changed, 15 insertions, 7 deletions
diff --git a/unix/gccollect.c b/unix/gccollect.c
index f24cc52495..d04e5d87fb 100644
--- a/unix/gccollect.c
+++ b/unix/gccollect.c
@@ -26,13 +26,13 @@
#include <stdio.h>
-#include "misc.h"
#include "mpconfig.h"
+#include "misc.h"
#include "gc.h"
#if MICROPY_ENABLE_GC
-extern void *stack_top;
+extern char *stack_top;
#if MICROPY_GCREGS_SETJMP
#include <setjmp.h>
diff --git a/unix/main.c b/unix/main.c
index 23615aa988..176cbc6ec3 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -147,7 +147,7 @@ STATIC char *strjoin(const char *s1, int sep_char, const char *s2) {
}
STATIC void do_repl(void) {
- printf("Micro Python " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; UNIX version\n");
+ printf("Micro Python " MICROPY_GIT_TAG " on " MICROPY_BUILD_DATE "; " MICROPY_PY_SYS_PLATFORM " version\n");
for (;;) {
char *line = prompt(">>> ");
@@ -214,7 +214,7 @@ int usage(char **argv) {
mp_obj_t mem_info(void) {
printf("mem: total=%d, current=%d, peak=%d\n",
m_get_total_bytes_allocated(), m_get_current_bytes_allocated(), m_get_peak_bytes_allocated());
- printf("stack: %u\n", stack_usage());
+ printf("stack: %u\n", mp_stack_usage());
#if MICROPY_ENABLE_GC
gc_dump_info();
#endif
@@ -265,7 +265,7 @@ void pre_process_options(int argc, char **argv) {
#endif
int main(int argc, char **argv) {
- stack_set_limit(32768);
+ mp_stack_set_limit(32768);
pre_process_options(argc, argv);
diff --git a/unix/modffi.c b/unix/modffi.c
index f1b219987b..eca3f9131b 100644
--- a/unix/modffi.c
+++ b/unix/modffi.c
@@ -51,6 +51,10 @@
* s - as argument, the same as "p", as return value, causes string
* to be allocated and returned, instead of pointer value.
*
+ * TODO:
+ * O - mp_obj_t, passed as is (mostly useful as callback param)
+ * C - callback function
+ *
* Note: all constraint specified by typecode can be not enforced at this time,
* but may be later.
*/
@@ -100,12 +104,15 @@ STATIC ffi_type *char2ffi_type(char c)
switch (c) {
case 'b': return &ffi_type_schar;
case 'B': return &ffi_type_uchar;
+ case 'h': return &ffi_type_sshort;
+ case 'H': return &ffi_type_ushort;
case 'i': return &ffi_type_sint;
case 'I': return &ffi_type_uint;
case 'l': return &ffi_type_slong;
case 'L': return &ffi_type_ulong;
case 'f': return &ffi_type_float;
case 'd': return &ffi_type_double;
+ case 'C': // (*)()
case 'P': // const void*
case 'p': // void*
case 's': return &ffi_type_pointer;
diff --git a/unix/modos.c b/unix/modos.c
index 2e02ef0aa7..9b034cdbc2 100644
--- a/unix/modos.c
+++ b/unix/modos.c
@@ -30,8 +30,8 @@
#include <unistd.h>
#include <errno.h>
-#include "misc.h"
#include "mpconfig.h"
+#include "misc.h"
#include "nlr.h"
#include "qstr.h"
#include "obj.h"
diff --git a/unix/modtime.c b/unix/modtime.c
index 006fd0ebd7..286d8ea97e 100644
--- a/unix/modtime.c
+++ b/unix/modtime.c
@@ -30,8 +30,8 @@
#include <sys/time.h>
#include <math.h>
-#include "misc.h"
#include "mpconfig.h"
+#include "misc.h"
#include "qstr.h"
#include "obj.h"
#include "runtime.h"
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h
index 1559bdb359..763b34ba3e 100644
--- a/unix/mpconfigport.h
+++ b/unix/mpconfigport.h
@@ -41,6 +41,7 @@
#define MICROPY_LONGINT_IMPL (MICROPY_LONGINT_IMPL_MPZ)
#define MICROPY_STREAMS_NON_BLOCK (1)
#define MICROPY_OPT_COMPUTED_GOTO (1)
+#define MICROPY_PY_BUILTINS_STR_UNICODE (0)
#define MICROPY_PY_BUILTINS_FROZENSET (1)
#define MICROPY_PY_SYS_EXIT (1)
#define MICROPY_PY_SYS_PLATFORM "linux"