diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-07-06 00:08:33 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2015-07-08 11:37:23 +0300 |
commit | 354d17523f599746a84e5b22fa670c9910137947 (patch) | |
tree | bfea06b4d85306803cd9a9bb0a3ec6bcdfd25d6c /unix/mpconfigport.h | |
parent | a0a3de60becb0147be209ab5a32139ea9cec3d2e (diff) | |
download | micropython-354d17523f599746a84e5b22fa670c9910137947.tar.gz micropython-354d17523f599746a84e5b22fa670c9910137947.zip |
modmachine: Implement physical memory access using /dev/mem (Linux, etc).
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.
Diffstat (limited to 'unix/mpconfigport.h')
-rw-r--r-- | unix/mpconfigport.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/unix/mpconfigport.h b/unix/mpconfigport.h index a0e7bf4674..9f65bc9295 100644 --- a/unix/mpconfigport.h +++ b/unix/mpconfigport.h @@ -179,6 +179,11 @@ void mp_unix_mark_exec(void); #define MP_PLAT_PRINT_STRN(str, len) fwrite(str, 1, len, stdout) +#ifdef __linux__ +// Can access physical memory using /dev/mem +#define MICROPY_PLAT_DEV_MEM (1) +#endif + extern const struct _mp_obj_fun_builtin_t mp_builtin_input_obj; extern const struct _mp_obj_fun_builtin_t mp_builtin_open_obj; #define MICROPY_PORT_BUILTINS \ |