#include "capability/capability.h" #include "object/process.h" #include "object/thread.h" template <> RefPtr Capability::obj() { if (type_ != PROCESS) { panic("Accessing %u cap as object.", type_); } return StaticCastRefPtr(obj_); } template <> RefPtr Capability::obj() { if (type_ != THREAD) { panic("Accessing %u cap as object.", type_); } return StaticCastRefPtr(obj_); } template <> RefPtr Capability::obj() { if (type_ != ADDRESS_SPACE) { panic("Accessing %u cap as object.", type_); } return StaticCastRefPtr(obj_); } template <> RefPtr Capability::obj() { if (type_ != MEMORY_OBJECT) { panic("Accessing %u cap as object.", type_); } return StaticCastRefPtr(obj_); } template <> RefPtr Capability::obj() { if (type_ != CHANNEL) { panic("Accessing %u cap as object.", type_); } return StaticCastRefPtr(obj_); }