Compare commits

..

4 Commits

Author SHA1 Message Date
Paul Fertser
ca218832bb The openocd-0.8.0 release
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2014-04-27 14:28:21 +04:00
Spencer Oliver
cf094f22ca nrf51: remove dereference of null pointer
found by clang 3.4.

Change-Id: Id499b546f65acd7a719498bc97e33b21d1ba565a
Signed-off-by: Spencer Oliver <spen@spen-soft.co.uk>
Reviewed-on: http://openocd.zylin.com/2119
Tested-by: jenkins
Reviewed-by: Andreas Fritiofson <andreas.fritiofson@gmail.com>
Reviewed-by: Andrey Smirnov <andrew.smirnov@gmail.com>
2014-04-27 09:16:47 +00:00
Ivan De Cesaris
7bd295953d quark_x10xx: fix IO r/w operations with paging enabled
Paging checking and disabling wasn't present for IO r/w,
so the commands were successful only when paging wasn't
enabled (e.g. EFI boot phase).

Change-Id: I41366c0fadff3ea1eb8a153291f20a46cd9ddec1
Signed-off-by: Ivan De Cesaris <ivan.de.cesaris@intel.com>
Reviewed-on: http://openocd.zylin.com/2118
Tested-by: jenkins
Reviewed-by: Peter Stuge <peter@stuge.se>
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
2014-04-27 09:16:30 +00:00
Paul Fertser
7ad635bb68 Restore -dev suffix
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2014-04-15 09:54:32 +04:00
3 changed files with 32 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
AC_PREREQ(2.64)
AC_INIT([openocd], [0.8.0-rc2],
AC_INIT([openocd], [0.8.0],
[OpenOCD Mailing List <openocd-devel@lists.sourceforge.net>])
AC_CONFIG_SRCDIR([src/openocd.c])

View File

@@ -629,7 +629,7 @@ static int nrf51_write_page(struct flash_bank *bank, uint32_t offset, const uint
struct flash_sector *sector = nrf51_find_sector_by_address(bank, offset);
if (!sector)
goto error;
return ERROR_FLASH_SECTOR_INVALID;
if (sector->is_protected)
goto error;

View File

@@ -670,6 +670,7 @@ int x86_32_common_read_io(struct target *t, uint32_t addr,
/* if CS.D bit=1 then its a 32 bit code segment, else 16 */
bool use32 = (buf_get_u32(x86_32->cache->reg_list[CSAR].value, 0, 32)) & CSAR_D;
int retval = ERROR_FAIL;
bool pg_disabled = false;
LOG_DEBUG("addr=%08" PRIx32 ", size=%d, buf=%p", addr, size, buf);
check_not_halted(t);
if (!buf || !addr) {
@@ -681,6 +682,13 @@ int x86_32_common_read_io(struct target *t, uint32_t addr,
LOG_ERROR("%s error EDX write", __func__);
return retval;
}
/* to access physical memory, switch off the CR0.PG bit */
if (x86_32->is_paging_enabled(t)) {
retval = x86_32->disable_paging(t);
if (retval != ERROR_OK)
return retval;
pg_disabled = true;
}
switch (size) {
case BYTE:
if (use32)
@@ -704,6 +712,13 @@ int x86_32_common_read_io(struct target *t, uint32_t addr,
LOG_ERROR("%s invalid read io size", __func__);
return ERROR_FAIL;
}
/* restore CR0.PG bit if needed */
if (pg_disabled) {
retval = x86_32->enable_paging(t);
if (retval != ERROR_OK)
return retval;
pg_disabled = false;
}
uint32_t regval = 0;
retval = x86_32->read_hw_reg(t, EAX, &regval, 0);
if (retval != ERROR_OK) {
@@ -729,6 +744,7 @@ int x86_32_common_write_io(struct target *t, uint32_t addr,
LOG_DEBUG("addr=%08" PRIx32 ", size=%d, buf=%p", addr, size, buf);
check_not_halted(t);
int retval = ERROR_FAIL;
bool pg_disabled = false;
if (!buf || !addr) {
LOG_ERROR("%s invalid params buf=%p, addr=%08" PRIx32, __func__, buf, addr);
return retval;
@@ -747,6 +763,13 @@ int x86_32_common_write_io(struct target *t, uint32_t addr,
LOG_ERROR("%s error on EAX write", __func__);
return retval;
}
/* to access physical memory, switch off the CR0.PG bit */
if (x86_32->is_paging_enabled(t)) {
retval = x86_32->disable_paging(t);
if (retval != ERROR_OK)
return retval;
pg_disabled = true;
}
switch (size) {
case BYTE:
if (use32)
@@ -770,6 +793,13 @@ int x86_32_common_write_io(struct target *t, uint32_t addr,
LOG_ERROR("%s invalid write io size", __func__);
return ERROR_FAIL;
}
/* restore CR0.PG bit if needed */
if (pg_disabled) {
retval = x86_32->enable_paging(t);
if (retval != ERROR_OK)
return retval;
pg_disabled = false;
}
retval = x86_32->transaction_status(t);
if (retval != ERROR_OK) {
LOG_ERROR("%s error on io write", __func__);