Use base/log.h instead of deprecated base/printf.h
- Remove use of PLOG, PINF, PWRN, PERR, and printf. Only a single use of printf in fesrv remains for now. - Whitespace and style fixes - Fix build of server/synergy_input - Add missing include of base/heap.h (previously, this header was implicitly included by root/component.h)
This commit is contained in:
@@ -374,7 +374,7 @@ Just add the following two lines to hold the program when the second
|
||||
message appears:
|
||||
|
||||
! if (strcmp("basic_string::substr", s) == 0) {
|
||||
! PERR("stop!");
|
||||
! Genode::error("stop!");
|
||||
! for (;;);
|
||||
! }
|
||||
|
||||
@@ -414,7 +414,7 @@ in a new _getenv.cc_ file that we link to the target:
|
||||
|
||||
! extern "C" char *getenv(const char *name)
|
||||
! {
|
||||
! PINF("environment variable \"%s\" requested", name);
|
||||
! Genode::log("environment variable \"", name, "\" requested");
|
||||
! return (char *)"";
|
||||
! };
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
f3880fddb60b77e7af5bc03abfef751db0e1faf6
|
||||
e8c92ca78721ec791f0780481ca12aa31c3fdc50
|
||||
|
||||
@@ -127,15 +127,15 @@ int main()
|
||||
{
|
||||
auto image = image_name();
|
||||
Htif_zedboard_genode htif( image );
|
||||
PINF( "Initialized Htif_zedboard with %s", image.c_str() );
|
||||
Genode::log( "Initialized Htif_zedboard with ", image.c_str() );
|
||||
htif.run();
|
||||
}
|
||||
catch ( const std::runtime_error &e )
|
||||
{
|
||||
PERR( "Caught runtime error: %s", e.what() );
|
||||
Genode::error( "Caught runtime error: ", e.what() );
|
||||
}
|
||||
catch ( ... )
|
||||
{
|
||||
PERR( "Unknown error occured" );
|
||||
Genode::error( "Unknown error occured" );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ LIBS = stdcxx
|
||||
INC_DIR += $(FESRV_SRC)
|
||||
|
||||
# Some defines to keep the fesrv compilation process happy
|
||||
CC_OPT += -DPREFIX=\"\" -DTARGET_ARCH=\"\" -DTARGET_DIR=\"\"
|
||||
CC_OPT += -DTARGET_ARCH=\"\" -DTARGET_DIR=\"\"
|
||||
CC_OPT_htif += -DPREFIX=\"\"
|
||||
|
||||
vpath %.cc $(FESRV_SRC)
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <base/log.h>
|
||||
|
||||
|
||||
extern "C" char *getenv(const char *name)
|
||||
{
|
||||
PINF("environment variable \"%s\" requested", name);
|
||||
Genode::log("environment variable \"", name, "\" requested");
|
||||
|
||||
return (char *)"";
|
||||
};
|
||||
|
||||
@@ -14,8 +14,9 @@
|
||||
#include <gpio_session/zynq/gpio_session.h>
|
||||
#include <cap_session/connection.h>
|
||||
#include <dataspace/client.h>
|
||||
#include <base/printf.h>
|
||||
#include <base/log.h>
|
||||
#include <base/sleep.h>
|
||||
#include <base/heap.h>
|
||||
#include <root/component.h>
|
||||
#include <os/static_root.h>
|
||||
#include <os/config.h>
|
||||
@@ -28,6 +29,7 @@ namespace Gpio {
|
||||
class Root;
|
||||
};
|
||||
|
||||
|
||||
class Gpio::Session_component : public Genode::Rpc_object<Gpio::Session>
|
||||
{
|
||||
private:
|
||||
@@ -37,7 +39,8 @@ class Gpio::Session_component : public Genode::Rpc_object<Gpio::Session>
|
||||
|
||||
public:
|
||||
|
||||
Session_component(Driver &driver, unsigned gpio_number) : _driver(driver), _number(gpio_number) {}
|
||||
Session_component(Driver &driver, unsigned gpio_number)
|
||||
: _driver(driver), _number(gpio_number) {}
|
||||
|
||||
virtual Genode::uint32_t read(bool isChannel2)
|
||||
{
|
||||
@@ -50,6 +53,7 @@ class Gpio::Session_component : public Genode::Rpc_object<Gpio::Session>
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Gpio::Root : public Genode::Root_component<Gpio::Session_component>
|
||||
{
|
||||
private:
|
||||
@@ -64,8 +68,8 @@ class Gpio::Root : public Genode::Root_component<Gpio::Session_component>
|
||||
Genode::size_t ram_quota = Genode::Arg_string::find_arg(args, "ram_quota").ulong_value(0);
|
||||
|
||||
if (ram_quota < sizeof(Session_component)) {
|
||||
PWRN("Insufficient dontated ram_quota (%zd bytes), require %zd bytes",
|
||||
ram_quota, sizeof(Session_component));
|
||||
Genode::warning("Insufficient dontated ram_quota (", ram_quota, " bytes), "
|
||||
"require ", sizeof(Session_component), " bytes");
|
||||
throw Genode::Root::Quota_exceeded();
|
||||
}
|
||||
|
||||
@@ -76,15 +80,18 @@ class Gpio::Root : public Genode::Root_component<Gpio::Session_component>
|
||||
|
||||
Root(Genode::Rpc_entrypoint *session_ep,
|
||||
Genode::Allocator *md_alloc, Driver &driver)
|
||||
: Genode::Root_component<Gpio::Session_component>(session_ep, md_alloc),
|
||||
_driver(driver) { }
|
||||
:
|
||||
Genode::Root_component<Gpio::Session_component>(session_ep, md_alloc),
|
||||
_driver(driver)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
using namespace Gpio;
|
||||
|
||||
PINF("Zynq Gpio driver");
|
||||
Genode::log("Zynq Gpio driver");
|
||||
|
||||
/*
|
||||
* Read config
|
||||
@@ -98,13 +105,13 @@ int main(int, char **)
|
||||
{
|
||||
addr.push_back(0);
|
||||
gpio_node.attribute("addr").value(&addr[i]);
|
||||
PINF("Gpio with mio address 0x%x added.", (unsigned int)addr[i]);
|
||||
Genode::log("Gpio with mio address ", Genode::Hex(addr[i]), " added.");
|
||||
|
||||
if (gpio_node.is_last("gpio")) break;
|
||||
}
|
||||
}
|
||||
catch (Genode::Xml_node::Nonexistent_sub_node) {
|
||||
PWRN("No Gpio config");
|
||||
Genode::warning("No Gpio config");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -58,12 +58,12 @@ class I2C::Driver
|
||||
buf[1]=reg;
|
||||
if (i2c_reg->i2c_write(adr, buf, 2) != 0)
|
||||
{
|
||||
PERR("Zynq i2c: read failed");
|
||||
Genode::error("Zynq i2c: read failed");
|
||||
return false;
|
||||
}
|
||||
if (i2c_reg->i2c_read_byte(adr, data) != 0)
|
||||
{
|
||||
PERR("Zynq i2c: read failed");
|
||||
Genode::error("Zynq i2c: read failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -79,7 +79,7 @@ class I2C::Driver
|
||||
buf[2]=data;
|
||||
if (i2c_reg->i2c_write(adr, buf, 3) != 0)
|
||||
{
|
||||
PERR("Zynq i2c: write failed");
|
||||
Genode::error("Zynq i2c: write failed");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
#include <i2c_session/i2c_session.h>
|
||||
#include <cap_session/connection.h>
|
||||
#include <dataspace/client.h>
|
||||
#include <base/printf.h>
|
||||
#include <base/log.h>
|
||||
#include <base/heap.h>
|
||||
#include <base/sleep.h>
|
||||
#include <root/component.h>
|
||||
|
||||
@@ -78,7 +79,7 @@ int main(int, char **)
|
||||
{
|
||||
using namespace I2C;
|
||||
|
||||
PINF("Zynq I2C driver");
|
||||
Genode::log("Zynq I2C driver");
|
||||
|
||||
Driver &driver = Driver::factory();
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <base/log.h>
|
||||
#include <os/server.h>
|
||||
|
||||
/* local includes */
|
||||
@@ -24,7 +24,6 @@ struct Main
|
||||
{
|
||||
Server::Entrypoint &ep;
|
||||
|
||||
|
||||
struct Factory : Block::Driver_factory
|
||||
{
|
||||
Block::Driver *create() {
|
||||
@@ -40,7 +39,7 @@ struct Main
|
||||
Main(Server::Entrypoint &ep)
|
||||
: ep(ep), root(ep, Genode::env()->heap(), factory)
|
||||
{
|
||||
Genode::printf("--- SD card driver ---\n");
|
||||
Genode::log("--- SD card driver ---");
|
||||
|
||||
Genode::env()->parent()->announce(ep.manage(root));
|
||||
}
|
||||
|
||||
@@ -14,7 +14,8 @@
|
||||
#include <vdma_session/vdma_session.h>
|
||||
#include <cap_session/connection.h>
|
||||
#include <dataspace/client.h>
|
||||
#include <base/printf.h>
|
||||
#include <base/log.h>
|
||||
#include <base/heap.h>
|
||||
#include <base/sleep.h>
|
||||
#include <root/component.h>
|
||||
#include <os/static_root.h>
|
||||
@@ -28,6 +29,7 @@ namespace Vdma {
|
||||
class Root;
|
||||
};
|
||||
|
||||
|
||||
class Vdma::Session_component : public Genode::Rpc_object<Vdma::Session>
|
||||
{
|
||||
private:
|
||||
@@ -37,7 +39,8 @@ class Vdma::Session_component : public Genode::Rpc_object<Vdma::Session>
|
||||
|
||||
public:
|
||||
|
||||
Session_component(Driver &driver, unsigned vdma_number) : _driver(driver), _number(vdma_number) {}
|
||||
Session_component(Driver &driver, unsigned vdma_number)
|
||||
: _driver(driver), _number(vdma_number) {}
|
||||
|
||||
virtual bool setConfig(Genode::uint32_t data, bool isMM2S)
|
||||
{
|
||||
@@ -65,6 +68,7 @@ class Vdma::Session_component : public Genode::Rpc_object<Vdma::Session>
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Vdma::Root : public Genode::Root_component<Vdma::Session_component>
|
||||
{
|
||||
private:
|
||||
@@ -95,11 +99,12 @@ class Vdma::Root : public Genode::Root_component<Vdma::Session_component>
|
||||
_driver(driver) { }
|
||||
};
|
||||
|
||||
|
||||
int main(int, char **)
|
||||
{
|
||||
using namespace Vdma;
|
||||
|
||||
PINF("Zynq VDMA driver");
|
||||
Genode::log("Zynq VDMA driver");
|
||||
|
||||
/*
|
||||
* Read config
|
||||
@@ -113,13 +118,13 @@ int main(int, char **)
|
||||
{
|
||||
addr.push_back(0);
|
||||
vdma_node.attribute("addr").value(&addr[i]);
|
||||
PINF("VDMA with mio address 0x%x added.", (unsigned int)addr[i]);
|
||||
Genode::log("VDMA with mio address ", Genode::Hex(addr[i]), " added.");
|
||||
|
||||
if (vdma_node.is_last("vdma")) break;
|
||||
}
|
||||
}
|
||||
catch (Genode::Xml_node::Nonexistent_sub_node) {
|
||||
PWRN("No VDMA config");
|
||||
Genode::warning("No VDMA config");
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <base/env.h>
|
||||
#include <base/exception.h>
|
||||
#include <base/log.h>
|
||||
|
||||
#include <backend_base.h>
|
||||
|
||||
@@ -68,7 +69,12 @@ class Remote_rom::Packet_base : public Ethernet_frame, public Ipv4_packet
|
||||
|
||||
public:
|
||||
|
||||
Packet_base(size_t size) : Ethernet_frame(sizeof(Packet_base) + size), Ipv4_packet(sizeof(Packet_base) + size - sizeof(Ethernet_frame)), _payload_size(size) { }
|
||||
Packet_base(size_t size)
|
||||
:
|
||||
Ethernet_frame(sizeof(Packet_base) + size),
|
||||
Ipv4_packet(sizeof(Packet_base) + size - sizeof(Ethernet_frame)),
|
||||
_payload_size(size)
|
||||
{ }
|
||||
|
||||
void const * base() const { return &payload; }
|
||||
|
||||
@@ -240,7 +246,7 @@ class Remote_rom::Backend_base
|
||||
|
||||
void _handle_link_state(unsigned)
|
||||
{
|
||||
PINF("link state changed");
|
||||
Genode::log("link state changed");
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -291,7 +297,10 @@ class Remote_rom::Backend_base
|
||||
}
|
||||
|
||||
public:
|
||||
explicit Backend_base(Genode::Allocator &alloc, HANDLER &handler) : _tx_block_alloc(&alloc), _nic(&_tx_block_alloc, BUF_SIZE, BUF_SIZE), _rx_thread(_nic, handler, _accept_ip)
|
||||
explicit Backend_base(Genode::Allocator &alloc, HANDLER &handler)
|
||||
:
|
||||
_tx_block_alloc(&alloc), _nic(&_tx_block_alloc, BUF_SIZE, BUF_SIZE),
|
||||
_rx_thread(_nic, handler, _accept_ip)
|
||||
{
|
||||
/* start dispatcher thread */
|
||||
_rx_thread.start();
|
||||
@@ -316,7 +325,7 @@ class Remote_rom::Backend_base
|
||||
|
||||
_accept_ip = _src_ip;
|
||||
} catch (...) {
|
||||
PWRN("No IP configured, falling back to broadcast mode!");
|
||||
Genode::warning("No IP configured, falling back to broadcast mode!");
|
||||
_src_ip = Ipv4_packet::CURRENT;
|
||||
_dst_ip = Ipv4_packet::BROADCAST;
|
||||
_accept_ip = Ipv4_packet::BROADCAST;
|
||||
@@ -417,7 +426,8 @@ class Remote_rom::Backend_server : public Backend_server_base, public Backend_ba
|
||||
switch (packet.type())
|
||||
{
|
||||
case Packet_base::UPDATE:
|
||||
if (verbose) PINF("receiving UPDATE (%s) packet", packet.module_name());
|
||||
if (verbose)
|
||||
Genode::log("receiving UPDATE (", packet.module_name(), ") packet");
|
||||
|
||||
if (!_forwarder)
|
||||
return;
|
||||
@@ -508,14 +518,16 @@ class Remote_rom::Backend_client : public Backend_client_base, public Backend_ba
|
||||
switch (packet.type())
|
||||
{
|
||||
case Packet_base::SIGNAL:
|
||||
if (verbose) PINF("receiving SIGNAL(%s) packet", packet.module_name());
|
||||
if (verbose)
|
||||
Genode::log("receiving SIGNAL(", packet.module_name(), ") packet");
|
||||
|
||||
/* send update request */
|
||||
update(packet.module_name());
|
||||
|
||||
break;
|
||||
case Packet_base::DATA:
|
||||
if (verbose) PINF("receiving DATA(%s) packet", packet.module_name());
|
||||
if (verbose)
|
||||
Genode::log("receiving DATA(", packet.module_name(), ") packet");
|
||||
|
||||
/* write into buffer */
|
||||
if (!_receiver) return;
|
||||
@@ -531,7 +543,8 @@ class Remote_rom::Backend_client : public Backend_client_base, public Backend_ba
|
||||
|
||||
break;
|
||||
case Packet_base::DATA_CONT:
|
||||
if (verbose) PINF("receiving DATA_CONT(%s) packet", packet.module_name());
|
||||
if (verbose)
|
||||
Genode::log("receiving DATA_CONT(", packet.module_name(), ") packet");
|
||||
|
||||
if (!_receiver) return;
|
||||
|
||||
|
||||
@@ -351,6 +351,7 @@ static int genode_file_size(sqlite3_file *pFile, sqlite_int64 *pSize)
|
||||
typedef Vfs::Directory_service::Stat_result Result;
|
||||
switch(p->vfs->stat(p->path, stat)) {
|
||||
case Result::STAT_ERR_NO_ENTRY: return SQLITE_IOERR_FSTAT;
|
||||
case Result::STAT_ERR_NO_PERM: return SQLITE_IOERR_ACCESS;
|
||||
case Result::STAT_OK: break;
|
||||
}
|
||||
*pSize = stat.size;
|
||||
@@ -510,17 +511,17 @@ static int genode_open(
|
||||
|
||||
int sqlite3_os_init(void)
|
||||
{
|
||||
PINF("initializing native SQLite OS interface");
|
||||
Genode::log("initializing native SQLite OS interface");
|
||||
|
||||
int ret = Jitter::jent_entropy_init();
|
||||
if(ret) {
|
||||
PERR("Jitter entropy initialization failed with error code %d", ret);
|
||||
Genode::error("Jitter entropy initialization failed with error code ", ret);
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
_jitter = Jitter::jent_entropy_collector_alloc(0, 0);
|
||||
if (!_jitter) {
|
||||
PERR("Jitter entropy collector initialization failed");
|
||||
Genode::error("Jitter entropy collector initialization failed");
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
@@ -538,11 +539,11 @@ int sqlite3_os_init(void)
|
||||
PWRN("additional VFS created for SQLite");
|
||||
|
||||
} catch (Genode::Xml_node::Nonexistent_sub_node) {
|
||||
PERR("no VFS defined for SQLite library");
|
||||
Genode::error("no VFS defined for SQLite library");
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
} catch (...) {
|
||||
PERR("error loading VFS definition for SQLite library");
|
||||
Genode::error("error loading VFS definition for SQLite library");
|
||||
return SQLITE_ERROR;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,9 @@
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <base/printf.h>
|
||||
#include <base/env.h>
|
||||
#include <base/heap.h>
|
||||
#include <base/log.h>
|
||||
#include <util/volatile_object.h>
|
||||
#include <util/list.h>
|
||||
|
||||
@@ -200,7 +201,7 @@ struct Remote_rom::Main : public Remote_rom::Read_buffer, public Remote_rom::Rom
|
||||
void commit_new_content(bool abort=false)
|
||||
{
|
||||
if (abort)
|
||||
PERR("abort not supported");
|
||||
Genode::error("abort not supported");
|
||||
|
||||
// TODO release write lock
|
||||
|
||||
@@ -251,7 +252,7 @@ namespace Component {
|
||||
Genode::Xml_node remote_rom = Genode::config()->xml_node().sub_node("remote_rom");
|
||||
remote_rom.attribute("name").value(Remote_rom::remotename, sizeof(Remote_rom::remotename));
|
||||
} catch (...) {
|
||||
PERR("No ROM module configured!");
|
||||
Genode::error("No ROM module configured!");
|
||||
}
|
||||
|
||||
static Remote_rom::Main main(env);
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include <base/printf.h>
|
||||
#include <base/log.h>
|
||||
#include <base/env.h>
|
||||
|
||||
#include <backend_base.h>
|
||||
@@ -133,7 +133,7 @@ namespace Component {
|
||||
remote_rom.attribute("binary").value(&Remote_rom::binary);
|
||||
} catch (...) { }
|
||||
} catch (...) {
|
||||
PERR("No ROM module configured!");
|
||||
Genode::error("No ROM module configured!");
|
||||
}
|
||||
|
||||
static Remote_rom::Main main(env.ep());
|
||||
|
||||
@@ -148,7 +148,7 @@ struct Proxy : Rpc_object<Typed_root<File_system::Session>>
|
||||
catch (No_space) { errstr = "no space"; }
|
||||
catch (...) { errstr = "unknown error"; }
|
||||
|
||||
PERR("%s: %s", new_root, errstr);
|
||||
Genode::error(new_root, ": ", errstr);
|
||||
throw Root::Unavailable();
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
*/
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/log.h>
|
||||
#include <input/component.h>
|
||||
#include <framebuffer_session/connection.h>
|
||||
#include <nitpicker_session/connection.h>
|
||||
@@ -94,7 +95,7 @@ static uSynergyBool connect(uSynergyCookie cookie)
|
||||
try {
|
||||
config_node.attribute("addr").value(addr, sizeof(addr));
|
||||
} catch (Xml_node::Nonexistent_attribute) {
|
||||
PERR("server address not set in config");
|
||||
Genode::error("server address not set in config");
|
||||
return USYNERGY_FALSE;
|
||||
}
|
||||
|
||||
@@ -111,7 +112,7 @@ static uSynergyBool connect(uSynergyCookie cookie)
|
||||
sockaddr.sin_family = AF_INET;
|
||||
sockaddr.sin_port = htons(port);
|
||||
if (inet_pton(AF_INET, addr, &sockaddr.sin_addr.s_addr) == 0) {
|
||||
PERR("bad IPv4 address %s for server", addr);
|
||||
Genode::error("bad IPv4 address ", addr, " for server");
|
||||
return USYNERGY_FALSE;
|
||||
}
|
||||
|
||||
@@ -149,7 +150,7 @@ void sleep(uSynergyCookie, int timeMs) { timer()->msleep(timeMs); }
|
||||
|
||||
uint32_t get_time() { return timer()->elapsed_ms(); }
|
||||
|
||||
void trace_callback(uSynergyCookie cookie, const char *text) { PLOG("%s", text); }
|
||||
void trace_callback(uSynergyCookie cookie, const char *text) { Genode::log(text); }
|
||||
|
||||
void screen_active_callback(uSynergyCookie cookie, uSynergyBool active)
|
||||
{
|
||||
@@ -227,12 +228,12 @@ void keyboard_callback(uSynergyCookie cookie,
|
||||
** Network processing thread **
|
||||
*******************************/
|
||||
|
||||
struct Synergy_thread : Thread_base
|
||||
struct Synergy_thread : Thread
|
||||
{
|
||||
|
||||
enum {
|
||||
MAX_NAME_LEN = 256,
|
||||
WEIGHT = Cpu_session::DEFAULT_WEIGHT,
|
||||
WEIGHT = Cpu_session::Weight::DEFAULT_WEIGHT,
|
||||
STACK_SIZE = 1024*sizeof(long)
|
||||
};
|
||||
|
||||
@@ -242,7 +243,7 @@ struct Synergy_thread : Thread_base
|
||||
Signal_context config_ctx;
|
||||
|
||||
Synergy_thread(Session_component &session)
|
||||
: Thread_base(WEIGHT, "synergy_ep", STACK_SIZE)
|
||||
: Thread(WEIGHT, "synergy_ep", STACK_SIZE)
|
||||
{
|
||||
*screen_name = 0;
|
||||
uSynergyInit(&context);
|
||||
@@ -282,14 +283,14 @@ struct Synergy_thread : Thread_base
|
||||
try {
|
||||
config_node.attribute("addr");;
|
||||
} catch (Xml_node::Nonexistent_attribute) {
|
||||
PERR("server address not set in config");
|
||||
Genode::error("server address not set in config");
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
config_node.attribute("name").value(screen_name, sizeof(screen_name));
|
||||
} catch (Xml_node::Nonexistent_attribute) {
|
||||
PERR("client screen name not set in config, waiting for update");
|
||||
Genode::error("client screen name not set in config, waiting for update");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <os/session_policy.h>
|
||||
#include <os/path.h>
|
||||
#include <base/attached_rom_dataspace.h>
|
||||
#include <base/heap.h>
|
||||
#include <root/component.h>
|
||||
#include <base/component.h>
|
||||
#include <util/list.h>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#include <base/printf.h>
|
||||
#include <timer_session/connection.h>
|
||||
|
||||
#include <glucose/core/Solver.h>
|
||||
@@ -6,6 +5,8 @@
|
||||
|
||||
#include <trace/timestamp.h>
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
// this value is for the Raspberry Pi
|
||||
#define TICKS_PER_USEC (700.0/64.0)
|
||||
|
||||
@@ -39,7 +40,7 @@ void printStats(Solver& solver, double initial_time, Genode::Trace::Timestamp st
|
||||
|
||||
if (mem_used != 0) printf("Memory used : %.2f MB\n", mem_used);
|
||||
printf("c CPU time : %.2f ms\n", cpu_time);
|
||||
printf("c TS ticks : %d (%.1f µs)\n", ts_ticks, (double)ts_ticks/TICKS_PER_USEC);
|
||||
printf("c TS ticks : %u (%.1f µs)\n", (unsigned)ts_ticks, (double)ts_ticks/TICKS_PER_USEC);
|
||||
}
|
||||
|
||||
int main()
|
||||
@@ -63,7 +64,7 @@ int main()
|
||||
printf("c | Number of clauses: %12d |\n", S.nClauses());
|
||||
|
||||
printf("c | Parse time: %12.2f ms |\n", parsed_time - initial_time);
|
||||
printf("c | Parse ticks: %d (%.1f µs) |\n", parse_ticks - start_ts, (double)(parse_ticks-start_ts)/TICKS_PER_USEC);
|
||||
printf("c | Parse ticks: %u (%.1f µs) |\n", (unsigned)parse_ticks - start_ts, (double)(parse_ticks-start_ts)/TICKS_PER_USEC);
|
||||
printf("c | |\n");
|
||||
|
||||
if (!S.simplify()){
|
||||
@@ -92,10 +93,10 @@ int main()
|
||||
|
||||
/* solver finished */
|
||||
|
||||
PINF("Okay");
|
||||
Genode::log("Okay");
|
||||
}
|
||||
else {
|
||||
PERR("Unable to open file \"Test.cnf\"");
|
||||
Genode::error("Unable to open file \"Test.cnf\"");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user