/** @addtogroup tdebug
* @{
*/
/** @file
*/
#ifndef KERN_TDEBUG_TYPE_H_
#define KERN_TDEBUG_TYPE_H_
/**
* Type of tdebug event.
*/
typedef enum {
TDEBUG_EV_STOP, /**< stopped on monitor request */
TDEBUG_EV_SYSCALL, /**< syscall */
TDEBUG_EV_EXCEPTION, /**< hardware exception */
TDEBUG_EV_IBEFORE, /**< before executing an instruction */
TDEBUG_EV_IAFTER /**< after executing an instruction */
} tdebug_event_t;
/**
* Event type bitmasks.
*/
typedef enum {
TDEBUG_EVMASK_STOP = (1 << TDEBUG_EV_STOP),
TDEBUG_EVMASK_SYSCALL = (1 << TDEBUG_EV_SYSCALL),
TDEBUG_EVMASK_EXCEPTION = (1 << TDEBUG_EV_EXCEPTION),
TDEBUG_EVMASK_IBEFORE = (1 << TDEBUG_EV_IBEFORE),
TDEBUG_EVMASK_IAFTER = (1 << TDEBUG_EV_IAFTER),
} tdebug_evmask_t;
#ifdef KERNEL
#include <atomic.h>
#include <arch/types.h>
#include <arch/interrupt.h>
#include <synch/condvar.h>
struct thread;
struct task;
/**
* A part of the task structure related to the tdebug interface.
* Access is synchronized using task lock of the containing task structure,
* except for the field have_monitor, which is not locked.
*/
typedef struct task_tdebug {
atomic_t have_monitor; /**< this field is only informative */
struct task *monitor; /**< points to the monitoring task or NULL */
unative_t method; /**< method number to use with notifications */
link_t targets;
link_t targets_link;
} task_tdebug_t;
/**
* A part of the thread structure related to the tdebug interface.
*/
typedef struct thread_tdebug {
int stopped;
condvar_t stopped_cv;
unative_t current_event;
int stop_request;
unative_t event_mask;
/** Points to the stored userspace istate or NULL if none */
istate_t *uspace_state;
unative_t *syscall_args;
} thread_tdebug_t;
#endif /* KERNEL */
#endif
/** @}
*/