Author: Spencer Oliver <spen@spen-soft.co.uk>

- Bring the mips step/resume interrupt handling inline with the
rest of openocd.


git-svn-id: svn://svn.berlios.de/openocd/trunk@1850 b42882b7-edfa-0310-969c-e2dbd0fdcd60
This commit is contained in:
kc8apf
2009-05-20 05:07:34 +00:00
parent b7b0452517
commit 30268bc40f
5 changed files with 55 additions and 9 deletions

View File

@@ -420,3 +420,41 @@ int mips32_configure_break_unit(struct target_s *target)
return ERROR_OK;
}
int mips32_enable_interrupts(struct target_s *target, int enable)
{
int retval;
int update = 0;
u32 dcr;
/* read debug control register */
if ((retval = target_read_u32(target, EJTAG_DCR, &dcr)) != ERROR_OK)
return retval;
if (enable)
{
if (!(dcr & (1<<4)))
{
/* enable interrupts */
dcr |= (1<<4);
update = 1;
}
}
else
{
if (dcr & (1<<4))
{
/* disable interrupts */
dcr &= ~(1<<4);
update = 1;
}
}
if (update)
{
if ((retval = target_write_u32(target, EJTAG_DCR, dcr)) != ERROR_OK)
return retval;
}
return ERROR_OK;
}