2018-01-24 14:28:29 +01:00
|
|
|
/*
|
|
|
|
* \brief Genode XML nodes plus local utilities
|
|
|
|
* \author Martin Stein
|
|
|
|
* \date 2016-08-19
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2016-2017 Genode Labs GmbH
|
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* local includes */
|
2019-10-03 20:30:26 +02:00
|
|
|
#include "xml_node.h"
|
2018-01-24 14:28:29 +01:00
|
|
|
|
|
|
|
using namespace Genode;
|
|
|
|
|
|
|
|
|
2019-04-09 15:46:36 +02:00
|
|
|
Microseconds Genode::read_sec_attr(Xml_node const node,
|
|
|
|
char const *name,
|
|
|
|
uint64_t const default_sec)
|
2018-01-24 14:28:29 +01:00
|
|
|
{
|
2019-04-09 15:46:36 +02:00
|
|
|
uint64_t sec = node.attribute_value(name, (uint64_t)0);
|
2018-01-24 14:28:29 +01:00
|
|
|
if (!sec) {
|
|
|
|
sec = default_sec;
|
|
|
|
}
|
|
|
|
return Microseconds(sec * 1000 * 1000);
|
|
|
|
}
|