2016-10-30 15:17:24 +01:00
|
|
|
/*
|
|
|
|
* \brief Interfaces for initializing libc subsystems
|
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2016-10-27
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2016-2017 Genode Labs GmbH
|
2016-10-30 15:17:24 +01:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
2017-02-20 13:23:52 +01:00
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
2016-10-30 15:17:24 +01:00
|
|
|
*/
|
|
|
|
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
#ifndef _LIBC__INTERNAL__INIT_H_
|
|
|
|
#define _LIBC__INTERNAL__INIT_H_
|
2016-10-30 15:17:24 +01:00
|
|
|
|
|
|
|
/* Genode includes */
|
|
|
|
#include <base/env.h>
|
2019-08-14 17:34:09 +02:00
|
|
|
#include <base/heap.h>
|
2017-02-22 14:42:20 +01:00
|
|
|
#include <util/xml_node.h>
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
#include <vfs/types.h> /* for 'MAX_PATH_LEN' */
|
2016-10-30 15:17:24 +01:00
|
|
|
|
2019-08-14 17:34:09 +02:00
|
|
|
/* libc includes */
|
|
|
|
#include <setjmp.h> /* for 'jmp_buf' type */
|
|
|
|
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
/* libc-internal includes */
|
|
|
|
#include <internal/types.h>
|
|
|
|
|
2016-10-30 15:17:24 +01:00
|
|
|
namespace Libc {
|
|
|
|
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
struct Resume;
|
|
|
|
struct Suspend;
|
|
|
|
struct Select;
|
|
|
|
struct Current_time;
|
|
|
|
struct Clone_connection;
|
|
|
|
struct Kernel_routine_scheduler;
|
2019-09-20 16:59:47 +02:00
|
|
|
struct Watch;
|
2019-10-11 15:23:22 +02:00
|
|
|
struct Signal;
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
|
2016-10-30 15:17:24 +01:00
|
|
|
/**
|
|
|
|
* Support for shared libraries
|
|
|
|
*/
|
|
|
|
void init_dl(Genode::Env &env);
|
2017-01-31 16:01:07 +01:00
|
|
|
|
2019-08-20 12:18:54 +02:00
|
|
|
/**
|
|
|
|
* File-descriptor allocator
|
|
|
|
*/
|
|
|
|
void init_fd_alloc(Genode::Allocator &);
|
|
|
|
|
2017-01-31 16:01:07 +01:00
|
|
|
/**
|
|
|
|
* Global memory allocator
|
|
|
|
*/
|
|
|
|
void init_mem_alloc(Genode::Env &env);
|
2017-02-22 14:23:06 +01:00
|
|
|
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
/**
|
|
|
|
* Plugin interface
|
|
|
|
*/
|
|
|
|
void init_plugin(Resume &);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Virtual file system
|
|
|
|
*/
|
|
|
|
void init_vfs_plugin(Suspend &);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Select support
|
|
|
|
*/
|
|
|
|
void init_select(Suspend &, Resume &, Select &);
|
|
|
|
|
2017-02-22 14:23:06 +01:00
|
|
|
/**
|
|
|
|
* Support for querying available RAM quota in sysctl functions
|
|
|
|
*/
|
|
|
|
void sysctl_init(Genode::Env &env);
|
2017-02-22 14:42:20 +01:00
|
|
|
|
2019-09-20 16:26:52 +02:00
|
|
|
/**
|
|
|
|
* Support for getpwent
|
|
|
|
*/
|
|
|
|
void init_passwd(Xml_node);
|
|
|
|
|
2017-02-22 14:42:20 +01:00
|
|
|
/**
|
|
|
|
* Set libc config node
|
|
|
|
*/
|
2019-09-19 20:37:17 +02:00
|
|
|
void libc_config_init(Xml_node node);
|
2017-05-12 23:10:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Malloc allocator
|
2019-01-21 15:59:00 +01:00
|
|
|
*/
|
2019-08-20 12:18:54 +02:00
|
|
|
void init_malloc(Genode::Allocator &);
|
2019-08-14 17:34:09 +02:00
|
|
|
void init_malloc_cloned(Clone_connection &);
|
2019-08-20 12:18:54 +02:00
|
|
|
void reinit_malloc(Genode::Allocator &);
|
2019-01-21 15:59:00 +01:00
|
|
|
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
typedef String<Vfs::MAX_PATH_LEN> Rtc_path;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Init timing facilities
|
|
|
|
*/
|
|
|
|
void init_sleep(Suspend &);
|
2019-09-20 16:59:47 +02:00
|
|
|
void init_time(Current_time &, Rtc_path const &, Watch &);
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Socket fs
|
|
|
|
*/
|
|
|
|
void init_socket_fs(Suspend &);
|
|
|
|
|
2019-01-21 15:59:00 +01:00
|
|
|
/**
|
|
|
|
* Allow thread.cc to access the 'Genode::Env' (needed for the
|
|
|
|
* implementation of condition variables with timeout)
|
|
|
|
*/
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
void init_pthread_support(Genode::Env &env, Suspend &, Resume &);
|
2019-08-14 17:34:09 +02:00
|
|
|
|
2019-09-19 20:37:17 +02:00
|
|
|
struct Config_accessor : Interface
|
2019-08-14 17:34:09 +02:00
|
|
|
{
|
2019-09-19 20:37:17 +02:00
|
|
|
virtual Xml_node config() const = 0;
|
2019-08-14 17:34:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Fork mechanism
|
|
|
|
*/
|
|
|
|
void init_fork(Genode::Env &, Config_accessor const &,
|
2019-09-19 20:37:17 +02:00
|
|
|
Genode::Allocator &heap, Heap &malloc_heap, int pid,
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
Suspend &, Resume &, Kernel_routine_scheduler &);
|
2019-08-20 12:18:54 +02:00
|
|
|
|
2019-09-19 20:37:17 +02:00
|
|
|
struct Reset_malloc_heap : Interface
|
2019-08-20 12:18:54 +02:00
|
|
|
{
|
|
|
|
virtual void reset_malloc_heap() = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Execve mechanism
|
|
|
|
*/
|
|
|
|
void init_execve(Genode::Env &, Genode::Allocator &, void *user_stack,
|
|
|
|
Reset_malloc_heap &);
|
2019-10-11 15:23:22 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Signal handling
|
|
|
|
*/
|
|
|
|
void init_signal(Signal &);
|
2016-10-30 15:17:24 +01:00
|
|
|
}
|
|
|
|
|
libc: split task.cc into multiple files
This patch is the first step of re-organizing the internal structure of
the libc. The original version involved many direct calls of global
functions (often with side effects) across compilation units, which
made the control flow (e.g., the initialization sequence) hard to
follow.
The new version replaces those ad-hoc interactions with dedicated
interfaces (like suspend.h, resume.h, select.h, current_time.h). The
underlying facilities are provided by the central Libc::Kernel and
selectively propagated to the various compilation units. The latter is
done by a sequence of 'init_*' calls, which eventually will be replaced
by constructor calls.
The addition of new headers increases the chance for name clashes with
existing (public) headers. To disambiguate libc-internal header files
from public headers, this patch moves the former into a new 'internal/'
subdirectory. This makes the include directives easier to follow and the
libc's source-tree structure more tidy.
There are still a few legacies left, which cannot easily be removed
right now (e.g., because noux relies on them). However, the patch moves
those bad apples to legacy.h and legacy.cc, which highlights the
deprecation of those functions.
Issue #3497
2019-09-18 20:19:10 +02:00
|
|
|
#endif /* _LIBC__INTERNAL__INIT_H_ */
|