for (int ti = 0; ti < firmware->tracecount; ti++) {
if (firmware->trace[ti].mask == 0xff || firmware->trace[ti].mask == 0) {
// easy one
- avr_irq_t * all = avr_iomem_getirq(avr, firmware->trace[ti].addr, AVR_IOMEM_IRQ_ALL);
+ avr_irq_t * all = avr_iomem_getirq(avr,
+ firmware->trace[ti].addr,
+ firmware->trace[ti].name,
+ AVR_IOMEM_IRQ_ALL);
if (!all) {
AVR_LOG(avr, LOG_ERROR, "ELF: %s: unable to attach trace to address %04x\n",
__FUNCTION__, firmware->trace[ti].addr);
count++;
for (int bi = 0; bi < 8; bi++)
if (firmware->trace[ti].mask & (1 << bi)) {
- avr_irq_t * bit = avr_iomem_getirq(avr, firmware->trace[ti].addr, bi);
+ avr_irq_t * bit = avr_iomem_getirq(avr,
+ firmware->trace[ti].addr,
+ firmware->trace[ti].name,
+ bi);
if (!bit) {
AVR_LOG(avr, LOG_ERROR, "ELF: %s: unable to attach trace to address %04x\n",
__FUNCTION__, firmware->trace[ti].addr);
avr_iomem_getirq(
avr_t * avr,
avr_io_addr_t addr,
+ const char * name,
int index)
{
+ if (index > 8)
+ return NULL;
avr_io_addr_t a = AVR_DATA_TO_IO(addr);
if (avr->io[a].irq == NULL) {
/*
for (int i = 0; i < 8; i++)
avr->io[a].irq[i].flags |= IRQ_FLAG_FILTERED;
}
- return index < 9 ? avr->io[a].irq + index : NULL;
+ // if given a name, replace the default one...
+ if (name) {
+ int l = strlen(name);
+ char n[l + 10];
+ sprintf(n, "avr.io.%s", name);
+ free((void*)avr->io[a].irq[index].name);
+ avr->io[a].irq[index].name = strdup(n);
+ }
+ return avr->io[a].irq + index;
}
avr_irq_t *