[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT/PYTHON3 PATCH v3 08/14] Add modules_config.c


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Mon, 23 Sep 2019 12:58:46 +0300
  • Cc: felipe.huici@xxxxxxxxx, vlad_andrei.badoiu@xxxxxxxxxxxxxxx
  • Delivery-date: Mon, 23 Sep 2019 09:59:27 +0000
  • Ironport-phdr: 9a23:fB8GdBXSRYvVHo93oYkYxmvaZo3V8LGtZVwlr6E/grcLSJyIuqrYbROGt8tkgFKBZ4jH8fUM07OQ7/m7HzZQqszZ+DBaKdoQDkVD0Z1X1yUbQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYnbr+tQt2agMu4zf299IPOaAtUmjW9falyLBKrpgnNq8Uam4RvJrs/xxfTvHdFeOtayX10KVmOmxrw+tq88IRs/ihNpf4t7dJMXbn/c68lUbFWETMqPnwv6sb2rxfDVwyP5nUdUmUSjBVFBhXO4Q/5UJnsrCb0r/Jx1yaGM8L4S7A0Qimi4LxwSBD0kicHNiU2/3/Rh8dtka9UuhOhpxh4w47JfIGYMed1c63Bcd8GQ2dKQ8BcXDFDDIyhdYsCF+oPM/hFoYfzpFUAqhmxBQe3Ce/z1jNFnGP60Lcm3+g9FwzNwQwuH8gJsHTRtNj4KqASUfupzKnJyzXIcvVY2Srl6IjVbxsspu2DXbVrccrNyEkvERnJjlGNqYz9IjOYzfgCs3OB4+p4SOKgkHQrqxt2ojW2wMonl4fHhoUQyl/e9CV5xp44KsamR058ed6rDp1QuzuGOItxR8MvRXxjtiUiyrAepJK2czUGxI4kyhPfcfCLbZaE7xD5WOufOTt0mX1odK+lixux8UWs0PPwW8e63VpQsyZIncfAu3YQ3BLJ8MeHUOFy/kK51DaK0ADc9/9LLFgvlareN54h2rkwlocPsUjbHi/5hkH2jKiOe0U6/+in8eXnYrH8qpCALI94kBn+Mrk1lcClG+Q4NRACX2md+euiyL3u5VD1TbpXgvEskaTUsIrWKdoFqqO7GQNY3J4v6xOlADen1NQYk2MHLFVAeB+fk4fpPErOIOz5Dfe5mVislCprx+jbPrD6HprNNWLPkK/8fblm8UJc0g0zwchF551IErEBPO7zWkjpudzdDx85NQ20w+H8CNlky4wRR3yPDbGdMK7JtV+I5/kvI/WXZIMPtzfyNf4l6+TpjX8jll8XZbOp0ocPaHCkAvRmJF2UYXTyjdcFEGcKphQxQPbqiF2fUD5ce3eyUrk65j4lFI2mCZ3MSZu3jLOfwSexBodWaXxeClCQDXfocJ2JW+kIaC2IP8BuiiYLVb68RI87yx6utRX2xKF9IeXJ/S0YtI/j2cNu5+3PiBE96CZ4AN6B3GGWVW10g3sISCQs0KBlpkwugmuEhK15hf1fDplf6u1EVi8+NIXA1KpqBta0XRjOLfmTT1PzadK9HTA3BvYs28JGN016AMmjiFbHwjK3K7QO0aSWDtou9fSPjDDKO89hxiOeh+EahF48T54XOA==
  • Ironport-sdr: dVPBossJVYfWcZvFGC/pAZyklNPagR1YjPzIcUWJ3ZmwXdXLa9LLepcBvsQUxPF/7w+9e6ol3n G/IM7xeksFzw==
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

From: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>

This file is copied from a './Modules/config.c' of a Linux build and it contains
the modules init functions and their registration as Python extensions. We
commented the registration of the modules that we do not support yet. They
should be enabled back when we will add support for them by porting the
underlying native libraries.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 Makefile.uk      |   2 +
 modules_config.c | 328 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 330 insertions(+)
 create mode 100644 modules_config.c

diff --git a/Makefile.uk b/Makefile.uk
index 95119d7..4832417 100644
--- a/Makefile.uk
+++ b/Makefile.uk
@@ -97,6 +97,8 @@ LIBPYTHON3_COMMON_CXXFLAGS-y += $(LIBPYTHON3_COMMON_DEFINES-y)
 LIBPYTHON3_CINCLUDES-y   += $(LIBPYTHON3_COMMON_INCLUDES-y)
 LIBPYTHON3_CXXINCLUDES-y += $(LIBPYTHON3_COMMON_INCLUDES-y)
 
+LIBPYTHON3_SRCS-y += $(LIBPYTHON3_BASE)/modules_config.c|unikraft
+
 
################################################################################
 # Python core
 
################################################################################
diff --git a/modules_config.c b/modules_config.c
new file mode 100644
index 0000000..2bd6025
--- /dev/null
+++ b/modules_config.c
@@ -0,0 +1,328 @@
+/* Generated automatically from ./Modules/config.c.in by makesetup. */
+/* -*- C -*- ***********************************************
+Copyright (c) 2000, BeOpen.com.
+Copyright (c) 1995-2000, Corporation for National Research Initiatives.
+Copyright (c) 1990-1995, Stichting Mathematisch Centrum.
+All rights reserved.
+
+See the file "Misc/COPYRIGHT" for information on usage and
+redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+******************************************************************/
+
+/* Module configuration */
+
+/* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */
+
+/* This file contains the table of built-in modules.
+   See create_builtin() in import.c. */
+
+#include <uk/config.h>
+#include "Python.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+extern PyObject* PyInit_posix(void);
+extern PyObject* PyInit_errno(void);
+extern PyObject* PyInit_pwd(void);
+extern PyObject* PyInit__sre(void);
+extern PyObject* PyInit__codecs(void);
+extern PyObject* PyInit__weakref(void);
+extern PyObject* PyInit__functools(void);
+extern PyObject* PyInit__operator(void);
+extern PyObject* PyInit__collections(void);
+extern PyObject* PyInit__abc(void);
+extern PyObject* PyInit_itertools(void);
+extern PyObject* PyInit_atexit(void);
+extern PyObject* PyInit__signal(void);
+extern PyObject* PyInit__stat(void);
+extern PyObject* PyInit_time(void);
+extern PyObject* PyInit__thread(void);
+extern PyObject* PyInit__locale(void);
+extern PyObject* PyInit__io(void);
+extern PyObject* PyInit_zipimport(void);
+extern PyObject* PyInit_faulthandler(void);
+extern PyObject* PyInit__tracemalloc(void);
+extern PyObject* PyInit__symtable(void);
+extern PyObject* PyInit_xxsubtype(void);
+
+/* Unikraft Marker start */
+extern PyObject* PyInit__abc(void);
+extern PyObject* PyInit_array(void);
+extern PyObject* PyInit__asyncio(void);
+extern PyObject* PyInit_atexit(void);
+extern PyObject* PyInit_audioop(void);
+extern PyObject* PyInit_binascii(void);
+extern PyObject* PyInit__bisect(void);
+extern PyObject* PyInit__blake2(void);
+extern PyObject* PyInit__bz2(void);
+extern PyObject* PyInit_cmath(void);
+extern PyObject* PyInit__codecs(void);
+extern PyObject* PyInit__collections(void);
+extern PyObject* PyInit__contextvars(void);
+extern PyObject* PyInit__crypt(void);
+extern PyObject* PyInit__csv(void);
+extern PyObject* PyInit__ctypes_test(void);
+extern PyObject* PyInit__ctypes(void);
+extern PyObject* PyInit__curses_panel(void);
+extern PyObject* PyInit__curses(void);
+extern PyObject* PyInit_custom2(void);
+extern PyObject* PyInit_custom3(void);
+extern PyObject* PyInit_custom4(void);
+extern PyObject* PyInit_custom(void);
+extern PyObject* PyInit__datetime(void);
+extern PyObject* PyInit__dbm(void);
+extern PyObject* PyInit__decimal(void);
+extern PyObject* PyInit__elementtree(void);
+extern PyObject* PyInit_errno(void);
+extern PyObject* PyInit_faulthandler(void);
+extern PyObject* PyInit_fcntl(void);
+extern PyObject* PyInit__functools(void);
+extern PyObject* PyInit_gc(void);
+extern PyObject* PyInit_grp(void);
+extern PyObject* PyInit__hashlib(void);
+extern PyObject* PyInit__heapq(void);
+extern PyObject* PyInit__imp(void);
+extern PyObject* PyInit__io(void);
+extern PyObject* PyInit_itertools(void);
+extern PyObject* PyInit__json(void);
+extern PyObject* PyInit__locale(void);
+extern PyObject* PyInit__lsprof(void);
+extern PyObject* PyInit__lzma(void);
+extern PyObject* PyInit_math(void);
+extern PyObject* PyInit__md5(void);
+extern PyObject* PyInit_mmap(void);
+extern PyObject* PyInit__multibytecodec(void);
+extern PyObject* PyInit__multiprocessing(void);
+extern PyObject* PyInit_nis(void);
+extern PyObject* PyInit__opcode(void);
+extern PyObject* PyInit__operator(void);
+extern PyObject* PyInit_ossaudiodev(void);
+extern PyObject* PyInit__overlapped(void);
+extern PyObject* PyInit_parser(void);
+extern PyObject* PyInit__pickle(void);
+extern PyObject* PyInit__posixsubprocess(void);
+extern PyObject* PyInit_pwd(void);
+extern PyObject* PyInit__queue(void);
+extern PyObject* PyInit__random(void);
+extern PyObject* PyInit_readline(void);
+extern PyObject* PyInit_resource(void);
+extern PyObject* PyInit__scproxy(void);
+extern PyObject* PyInit_select(void);
+extern PyObject* PyInit__sha1(void);
+extern PyObject* PyInit__sha256(void);
+extern PyObject* PyInit__sha3(void);
+extern PyObject* PyInit__sha512(void);
+extern PyObject* PyInit__signal(void);
+extern PyObject* PyInit__socket(void);
+extern PyObject* PyInit_spwd(void);
+extern PyObject* PyInit__ssl(void);
+extern PyObject* PyInit__stat(void);
+extern PyObject* PyInit__string(void);
+extern PyObject* PyInit__struct(void);
+extern PyObject* PyInit_sublist(void);
+extern PyObject* PyInit__symtable(void);
+extern PyObject* PyInit_syslog(void);
+extern PyObject* PyInit_termios(void);
+extern PyObject* PyInit__testbuffer(void);
+extern PyObject* PyInit__testcapi(void);
+extern PyObject* PyInit__thread(void);
+extern PyObject* PyInit_time(void);
+extern PyObject* PyInit__tkinter(void);
+extern PyObject* PyInit__tracemalloc(void);
+extern PyObject* PyInit_unicodedata(void);
+extern PyObject* PyInit__uuid(void);
+extern PyObject* PyInit__weakref(void);
+extern PyObject* PyInit__winapi(void);
+extern PyObject* PyInit_xxlimited(void);
+extern PyObject* PyInit_xxsubtype(void);
+extern PyObject* PyInit__xxtestfuzz(void);
+extern PyObject* PyInit_xx(void);
+extern PyObject* PyInit_zipimport(void);
+#ifdef CONFIG_LIBZLIB
+extern PyObject* PyInit_zlib(void);
+#endif
+/* Unikraft Marker end */
+/* -- ADDMODULE MARKER 1 -- */
+
+extern PyObject* PyMarshal_Init(void);
+extern PyObject* PyInit__imp(void);
+extern PyObject* PyInit_gc(void);
+extern PyObject* PyInit__ast(void);
+extern PyObject* _PyWarnings_Init(void);
+extern PyObject* PyInit__string(void);
+
+struct _inittab _PyImport_Inittab[] = {
+
+    {"posix", PyInit_posix},
+    {"errno", PyInit_errno},
+    {"pwd", PyInit_pwd},
+    {"_sre", PyInit__sre},
+    {"_codecs", PyInit__codecs},
+    {"_weakref", PyInit__weakref},
+    {"_functools", PyInit__functools},
+    {"_operator", PyInit__operator},
+    {"_collections", PyInit__collections},
+    {"_abc", PyInit__abc},
+    {"itertools", PyInit_itertools},
+    {"atexit", PyInit_atexit},
+    {"_signal", PyInit__signal},
+    {"_stat", PyInit__stat},
+    {"time", PyInit_time},
+    {"_thread", PyInit__thread},
+    {"_locale", PyInit__locale},
+    {"_io", PyInit__io},
+    {"zipimport", PyInit_zipimport},
+    {"faulthandler", PyInit_faulthandler},
+    {"_tracemalloc", PyInit__tracemalloc},
+    {"_symtable", PyInit__symtable},
+    {"xxsubtype", PyInit_xxsubtype},
+
+/* -- ADDMODULE MARKER 2 -- */
+
+    /* This module lives in marshal.c */
+    {"marshal", PyMarshal_Init},
+
+    /* This lives in import.c */
+    {"_imp", PyInit__imp},
+
+    /* This lives in Python/Python-ast.c */
+    {"_ast", PyInit__ast},
+
+    /* These entries are here for sys.builtin_module_names */
+    {"builtins", NULL},
+    {"sys", NULL},
+
+    /* This lives in gcmodule.c */
+    {"gc", PyInit_gc},
+
+    /* This lives in _warnings.c */
+    {"_warnings", _PyWarnings_Init},
+
+    /* This lives in Objects/unicodeobject.c */
+    {"_string", PyInit__string},
+
+
+/* Unikraft Marker start */
+    {"_abc", PyInit__abc},
+    {"array", PyInit_array},
+    {"_asyncio", PyInit__asyncio},
+    {"atexit", PyInit_atexit},
+/* audio {"audioop", PyInit_audioop}, */
+    {"binascii", PyInit_binascii},
+    {"_bisect", PyInit__bisect},
+#ifdef CONFIG_LIBINTEL_INTRINSICS
+    {"_blake2", PyInit__blake2},
+#endif
+//    {"_bz2", PyInit__bz2},
+    {"cmath", PyInit_cmath},
+    {"_codecs", PyInit__codecs},
+    {"_collections", PyInit__collections},
+    {"_contextvars", PyInit__contextvars},
+//TODO    {"_crypt", PyInit__crypt},
+    {"_csv", PyInit__csv},
+#if CONFIG_LIBPYTHON3_EXTENSION_CTYPES
+//    {"_ctypes_test", PyInit__ctypes_test},
+    {"_ctypes", PyInit__ctypes},
+#endif
+/*    {"_curses_panel", PyInit__curses_panel}, */
+//TODO    {"_curses", PyInit__curses}, evaluate to `PyInit(char, long double 
__restrict, short,...)(short)'
+/* Doc {"custom", PyInit_custom},   */
+/* Doc {"custom2", PyInit_custom2}, */
+/* Doc {"custom3", PyInit_custom3}, */
+/* Doc {"custom4", PyInit_custom4}, */
+    {"_datetime", PyInit__datetime},
+//    {"_dbm", PyInit__dbm},
+#if CONFIG_LIBPYTHON3_EXTENSION_LIBMPDEC
+    {"_decimal", PyInit__decimal},
+#endif
+#if CONFIG_LIBPYTHON3_EXTENSION_EXPAT
+    {"_elementtree", PyInit__elementtree},
+#endif
+    {"errno", PyInit_errno},
+    {"faulthandler", PyInit_faulthandler},
+    {"fcntl", PyInit_fcntl},
+    {"_functools", PyInit__functools},
+    {"gc", PyInit_gc},
+//TODO enable    {"grp", PyInit_grp},
+    {"_hashlib", PyInit__hashlib},
+    {"_heapq", PyInit__heapq},
+    {"_imp", PyInit__imp},
+    {"_io", PyInit__io},
+    {"itertools", PyInit_itertools},
+    {"_json", PyInit__json},
+    {"_locale", PyInit__locale},
+    {"_lsprof", PyInit__lsprof},
+//    {"_lzma", PyInit__lzma},
+    {"math", PyInit_math},
+    {"_md5", PyInit__md5},
+//TODO enable    {"mmap", PyInit_mmap},
+    {"_multibytecodec", PyInit__multibytecodec},
+/*    {"_multiprocessing", PyInit__multiprocessing},*/
+/*    {"nis", PyInit_nis},*/
+    {"_opcode", PyInit__opcode},
+    {"_operator", PyInit__operator},
+/* audio {"ossaudiodev", PyInit_ossaudiodev}, */
+/* Windows {"_overlapped", PyInit__overlapped}, */
+    {"parser", PyInit_parser},
+    {"_pickle", PyInit__pickle},
+    {"_posixsubprocess", PyInit__posixsubprocess},
+    {"pwd", PyInit_pwd},
+    {"_queue", PyInit__queue},
+    {"_random", PyInit__random},
+//    {"readline", PyInit_readline},
+    {"resource", PyInit_resource},
+/* iOS {"_scproxy", PyInit__scproxy}, */
+    {"select", PyInit_select},
+    {"_sha1", PyInit__sha1},
+    {"_sha256", PyInit__sha256},
+    {"_sha3", PyInit__sha3},
+    {"_sha512", PyInit__sha512},
+    {"_signal", PyInit__signal},
+    {"_socket", PyInit__socket},
+//TODO enable    {"spwd", PyInit_spwd},
+#if CONFIG_LIBPYTHON3_EXTENSION_SQLITE
+    {"sqlite", PyInit__sqlite3},
+#endif
+#if CONFIG_LIBPYTHON3_EXTENSION_SSL
+    {"_ssl", PyInit__ssl},
+#endif
+    {"_stat", PyInit__stat},
+    {"_string", PyInit__string},
+    {"_struct", PyInit__struct},
+/* Doc {"sublist", PyInit_sublist}, */
+    {"_symtable", PyInit__symtable},
+    {"syslog", PyInit_syslog},
+//    {"termios", PyInit_termios},
+    {"_testbuffer", PyInit__testbuffer},
+    {"_testcapi", PyInit__testcapi},
+    {"_thread", PyInit__thread},
+    {"time", PyInit_time},
+//    {"_tkinter", PyInit__tkinter},
+    {"_tracemalloc", PyInit__tracemalloc},
+    {"unicodedata", PyInit_unicodedata},
+#if CONFIG_LIBPYTHON3_EXTENSION_UUID
+    {"_uuid", PyInit__uuid},
+#endif
+    {"_weakref", PyInit__weakref},
+/* Windows {"_winapi", PyInit__winapi}, */
+    {"xxlimited", PyInit_xxlimited},
+    {"xxsubtype", PyInit_xxsubtype},
+    {"_xxtestfuzz", PyInit__xxtestfuzz},
+    {"xx", PyInit_xx},
+    {"zipimport", PyInit_zipimport},
+#if CONFIG_LIBPYTHON3_EXTENSION_ZLIB
+    {"zlib", PyInit_zlib},
+#endif
+/* Unikraft Marker end */
+
+    /* Sentinel */
+    {0, 0}
+};
+
+
+#ifdef __cplusplus
+}
+#endif
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.