mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-18 07:08:18 +00:00
@ -44,7 +44,7 @@ class Genode::Arg
|
||||
*
|
||||
* Argument-string tokens accept C-style identifiers.
|
||||
*/
|
||||
typedef ::Genode::Token<Scanner_policy_identifier_with_underline> Token;
|
||||
using Token = ::Genode::Token<Scanner_policy_identifier_with_underline>;
|
||||
|
||||
friend class Arg_string;
|
||||
|
||||
@ -202,7 +202,7 @@ class Genode::Arg
|
||||
|
||||
class Genode::Arg_string
|
||||
{
|
||||
typedef Arg::Token Token;
|
||||
using Token = Arg::Token;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -67,7 +67,7 @@ class Genode::Avl_node_base : Noncopyable
|
||||
|
||||
public:
|
||||
|
||||
typedef bool Side;
|
||||
using Side = bool;
|
||||
|
||||
enum { LEFT = false, RIGHT = true };
|
||||
|
||||
|
@ -22,22 +22,22 @@ namespace Genode {
|
||||
** Reference and non-reference types **
|
||||
***************************************/
|
||||
|
||||
template <typename T> struct Reference { typedef T& Type; };
|
||||
template <typename T> struct Reference<T*> { typedef T* Type; };
|
||||
template <typename T> struct Reference<T&> { typedef T& Type; };
|
||||
template <typename T> struct Reference { using Type = T&; };
|
||||
template <typename T> struct Reference<T*> { using Type = T*; };
|
||||
template <typename T> struct Reference<T&> { using Type = T&; };
|
||||
|
||||
template <typename T> struct Non_reference { typedef T Type; };
|
||||
template <typename T> struct Non_reference<T*> { typedef T Type; };
|
||||
template <typename T> struct Non_reference<T&> { typedef T Type; };
|
||||
template <typename T> struct Non_reference { using Type = T; };
|
||||
template <typename T> struct Non_reference<T*> { using Type = T; };
|
||||
template <typename T> struct Non_reference<T&> { using Type = T; };
|
||||
|
||||
template <typename T> struct Non_const { typedef T Type; };
|
||||
template <typename T> struct Non_const<T const> { typedef T Type; };
|
||||
template <typename T> struct Non_const { using Type = T; };
|
||||
template <typename T> struct Non_const<T const> { using Type = T; };
|
||||
|
||||
/**
|
||||
* Determine plain-old-data type corresponding to type 'T'
|
||||
*/
|
||||
template <typename T> struct Pod {
|
||||
typedef typename Non_const<typename Non_reference<T>::Type>::Type Type; };
|
||||
using Type = typename Non_const<typename Non_reference<T>::Type>::Type; };
|
||||
|
||||
} /* namespace Trait */
|
||||
|
||||
@ -80,8 +80,8 @@ namespace Genode {
|
||||
template <typename HEAD, typename TAIL>
|
||||
struct Type_tuple
|
||||
{
|
||||
typedef HEAD Head;
|
||||
typedef TAIL Tail;
|
||||
using Head = HEAD;
|
||||
using Tail = TAIL;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -91,7 +91,7 @@ namespace Genode {
|
||||
struct Type_list;
|
||||
|
||||
template <>
|
||||
struct Type_list<> { typedef Empty Head; };
|
||||
struct Type_list<> { using Head = Empty; };
|
||||
|
||||
template <typename T>
|
||||
struct Type_list<T> : Type_tuple<T, Empty> { };
|
||||
@ -136,18 +136,18 @@ namespace Genode {
|
||||
class Append
|
||||
{
|
||||
/* pass appendix towards the end of the typelist */
|
||||
typedef typename Append<typename TL::Tail, APPENDIX>::Type _Tail;
|
||||
using _Tail = typename Append<typename TL::Tail, APPENDIX>::Type;
|
||||
|
||||
public:
|
||||
|
||||
/* keep head, replace tail */
|
||||
typedef Type_tuple<typename TL::Head, _Tail> Type;
|
||||
using Type = Type_tuple<typename TL::Head, _Tail>;
|
||||
};
|
||||
|
||||
|
||||
/* replace end of type list ('Empty' type) with appendix */
|
||||
template <typename APPENDIX>
|
||||
struct Append<Empty, APPENDIX> { typedef APPENDIX Type; };
|
||||
struct Append<Empty, APPENDIX> { using Type = APPENDIX; };
|
||||
|
||||
|
||||
/**
|
||||
@ -155,17 +155,17 @@ namespace Genode {
|
||||
*/
|
||||
template <typename TL, unsigned I>
|
||||
struct Type_at {
|
||||
typedef typename Type_at<typename TL::Tail, I - 1>::Type Type; };
|
||||
using Type = typename Type_at<typename TL::Tail, I - 1>::Type; };
|
||||
|
||||
/* end recursion if we reached the type */
|
||||
template <typename TL>
|
||||
struct Type_at<TL, 0U> { typedef typename TL::Head Type; };
|
||||
struct Type_at<TL, 0U> { using Type = typename TL::Head; };
|
||||
|
||||
/* end recursion at the end of type list */
|
||||
template <unsigned I> struct Type_at<Empty, I> { typedef void Type; };
|
||||
template <unsigned I> struct Type_at<Empty, I> { using Type = void; };
|
||||
|
||||
/* resolve ambiguous specializations */
|
||||
template <> struct Type_at<Empty, 0> { typedef void Type; };
|
||||
template <> struct Type_at<Empty, 0> { using Type = void; };
|
||||
|
||||
|
||||
/**
|
||||
@ -300,12 +300,12 @@ namespace Genode {
|
||||
template <typename HEAD, typename TAIL>
|
||||
struct Pod_tuple
|
||||
{
|
||||
typedef typename Trait::Pod<HEAD>::Type Stored_head;
|
||||
using Stored_head = typename Trait::Pod<HEAD>::Type;
|
||||
Stored_head _1;
|
||||
TAIL _2;
|
||||
|
||||
typedef HEAD Head;
|
||||
typedef TAIL Tail;
|
||||
using Head = HEAD;
|
||||
using Tail = TAIL;
|
||||
|
||||
/**
|
||||
* Accessor for requesting the data reference to '_1'
|
||||
@ -324,12 +324,12 @@ namespace Genode {
|
||||
template <typename HEAD, typename TAIL>
|
||||
struct Pod_tuple<HEAD *, TAIL>
|
||||
{
|
||||
typedef typename Trait::Non_reference<HEAD>::Type Stored_head;
|
||||
using Stored_head = typename Trait::Non_reference<HEAD>::Type;
|
||||
Stored_head _1;
|
||||
TAIL _2;
|
||||
|
||||
typedef HEAD* Head;
|
||||
typedef TAIL Tail;
|
||||
using Head = HEAD*;
|
||||
using Tail = TAIL;
|
||||
|
||||
HEAD *get() { return &_1; }
|
||||
};
|
||||
@ -355,35 +355,35 @@ namespace Genode {
|
||||
|
||||
template <>
|
||||
struct Ref_args<Void> {
|
||||
typedef Empty Type; };
|
||||
using Type = Empty; };
|
||||
|
||||
template <typename T1>
|
||||
struct Ref_args<T1, Void> {
|
||||
typedef Ref_tuple<T1, Empty> Type; };
|
||||
using Type = Ref_tuple<T1, Empty>; };
|
||||
|
||||
template <typename T1, typename T2>
|
||||
struct Ref_args<T1, T2, Void> {
|
||||
typedef Ref_tuple_3<T1, T2, Empty> Type; };
|
||||
using Type = Ref_tuple_3<T1, T2, Empty>; };
|
||||
|
||||
template <typename T1, typename T2, typename T3>
|
||||
struct Ref_args<T1, T2, T3, Void> {
|
||||
typedef Ref_tuple_4<T1, T2, T3, Empty> Type; };
|
||||
using Type = Ref_tuple_4<T1, T2, T3, Empty>; };
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4>
|
||||
struct Ref_args<T1, T2, T3, T4, Void> {
|
||||
typedef Ref_tuple_5<T1, T2, T3, T4, Empty> Type; };
|
||||
using Type = Ref_tuple_5<T1, T2, T3, T4, Empty>; };
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
struct Ref_args<T1, T2, T3, T4, T5, Void> {
|
||||
typedef Ref_tuple_6<T1, T2, T3, T4, T5, Empty> Type; };
|
||||
using Type = Ref_tuple_6<T1, T2, T3, T4, T5, Empty>; };
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
|
||||
struct Ref_args<T1, T2, T3, T4, T5, T6, Void> {
|
||||
typedef Ref_tuple_7<T1, T2, T3, T4, T5, T6, Empty> Type; };
|
||||
using Type = Ref_tuple_7<T1, T2, T3, T4, T5, T6, Empty>; };
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
|
||||
struct Ref_args<T1, T2, T3, T4, T5, T6, T7, Void> {
|
||||
typedef Ref_tuple_8<T1, T2, T3, T4, T5, T6, T7, Empty> Type; };
|
||||
using Type = Ref_tuple_8<T1, T2, T3, T4, T5, T6, T7, Empty>; };
|
||||
|
||||
|
||||
/**
|
||||
@ -398,28 +398,28 @@ namespace Genode {
|
||||
struct Pod_args;
|
||||
|
||||
template <>
|
||||
struct Pod_args<Void> { typedef Empty Type; };
|
||||
struct Pod_args<Void> { using Type = Empty; };
|
||||
|
||||
template <typename T1>
|
||||
struct Pod_args<T1, Void> { typedef Pod_tuple<T1, Empty> Type; };
|
||||
struct Pod_args<T1, Void> { using Type = Pod_tuple<T1, Empty>; };
|
||||
|
||||
template <typename T1, typename T2>
|
||||
struct Pod_args<T1, T2, Void> { typedef Pod_tuple<T1, typename Pod_args<T2, Void>::Type> Type; };
|
||||
struct Pod_args<T1, T2, Void> { using Type = Pod_tuple<T1, typename Pod_args<T2, Void>::Type>; };
|
||||
|
||||
template <typename T1, typename T2, typename T3>
|
||||
struct Pod_args<T1, T2, T3, Void> { typedef Pod_tuple<T1, typename Pod_args<T2, T3, Void>::Type> Type; };
|
||||
struct Pod_args<T1, T2, T3, Void> { using Type = Pod_tuple<T1, typename Pod_args<T2, T3, Void>::Type>; };
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4>
|
||||
struct Pod_args<T1, T2, T3, T4, Void> { typedef Pod_tuple<T1, typename Pod_args<T2, T3, T4, Void>::Type> Type; };
|
||||
struct Pod_args<T1, T2, T3, T4, Void> { using Type = Pod_tuple<T1, typename Pod_args<T2, T3, T4, Void>::Type>; };
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5>
|
||||
struct Pod_args<T1, T2, T3, T4, T5, Void> { typedef Pod_tuple<T1, typename Pod_args<T2, T3, T4, T5, Void>::Type> Type; };
|
||||
struct Pod_args<T1, T2, T3, T4, T5, Void> { using Type = Pod_tuple<T1, typename Pod_args<T2, T3, T4, T5, Void>::Type>; };
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6>
|
||||
struct Pod_args<T1, T2, T3, T4, T5, T6, Void> { typedef Pod_tuple<T1, typename Pod_args<T2, T3, T4, T5, T6, Void>::Type> Type; };
|
||||
struct Pod_args<T1, T2, T3, T4, T5, T6, Void> { using Type = Pod_tuple<T1, typename Pod_args<T2, T3, T4, T5, T6, Void>::Type>; };
|
||||
|
||||
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7>
|
||||
struct Pod_args<T1, T2, T3, T4, T5, T6, T7, Void> { typedef Pod_tuple<T1, typename Pod_args<T2, T3, T4, T5, T6, T7, Void>::Type> Type; };
|
||||
struct Pod_args<T1, T2, T3, T4, T5, T6, T7, Void> { using Type = Pod_tuple<T1, typename Pod_args<T2, T3, T4, T5, T6, T7, Void>::Type>; };
|
||||
|
||||
|
||||
/**
|
||||
@ -619,8 +619,8 @@ namespace Genode {
|
||||
* Make class unique for different template arguments. The types
|
||||
* are never used.
|
||||
*/
|
||||
typedef T1 _T1;
|
||||
typedef T2 _T2;
|
||||
using _T1 = T1;
|
||||
using _T2 = T2;
|
||||
|
||||
/* prevent zero initialization of objects */
|
||||
Overload_selector() { }
|
||||
|
@ -46,7 +46,7 @@ namespace Genode { namespace Trait {
|
||||
|
||||
template <> struct Uint_width<8>
|
||||
{
|
||||
typedef uint8_t Type;
|
||||
using Type = uint8_t;
|
||||
enum { WIDTH_LOG2 = 3 };
|
||||
|
||||
/**
|
||||
@ -57,19 +57,19 @@ namespace Genode { namespace Trait {
|
||||
|
||||
template <> struct Uint_width<16> : Uint_width<8>
|
||||
{
|
||||
typedef uint16_t Type;
|
||||
using Type = uint16_t;
|
||||
enum { WIDTH_LOG2 = 4 };
|
||||
};
|
||||
|
||||
template <> struct Uint_width<32> : Uint_width<16>
|
||||
{
|
||||
typedef uint32_t Type;
|
||||
using Type = uint32_t;
|
||||
enum { WIDTH_LOG2 = 5 };
|
||||
};
|
||||
|
||||
template <> struct Uint_width<64> : Uint_width<32>
|
||||
{
|
||||
typedef uint64_t Type;
|
||||
using Type = uint64_t;
|
||||
enum { WIDTH_LOG2 = 6 };
|
||||
};
|
||||
|
||||
@ -111,7 +111,7 @@ struct Genode::Register
|
||||
static constexpr size_t ACCESS_WIDTH_LOG2 = Trait::Uint_width<ACCESS_WIDTH>::WIDTH_LOG2;
|
||||
static constexpr size_t BITFIELD_WIDTH = ACCESS_WIDTH;
|
||||
|
||||
typedef typename Trait::Uint_width<ACCESS_WIDTH>::Type access_t;
|
||||
using access_t = typename Trait::Uint_width<ACCESS_WIDTH>::Type;
|
||||
|
||||
/**
|
||||
* A bitregion within a register
|
||||
@ -133,9 +133,8 @@ struct Genode::Register
|
||||
static constexpr size_t WIDTH = _WIDTH;
|
||||
static constexpr size_t BITFIELD_WIDTH = WIDTH;
|
||||
|
||||
typedef typename
|
||||
Trait::Uint_width<Trait::Raise_to_uint_width<WIDTH>::WIDTH>::Type
|
||||
bitfield_t;
|
||||
using bitfield_t =
|
||||
typename Trait::Uint_width<Trait::Raise_to_uint_width<WIDTH>::WIDTH>::Type;
|
||||
|
||||
/**
|
||||
* Get an unshifted mask of this field
|
||||
@ -163,7 +162,7 @@ struct Genode::Register
|
||||
/**
|
||||
* Back reference to containing register
|
||||
*/
|
||||
typedef Register<ACCESS_WIDTH> Compound_reg;
|
||||
using Compound_reg = Register<ACCESS_WIDTH>;
|
||||
|
||||
/**
|
||||
* Get register with this bitfield set to 'value' and rest left 0
|
||||
@ -217,16 +216,16 @@ struct Genode::Register
|
||||
template <typename _BITS_0, typename _BITS_1>
|
||||
struct Genode::Bitset_2
|
||||
{
|
||||
typedef _BITS_0 Bits_0;
|
||||
typedef _BITS_1 Bits_1;
|
||||
using Bits_0 = _BITS_0;
|
||||
using Bits_1 = _BITS_1;
|
||||
|
||||
static constexpr size_t WIDTH = Bits_0::BITFIELD_WIDTH +
|
||||
Bits_1::BITFIELD_WIDTH;
|
||||
static constexpr size_t BITFIELD_WIDTH = WIDTH;
|
||||
static constexpr size_t ACCESS_WIDTH = Trait::Raise_to_uint_width<WIDTH>::WIDTH;
|
||||
|
||||
typedef typename Trait::Uint_width<ACCESS_WIDTH>::Type access_t;
|
||||
typedef Bitset_2<Bits_0, Bits_1> Bitset_2_base;
|
||||
using access_t = typename Trait::Uint_width<ACCESS_WIDTH>::Type;
|
||||
using Bitset_2_base = Bitset_2<Bits_0, Bits_1>;
|
||||
|
||||
/**
|
||||
* Convert bitset value to register representation
|
||||
@ -284,10 +283,10 @@ struct Genode::Bitset_2
|
||||
template <typename _BITS_0, typename _BITS_1, typename _BITS_2>
|
||||
struct Genode::Bitset_3
|
||||
{
|
||||
typedef _BITS_0 Bits_0;
|
||||
typedef _BITS_1 Bits_1;
|
||||
typedef _BITS_2 Bits_2;
|
||||
typedef Bitset_2<Bits_0, Bits_1> Bits_0_1;
|
||||
using Bits_0 = _BITS_0;
|
||||
using Bits_1 = _BITS_1;
|
||||
using Bits_2 = _BITS_2;
|
||||
using Bits_0_1 = Bitset_2<Bits_0, Bits_1>;
|
||||
|
||||
static constexpr size_t WIDTH = Bits_0::BITFIELD_WIDTH +
|
||||
Bits_1::BITFIELD_WIDTH +
|
||||
@ -295,8 +294,8 @@ struct Genode::Bitset_3
|
||||
static constexpr size_t BITFIELD_WIDTH = WIDTH;
|
||||
static constexpr size_t ACCESS_WIDTH = Trait::Raise_to_uint_width<WIDTH>::WIDTH;
|
||||
|
||||
typedef typename Trait::Uint_width<ACCESS_WIDTH>::Type access_t;
|
||||
typedef Bitset_3<Bits_0, Bits_1, Bits_2> Bitset_3_base;
|
||||
using access_t = typename Trait::Uint_width<ACCESS_WIDTH>::Type;
|
||||
using Bitset_3_base = Bitset_3<Bits_0, Bits_1, Bits_2>;
|
||||
|
||||
/**
|
||||
* Convert bitset value to register representation
|
||||
|
@ -165,13 +165,13 @@ class Genode::Register_set : public Register_set_base
|
||||
{
|
||||
private:
|
||||
|
||||
typedef typename T::access_t access_t;
|
||||
using access_t = typename T::access_t;
|
||||
|
||||
access_t const _reference_val;
|
||||
|
||||
public:
|
||||
|
||||
typedef T Object;
|
||||
using Object = T;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -235,11 +235,8 @@ class Genode::Register_set : public Register_set_base
|
||||
* that solely must not be redefined by the deriving
|
||||
* class to ensure correct template selection.
|
||||
*/
|
||||
typedef Register<_OFFSET, _ACCESS_WIDTH, _STRICT_WRITE>
|
||||
Register_base;
|
||||
|
||||
typedef typename Genode::Register<_ACCESS_WIDTH>::access_t
|
||||
access_t;
|
||||
using Register_base = Register<_OFFSET, _ACCESS_WIDTH, _STRICT_WRITE>;
|
||||
using access_t = typename Genode::Register<_ACCESS_WIDTH>::access_t;
|
||||
|
||||
static_assert(OFFSET + sizeof(access_t) <= REGISTER_SET_SIZE);
|
||||
|
||||
@ -260,13 +257,11 @@ class Genode::Register_set : public Register_set_base
|
||||
public Conditions<Bitfield<_SHIFT, _WIDTH> >
|
||||
{
|
||||
/* analogous to 'Register_set::Register::Register_base' */
|
||||
typedef Bitfield<_SHIFT, _WIDTH> Bitfield_base;
|
||||
using Bitfield_base = Bitfield<_SHIFT, _WIDTH>;
|
||||
|
||||
/* back reference to containing register */
|
||||
typedef Register<_OFFSET, _ACCESS_WIDTH, _STRICT_WRITE>
|
||||
Compound_reg;
|
||||
|
||||
typedef Compound_reg::access_t access_t;
|
||||
using Compound_reg = Register<_OFFSET, _ACCESS_WIDTH, _STRICT_WRITE>;
|
||||
using access_t = Compound_reg::access_t;
|
||||
};
|
||||
};
|
||||
|
||||
@ -306,8 +301,8 @@ class Genode::Register_set : public Register_set_base
|
||||
struct Register_array : public Register<_OFFSET, _ACCESS_WIDTH,
|
||||
_STRICT_WRITE>
|
||||
{
|
||||
typedef typename Trait::Uint_width<_ACCESS_WIDTH>::
|
||||
template Divisor<_ITEM_WIDTH> Item;
|
||||
using Item = typename Trait::Uint_width<_ACCESS_WIDTH>
|
||||
::template Divisor<_ITEM_WIDTH>;
|
||||
|
||||
enum {
|
||||
STRICT_WRITE = _STRICT_WRITE,
|
||||
@ -322,12 +317,11 @@ class Genode::Register_set : public Register_set_base
|
||||
};
|
||||
|
||||
/* analogous to 'Register_set::Register::Register_base' */
|
||||
typedef Register_array<OFFSET, ACCESS_WIDTH, ITEMS,
|
||||
ITEM_WIDTH, STRICT_WRITE>
|
||||
Register_array_base;
|
||||
using Register_array_base = Register_array<OFFSET, ACCESS_WIDTH, ITEMS,
|
||||
ITEM_WIDTH, STRICT_WRITE>;
|
||||
|
||||
typedef typename Register<OFFSET, ACCESS_WIDTH, STRICT_WRITE>::
|
||||
access_t access_t;
|
||||
using access_t =
|
||||
typename Register<OFFSET, ACCESS_WIDTH, STRICT_WRITE>:: access_t;
|
||||
|
||||
/**
|
||||
* A bit region within a register array item
|
||||
@ -343,12 +337,11 @@ class Genode::Register_set : public Register_set_base
|
||||
template Bitfield<_SHIFT, _SIZE>
|
||||
{
|
||||
/* analogous to 'Register_set::Register::Register_base' */
|
||||
typedef Bitfield<_SHIFT, _SIZE> Array_bitfield_base;
|
||||
using Array_bitfield_base = Bitfield<_SHIFT, _SIZE>;
|
||||
|
||||
/* back reference to containing register array */
|
||||
typedef Register_array<OFFSET, ACCESS_WIDTH, ITEMS,
|
||||
ITEM_WIDTH, STRICT_WRITE>
|
||||
Compound_array;
|
||||
using Compound_array = Register_array<OFFSET, ACCESS_WIDTH, ITEMS,
|
||||
ITEM_WIDTH, STRICT_WRITE>;
|
||||
};
|
||||
|
||||
|
||||
@ -406,8 +399,8 @@ class Genode::Register_set : public Register_set_base
|
||||
template <typename T>
|
||||
inline typename T::Register_base::access_t read() const
|
||||
{
|
||||
typedef typename T::Register_base Register;
|
||||
typedef typename Register::access_t access_t;
|
||||
using Register = typename T::Register_base;
|
||||
using access_t = typename Register::access_t;
|
||||
return Plain_access::read<access_t>(_plain_access,
|
||||
Register::OFFSET);
|
||||
}
|
||||
@ -419,8 +412,8 @@ class Genode::Register_set : public Register_set_base
|
||||
inline void
|
||||
write(typename T::Register_base::access_t const value)
|
||||
{
|
||||
typedef typename T::Register_base Register;
|
||||
typedef typename Register::access_t access_t;
|
||||
using Register = typename T::Register_base;
|
||||
using access_t = typename Register::access_t;
|
||||
Plain_access::write<access_t>(_plain_access, Register::OFFSET,
|
||||
value);
|
||||
}
|
||||
@ -436,9 +429,9 @@ class Genode::Register_set : public Register_set_base
|
||||
inline typename T::Bitfield_base::bitfield_t
|
||||
read() const
|
||||
{
|
||||
typedef typename T::Bitfield_base Bitfield;
|
||||
typedef typename Bitfield::Compound_reg Register;
|
||||
typedef typename Register::access_t access_t;
|
||||
using Bitfield = typename T::Bitfield_base;
|
||||
using Register = typename Bitfield::Compound_reg;
|
||||
using access_t = typename Register::access_t;
|
||||
return
|
||||
Bitfield::get(Plain_access::read<access_t>(_plain_access,
|
||||
Register::OFFSET));
|
||||
@ -453,9 +446,9 @@ class Genode::Register_set : public Register_set_base
|
||||
inline void
|
||||
write(typename T::Bitfield_base::Compound_reg::access_t const value)
|
||||
{
|
||||
typedef typename T::Bitfield_base Bitfield;
|
||||
typedef typename Bitfield::Compound_reg Register;
|
||||
typedef typename Register::access_t access_t;
|
||||
using Bitfield = typename T::Bitfield_base;
|
||||
using Register = typename Bitfield::Compound_reg;
|
||||
using access_t = typename Register::access_t;
|
||||
|
||||
/* initialize the pattern written finally to the register */
|
||||
access_t write_value;
|
||||
@ -488,8 +481,8 @@ class Genode::Register_set : public Register_set_base
|
||||
inline typename T::Register_array_base::access_t
|
||||
read(unsigned long const index) const
|
||||
{
|
||||
typedef typename T::Register_array_base Array;
|
||||
typedef typename Array::access_t access_t;
|
||||
using Array = typename T::Register_array_base;
|
||||
using access_t = typename Array::access_t;
|
||||
|
||||
/* reads outside the array return 0 */
|
||||
if (index > Array::MAX_INDEX) return 0;
|
||||
@ -519,8 +512,8 @@ class Genode::Register_set : public Register_set_base
|
||||
write(typename T::Register_array_base::access_t const value,
|
||||
unsigned long const index)
|
||||
{
|
||||
typedef typename T::Register_array_base Array;
|
||||
typedef typename Array::access_t access_t;
|
||||
using Array = typename T::Register_array_base;
|
||||
using access_t = typename Array::access_t;
|
||||
|
||||
/* ignore writes outside the array */
|
||||
if (index > Array::MAX_INDEX) return;
|
||||
@ -569,8 +562,8 @@ class Genode::Register_set : public Register_set_base
|
||||
inline typename T::Array_bitfield_base::bitfield_t
|
||||
read(unsigned long const index) const
|
||||
{
|
||||
typedef typename T::Array_bitfield_base Bitfield;
|
||||
typedef typename Bitfield::Compound_array Array;
|
||||
using Bitfield = typename T::Array_bitfield_base;
|
||||
using Array = typename Bitfield::Compound_array;
|
||||
return Bitfield::get(read<Array>(index));
|
||||
}
|
||||
|
||||
@ -585,9 +578,9 @@ class Genode::Register_set : public Register_set_base
|
||||
write(typename T::Array_bitfield_base::Compound_array::access_t const value,
|
||||
long unsigned const index)
|
||||
{
|
||||
typedef typename T::Array_bitfield_base Bitfield;
|
||||
typedef typename Bitfield::Compound_array Array;
|
||||
typedef typename Array::access_t access_t;
|
||||
using Bitfield = typename T::Array_bitfield_base;
|
||||
using Array = typename Bitfield::Compound_array;
|
||||
using access_t = typename Array::access_t;
|
||||
|
||||
/* initialize the pattern written finally to the register */
|
||||
access_t write_value;
|
||||
@ -617,9 +610,9 @@ class Genode::Register_set : public Register_set_base
|
||||
template <typename T>
|
||||
inline typename T::Bitset_2_base::access_t const read()
|
||||
{
|
||||
typedef typename T::Bitset_2_base::Bits_0 Bits_0;
|
||||
typedef typename T::Bitset_2_base::Bits_1 Bits_1;
|
||||
typedef typename T::Bitset_2_base::access_t access_t;
|
||||
using Bits_0 = typename T::Bitset_2_base::Bits_0;
|
||||
using Bits_1 = typename T::Bitset_2_base::Bits_1;
|
||||
using access_t = typename T::Bitset_2_base::access_t;
|
||||
enum { V1_SHIFT = Bits_0::BITFIELD_WIDTH };
|
||||
access_t const v0 = read<Bits_0>();
|
||||
access_t const v1 = read<Bits_1>();
|
||||
@ -634,8 +627,8 @@ class Genode::Register_set : public Register_set_base
|
||||
template <typename T>
|
||||
inline void write(typename T::Bitset_2_base::access_t v)
|
||||
{
|
||||
typedef typename T::Bitset_2_base::Bits_0 Bits_0;
|
||||
typedef typename T::Bitset_2_base::Bits_1 Bits_1;
|
||||
using Bits_0 = typename T::Bitset_2_base::Bits_0;
|
||||
using Bits_1 = typename T::Bitset_2_base::Bits_1;
|
||||
write<Bits_0>(typename Bits_0::access_t(v));
|
||||
write<Bits_1>(typename Bits_1::access_t(v >> Bits_0::BITFIELD_WIDTH));
|
||||
}
|
||||
@ -646,10 +639,10 @@ class Genode::Register_set : public Register_set_base
|
||||
template <typename T>
|
||||
inline typename T::Bitset_3_base::access_t const read()
|
||||
{
|
||||
typedef typename T::Bitset_3_base::Bits_0 Bits_0;
|
||||
typedef typename T::Bitset_3_base::Bits_1 Bits_1;
|
||||
typedef typename T::Bitset_3_base::Bits_2 Bits_2;
|
||||
typedef typename T::Bitset_3_base::access_t access_t;
|
||||
using Bits_0 = typename T::Bitset_3_base::Bits_0;
|
||||
using Bits_1 = typename T::Bitset_3_base::Bits_1;
|
||||
using Bits_2 = typename T::Bitset_3_base::Bits_2;
|
||||
using access_t = typename T::Bitset_3_base::access_t;
|
||||
|
||||
static constexpr size_t BITS_0_WIDTH = Bits_0::BITFIELD_WIDTH;
|
||||
static constexpr size_t BITS_1_WIDTH = Bits_1::BITFIELD_WIDTH;
|
||||
@ -668,9 +661,9 @@ class Genode::Register_set : public Register_set_base
|
||||
template <typename T>
|
||||
inline void write(typename T::Bitset_3_base::access_t v)
|
||||
{
|
||||
typedef typename T::Bitset_3_base::Bits_0 Bits_0;
|
||||
typedef typename T::Bitset_3_base::Bits_1 Bits_1;
|
||||
typedef typename T::Bitset_3_base::Bits_2 Bits_2;
|
||||
using Bits_0 = typename T::Bitset_3_base::Bits_0;
|
||||
using Bits_1 = typename T::Bitset_3_base::Bits_1;
|
||||
using Bits_2 = typename T::Bitset_3_base::Bits_2;
|
||||
write<Bitset_2<Bits_0, Bits_1> >(typename Bitset_2<Bits_0, Bits_1>::access_t(v));
|
||||
write<Bits_2>(typename Bits_2::access_t(v >> (Bits_0::BITFIELD_WIDTH +
|
||||
Bits_1::BITFIELD_WIDTH)));
|
||||
|
@ -275,7 +275,7 @@ namespace Genode {
|
||||
__attribute((optimize("no-tree-loop-distribute-patterns")))
|
||||
inline void *memset(void *dst, uint8_t i, size_t size)
|
||||
{
|
||||
typedef unsigned long word_t;
|
||||
using word_t = unsigned long;
|
||||
|
||||
enum {
|
||||
LEN = sizeof(word_t),
|
||||
|
@ -50,7 +50,7 @@ class Genode::Xml_attribute
|
||||
/**
|
||||
* Define tokenizer that matches XML tags (with hyphens) as identifiers
|
||||
*/
|
||||
typedef ::Genode::Token<Scanner_policy_xml_identifier> Token;
|
||||
using Token = ::Genode::Token<Scanner_policy_xml_identifier>;
|
||||
|
||||
struct Tokens
|
||||
{
|
||||
@ -113,7 +113,7 @@ class Genode::Xml_attribute
|
||||
class Invalid_syntax : public Exception { };
|
||||
|
||||
|
||||
typedef String<64> Name;
|
||||
using Name = String<64>;
|
||||
Name name() const {
|
||||
return Name(Cstring(_tokens.name.start(), _tokens.name.len())); }
|
||||
|
||||
@ -205,7 +205,7 @@ class Genode::Xml_node
|
||||
{
|
||||
private:
|
||||
|
||||
typedef Xml_attribute::Token Token;
|
||||
using Token = Xml_attribute::Token;
|
||||
|
||||
/**
|
||||
* Forward declaration needed for befriending Tag with Xml_attribute
|
||||
@ -220,7 +220,7 @@ class Genode::Xml_node
|
||||
** Exception types **
|
||||
*********************/
|
||||
|
||||
typedef Xml_attribute::Invalid_syntax Invalid_syntax;
|
||||
using Invalid_syntax = Xml_attribute::Invalid_syntax;
|
||||
|
||||
class Nonexistent_sub_node : public Exception { };
|
||||
|
||||
@ -228,7 +228,7 @@ class Genode::Xml_node
|
||||
/**
|
||||
* Type definition for maintaining backward compatibility
|
||||
*/
|
||||
typedef Xml_attribute Attribute;
|
||||
using Attribute = Xml_attribute;
|
||||
|
||||
private:
|
||||
|
||||
@ -655,7 +655,7 @@ class Genode::Xml_node
|
||||
/**
|
||||
* Request type name of XML node as null-terminated string
|
||||
*/
|
||||
typedef String<64> Type;
|
||||
using Type = String<64>;
|
||||
Type type() const
|
||||
{
|
||||
Token name = _tags.start.name();
|
||||
|
Reference in New Issue
Block a user