1/*
2 * Copyright 2017, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
8 * See "LICENSE_BSD2.txt" for details.
9 *
10 * @TAG(DATA61_BSD)
11 */
12
13#define DEBUG_COMPOSITION(TARGET, IRQ_NUM, IOPORT_RANGE) \
14assembly {  \
15    composition {   \
16    component debug_server debug; \
17    component debug_serial debug_hw_serial; \
18    connection seL4HardwareIOPort debug_port (from debug.serial_port, to debug_hw_serial.serial); \
19    connection seL4HardwareInterrupt interrupt1 (from debug_hw_serial.serial_irq, to debug.serial_irq); \
20    connection seL4RPC delegate_con (from debug.delegate, to TARGET.delegate); \
21    connection seL4GDB debug0 (from TARGET.fault, to debug.client_fault); \
22    connection seL4GDBMem debug0_mem (from TARGET.GDB_mem, to TARGET.GDB_mem_handler); \
23    } \
24    configuration { \
25        debug_hw_serial.serial_irq_irq_number = IRQ_NUM; \
26        debug_hw_serial.serial_attributes = IOPORT_RANGE; \
27        TARGET.debug = True; \
28    } \
29}
30
31#define DEBUG_COMPONENT() \
32  uses CAmkES_Debug fault; \
33  provides GDB_delegate delegate; \
34  uses CAmkES_Debug GDB_mem; \
35  provides CAmkES_Debug GDB_mem_handler;
36