2011-12-22 16:19:25 +01:00
|
|
|
/*
|
|
|
|
* \brief Paging-server framework
|
|
|
|
* \author Norman Feske
|
|
|
|
* \date 2006-04-28
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2017-02-20 13:23:52 +01:00
|
|
|
* Copyright (C) 2006-2017 Genode Labs GmbH
|
2011-12-22 16:19:25 +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.
|
2011-12-22 16:19:25 +01:00
|
|
|
*/
|
|
|
|
|
2015-06-19 14:58:18 +02:00
|
|
|
#ifndef _CORE__INCLUDE__PAGER_H_
|
|
|
|
#define _CORE__INCLUDE__PAGER_H_
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2015-06-19 14:58:18 +02:00
|
|
|
/* Genode includes */
|
2011-12-22 16:19:25 +01:00
|
|
|
#include <base/thread.h>
|
|
|
|
#include <base/object_pool.h>
|
|
|
|
#include <base/capability.h>
|
2016-09-05 11:24:51 +02:00
|
|
|
#include <base/session_label.h>
|
Streamline exception types
This patch reduces the number of exception types by facilitating
globally defined exceptions for common usage patterns shared by most
services. In particular, RPC functions that demand a session-resource
upgrade not longer reflect this condition via a session-specific
exception but via the 'Out_of_ram' or 'Out_of_caps' types.
Furthermore, the 'Parent::Service_denied', 'Parent::Unavailable',
'Root::Invalid_args', 'Root::Unavailable', 'Service::Invalid_args',
'Service::Unavailable', and 'Local_service::Factory::Denied' types have
been replaced by the single 'Service_denied' exception type defined in
'session/session.h'.
This consolidation eases the error handling (there are fewer exceptions
to handle), alleviates the need to convert exceptions along the
session-creation call chain, and avoids possible aliasing problems
(catching the wrong type with the same name but living in a different
scope).
2017-05-07 22:03:22 +02:00
|
|
|
#include <cpu_session/cpu_session.h>
|
2011-12-22 16:19:25 +01:00
|
|
|
#include <pager/capability.h>
|
|
|
|
|
2016-06-15 15:04:54 +02:00
|
|
|
/* NOVA includes */
|
|
|
|
#include <nova/cap_map.h>
|
|
|
|
|
2016-01-19 20:24:22 +01:00
|
|
|
/* core-local includes */
|
2015-06-19 14:58:18 +02:00
|
|
|
#include <ipc_pager.h>
|
2016-01-19 20:24:22 +01:00
|
|
|
#include <rpc_cap_factory.h>
|
2015-06-19 14:58:18 +02:00
|
|
|
|
|
|
|
|
2011-12-22 16:19:25 +01:00
|
|
|
namespace Genode {
|
|
|
|
|
Streamline exception types
This patch reduces the number of exception types by facilitating
globally defined exceptions for common usage patterns shared by most
services. In particular, RPC functions that demand a session-resource
upgrade not longer reflect this condition via a session-specific
exception but via the 'Out_of_ram' or 'Out_of_caps' types.
Furthermore, the 'Parent::Service_denied', 'Parent::Unavailable',
'Root::Invalid_args', 'Root::Unavailable', 'Service::Invalid_args',
'Service::Unavailable', and 'Local_service::Factory::Denied' types have
been replaced by the single 'Service_denied' exception type defined in
'session/session.h'.
This consolidation eases the error handling (there are fewer exceptions
to handle), alleviates the need to convert exceptions along the
session-creation call chain, and avoids possible aliasing problems
(catching the wrong type with the same name but living in a different
scope).
2017-05-07 22:03:22 +02:00
|
|
|
typedef Cpu_session::Thread_creation_failed Invalid_thread;
|
|
|
|
|
2011-12-22 16:19:25 +01:00
|
|
|
class Pager_entrypoint;
|
2014-09-05 17:00:31 +02:00
|
|
|
class Pager_object;
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2014-09-05 17:00:31 +02:00
|
|
|
class Exception_handlers
|
2011-12-22 16:19:25 +01:00
|
|
|
{
|
|
|
|
private:
|
|
|
|
|
2014-09-05 17:00:31 +02:00
|
|
|
template <uint8_t EV>
|
base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:
* The contract between caller and callee becomes more obvious. When
passing a reference, the contract says that the argument cannot be
a null pointer. The caller is responsible to ensure that. Therefore,
the use of reference eliminates the need to add defensive null-pointer
checks at the callee site, which sometimes merely exist to be on the
safe side. The bottom line is that the code becomes easier to follow.
* Reference members must be initialized via an object initializer,
which promotes a programming style that avoids intermediate object-
construction states. Within core, there are still a few pointers
as member variables left though. E.g., caused by the late association
of 'Platform_thread' objects with their 'Platform_pd' objects.
* If no pointers are present as member variables, we don't need to
manually provide declarations of a private copy constructor and
an assignment operator to avoid -Weffc++ errors "class ... has
pointer data members [-Werror=effc++]".
This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.
Fixes #3135
2019-01-24 22:00:01 +01:00
|
|
|
__attribute__((regparm(1))) static void _handler(Pager_object &);
|
2014-09-05 17:00:31 +02:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:
* The contract between caller and callee becomes more obvious. When
passing a reference, the contract says that the argument cannot be
a null pointer. The caller is responsible to ensure that. Therefore,
the use of reference eliminates the need to add defensive null-pointer
checks at the callee site, which sometimes merely exist to be on the
safe side. The bottom line is that the code becomes easier to follow.
* Reference members must be initialized via an object initializer,
which promotes a programming style that avoids intermediate object-
construction states. Within core, there are still a few pointers
as member variables left though. E.g., caused by the late association
of 'Platform_thread' objects with their 'Platform_pd' objects.
* If no pointers are present as member variables, we don't need to
manually provide declarations of a private copy constructor and
an assignment operator to avoid -Weffc++ errors "class ... has
pointer data members [-Werror=effc++]".
This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.
Fixes #3135
2019-01-24 22:00:01 +01:00
|
|
|
Exception_handlers(Pager_object &);
|
2014-09-05 17:00:31 +02:00
|
|
|
|
|
|
|
template <uint8_t EV>
|
base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:
* The contract between caller and callee becomes more obvious. When
passing a reference, the contract says that the argument cannot be
a null pointer. The caller is responsible to ensure that. Therefore,
the use of reference eliminates the need to add defensive null-pointer
checks at the callee site, which sometimes merely exist to be on the
safe side. The bottom line is that the code becomes easier to follow.
* Reference members must be initialized via an object initializer,
which promotes a programming style that avoids intermediate object-
construction states. Within core, there are still a few pointers
as member variables left though. E.g., caused by the late association
of 'Platform_thread' objects with their 'Platform_pd' objects.
* If no pointers are present as member variables, we don't need to
manually provide declarations of a private copy constructor and
an assignment operator to avoid -Weffc++ errors "class ... has
pointer data members [-Werror=effc++]".
This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.
Fixes #3135
2019-01-24 22:00:01 +01:00
|
|
|
void register_handler(Pager_object &, Nova::Mtd,
|
|
|
|
void (__attribute__((regparm(1)))*)(Pager_object &) = nullptr);
|
2014-09-05 17:00:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class Pager_object : public Object_pool<Pager_object>::Entry
|
|
|
|
{
|
|
|
|
private:
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
unsigned long _badge; /* used for debugging */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* User-level signal handler registered for this pager object via
|
|
|
|
* 'Cpu_session::exception_handler()'.
|
|
|
|
*/
|
Follow practices suggested by "Effective C++"
The patch adjust the code of the base, base-<kernel>, and os repository.
To adapt existing components to fix violations of the best practices
suggested by "Effective C++" as reported by the -Weffc++ compiler
argument. The changes follow the patterns outlined below:
* A class with virtual functions can no longer publicly inherit base
classed without a vtable. The inherited object may either be moved
to a member variable, or inherited privately. The latter would be
used for classes that inherit 'List::Element' or 'Avl_node'. In order
to enable the 'List' and 'Avl_tree' to access the meta data, the
'List' must become a friend.
* Instead of adding a virtual destructor to abstract base classes,
we inherit the new 'Interface' class, which contains a virtual
destructor. This way, single-line abstract base classes can stay
as compact as they are now. The 'Interface' utility resides in
base/include/util/interface.h.
* With the new warnings enabled, all member variables must be explicitly
initialized. Basic types may be initialized with '='. All other types
are initialized with braces '{ ... }' or as class initializers. If
basic types and non-basic types appear in a row, it is nice to only
use the brace syntax (also for basic types) and align the braces.
* If a class contains pointers as members, it must now also provide a
copy constructor and assignment operator. In the most cases, one
would make them private, effectively disallowing the objects to be
copied. Unfortunately, this warning cannot be fixed be inheriting
our existing 'Noncopyable' class (the compiler fails to detect that
the inheriting class cannot be copied and still gives the error).
For now, we have to manually add declarations for both the copy
constructor and assignment operator as private class members. Those
declarations should be prepended with a comment like this:
/*
* Noncopyable
*/
Thread(Thread const &);
Thread &operator = (Thread const &);
In the future, we should revisit these places and try to replace
the pointers with references. In the presence of at least one
reference member, the compiler would no longer implicitly generate
a copy constructor. So we could remove the manual declaration.
Issue #465
2017-12-21 15:42:15 +01:00
|
|
|
Signal_context_capability _exception_sigh { };
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2013-01-11 23:10:21 +01:00
|
|
|
/**
|
2014-09-05 17:00:31 +02:00
|
|
|
* selectors for
|
|
|
|
* - cleanup portal
|
|
|
|
* - semaphore used by caller used to notify paused state
|
|
|
|
* - semaphore used to block during page fault handling or pausing
|
2012-08-24 10:25:24 +02:00
|
|
|
*/
|
2014-09-05 17:00:31 +02:00
|
|
|
addr_t _selectors;
|
2012-08-24 10:25:24 +02:00
|
|
|
|
Follow practices suggested by "Effective C++"
The patch adjust the code of the base, base-<kernel>, and os repository.
To adapt existing components to fix violations of the best practices
suggested by "Effective C++" as reported by the -Weffc++ compiler
argument. The changes follow the patterns outlined below:
* A class with virtual functions can no longer publicly inherit base
classed without a vtable. The inherited object may either be moved
to a member variable, or inherited privately. The latter would be
used for classes that inherit 'List::Element' or 'Avl_node'. In order
to enable the 'List' and 'Avl_tree' to access the meta data, the
'List' must become a friend.
* Instead of adding a virtual destructor to abstract base classes,
we inherit the new 'Interface' class, which contains a virtual
destructor. This way, single-line abstract base classes can stay
as compact as they are now. The 'Interface' utility resides in
base/include/util/interface.h.
* With the new warnings enabled, all member variables must be explicitly
initialized. Basic types may be initialized with '='. All other types
are initialized with braces '{ ... }' or as class initializers. If
basic types and non-basic types appear in a row, it is nice to only
use the brace syntax (also for basic types) and align the braces.
* If a class contains pointers as members, it must now also provide a
copy constructor and assignment operator. In the most cases, one
would make them private, effectively disallowing the objects to be
copied. Unfortunately, this warning cannot be fixed be inheriting
our existing 'Noncopyable' class (the compiler fails to detect that
the inheriting class cannot be copied and still gives the error).
For now, we have to manually add declarations for both the copy
constructor and assignment operator as private class members. Those
declarations should be prepended with a comment like this:
/*
* Noncopyable
*/
Thread(Thread const &);
Thread &operator = (Thread const &);
In the future, we should revisit these places and try to replace
the pointers with references. In the presence of at least one
reference member, the compiler would no longer implicitly generate
a copy constructor. So we could remove the manual declaration.
Issue #465
2017-12-21 15:42:15 +01:00
|
|
|
addr_t _initial_esp = 0;
|
|
|
|
addr_t _initial_eip = 0;
|
2013-09-23 09:07:33 +02:00
|
|
|
addr_t _client_exc_pt_sel;
|
2011-12-22 16:19:25 +01:00
|
|
|
|
Follow practices suggested by "Effective C++"
The patch adjust the code of the base, base-<kernel>, and os repository.
To adapt existing components to fix violations of the best practices
suggested by "Effective C++" as reported by the -Weffc++ compiler
argument. The changes follow the patterns outlined below:
* A class with virtual functions can no longer publicly inherit base
classed without a vtable. The inherited object may either be moved
to a member variable, or inherited privately. The latter would be
used for classes that inherit 'List::Element' or 'Avl_node'. In order
to enable the 'List' and 'Avl_tree' to access the meta data, the
'List' must become a friend.
* Instead of adding a virtual destructor to abstract base classes,
we inherit the new 'Interface' class, which contains a virtual
destructor. This way, single-line abstract base classes can stay
as compact as they are now. The 'Interface' utility resides in
base/include/util/interface.h.
* With the new warnings enabled, all member variables must be explicitly
initialized. Basic types may be initialized with '='. All other types
are initialized with braces '{ ... }' or as class initializers. If
basic types and non-basic types appear in a row, it is nice to only
use the brace syntax (also for basic types) and align the braces.
* If a class contains pointers as members, it must now also provide a
copy constructor and assignment operator. In the most cases, one
would make them private, effectively disallowing the objects to be
copied. Unfortunately, this warning cannot be fixed be inheriting
our existing 'Noncopyable' class (the compiler fails to detect that
the inheriting class cannot be copied and still gives the error).
For now, we have to manually add declarations for both the copy
constructor and assignment operator as private class members. Those
declarations should be prepended with a comment like this:
/*
* Noncopyable
*/
Thread(Thread const &);
Thread &operator = (Thread const &);
In the future, we should revisit these places and try to replace
the pointers with references. In the presence of at least one
reference member, the compiler would no longer implicitly generate
a copy constructor. So we could remove the manual declaration.
Issue #465
2017-12-21 15:42:15 +01:00
|
|
|
Lock _state_lock { };
|
2016-05-17 16:13:56 +02:00
|
|
|
|
2013-01-11 23:10:21 +01:00
|
|
|
struct
|
|
|
|
{
|
2012-08-24 10:25:24 +02:00
|
|
|
struct Thread_state thread;
|
2012-08-22 12:10:04 +02:00
|
|
|
addr_t sel_client_ec;
|
2013-09-26 15:16:01 +02:00
|
|
|
enum {
|
2018-04-27 17:17:56 +02:00
|
|
|
BLOCKED = 0x1U,
|
|
|
|
DEAD = 0x2U,
|
|
|
|
SINGLESTEP = 0x4U,
|
|
|
|
SIGNAL_SM = 0x8U,
|
|
|
|
DISSOLVED = 0x10U,
|
|
|
|
SUBMIT_SIGNAL = 0x20U,
|
|
|
|
BLOCKED_PAUSE_SM = 0x40U,
|
2013-09-26 15:16:01 +02:00
|
|
|
};
|
|
|
|
uint8_t _status;
|
2016-05-17 16:13:56 +02:00
|
|
|
bool modified;
|
2013-09-26 15:16:01 +02:00
|
|
|
|
|
|
|
/* convenience function to access pause/recall state */
|
2018-04-27 17:17:56 +02:00
|
|
|
inline bool blocked() { return _status & BLOCKED;}
|
|
|
|
inline void block() { _status |= BLOCKED; }
|
|
|
|
inline void unblock() { _status &= ~BLOCKED; }
|
|
|
|
inline bool blocked_pause_sm() { return _status & BLOCKED_PAUSE_SM;}
|
|
|
|
inline void block_pause_sm() { _status |= BLOCKED_PAUSE_SM; }
|
|
|
|
inline void unblock_pause_sm() { _status &= ~BLOCKED_PAUSE_SM; }
|
2013-09-26 15:16:01 +02:00
|
|
|
|
|
|
|
inline void mark_dead() { _status |= DEAD; }
|
|
|
|
inline bool is_dead() { return _status & DEAD; }
|
|
|
|
|
|
|
|
inline bool singlestep() { return _status & SINGLESTEP; }
|
2013-09-26 14:31:56 +02:00
|
|
|
|
|
|
|
inline void mark_signal_sm() { _status |= SIGNAL_SM; }
|
|
|
|
inline bool has_signal_sm() { return _status & SIGNAL_SM; }
|
2014-09-05 17:00:31 +02:00
|
|
|
|
|
|
|
inline void mark_dissolved() { _status |= DISSOLVED; }
|
|
|
|
inline bool dissolved() { return _status & DISSOLVED; }
|
|
|
|
|
|
|
|
inline bool to_submit() { return _status & SUBMIT_SIGNAL; }
|
|
|
|
inline void submit_signal() { _status |= SUBMIT_SIGNAL; }
|
|
|
|
inline void reset_submit() { _status &= ~SUBMIT_SIGNAL; }
|
|
|
|
|
Follow practices suggested by "Effective C++"
The patch adjust the code of the base, base-<kernel>, and os repository.
To adapt existing components to fix violations of the best practices
suggested by "Effective C++" as reported by the -Weffc++ compiler
argument. The changes follow the patterns outlined below:
* A class with virtual functions can no longer publicly inherit base
classed without a vtable. The inherited object may either be moved
to a member variable, or inherited privately. The latter would be
used for classes that inherit 'List::Element' or 'Avl_node'. In order
to enable the 'List' and 'Avl_tree' to access the meta data, the
'List' must become a friend.
* Instead of adding a virtual destructor to abstract base classes,
we inherit the new 'Interface' class, which contains a virtual
destructor. This way, single-line abstract base classes can stay
as compact as they are now. The 'Interface' utility resides in
base/include/util/interface.h.
* With the new warnings enabled, all member variables must be explicitly
initialized. Basic types may be initialized with '='. All other types
are initialized with braces '{ ... }' or as class initializers. If
basic types and non-basic types appear in a row, it is nice to only
use the brace syntax (also for basic types) and align the braces.
* If a class contains pointers as members, it must now also provide a
copy constructor and assignment operator. In the most cases, one
would make them private, effectively disallowing the objects to be
copied. Unfortunately, this warning cannot be fixed be inheriting
our existing 'Noncopyable' class (the compiler fails to detect that
the inheriting class cannot be copied and still gives the error).
For now, we have to manually add declarations for both the copy
constructor and assignment operator as private class members. Those
declarations should be prepended with a comment like this:
/*
* Noncopyable
*/
Thread(Thread const &);
Thread &operator = (Thread const &);
In the future, we should revisit these places and try to replace
the pointers with references. In the presence of at least one
reference member, the compiler would no longer implicitly generate
a copy constructor. So we could remove the manual declaration.
Issue #465
2017-12-21 15:42:15 +01:00
|
|
|
} _state { };
|
2012-08-24 10:25:24 +02:00
|
|
|
|
2016-09-23 17:47:36 +02:00
|
|
|
Cpu_session_capability _cpu_session_cap;
|
|
|
|
Thread_capability _thread_cap;
|
|
|
|
Affinity::Location const _location;
|
|
|
|
Exception_handlers _exceptions;
|
2012-11-29 13:37:30 +01:00
|
|
|
|
2016-11-24 21:57:33 +01:00
|
|
|
addr_t _pd_target;
|
2015-06-09 19:33:53 +02:00
|
|
|
|
base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:
* The contract between caller and callee becomes more obvious. When
passing a reference, the contract says that the argument cannot be
a null pointer. The caller is responsible to ensure that. Therefore,
the use of reference eliminates the need to add defensive null-pointer
checks at the callee site, which sometimes merely exist to be on the
safe side. The bottom line is that the code becomes easier to follow.
* Reference members must be initialized via an object initializer,
which promotes a programming style that avoids intermediate object-
construction states. Within core, there are still a few pointers
as member variables left though. E.g., caused by the late association
of 'Platform_thread' objects with their 'Platform_pd' objects.
* If no pointers are present as member variables, we don't need to
manually provide declarations of a private copy constructor and
an assignment operator to avoid -Weffc++ errors "class ... has
pointer data members [-Werror=effc++]".
This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.
Fixes #3135
2019-01-24 22:00:01 +01:00
|
|
|
void _copy_state_from_utcb(Nova::Utcb const &utcb);
|
|
|
|
void _copy_state_to_utcb(Nova::Utcb &utcb) const;
|
2016-05-17 16:13:56 +02:00
|
|
|
|
|
|
|
uint8_t _unsynchronized_client_recall(bool get_state_and_block);
|
2012-08-24 10:25:24 +02:00
|
|
|
|
2016-05-17 16:13:56 +02:00
|
|
|
addr_t sel_pt_cleanup() const { return _selectors; }
|
|
|
|
addr_t sel_sm_block_pause() const { return _selectors + 1; }
|
|
|
|
addr_t sel_sm_block_oom() const { return _selectors + 2; }
|
|
|
|
addr_t sel_oom_portal() const { return _selectors + 3; }
|
2013-09-23 09:07:33 +02:00
|
|
|
|
2014-09-05 17:00:31 +02:00
|
|
|
__attribute__((regparm(1)))
|
base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:
* The contract between caller and callee becomes more obvious. When
passing a reference, the contract says that the argument cannot be
a null pointer. The caller is responsible to ensure that. Therefore,
the use of reference eliminates the need to add defensive null-pointer
checks at the callee site, which sometimes merely exist to be on the
safe side. The bottom line is that the code becomes easier to follow.
* Reference members must be initialized via an object initializer,
which promotes a programming style that avoids intermediate object-
construction states. Within core, there are still a few pointers
as member variables left though. E.g., caused by the late association
of 'Platform_thread' objects with their 'Platform_pd' objects.
* If no pointers are present as member variables, we don't need to
manually provide declarations of a private copy constructor and
an assignment operator to avoid -Weffc++ errors "class ... has
pointer data members [-Werror=effc++]".
This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.
Fixes #3135
2019-01-24 22:00:01 +01:00
|
|
|
static void _page_fault_handler(Pager_object &);
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2012-08-23 11:02:31 +02:00
|
|
|
__attribute__((regparm(1)))
|
base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:
* The contract between caller and callee becomes more obvious. When
passing a reference, the contract says that the argument cannot be
a null pointer. The caller is responsible to ensure that. Therefore,
the use of reference eliminates the need to add defensive null-pointer
checks at the callee site, which sometimes merely exist to be on the
safe side. The bottom line is that the code becomes easier to follow.
* Reference members must be initialized via an object initializer,
which promotes a programming style that avoids intermediate object-
construction states. Within core, there are still a few pointers
as member variables left though. E.g., caused by the late association
of 'Platform_thread' objects with their 'Platform_pd' objects.
* If no pointers are present as member variables, we don't need to
manually provide declarations of a private copy constructor and
an assignment operator to avoid -Weffc++ errors "class ... has
pointer data members [-Werror=effc++]".
This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.
Fixes #3135
2019-01-24 22:00:01 +01:00
|
|
|
static void _startup_handler(Pager_object &);
|
2012-08-23 11:02:31 +02:00
|
|
|
|
2014-09-05 17:00:31 +02:00
|
|
|
__attribute__((regparm(1)))
|
base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:
* The contract between caller and callee becomes more obvious. When
passing a reference, the contract says that the argument cannot be
a null pointer. The caller is responsible to ensure that. Therefore,
the use of reference eliminates the need to add defensive null-pointer
checks at the callee site, which sometimes merely exist to be on the
safe side. The bottom line is that the code becomes easier to follow.
* Reference members must be initialized via an object initializer,
which promotes a programming style that avoids intermediate object-
construction states. Within core, there are still a few pointers
as member variables left though. E.g., caused by the late association
of 'Platform_thread' objects with their 'Platform_pd' objects.
* If no pointers are present as member variables, we don't need to
manually provide declarations of a private copy constructor and
an assignment operator to avoid -Weffc++ errors "class ... has
pointer data members [-Werror=effc++]".
This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.
Fixes #3135
2019-01-24 22:00:01 +01:00
|
|
|
static void _invoke_handler(Pager_object &);
|
2014-09-05 17:00:31 +02:00
|
|
|
|
|
|
|
__attribute__((regparm(1)))
|
base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:
* The contract between caller and callee becomes more obvious. When
passing a reference, the contract says that the argument cannot be
a null pointer. The caller is responsible to ensure that. Therefore,
the use of reference eliminates the need to add defensive null-pointer
checks at the callee site, which sometimes merely exist to be on the
safe side. The bottom line is that the code becomes easier to follow.
* Reference members must be initialized via an object initializer,
which promotes a programming style that avoids intermediate object-
construction states. Within core, there are still a few pointers
as member variables left though. E.g., caused by the late association
of 'Platform_thread' objects with their 'Platform_pd' objects.
* If no pointers are present as member variables, we don't need to
manually provide declarations of a private copy constructor and
an assignment operator to avoid -Weffc++ errors "class ... has
pointer data members [-Werror=effc++]".
This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.
Fixes #3135
2019-01-24 22:00:01 +01:00
|
|
|
static void _recall_handler(Pager_object &);
|
2013-09-23 09:07:33 +02:00
|
|
|
|
2015-06-09 19:33:53 +02:00
|
|
|
__attribute__((regparm(3)))
|
|
|
|
static void _oom_handler(addr_t, addr_t, addr_t);
|
|
|
|
|
2011-12-22 16:19:25 +01:00
|
|
|
public:
|
|
|
|
|
2016-04-20 21:12:57 +02:00
|
|
|
Pager_object(Cpu_session_capability cpu_session_cap,
|
|
|
|
Thread_capability thread_cap,
|
2016-09-05 11:24:51 +02:00
|
|
|
unsigned long badge, Affinity::Location location,
|
|
|
|
Genode::Session_label const &,
|
|
|
|
Cpu_session::Name const &);
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
virtual ~Pager_object();
|
|
|
|
|
|
|
|
unsigned long badge() const { return _badge; }
|
2014-09-05 17:00:31 +02:00
|
|
|
void reset_badge() { _badge = 0; }
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2016-05-19 20:33:36 +02:00
|
|
|
const char * client_thread() const;
|
|
|
|
const char * client_pd() const;
|
|
|
|
|
2011-12-22 16:19:25 +01:00
|
|
|
virtual int pager(Ipc_pager &ps) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Assign user-level exception handler for the pager object
|
|
|
|
*/
|
|
|
|
void exception_handler(Signal_context_capability sigh)
|
|
|
|
{
|
|
|
|
_exception_sigh = sigh;
|
|
|
|
}
|
|
|
|
|
2016-09-23 17:47:36 +02:00
|
|
|
Affinity::Location location() const { return _location; }
|
|
|
|
|
2015-06-09 19:33:53 +02:00
|
|
|
/**
|
|
|
|
* Assign PD selector to PD
|
|
|
|
*/
|
2016-11-30 19:36:32 +01:00
|
|
|
void assign_pd(addr_t pd_sel) { _pd_target = pd_sel; }
|
2016-11-24 21:57:33 +01:00
|
|
|
addr_t pd_sel() const { return _pd_target; }
|
2015-06-09 19:33:53 +02:00
|
|
|
|
2014-09-05 17:00:31 +02:00
|
|
|
void exception(uint8_t exit_id);
|
2012-08-08 14:23:13 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return base of initial portal window
|
|
|
|
*/
|
2013-09-23 09:07:33 +02:00
|
|
|
addr_t exc_pt_sel_client() { return _client_exc_pt_sel; }
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set initial stack pointer used by the startup handler
|
|
|
|
*/
|
2013-09-27 14:47:11 +02:00
|
|
|
addr_t initial_esp() { return _initial_esp; }
|
2011-12-22 16:19:25 +01:00
|
|
|
void initial_esp(addr_t esp) { _initial_esp = esp; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set initial instruction pointer used by the startup handler
|
|
|
|
*/
|
|
|
|
void initial_eip(addr_t eip) { _initial_eip = eip; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Continue execution of pager object
|
|
|
|
*/
|
|
|
|
void wake_up();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Notify exception handler about the occurrence of an exception
|
|
|
|
*/
|
2012-08-24 10:25:24 +02:00
|
|
|
bool submit_exception_signal()
|
2011-12-22 16:19:25 +01:00
|
|
|
{
|
2012-08-24 10:25:24 +02:00
|
|
|
if (!_exception_sigh.valid()) return false;
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2014-09-05 17:00:31 +02:00
|
|
|
_state.reset_submit();
|
|
|
|
|
2011-12-22 16:19:25 +01:00
|
|
|
Signal_transmitter transmitter(_exception_sigh);
|
|
|
|
transmitter.submit();
|
2012-08-24 10:25:24 +02:00
|
|
|
|
|
|
|
return true;
|
2011-12-22 16:19:25 +01:00
|
|
|
}
|
2012-08-08 14:23:13 +02:00
|
|
|
|
2012-08-24 10:25:24 +02:00
|
|
|
/**
|
2016-05-17 16:13:56 +02:00
|
|
|
* Copy thread state of recalled thread.
|
2012-08-24 10:25:24 +02:00
|
|
|
*/
|
2016-05-17 16:13:56 +02:00
|
|
|
bool copy_thread_state(Thread_state * state_dst)
|
2012-08-24 10:25:24 +02:00
|
|
|
{
|
2016-05-17 16:13:56 +02:00
|
|
|
Lock::Guard _state_lock_guard(_state_lock);
|
2012-08-24 10:25:24 +02:00
|
|
|
|
2016-05-17 16:13:56 +02:00
|
|
|
if (!state_dst || !_state.blocked())
|
|
|
|
return false;
|
2014-09-05 17:00:31 +02:00
|
|
|
|
2016-05-17 16:13:56 +02:00
|
|
|
*state_dst = _state.thread;
|
|
|
|
|
|
|
|
return true;
|
2012-08-08 14:23:13 +02:00
|
|
|
}
|
2012-08-24 10:25:24 +02:00
|
|
|
|
2016-05-17 16:13:56 +02:00
|
|
|
/*
|
|
|
|
* Copy thread state to recalled thread.
|
2012-08-24 10:25:24 +02:00
|
|
|
*/
|
2016-05-17 16:13:56 +02:00
|
|
|
bool copy_thread_state(Thread_state state_src)
|
2012-08-24 10:25:24 +02:00
|
|
|
{
|
2016-05-17 16:13:56 +02:00
|
|
|
Lock::Guard _state_lock_guard(_state_lock);
|
|
|
|
|
|
|
|
if (!_state.blocked())
|
2013-09-27 14:47:11 +02:00
|
|
|
return false;
|
2012-08-24 10:25:24 +02:00
|
|
|
|
2016-05-17 16:13:56 +02:00
|
|
|
_state.thread = state_src;
|
|
|
|
_state.modified = true;
|
2012-08-24 10:25:24 +02:00
|
|
|
|
2013-09-27 14:47:11 +02:00
|
|
|
return true;
|
2012-08-24 10:25:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Cancel blocking in a lock so that recall exception can take
|
|
|
|
* place.
|
|
|
|
*/
|
2012-08-22 12:10:04 +02:00
|
|
|
void client_cancel_blocking();
|
|
|
|
|
2016-05-17 16:13:56 +02:00
|
|
|
uint8_t client_recall(bool get_state_and_block);
|
|
|
|
void client_set_ec(addr_t ec) { _state.sel_client_ec = ec; }
|
2012-08-23 12:43:19 +02:00
|
|
|
|
2016-05-17 16:13:56 +02:00
|
|
|
inline void single_step(bool on)
|
2013-09-26 15:16:01 +02:00
|
|
|
{
|
2016-05-17 16:13:56 +02:00
|
|
|
_state_lock.lock();
|
|
|
|
|
|
|
|
if (_state.is_dead() || !_state.blocked() ||
|
2014-09-05 17:00:31 +02:00
|
|
|
(on && (_state._status & _state.SINGLESTEP)) ||
|
2016-05-17 16:13:56 +02:00
|
|
|
(!on && !(_state._status & _state.SINGLESTEP))) {
|
|
|
|
_state_lock.unlock();
|
|
|
|
return;
|
|
|
|
}
|
2014-09-05 17:00:31 +02:00
|
|
|
|
2013-09-26 15:16:01 +02:00
|
|
|
if (on)
|
|
|
|
_state._status |= _state.SINGLESTEP;
|
|
|
|
else
|
|
|
|
_state._status &= ~_state.SINGLESTEP;
|
2014-09-05 17:00:31 +02:00
|
|
|
|
2016-05-17 16:13:56 +02:00
|
|
|
_state_lock.unlock();
|
2014-09-05 17:00:31 +02:00
|
|
|
|
|
|
|
/* force client in exit and thereby apply single_step change */
|
2016-05-17 16:13:56 +02:00
|
|
|
client_recall(false);
|
2013-09-26 15:16:01 +02:00
|
|
|
}
|
2012-11-29 13:37:30 +01:00
|
|
|
|
|
|
|
/**
|
2016-04-20 21:12:57 +02:00
|
|
|
* Return CPU session that was used to created the thread
|
2012-11-29 13:37:30 +01:00
|
|
|
*/
|
2016-04-20 21:12:57 +02:00
|
|
|
Cpu_session_capability cpu_session_cap() const { return _cpu_session_cap; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return thread capability
|
|
|
|
*
|
|
|
|
* This function enables the destructor of the thread's
|
|
|
|
* address-space region map to kill the thread.
|
|
|
|
*/
|
|
|
|
Thread_capability thread_cap() const { return _thread_cap; }
|
2012-12-04 09:49:01 +01:00
|
|
|
|
2014-09-05 17:00:31 +02:00
|
|
|
/**
|
2014-07-15 19:05:26 +02:00
|
|
|
* Note in the thread state that an unresolved page
|
|
|
|
* fault occurred.
|
|
|
|
*/
|
|
|
|
void unresolved_page_fault_occurred()
|
|
|
|
{
|
|
|
|
_state.thread.unresolved_page_fault = true;
|
|
|
|
}
|
|
|
|
|
2012-12-04 09:49:01 +01:00
|
|
|
/**
|
|
|
|
* Make sure nobody is in the handler anymore by doing an IPC to a
|
|
|
|
* local cap pointing to same serving thread (if not running in the
|
|
|
|
* context of the serving thread). When the call returns
|
|
|
|
* we know that nobody is handled by this object anymore, because
|
|
|
|
* all remotely available portals had been revoked beforehand.
|
|
|
|
*/
|
|
|
|
void cleanup_call();
|
2013-11-14 10:35:44 +01:00
|
|
|
|
2015-06-09 19:33:53 +02:00
|
|
|
/**
|
|
|
|
* Portal called by thread that causes a out of memory in kernel.
|
|
|
|
*/
|
|
|
|
addr_t get_oom_portal();
|
|
|
|
|
|
|
|
enum Policy {
|
|
|
|
STOP = 1,
|
|
|
|
UPGRADE_CORE_TO_DST = 2,
|
|
|
|
UPGRADE_PREFER_SRC_TO_DST = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum Oom {
|
|
|
|
SEND = 1, REPLY = 2, SELF = 4,
|
|
|
|
SRC_CORE_PD = ~0UL, SRC_PD_UNKNOWN = 0,
|
2016-11-28 10:54:06 +01:00
|
|
|
NO_NOTIFICATION = 0
|
2015-06-09 19:33:53 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements policy on how to react on out of memory in kernel.
|
|
|
|
*
|
|
|
|
* Used solely inside core. On Genode core creates all the out
|
|
|
|
* of memory portals per EC. If the PD of a EC runs out of kernel
|
|
|
|
* memory it causes a OOM portal traversal, which is handled
|
|
|
|
* by the pager object of the causing thread.
|
|
|
|
*
|
|
|
|
* /param pd_sel PD selector from where to transfer kernel memory
|
|
|
|
* resources. The PD of this pager_object is the
|
|
|
|
* target PD.
|
|
|
|
* /param pd debug feature - string of PD (transfer_from)
|
|
|
|
* /param thread debug feature - string of EC (transfer_from)
|
|
|
|
*/
|
2016-11-28 10:54:06 +01:00
|
|
|
uint8_t handle_oom(addr_t pd_sel = SRC_CORE_PD,
|
|
|
|
const char * pd = "core",
|
2015-06-09 19:33:53 +02:00
|
|
|
const char * thread = "unknown",
|
|
|
|
Policy = Policy::UPGRADE_CORE_TO_DST);
|
2016-11-28 10:54:06 +01:00
|
|
|
static uint8_t handle_oom(addr_t pd_from, addr_t pd_to,
|
|
|
|
char const * src_pd,
|
|
|
|
char const * src_thread,
|
|
|
|
Policy policy,
|
|
|
|
addr_t sm_notify = NO_NOTIFICATION,
|
|
|
|
char const * dst_pd = "unknown",
|
|
|
|
char const * dst_thread = "unknown");
|
2016-09-05 11:24:51 +02:00
|
|
|
|
|
|
|
void print(Output &out) const;
|
2011-12-22 16:19:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2014-09-05 17:00:31 +02:00
|
|
|
* A 'Pager_activation' processes one page fault of a 'Pager_object' at a time.
|
2011-12-22 16:19:25 +01:00
|
|
|
*/
|
2014-09-05 17:00:31 +02:00
|
|
|
class Pager_entrypoint;
|
2016-05-04 12:27:17 +02:00
|
|
|
class Pager_activation_base: public Thread
|
2014-09-05 17:00:31 +02:00
|
|
|
{
|
|
|
|
private:
|
2011-12-22 16:19:25 +01:00
|
|
|
|
2014-09-05 17:00:31 +02:00
|
|
|
Native_capability _cap;
|
|
|
|
Pager_entrypoint *_ep; /* entry point to which the
|
|
|
|
activation belongs */
|
|
|
|
/**
|
|
|
|
* Lock used for blocking until '_cap' is initialized
|
|
|
|
*/
|
|
|
|
Lock _cap_valid;
|
2011-12-22 16:19:25 +01:00
|
|
|
|
Follow practices suggested by "Effective C++"
The patch adjust the code of the base, base-<kernel>, and os repository.
To adapt existing components to fix violations of the best practices
suggested by "Effective C++" as reported by the -Weffc++ compiler
argument. The changes follow the patterns outlined below:
* A class with virtual functions can no longer publicly inherit base
classed without a vtable. The inherited object may either be moved
to a member variable, or inherited privately. The latter would be
used for classes that inherit 'List::Element' or 'Avl_node'. In order
to enable the 'List' and 'Avl_tree' to access the meta data, the
'List' must become a friend.
* Instead of adding a virtual destructor to abstract base classes,
we inherit the new 'Interface' class, which contains a virtual
destructor. This way, single-line abstract base classes can stay
as compact as they are now. The 'Interface' utility resides in
base/include/util/interface.h.
* With the new warnings enabled, all member variables must be explicitly
initialized. Basic types may be initialized with '='. All other types
are initialized with braces '{ ... }' or as class initializers. If
basic types and non-basic types appear in a row, it is nice to only
use the brace syntax (also for basic types) and align the braces.
* If a class contains pointers as members, it must now also provide a
copy constructor and assignment operator. In the most cases, one
would make them private, effectively disallowing the objects to be
copied. Unfortunately, this warning cannot be fixed be inheriting
our existing 'Noncopyable' class (the compiler fails to detect that
the inheriting class cannot be copied and still gives the error).
For now, we have to manually add declarations for both the copy
constructor and assignment operator as private class members. Those
declarations should be prepended with a comment like this:
/*
* Noncopyable
*/
Thread(Thread const &);
Thread &operator = (Thread const &);
In the future, we should revisit these places and try to replace
the pointers with references. In the presence of at least one
reference member, the compiler would no longer implicitly generate
a copy constructor. So we could remove the manual declaration.
Issue #465
2017-12-21 15:42:15 +01:00
|
|
|
/*
|
|
|
|
* Noncopyable
|
|
|
|
*/
|
|
|
|
Pager_activation_base(Pager_activation_base const &);
|
|
|
|
Pager_activation_base &operator = (Pager_activation_base const &);
|
|
|
|
|
2014-09-05 17:00:31 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
|
|
|
* \param name name of the new thread
|
|
|
|
* \param stack_size stack size of the new thread
|
|
|
|
*/
|
|
|
|
Pager_activation_base(char const * const name,
|
|
|
|
size_t const stack_size);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Thread interface
|
|
|
|
*/
|
2019-02-14 22:39:08 +01:00
|
|
|
void entry() override;
|
2014-09-05 17:00:31 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Return capability to this activation
|
|
|
|
*
|
|
|
|
* This function should only be called from 'Pager_entrypoint'
|
|
|
|
*/
|
|
|
|
Native_capability cap()
|
|
|
|
{
|
|
|
|
/* ensure that the initialization of our 'Ipc_pager' is done */
|
|
|
|
if (!_cap.valid())
|
|
|
|
_cap_valid.lock();
|
|
|
|
return _cap;
|
|
|
|
}
|
|
|
|
};
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2014-09-05 17:00:31 +02:00
|
|
|
* Paging entry point
|
|
|
|
*
|
|
|
|
* For a paging entry point can hold only one activation. So, paging is
|
|
|
|
* strictly serialized for one entry point.
|
2011-12-22 16:19:25 +01:00
|
|
|
*/
|
|
|
|
class Pager_entrypoint : public Object_pool<Pager_object>
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2014-09-05 17:00:31 +02:00
|
|
|
/**
|
|
|
|
* Constructor
|
|
|
|
*
|
2016-01-19 20:24:22 +01:00
|
|
|
* \param cap_factory factory for creating capabilities
|
2014-09-05 17:00:31 +02:00
|
|
|
* for the pager objects managed by this
|
|
|
|
* entry point
|
|
|
|
*/
|
2016-01-19 20:24:22 +01:00
|
|
|
Pager_entrypoint(Rpc_cap_factory &cap_factory);
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
/**
|
2014-09-05 17:00:31 +02:00
|
|
|
* Associate Pager_object with the entry point
|
2011-12-22 16:19:25 +01:00
|
|
|
*/
|
base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:
* The contract between caller and callee becomes more obvious. When
passing a reference, the contract says that the argument cannot be
a null pointer. The caller is responsible to ensure that. Therefore,
the use of reference eliminates the need to add defensive null-pointer
checks at the callee site, which sometimes merely exist to be on the
safe side. The bottom line is that the code becomes easier to follow.
* Reference members must be initialized via an object initializer,
which promotes a programming style that avoids intermediate object-
construction states. Within core, there are still a few pointers
as member variables left though. E.g., caused by the late association
of 'Platform_thread' objects with their 'Platform_pd' objects.
* If no pointers are present as member variables, we don't need to
manually provide declarations of a private copy constructor and
an assignment operator to avoid -Weffc++ errors "class ... has
pointer data members [-Werror=effc++]".
This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.
Fixes #3135
2019-01-24 22:00:01 +01:00
|
|
|
Pager_capability manage(Pager_object &) {
|
2016-11-30 19:36:32 +01:00
|
|
|
return Pager_capability(); }
|
2011-12-22 16:19:25 +01:00
|
|
|
|
|
|
|
/**
|
2014-09-05 17:00:31 +02:00
|
|
|
* Dissolve Pager_object from entry point
|
2011-12-22 16:19:25 +01:00
|
|
|
*/
|
base/core: use references instead of pointers
This patch replaces the former prominent use of pointers by references
wherever feasible. This has the following benefits:
* The contract between caller and callee becomes more obvious. When
passing a reference, the contract says that the argument cannot be
a null pointer. The caller is responsible to ensure that. Therefore,
the use of reference eliminates the need to add defensive null-pointer
checks at the callee site, which sometimes merely exist to be on the
safe side. The bottom line is that the code becomes easier to follow.
* Reference members must be initialized via an object initializer,
which promotes a programming style that avoids intermediate object-
construction states. Within core, there are still a few pointers
as member variables left though. E.g., caused by the late association
of 'Platform_thread' objects with their 'Platform_pd' objects.
* If no pointers are present as member variables, we don't need to
manually provide declarations of a private copy constructor and
an assignment operator to avoid -Weffc++ errors "class ... has
pointer data members [-Werror=effc++]".
This patch also changes a few system bindings on NOVA and Fiasco.OC,
e.g., the return value of the global 'cap_map' accessor has become a
reference. Hence, the patch touches a few places outside of core.
Fixes #3135
2019-01-24 22:00:01 +01:00
|
|
|
void dissolve(Pager_object &obj);
|
2011-12-22 16:19:25 +01:00
|
|
|
};
|
2014-09-05 17:00:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
template <int STACK_SIZE>
|
|
|
|
class Pager_activation : public Pager_activation_base
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
Pager_activation() : Pager_activation_base("pager", STACK_SIZE)
|
|
|
|
{ }
|
|
|
|
};
|
2011-12-22 16:19:25 +01:00
|
|
|
}
|
|
|
|
|
2015-06-19 14:58:18 +02:00
|
|
|
#endif /* _CORE__INCLUDE__PAGER_H_ */
|