Loading...
Searching...
No Matches
obj_info.h
Go to the documentation of this file.
/*
* Copyright (C) 2023 Kernkonzept GmbH.
* Author(s): Frank Mehnert <frank.mehnert@kernkonzept.com>
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/compiler.h>
#include <l4/sys/l4int.h>
struct L4_kobj_info
{
// Type_mapping: See Jdb_mapdb::info_obj_mapping().
struct Mapping
{
enum { Type = 0 };
l4_uint64_t mapping_ptr;
char space_name[16];
l4_uint32_t cap_idx;
l4_uint16_t entry_rights;
l4_uint16_t entry_flags;
l4_uint64_t entry_ptr;
};
// Type_thread: See Jdb_tcb::info_kobject().
struct Thread
{
enum { Type = 1 };
bool is_kernel;
bool is_current;
bool in_ready_list;
bool is_kernel_task;
l4_uint32_t home_cpu;
l4_uint32_t current_cpu;
l4_int64_t ref_cnt;
l4_uint64_t space_id;
};
// Type_space: See Jdb_space::info_kobject().
struct Space
{
enum { Type = 2 };
bool is_kernel;
l4_int64_t ref_cnt;
};
// Type_vm: See Jdb_vm::info_kobject().
struct Vm
{
enum { Type = 3 };
l4_uint64_t utcb;
l4_uint64_t pc;
};
// Type_ipc_gate: See Jdb_ipc_gate::info_kobject().
struct Ipc_gate
{
enum { Type = 4 };
l4_uint64_t label;
l4_uint64_t thread_id;
};
// Type_irq: See Jdb_kobject_irq::info_kobject().
struct Irq_sender
{
enum { Type = 5 };
char chip_type[10];
l4_uint16_t flags;
l4_uint32_t pin;
l4_uint64_t label;
l4_uint64_t target_id;
l4_int64_t queued;
};
// Type_irq: See Jdb_kobject_irq::info_kobject().
struct Irq_semaphore
{
enum { Type = 6 };
char chip_type[10];
l4_uint16_t flags;
l4_uint32_t pin;
l4_uint64_t sender_id;
l4_uint64_t target_id;
l4_int64_t queued;
};
// Type_factory: See Jdb_factory::info_kobject().
struct Factory
{
enum { Type = 7 };
l4_uint64_t current;
l4_uint64_t limit;
};
struct Jdb { enum { Type = 8 }; };
struct Scheduler { enum { Type = 9 }; };
struct Vlog { enum { Type = 10 }; };
struct Pfc { enum { Type = 11 }; };
struct Dmar_space { enum { Type = 12 }; };
struct Iommu { enum { Type = 13 }; };
struct Smmu { enum { Type = 14 }; };
l4_uint64_t type:5;
l4_uint64_t id:59;
l4_uint64_t mapping_ptr;
l4_uint64_t ref_cnt;
union
{
Thread thread;
Space space;
Vm vm;
Ipc_gate ipc_gate;
Irq_sender irq_sender;
Irq_semaphore irq_semaphore;
Factory factory;
Mapping mapping;
l4_uint64_t raw[5];
};
};
static_assert(sizeof(L4_kobj_info) == 64, "Size of Jobj_info");
L4_INLINE l4_msgtag_t
l4_debugger_query_obj_infos(l4_cap_idx_t cap, l4_addr_t ku_mem_addr,
l4_size_t ku_mem_size, l4_umword_t skip,
l4_umword_t *result_cnt, l4_umword_t *result_all)
L4_NOTHROW;
L4_INLINE l4_msgtag_t
l4_debugger_query_obj_infos_u(l4_cap_idx_t cap, l4_addr_t ku_mem_addr,
l4_size_t ku_mem_size, l4_umword_t skip,
l4_umword_t *result_cnt, l4_umword_t *result_all,
l4_utcb_t *utcb) L4_NOTHROW
{
l4_utcb_mr()->mr[0] = 16;
l4_utcb_mr()->mr[1] = ku_mem_addr;
l4_utcb_mr()->mr[2] = ku_mem_size;
l4_utcb_mr()->mr[3] = skip;
l4_msgtag_t tag = l4_invoke_debugger(cap, l4_msgtag(0, 4, 0, 0), utcb);
*result_cnt = l4_utcb_mr()->mr[0];
*result_all = l4_utcb_mr()->mr[1];
return tag;
}
L4_INLINE l4_msgtag_t
l4_debugger_query_obj_infos(l4_cap_idx_t cap, l4_addr_t ku_mem_addr,
l4_size_t ku_mem_size, l4_umword_t skip,
l4_umword_t *result_cnt, l4_umword_t *result_all)
L4_NOTHROW
{
return l4_debugger_query_obj_infos_u(cap, ku_mem_addr, ku_mem_size, skip,
result_cnt, result_all, l4_utcb());
}
compiler.h
L4 compiler related defines.
l4_size_t
unsigned int l4_size_t
Unsigned size type.
Definition l4int.h:24
l4_umword_t
unsigned long l4_umword_t
Unsigned machine word.
Definition l4int.h:40
l4_addr_t
unsigned long l4_addr_t
Address type.
Definition l4int.h:34
l4_int64_t
signed long long l4_int64_t
Signed 64bit value.
Definition l4int.h:30
l4_uint32_t
unsigned int l4_uint32_t
Unsigned 32bit value.
Definition l4int.h:29
l4_uint16_t
unsigned short int l4_uint16_t
Unsigned 16bit value.
Definition l4int.h:27
l4_uint64_t
unsigned long long l4_uint64_t
Unsigned 64bit value.
Definition l4int.h:31
l4_cap_idx_t
unsigned long l4_cap_idx_t
Capability selector type.
Definition types.h:336
l4_msgtag
l4_msgtag_t l4_msgtag(long label, unsigned words, unsigned items, unsigned flags) L4_NOTHROW
Create a message tag from the specified values.
Definition types.h:405
l4_utcb_mr
l4_msg_regs_t * l4_utcb_mr(void) L4_NOTHROW L4_PURE
Get the message-register block of a UTCB.
Definition utcb.h:358
l4_utcb_t
struct l4_utcb_t l4_utcb_t
Opaque type for the UTCB.
Definition utcb.h:56
l4_utcb
l4_utcb_t * l4_utcb(void) L4_NOTHROW L4_PURE
Get the UTCB address.
Definition utcb.h:346
L4_NOTHROW
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:161
L4_INLINE
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
l4int.h
Fixed sized integer types, generic version.
l4_debugger_query_obj_infos
l4_msgtag_t l4_debugger_query_obj_infos(l4_cap_idx_t cap, l4_addr_t ku_mem_addr, l4_size_t ku_mem_size, l4_umword_t skip, l4_umword_t *result_cnt, l4_umword_t *result_all) L4_NOTHROW
Retrieve information from the kernel about all objects in the mapping database and write data to the ...
Definition obj_info.h:176
l4_msgtag_t
Message tag data structure.
Definition types.h:154
l4_msg_regs_t::mr
l4_umword_t mr[L4_UTCB_GENERIC_DATA_SIZE]
Message registers.
Definition utcb.h:69