This commit implements the body of SELFOUR-499. The API exposes the x86 DR0-7
and ARM coprocessor 14 features to userspace by virtualizing them as context-
switched registers in the TCB. Implemented as TCB invocations. This feature is
only built when CONFIG_HARDWARE_DEBUG_API is selected.
* Add low-level support routines for setting, unsetting, getting, enabling
and disabling breakpoints.
* Add support for single-stepping as well.
^ Single-stepping is not supported on ARMv6 since the hardware
doesn't have support.
^ ARM implements single-stepping as instruction breakpoints
configured to fault on every instruction -- this is achieved through
the "mismatch" mode, which is only supported from ARMv7 onwards.
* Also support explicit software break requests, a la "BKPT" and "INT $3".
* New invocations:
* seL4_TCB_SetBreakpoint().
* seL4_TCB_GetBreakpoint().
* seL4_TCB_UnsetBreakpoint().
* seL4_TCB_ConfigureSingleStepping().
* New constants:
^ Event types:
^ seL4_InstructionBreakpoint.
^ seL4_DataBreakpoint.
^ seL4_SoftwareBreakRequest.
^ Access types:
^ seL4_BreakOnRead.
^ seL4_BreakOnWrite.
^ seL4_BreakOnReadWrite.
^ Exports:
^ seL4_NumHWBreakpoints.
^ seL4_NumExclusiveBreakpoints.
^ seL4_NumExclusiveWatchpoints.
^ seL4_NumDualFunctionMonitors.
^ seL4_FirstBreakpoint.
^ seL4_FirstWatchpoint.
^ seL4_FirstDualFunctionMonitor.
See documentation in the seL4 API manual.
68 lines
1.6 KiB
C
68 lines
1.6 KiB
C
/*
|
|
* Copyright 2014, NICTA
|
|
*
|
|
* This software may be distributed and modified according to the terms of
|
|
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
|
|
* See "LICENSE_BSD2.txt" for details.
|
|
*
|
|
* @TAG(NICTA_BSD)
|
|
*/
|
|
|
|
#ifndef __API_CONSTANTS_H
|
|
#define __API_CONSTANTS_H
|
|
|
|
#ifdef HAVE_AUTOCONF
|
|
#include <autoconf.h>
|
|
#endif
|
|
|
|
#define LIBSEL4_BIT(n) (1ul<<(n))
|
|
|
|
#ifdef CONFIG_HARDWARE_DEBUG_API
|
|
/* API arg values for breakpoint API, "type" arguments. */
|
|
typedef enum {
|
|
seL4_DataBreakpoint = 0,
|
|
seL4_InstructionBreakpoint,
|
|
seL4_SingleStep,
|
|
seL4_SoftwareBreakRequest,
|
|
SEL4_FORCE_LONG_ENUM(seL4_BreakpointType)
|
|
} seL4_BreakpointType;
|
|
|
|
/* API arg values for breakpoint API, "access" arguments. */
|
|
typedef enum {
|
|
seL4_BreakOnRead = 0,
|
|
seL4_BreakOnWrite,
|
|
seL4_BreakOnReadWrite,
|
|
seL4_MaxBreakpointAccess,
|
|
SEL4_FORCE_LONG_ENUM(seL4_BreakpointAccess)
|
|
} seL4_BreakpointAccess;
|
|
|
|
/* Format of a debug-exception message. */
|
|
enum {
|
|
seL4_DebugException_FaultIP,
|
|
seL4_DebugException_ExceptionReason,
|
|
seL4_DebugException_TriggerAddress,
|
|
seL4_DebugException_BreakpointNumber,
|
|
seL4_DebugException_Length,
|
|
SEL4_FORCE_LONG_ENUM(seL4_DebugException_Msg)
|
|
} seL4_DebugException_Msg;
|
|
#endif
|
|
|
|
enum priorityConstants {
|
|
seL4_InvalidPrio = -1,
|
|
seL4_MinPrio = 0,
|
|
seL4_MaxPrio = CONFIG_NUM_PRIORITIES - 1
|
|
};
|
|
|
|
/* seL4_MessageInfo_t defined in api/shared_types.bf */
|
|
|
|
enum seL4_MsgLimits {
|
|
seL4_MsgLengthBits = 7,
|
|
seL4_MsgExtraCapBits = 2
|
|
};
|
|
|
|
enum {
|
|
seL4_MsgMaxLength = 120,
|
|
};
|
|
#define seL4_MsgMaxExtraCaps (LIBSEL4_BIT(seL4_MsgExtraCapBits)-1)
|
|
|
|
#endif /* __API_CONSTANTS_H */
|