mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-06 19:20:09 +00:00
parent
597098845c
commit
28e782dda5
@ -89,14 +89,12 @@ static inline void load_stylesheet()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
extern void initialize_qt_core(Genode::Env &);
|
|
||||||
extern void initialize_qt_gui(Genode::Env &);
|
extern void initialize_qt_gui(Genode::Env &);
|
||||||
|
|
||||||
void Libc::Component::construct(Libc::Env &env)
|
void Libc::Component::construct(Libc::Env &env)
|
||||||
{
|
{
|
||||||
Libc::with_libc([&] {
|
Libc::with_libc([&] {
|
||||||
|
|
||||||
initialize_qt_core(env);
|
|
||||||
initialize_qt_gui(env);
|
initialize_qt_gui(env);
|
||||||
|
|
||||||
int argc = 1;
|
int argc = 1;
|
||||||
|
@ -75,12 +75,10 @@ class Genode_signal_proxy : public QObject,
|
|||||||
* Qt initialization
|
* Qt initialization
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern void initialize_qt_core(Genode::Env &);
|
|
||||||
extern void initialize_qt_gui(Genode::Env &);
|
extern void initialize_qt_gui(Genode::Env &);
|
||||||
|
|
||||||
static inline QApplication & qt5_initialization(Libc::Env &env)
|
static inline QApplication & qt5_initialization(Libc::Env &env)
|
||||||
{
|
{
|
||||||
initialize_qt_core(env);
|
|
||||||
initialize_qt_gui(env);
|
initialize_qt_gui(env);
|
||||||
|
|
||||||
char const *argv[] = { "qt5_app", 0 };
|
char const *argv[] = { "qt5_app", 0 };
|
||||||
|
@ -7,15 +7,11 @@ CC_WARN = -Wno-unused-but-set-variable -Wno-deprecated-declarations
|
|||||||
|
|
||||||
include $(REP_DIR)/lib/mk/qt5_core_generated.inc
|
include $(REP_DIR)/lib/mk/qt5_core_generated.inc
|
||||||
|
|
||||||
# add Genode-specific sources
|
|
||||||
QT_SOURCES += qthread_genode.cpp
|
|
||||||
|
|
||||||
# remove unsupported UNIX-specific files
|
# remove unsupported UNIX-specific files
|
||||||
QT_SOURCES_FILTER_OUT = \
|
QT_SOURCES_FILTER_OUT = \
|
||||||
forkfd_qt.cpp \
|
forkfd_qt.cpp \
|
||||||
moc_qfilesystemwatcher_inotify_p.cpp \
|
moc_qfilesystemwatcher_inotify_p.cpp \
|
||||||
qfilesystemwatcher_inotify.cpp \
|
qfilesystemwatcher_inotify.cpp
|
||||||
qthread_unix.cpp
|
|
||||||
|
|
||||||
# remove unneeded files to prevent moc warnings
|
# remove unneeded files to prevent moc warnings
|
||||||
COMPILER_MOC_HEADER_MAKE_ALL_FILES_FILTER_OUT = \
|
COMPILER_MOC_HEADER_MAKE_ALL_FILES_FILTER_OUT = \
|
||||||
|
@ -1 +1 @@
|
|||||||
3d6643d8817e3817cf6c80d7a57de698f6eb36b7
|
08438581c2490afe7ced218efdded14505063f7b
|
||||||
|
@ -3,7 +3,6 @@ MIRROR_FROM_REP_DIR := lib/mk/qt5_core.mk \
|
|||||||
lib/mk/qt5_pcre2.mk \
|
lib/mk/qt5_pcre2.mk \
|
||||||
lib/mk/qt5_pcre2_generated.inc \
|
lib/mk/qt5_pcre2_generated.inc \
|
||||||
lib/mk/qt5.inc \
|
lib/mk/qt5.inc \
|
||||||
src/lib/qt5/qtbase/src/corelib \
|
|
||||||
src/lib/qt5/libc_dummies.cc \
|
src/lib/qt5/libc_dummies.cc \
|
||||||
include/libc-plugin \
|
include/libc-plugin \
|
||||||
lib/mk/libc_pipe.mk \
|
lib/mk/libc_pipe.mk \
|
||||||
|
@ -62,14 +62,12 @@ struct Qt_launchpad_namespace::Local_env : Genode::Env
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void initialize_qt_core(Genode::Env &);
|
|
||||||
extern void initialize_qt_gui(Genode::Env &);
|
extern void initialize_qt_gui(Genode::Env &);
|
||||||
|
|
||||||
void Libc::Component::construct(Libc::Env &env)
|
void Libc::Component::construct(Libc::Env &env)
|
||||||
{
|
{
|
||||||
Libc::with_libc([&] {
|
Libc::with_libc([&] {
|
||||||
|
|
||||||
initialize_qt_core(env);
|
|
||||||
initialize_qt_gui(env);
|
initialize_qt_gui(env);
|
||||||
|
|
||||||
Qt_launchpad_namespace::Local_env local_env(env);
|
Qt_launchpad_namespace::Local_env local_env(env);
|
||||||
|
@ -164,95 +164,21 @@ index dc0ab9f..a69e088 100644
|
|||||||
#define QT_USE_MMAP
|
#define QT_USE_MMAP
|
||||||
#include "private/qcore_unix_p.h"
|
#include "private/qcore_unix_p.h"
|
||||||
// for mmap
|
// for mmap
|
||||||
diff --git a/qtbase/src/corelib/thread/qthread.cpp b/qtbase/src/corelib/thread/qthread.cpp
|
diff --git a/qtbase/src/corelib/thread/qthread_unix.cpp b/qtbase/src/corelib/thread/qthread_unix.cpp
|
||||||
index 9f60de1..38bdb38 100644
|
index ea78b0a..e379c71 100644
|
||||||
--- a/qtbase/src/corelib/thread/qthread.cpp
|
--- a/qtbase/src/corelib/thread/qthread_unix.cpp
|
||||||
+++ b/qtbase/src/corelib/thread/qthread.cpp
|
+++ b/qtbase/src/corelib/thread/qthread_unix.cpp
|
||||||
@@ -166,6 +166,10 @@ QThreadPrivate::QThreadPrivate(QThreadData *d)
|
@@ -93,8 +93,10 @@
|
||||||
stackSize(0), priority(QThread::InheritPriority), data(d)
|
#endif
|
||||||
{
|
|
||||||
|
|
||||||
+#ifdef Q_OS_GENODE
|
#if defined(Q_OS_DARWIN) || !defined(Q_OS_ANDROID) && !defined(Q_OS_OPENBSD) && defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING-0 >= 0)
|
||||||
+ genode_thread = 0;
|
+#ifndef Q_OS_GENODE
|
||||||
+#endif /* Q_OS_GENODE */
|
#define QT_HAS_THREAD_PRIORITY_SCHEDULING
|
||||||
+
|
#endif
|
||||||
// INTEGRITY doesn't support self-extending stack. The default stack size for
|
|
||||||
// a pthread on INTEGRITY is too small so we have to increase the default size
|
|
||||||
// to 128K.
|
|
||||||
diff --git a/qtbase/src/corelib/thread/qthread_p.h b/qtbase/src/corelib/thread/qthread_p.h
|
|
||||||
index 57e6c99..fd038ec 100644
|
|
||||||
--- a/qtbase/src/corelib/thread/qthread_p.h
|
|
||||||
+++ b/qtbase/src/corelib/thread/qthread_p.h
|
|
||||||
@@ -53,6 +53,10 @@
|
|
||||||
//
|
|
||||||
//
|
|
||||||
|
|
||||||
+#ifdef Q_OS_GENODE
|
|
||||||
+#include <base/thread.h>
|
|
||||||
+#endif
|
+#endif
|
||||||
+
|
|
||||||
#include "qplatformdefs.h"
|
|
||||||
#include "QtCore/qthread.h"
|
|
||||||
#include "QtCore/qmutex.h"
|
|
||||||
@@ -179,6 +183,58 @@ public:
|
|
||||||
static QThread *threadForId(int id);
|
|
||||||
|
|
||||||
#ifdef Q_OS_UNIX
|
#if defined(Q_OS_QNX)
|
||||||
+#ifdef Q_OS_GENODE
|
#include <sys/neutrino.h>
|
||||||
+
|
|
||||||
+ enum { DEFAULT_STACK_SIZE = 4096*100 };
|
|
||||||
+
|
|
||||||
+ class Genode_thread : public Genode::Thread
|
|
||||||
+ {
|
|
||||||
+ private:
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ * The '_finished_lock' is necessary because 'QThreadPrivate::mutex'
|
|
||||||
+ * uses a 'Genode::Timed_semaphore' internally and it isn't safe
|
|
||||||
+ * to delete a Genode thread that just called 'Semaphore::up()',
|
|
||||||
+ * because the 'Semaphore::_meta_lock' could still be locked.
|
|
||||||
+ */
|
|
||||||
+ Genode::Lock _finished_lock;
|
|
||||||
+ QThread *_qthread;
|
|
||||||
+
|
|
||||||
+ public:
|
|
||||||
+
|
|
||||||
+ Genode_thread(Genode::Env &env, QThread *qthread)
|
|
||||||
+ : Genode::Thread(env, qthread->objectName().toLatin1().constData(), DEFAULT_STACK_SIZE),
|
|
||||||
+ _finished_lock(Genode::Lock::LOCKED),
|
|
||||||
+ _qthread(qthread) { }
|
|
||||||
+
|
|
||||||
+ virtual void entry()
|
|
||||||
+ {
|
|
||||||
+ QThreadPrivate::start(_qthread);
|
|
||||||
+ QThreadPrivate::finish(_qthread);
|
|
||||||
+ _finished_lock.unlock();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ void join()
|
|
||||||
+ {
|
|
||||||
+ _finished_lock.lock();
|
|
||||||
+ }
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ Genode_thread *genode_thread;
|
|
||||||
+
|
|
||||||
+ struct tls_struct {
|
|
||||||
+ QThreadData *data;
|
|
||||||
+ bool termination_enabled;
|
|
||||||
+ };
|
|
||||||
+
|
|
||||||
+ static Genode::Env *_env;
|
|
||||||
+ static void env(Genode::Env &env) { _env = &env; }
|
|
||||||
+
|
|
||||||
+ static QHash<Qt::HANDLE, struct tls_struct> tls;
|
|
||||||
+
|
|
||||||
+ Qt::HANDLE thread_id;
|
|
||||||
+#endif // Q_OS_GENODE
|
|
||||||
+
|
|
||||||
QWaitCondition thread_done;
|
|
||||||
|
|
||||||
static void *start(void *arg);
|
|
||||||
diff --git a/qtbase/src/corelib/tools/qdatetime.cpp b/qtbase/src/corelib/tools/qdatetime.cpp
|
diff --git a/qtbase/src/corelib/tools/qdatetime.cpp b/qtbase/src/corelib/tools/qdatetime.cpp
|
||||||
index 511dbf0..f1a7216 100644
|
index 511dbf0..f1a7216 100644
|
||||||
--- a/qtbase/src/corelib/tools/qdatetime.cpp
|
--- a/qtbase/src/corelib/tools/qdatetime.cpp
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
/* provided by the application */
|
/* provided by the application */
|
||||||
extern "C" int main(int argc, char const **argv);
|
extern "C" int main(int argc, char const **argv);
|
||||||
|
|
||||||
void initialize_qt_core(Genode::Env &);
|
|
||||||
|
|
||||||
void initialize_qt_gui(Genode::Env &env) __attribute__((weak));
|
void initialize_qt_gui(Genode::Env &env) __attribute__((weak));
|
||||||
void initialize_qt_gui(Genode::Env &) { }
|
void initialize_qt_gui(Genode::Env &) { }
|
||||||
|
|
||||||
@ -29,7 +27,6 @@ void Libc::Component::construct(Libc::Env &env)
|
|||||||
{
|
{
|
||||||
Libc::with_libc([&] {
|
Libc::with_libc([&] {
|
||||||
|
|
||||||
initialize_qt_core(env);
|
|
||||||
initialize_qt_gui(env);
|
initialize_qt_gui(env);
|
||||||
|
|
||||||
int argc = 1;
|
int argc = 1;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -12,14 +12,12 @@
|
|||||||
/* Qoost includes */
|
/* Qoost includes */
|
||||||
#include <qoost/compound_widget.h>
|
#include <qoost/compound_widget.h>
|
||||||
|
|
||||||
extern void initialize_qt_core(Genode::Env &);
|
|
||||||
extern void initialize_qt_gui(Genode::Env &);
|
extern void initialize_qt_gui(Genode::Env &);
|
||||||
|
|
||||||
void Libc::Component::construct(Libc::Env &env)
|
void Libc::Component::construct(Libc::Env &env)
|
||||||
{
|
{
|
||||||
Libc::with_libc([&] {
|
Libc::with_libc([&] {
|
||||||
|
|
||||||
initialize_qt_core(env);
|
|
||||||
initialize_qt_gui(env);
|
initialize_qt_gui(env);
|
||||||
QPluginWidget::env(env);
|
QPluginWidget::env(env);
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
/* provided by the application */
|
/* provided by the application */
|
||||||
extern "C" int main(int argc, char const **argv);
|
extern "C" int main(int argc, char const **argv);
|
||||||
|
|
||||||
extern void initialize_qt_core(Genode::Env &);
|
|
||||||
extern void initialize_qt_gui(Genode::Env &);
|
extern void initialize_qt_gui(Genode::Env &);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -44,7 +43,6 @@ void Libc::Component::construct(Libc::Env &env)
|
|||||||
{
|
{
|
||||||
Libc::with_libc([&] {
|
Libc::with_libc([&] {
|
||||||
|
|
||||||
initialize_qt_core(env);
|
|
||||||
initialize_qt_gui(env);
|
initialize_qt_gui(env);
|
||||||
QPluginWidget::env(env);
|
QPluginWidget::env(env);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user