2011-12-22 15:19:25 +00:00
|
|
|
/*
|
|
|
|
* \brief Pistachio-specific thread helper functions
|
|
|
|
* \author Julian Stecklina
|
|
|
|
* \date 2008-02-20
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2012-01-03 14:35:05 +00:00
|
|
|
* Copyright (C) 2008-2012 Genode Labs GmbH
|
2011-12-22 15:19:25 +00:00
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU General Public License version 2.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__PISTACHIO__THREAD_HELPER_H_
|
|
|
|
#define _INCLUDE__PISTACHIO__THREAD_HELPER_H_
|
|
|
|
|
|
|
|
#include <base/printf.h>
|
|
|
|
|
|
|
|
namespace Pistachio
|
|
|
|
{
|
|
|
|
#include <l4/types.h>
|
|
|
|
|
|
|
|
inline void print_l4_threadid(L4_ThreadId_t t)
|
|
|
|
{
|
|
|
|
if (L4_IsLocalId(t)) {
|
|
|
|
Genode::printf("THREAD (local) %02lx (raw %08lx)\n",
|
|
|
|
t.local.X.local_id, t.raw);
|
|
|
|
|
|
|
|
} else if (L4_IsGlobalId(t)) {
|
|
|
|
Genode::printf("THREAD (global) %02lx (version %lx) (raw %08lx)\n",
|
|
|
|
t.global.X.thread_no, t.global.X.version, t.raw);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
const char *name;
|
|
|
|
|
|
|
|
if (t == L4_nilthread) name = "nilthread";
|
|
|
|
else if (t == L4_anythread) name = "anythread";
|
|
|
|
else name = "???";
|
|
|
|
|
|
|
|
Genode::printf("THREAD (%s)\n", name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* _INCLUDE__PISTACHIO__THREAD_HELPER_H_ */
|