- Replace ')\([<>]\)(' with ') \1 ('.
- Replace ')\([<>]\)\(\w\)' with ') \1 \2'.
- Replace '\(\w\)\([<>]\)(' with '\1 \2 ('.
- Replace '\(\w\)\([<>]\)\(\w\)' with '\1 \2 \3'.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2375
b42882b7-edfa-0310-969c-
e2dbd0fdcd60
39 files changed:
/* calculate bank size */
bank_size = sectors_num * pages_per_sector * page_size;
/* calculate bank size */
bank_size = sectors_num * pages_per_sector * page_size;
- for (bnk = 0; bnk<banks_num; bnk++)
+ for (bnk = 0; bnk < banks_num; bnk++)
/* allocate sectors */
t_bank->sectors = malloc(sectors_num * sizeof(flash_sector_t));
/* allocate sectors */
t_bank->sectors = malloc(sectors_num * sizeof(flash_sector_t));
- for (sec = 0; sec<sectors_num; sec++)
+ for (sec = 0; sec < sectors_num; sec++)
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->sectors[sec].size = pages_per_sector * page_size;
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->sectors[sec].size = pages_per_sector * page_size;
at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH);
fast_check = 1;
at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH);
fast_check = 1;
- for (nSector = 0; nSector<bank->num_sectors; nSector++)
+ for (nSector = 0; nSector < bank->num_sectors; nSector++)
{
retval = target_blank_check_memory(target, bank->base + bank->sectors[nSector].offset,
bank->sectors[nSector].size, &blank);
{
retval = target_blank_check_memory(target, bank->base + bank->sectors[nSector].offset,
bank->sectors[nSector].size, &blank);
LOG_USER("Running slow fallback erase check - add working memory");
buffer = malloc(bank->sectors[0].size);
LOG_USER("Running slow fallback erase check - add working memory");
buffer = malloc(bank->sectors[0].size);
- for (nSector = 0; nSector<bank->num_sectors; nSector++)
+ for (nSector = 0; nSector < bank->num_sectors; nSector++)
{
bank->sectors[nSector].is_erased = 1;
retval = target_read_memory(target, bank->base + bank->sectors[nSector].offset, 4,
{
bank->sectors[nSector].is_erased = 1;
retval = target_read_memory(target, bank->base + bank->sectors[nSector].offset, 4,
if (retval != ERROR_OK)
return retval;
if (retval != ERROR_OK)
return retval;
- for (nByte = 0; nByte<bank->sectors[nSector].size; nByte++)
+ for (nByte = 0; nByte < bank->sectors[nSector].size; nByte++)
{
if (buffer[nByte] != 0xFF)
{
{
if (buffer[nByte] != 0xFF)
{
at91sam7_info->lockbits = (status >> 16);
at91sam7_info->num_lockbits_on = 0;
at91sam7_info->lockbits = (status >> 16);
at91sam7_info->num_lockbits_on = 0;
- for (lock_pos = 0; lock_pos<bank->num_sectors; lock_pos++)
+ for (lock_pos = 0; lock_pos < bank->num_sectors; lock_pos++)
{
if ( ((status >> (16 + lock_pos))&(0x0001)) == 1)
{
{
if ( ((status >> (16 + lock_pos))&(0x0001)) == 1)
{
at91sam7_info->nvmbits = (status >> 8)&0xFF;
at91sam7_info->num_nvmbits_on = 0;
at91sam7_info->nvmbits = (status >> 8)&0xFF;
at91sam7_info->num_nvmbits_on = 0;
- for (gpnvm_pos = 0; gpnvm_pos<at91sam7_info->num_nvmbits; gpnvm_pos++)
+ for (gpnvm_pos = 0; gpnvm_pos < at91sam7_info->num_nvmbits; gpnvm_pos++)
{
if ( ((status >> (8 + gpnvm_pos))&(0x01)) == 1)
{
{
if ( ((status >> (8 + gpnvm_pos))&(0x01)) == 1)
{
/* calculate bank size */
bank_size = num_sectors * pages_per_sector * page_size;
/* calculate bank size */
bank_size = num_sectors * pages_per_sector * page_size;
- for (bnk = 0; bnk<banks_num; bnk++)
+ for (bnk = 0; bnk < banks_num; bnk++)
/* allocate sectors */
t_bank->sectors = malloc(num_sectors * sizeof(flash_sector_t));
/* allocate sectors */
t_bank->sectors = malloc(num_sectors * sizeof(flash_sector_t));
- for (sec = 0; sec<num_sectors; sec++)
+ for (sec = 0; sec < num_sectors; sec++)
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->sectors[sec].size = pages_per_sector * page_size;
{
t_bank->sectors[sec].offset = sec * pages_per_sector * page_size;
t_bank->sectors[sec].size = pages_per_sector * page_size;
/* allocate and clean buffer */
nbytes = (last - first + 1) * bank->sectors[first].size;
buffer = malloc(nbytes * sizeof(uint8_t));
/* allocate and clean buffer */
nbytes = (last - first + 1) * bank->sectors[first].size;
buffer = malloc(nbytes * sizeof(uint8_t));
- for (pos = 0; pos<nbytes; pos++)
+ for (pos = 0; pos < nbytes; pos++)
at91sam7_read_clock_info(bank);
at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH);
at91sam7_read_clock_info(bank);
at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH);
- for (pagen = first_page; pagen<last_page; pagen++)
+ for (pagen = first_page; pagen < last_page; pagen++)
- if (bytes_remaining<dst_min_alignment)
+ if (bytes_remaining < dst_min_alignment)
count = bytes_remaining;
else
count = dst_min_alignment;
count = bytes_remaining;
else
count = dst_min_alignment;
if (cfi_info->x16_as_x8)
{
uint8_t i;
if (cfi_info->x16_as_x8)
{
uint8_t i;
target_read_memory(target, flash_address(bank, sector, offset + i), bank->bus_width, 1,
&data[i*bank->bus_width] );
}
target_read_memory(target, flash_address(bank, sector, offset + i), bank->bus_width, 1,
&data[i*bank->bus_width] );
}
if (cfi_info->x16_as_x8)
{
uint8_t i;
if (cfi_info->x16_as_x8)
{
uint8_t i;
target_read_memory(target, flash_address(bank, sector, offset + i), bank->bus_width, 1,
&data[i*bank->bus_width] );
}
target_read_memory(target, flash_address(bank, sector, offset + i), bank->bus_width, 1,
&data[i*bank->bus_width] );
}
- for (i = 0; i<len; i += chunk)
+ for (i = 0; i < len; i += chunk)
duration_start_measure(&duration);
duration_start_measure(&duration);
- for (wrote = 0; wrote<(count*wordsize); wrote += cur_size)
+ for (wrote = 0; wrote < (count*wordsize); wrote += cur_size)
{
cur_size = MIN( (count*wordsize - wrote), sizeof(chunk) );
flash_bank_t *bank;
{
cur_size = MIN( (count*wordsize - wrote), sizeof(chunk) );
flash_bank_t *bank;
- for (i = 0; i<cur_size; i++)
+ for (i = 0; i < cur_size; i++)
{
if (readback[i]!=chunk[i])
{
{
if (readback[i]!=chunk[i])
{
* that matches @c DRIVERNAME.
*
* The flash subsystem calls some of the other drivers routines a using
* that matches @c DRIVERNAME.
*
* The flash subsystem calls some of the other drivers routines a using
- * corresponding static <code>flash_driver_<i>callback</i>()</code>
+ * corresponding static <code > flash_driver_ < i>callback</i > ()</code>
* routine in flash.c.
*/
typedef struct flash_driver_s
* routine in flash.c.
*/
typedef struct flash_driver_s
chksum = OCL_CHKS_INIT;
/* copy data to DCC buffer in proper byte order and properly aligned */
chksum = OCL_CHKS_INIT;
/* copy data to DCC buffer in proper byte order and properly aligned */
- for (i = 0; i<runlen; i++)
+ for (i = 0; i < runlen; i++)
return ERROR_FLASH_BANK_INVALID;
}
sectsize = bank->size / bank->num_sectors;
return ERROR_FLASH_BANK_INVALID;
}
sectsize = bank->size / bank->num_sectors;
- for (i = 0; i<bank->num_sectors; i++)
+ for (i = 0; i < bank->num_sectors; i++)
{
bank->sectors[i].offset = i * sectsize;
bank->sectors[i].size = sectsize;
{
bank->sectors[i].offset = i * sectsize;
bank->sectors[i].size = sectsize;
bi_start = ofs/4;
bi_end = (ofs + len + 3)/4;
bi_start = ofs/4;
bi_end = (ofs + len + 3)/4;
+ if (bi_end > BUFSIZE) {
dcc_wr(OCL_BUFF_OVER);
return;
}
chksum = OCL_CHKS_INIT;
dcc_wr(OCL_BUFF_OVER);
return;
}
chksum = OCL_CHKS_INIT;
- for (bi = 0; bi<bi_end; bi++) chksum^=buffer[bi]=dcc_rd();
+ for (bi = 0; bi < bi_end; bi++) chksum^=buffer[bi]=dcc_rd();
if (dcc_rd() != chksum) {
dcc_wr(OCL_CHKS_FAIL);
if (dcc_rd() != chksum) {
dcc_wr(OCL_CHKS_FAIL);
}
/* fill in unused positions with unprogrammed values */
}
/* fill in unused positions with unprogrammed values */
- for (bi = 0; bi<bi_start; bi++) buffer[bi]=0xffffffff;
+ for (bi = 0; bi < bi_start; bi++) buffer[bi]=0xffffffff;
for (bi = bi_end; bi%flash_page_size; bi++) buffer[bi]=0xffffffff;
result = 0;
pagenum = adr/flash_page_size;
for (bi = bi_end; bi%flash_page_size; bi++) buffer[bi]=0xffffffff;
result = 0;
pagenum = adr/flash_page_size;
- for (bi = 0; bi<bi_end; bi += flash_page_size/4) {
+ for (bi = 0; bi < bi_end; bi += flash_page_size/4) {
result = flash_page_program(buffer + bi, pagenum++);
if (result) break;
}
result = flash_page_program(buffer + bi, pagenum++);
if (result) break;
}
if ((inr(MC_FSR + efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
}
if ((inr(MC_FSR + efc_ofs)&MC_LOCKE)) return FLASH_STAT_LOCKE;
}
- if ((page_num += flash_lock_pages)>flash_page_count) break;
+ if ((page_num += flash_lock_pages) > flash_page_count) break;
if ((result = flash_erase_plane(0)) != FLASH_STAT_OK) return result;
/* the second flash controller, if any */
if ((result = flash_erase_plane(0)) != FLASH_STAT_OK) return result;
/* the second flash controller, if any */
- if (flash_page_count>1024) result = flash_erase_plane(0x10);
+ if (flash_page_count > 1024) result = flash_erase_plane(0x10);
buf += printed;
buf_size -= printed;
buf += printed;
buf_size -= printed;
- if (stellaris_info->num_lockbits>0)
+ if (stellaris_info->num_lockbits > 0)
{
printed = snprintf(buf,
buf_size,
{
printed = snprintf(buf,
buf_size,
- for (timeout = 0; timeout<1000; timeout++) {
+ for (timeout = 0; timeout < 1000; timeout++) {
if ((retval = target_read_u8(target, adr, &status)) != ERROR_OK)
{
return retval;
if ((retval = target_read_u8(target, adr, &status)) != ERROR_OK)
{
return retval;
target_write_u16(target, bank_adr, 0x70);
int timeout;
target_write_u16(target, bank_adr, 0x70);
int timeout;
- for (timeout = 0; timeout<1000; timeout++)
+ for (timeout = 0; timeout < 1000; timeout++)
{
target_read_u8(target, bank_adr, &status);
if ( status & 0x80 )
{
target_read_u8(target, bank_adr, &status);
if ( status & 0x80 )
target_write_u16(target, bank_adr, 0x70);
int timeout;
target_write_u16(target, bank_adr, 0x70);
int timeout;
- for (timeout = 0; timeout<1000; timeout++)
+ for (timeout = 0; timeout < 1000; timeout++)
{
target_read_u8(target, bank_adr, &status);
if ( status & 0x80 )
{
target_read_u8(target, bank_adr, &status);
if ( status & 0x80 )
- for (i = first; i<first + num; i++)
+ for (i = first; i < first + num; i++)
{
if (((value >> (i-first))&1) == 1)
buffer[i/8] |= 1 << (i%8);
{
if (((value >> (i-first))&1) == 1)
buffer[i/8] |= 1 << (i%8);
uint32_t result = 0;
unsigned int i;
uint32_t result = 0;
unsigned int i;
- for (i = first; i<first + num; i++)
+ for (i = first; i < first + num; i++)
{
if (((buffer[i/8]>>(i%8))&1) == 1)
result |= 1 << (i-first);
{
if (((buffer[i/8]>>(i%8))&1) == 1)
result |= 1 << (i-first);
int reslen;
result = Jim_GetString(Jim_GetResult(interp), &reslen);
int reslen;
result = Jim_GetString(Jim_GetResult(interp), &reslen);
{
int i;
char buff[256 + 1];
{
int i;
char buff[256 + 1];
result2 = fseek(fileio->file, 0, SEEK_SET);
result2 = fseek(fileio->file, 0, SEEK_SET);
- if ((fileio->size<0)||(result<0)||(result2<0))
+ if ((fileio->size < 0)||(result < 0)||(result2 < 0))
{
fileio_close(fileio);
return ERROR_FILEIO_OPERATION_FAILED;
{
fileio_close(fileio);
return ERROR_FILEIO_OPERATION_FAILED;
static jim_wide JimPowWide(jim_wide b, jim_wide e)
{
jim_wide i, res = 1;
static jim_wide JimPowWide(jim_wide b, jim_wide e)
{
jim_wide i, res = 1;
- if ((b == 0 && e != 0) || (e<0)) return 0;
- for (i = 0; i<e; i++) {res *= b;}
+ if ((b == 0 && e != 0) || (e < 0)) return 0;
+ for (i = 0; i < e; i++) {res *= b;}
case JIM_EXPROP_ADD: wC = wA + wB; break;
case JIM_EXPROP_SUB: wC = wA-wB; break;
case JIM_EXPROP_MUL: wC = wA*wB; break;
case JIM_EXPROP_ADD: wC = wA + wB; break;
case JIM_EXPROP_SUB: wC = wA-wB; break;
case JIM_EXPROP_MUL: wC = wA*wB; break;
- case JIM_EXPROP_LT: wC = wA<wB; break;
- case JIM_EXPROP_GT: wC = wA>wB; break;
+ case JIM_EXPROP_LT: wC = wA < wB; break;
+ case JIM_EXPROP_GT: wC = wA > wB; break;
case JIM_EXPROP_LTE: wC = wA <= wB; break;
case JIM_EXPROP_GTE: wC = wA >= wB; break;
case JIM_EXPROP_LSHIFT: wC = wA << wB; break;
case JIM_EXPROP_LTE: wC = wA <= wB; break;
case JIM_EXPROP_GTE: wC = wA >= wB; break;
case JIM_EXPROP_LSHIFT: wC = wA << wB; break;
case JIM_EXPROP_ADD: dC = dA + dB; break;
case JIM_EXPROP_SUB: dC = dA-dB; break;
case JIM_EXPROP_MUL: dC = dA*dB; break;
case JIM_EXPROP_ADD: dC = dA + dB; break;
case JIM_EXPROP_SUB: dC = dA-dB; break;
case JIM_EXPROP_MUL: dC = dA*dB; break;
- case JIM_EXPROP_LT: dC = dA<dB; break;
- case JIM_EXPROP_GT: dC = dA>dB; break;
+ case JIM_EXPROP_LT: dC = dA < dB; break;
+ case JIM_EXPROP_GT: dC = dA > dB; break;
case JIM_EXPROP_LTE: dC = dA <= dB; break;
case JIM_EXPROP_GTE: dC = dA >= dB; break;
case JIM_EXPROP_NUMEQ: dC = dA == dB; break;
case JIM_EXPROP_LTE: dC = dA <= dB; break;
case JIM_EXPROP_GTE: dC = dA >= dB; break;
case JIM_EXPROP_NUMEQ: dC = dA == dB; break;
strncmp(fileName + fileNameLen-4, ".dll", 4) == 0 ||
strncmp(fileName + fileNameLen-3, ".so", 3) == 0))
{
strncmp(fileName + fileNameLen-4, ".dll", 4) == 0 ||
strncmp(fileName + fileNameLen-3, ".so", 3) == 0))
{
- char ver[6]; /* xx.yy<nulterm> */
+ char ver[6]; /* xx.yy < nulterm> */
char *p = strrchr(fileName, '.');
int verLen, fileVer;
char *p = strrchr(fileName, '.');
int verLen, fileVer;
void keep_alive()
{
current_time = timeval_ms();
void keep_alive()
{
current_time = timeval_ms();
- if (current_time-last_time>1000)
+ if (current_time-last_time > 1000)
{
extern int gdb_actual_connections;
{
extern int gdb_actual_connections;
"trouble with GDB connections.",
current_time-last_time);
}
"trouble with GDB connections.",
current_time-last_time);
}
- if (current_time-last_time>500)
+ if (current_time-last_time > 500)
{
/* this will keep the GDB connection alive */
LOG_USER_N("%s", "");
{
/* this will keep the GDB connection alive */
LOG_USER_N("%s", "");
{
int i;
int napTime = 10;
{
int i;
int napTime = 10;
- for (i = 0; i<ms; i += napTime)
+ for (i = 0; i < ms; i += napTime)
{
int sleep_a_bit = ms-i;
{
int sleep_a_bit = ms-i;
- if (sleep_a_bit>napTime)
+ if (sleep_a_bit > napTime)
{
sleep_a_bit = napTime;
}
{
sleep_a_bit = napTime;
}
{
long long then;
then = timeval_ms();
{
long long then;
then = timeval_ms();
- while ((timeval_ms()-then)<ms)
+ while ((timeval_ms()-then) < ms)
/* MIN,MAX macros */
#ifndef MIN
/* MIN,MAX macros */
#ifndef MIN
-#define MIN(a,b) (((a)<(b))?(a):(b))
+#define MIN(a,b) (((a) < (b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
+#define MAX(a,b) (((a) > (b))?(a):(b))
#endif
/* for systems that do not support ENOTSUP
#endif
/* for systems that do not support ENOTSUP
if (bitq_in_state.cmd->type == JTAG_SCAN)
{
/* loop through the fields */
if (bitq_in_state.cmd->type == JTAG_SCAN)
{
/* loop through the fields */
- while (bitq_in_state.field_idx<bitq_in_state.cmd->cmd.scan->num_fields)
+ while (bitq_in_state.field_idx < bitq_in_state.cmd->cmd.scan->num_fields)
{
field = &bitq_in_state.cmd->cmd.scan->fields[bitq_in_state.field_idx];
if (field->in_value)
{
field = &bitq_in_state.cmd->cmd.scan->fields[bitq_in_state.field_idx];
if (field->in_value)
else
{
/* buffer reallocation needed? */
else
{
/* buffer reallocation needed? */
- if (field->num_bits>bitq_in_bufsize * 8)
+ if (field->num_bits > bitq_in_bufsize * 8)
{
/* buffer previously allocated? */
if (bitq_in_buffer != NULL)
{
/* buffer previously allocated? */
if (bitq_in_buffer != NULL)
bitq_in_buffer = NULL;
}
/* double the buffer size until it fits */
bitq_in_buffer = NULL;
}
/* double the buffer size until it fits */
- while (field->num_bits>bitq_in_bufsize * 8)
+ while (field->num_bits > bitq_in_bufsize * 8)
bitq_in_bufsize *= 2;
}
/* if necessary, allocate buffer and check for malloc error */
bitq_in_bufsize *= 2;
}
/* if necessary, allocate buffer and check for malloc error */
- while (bitq_in_state.bit_pos<field->num_bits)
+ while (bitq_in_state.bit_pos < field->num_bits)
- if ( ( tdo = bitq_interface->in() )<0 )
+ if ( ( tdo = bitq_interface->in() ) < 0 )
{
#ifdef _DEBUG_JTAG_IO_
LOG_DEBUG("bitq in EOF");
{
#ifdef _DEBUG_JTAG_IO_
LOG_DEBUG("bitq in EOF");
tms_scan = tap_get_tms_path(tap_get_state(), new_state);
int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
tms_scan = tap_get_tms_path(tap_get_state(), new_state);
int tms_count = tap_get_tms_path_len(tap_get_state(), tap_get_end_state());
- for (i = 0; i<tms_count; i++)
+ for (i = 0; i < tms_count; i++)
{
bitq_io(tms_scan & 1, 0, 0);
tms_scan >>= 1;
{
bitq_io(tms_scan & 1, 0, 0);
tms_scan >>= 1;
if (field->out_value == NULL)
{
/* just send zeros and request data from TDO */
if (field->out_value == NULL)
{
/* just send zeros and request data from TDO */
- for (bit_cnt = field->num_bits; bit_cnt>1; bit_cnt--)
+ for (bit_cnt = field->num_bits; bit_cnt > 1; bit_cnt--)
bitq_io(0, 0, tdo_req);
bitq_io(pause, 0, tdo_req);
bitq_io(0, 0, tdo_req);
bitq_io(pause, 0, tdo_req);
/* send data, and optionally request TDO */
out_mask = 0x01;
out_ptr = field->out_value;
/* send data, and optionally request TDO */
out_mask = 0x01;
out_ptr = field->out_value;
- for (bit_cnt = field->num_bits; bit_cnt>1; bit_cnt--)
+ for (bit_cnt = field->num_bits; bit_cnt > 1; bit_cnt--)
{
bitq_io(0, ( (*out_ptr) & out_mask ) != 0, tdo_req);
if (out_mask == 0x80)
{
bitq_io(0, ( (*out_ptr) & out_mask ) != 0, tdo_req);
if (out_mask == 0x80)
cp[-2] = 0;
ft2232_device_desc = strdup(buf);
} else {
cp[-2] = 0;
ft2232_device_desc = strdup(buf);
} else {
- // <space>A not defined
+ // <space > A not defined
// so create it
sprintf(buf, "%s A", ft2232_device_desc);
ft2232_device_desc_A = strdup(buf);
// so create it
sprintf(buf, "%s A", ft2232_device_desc);
ft2232_device_desc_A = strdup(buf);
LOG_DEBUG("opening %s...", buffer);
device_handle = open(buffer, O_WRONLY);
LOG_DEBUG("opening %s...", buffer);
device_handle = open(buffer, O_WRONLY);
{
LOG_ERROR("cannot open device. check it exists and that user read and write rights are set");
return ERROR_JTAG_INIT_FAILED;
{
LOG_ERROR("cannot open device. check it exists and that user read and write rights are set");
return ERROR_JTAG_INIT_FAILED;
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
i = ioctl(device_handle, PPCLAIM);
#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__)
i = ioctl(device_handle, PPCLAIM);
{
LOG_ERROR("cannot claim device");
return ERROR_JTAG_INIT_FAILED;
{
LOG_ERROR("cannot claim device");
return ERROR_JTAG_INIT_FAILED;
i = PARPORT_MODE_COMPAT;
i= ioctl(device_handle, PPSETMODE, & i);
i = PARPORT_MODE_COMPAT;
i= ioctl(device_handle, PPSETMODE, & i);
{
LOG_ERROR(" cannot set compatible mode to device");
return ERROR_JTAG_INIT_FAILED;
{
LOG_ERROR(" cannot set compatible mode to device");
return ERROR_JTAG_INIT_FAILED;
i = IEEE1284_MODE_COMPAT;
i = ioctl(device_handle, PPNEGOT, & i);
i = IEEE1284_MODE_COMPAT;
i = ioctl(device_handle, PPNEGOT, & i);
{
LOG_ERROR("cannot set compatible 1284 mode to device");
return ERROR_JTAG_INIT_FAILED;
{
LOG_ERROR("cannot set compatible 1284 mode to device");
return ERROR_JTAG_INIT_FAILED;
if (presto_flush() != ERROR_OK)
return -1;
if (presto_flush() != ERROR_OK)
return -1;
- if (presto->buff_in_pos<presto->buff_in_len)
+ if (presto->buff_in_pos < presto->buff_in_len)
return presto->buff_in[presto->buff_in_pos++];
return -1;
return presto->buff_in[presto->buff_in_pos++];
return -1;
}
/* delay with TCK low */
}
/* delay with TCK low */
- for (i = presto->jtag_speed; i>1; i--)
+ for (i = presto->jtag_speed; i > 1; i--)
presto_sendbyte(cmd);
cmd |= 0x04;
presto_sendbyte(cmd | (tdo_req ? 0x10 : 0));
/* delay with TCK high */
presto_sendbyte(cmd);
cmd |= 0x04;
presto_sendbyte(cmd | (tdo_req ? 0x10 : 0));
/* delay with TCK high */
- for (i = presto->jtag_speed; i>1; i--)
+ for (i = presto->jtag_speed; i > 1; i--)
presto_sendbyte(cmd);
presto->jtag_tck = 1;
presto_sendbyte(cmd);
presto->jtag_tck = 1;
script_debug(interp, "pathmove", argc, args);
int i;
script_debug(interp, "pathmove", argc, args);
int i;
- for (i = 0; i<argc-1; i++)
+ for (i = 0; i < argc-1; i++)
{
const char *cp;
cp = Jim_GetString( args[i + 1], NULL );
{
const char *cp;
cp = Jim_GetString( args[i + 1], NULL );
{
int i;
setCurrentState(state);
{
int i;
setCurrentState(state);
- for (i = 0; i<repeat; i++)
+ for (i = 0; i < repeat; i++)
#endif
#else
/* maximum debug version */
#endif
#else
/* maximum debug version */
- if ((repeat>0) && ((state == TAP_DRSHIFT)||(state == TAP_SI)))
+ if ((repeat > 0) && ((state == TAP_DRSHIFT)||(state == TAP_SI)))
{
int i;
/* sample shift register for every bit. */
{
int i;
/* sample shift register for every bit. */
- for (i = 0; i<repeat-1; i++)
+ for (i = 0; i < repeat-1; i++)
{
sampleShiftRegister();
ZY1000_POKE(ZY1000_JTAG_BASE + 0xc, value >> i);
{
sampleShiftRegister();
ZY1000_POKE(ZY1000_JTAG_BASE + 0xc, value >> i);
if (tap == target_tap)
{
int j;
if (tap == target_tap)
{
int j;
- for (j = 0; j<(num_fields-1); j++)
+ for (j = 0; j < (num_fields-1); j++)
{
shiftValueInner(TAP_DRSHIFT, TAP_DRSHIFT, num_bits[j], value[j]);
}
{
shiftValueInner(TAP_DRSHIFT, TAP_DRSHIFT, num_bits[j], value[j]);
}
- for (i = 0; i<1000; i++)
+ for (i = 0; i < 1000; i++)
{
// We don't want to sense our own reset, so we clear here.
// There is of course a timing hole where we could loose
{
// We don't want to sense our own reset, so we clear here.
// There is of course a timing hole where we could loose
if (i == 1000)
{
LOG_USER("SRST didn't deassert after %dms", i);
if (i == 1000)
{
LOG_USER("SRST didn't deassert after %dms", i);
{
LOG_USER("SRST took %dms to deassert", i);
}
{
LOG_USER("SRST took %dms to deassert", i);
}
// here we shuffle N bits out/in
j = 0;
// here we shuffle N bits out/in
j = 0;
{
tap_state_t pause_state;
int l;
k = num_bits-j;
pause_state = (shiftState == TAP_DRSHIFT)?TAP_DRSHIFT:TAP_IRSHIFT;
{
tap_state_t pause_state;
int l;
k = num_bits-j;
pause_state = (shiftState == TAP_DRSHIFT)?TAP_DRSHIFT:TAP_IRSHIFT;
{
k = 32;
/* we have more to shift out */
{
k = 32;
/* we have more to shift out */
value = 0;
if (fields[i].out_value != NULL)
{
value = 0;
if (fields[i].out_value != NULL)
{
- for (l = 0; l<k; l += 8)
+ for (l = 0; l < k; l += 8)
{
value|=fields[i].out_value[(j + l)/8]<<l;
}
{
value|=fields[i].out_value[(j + l)/8]<<l;
}
// we're shifting in data to MSB, shift data to be aligned for returning the value
value >>= 32-k;
// we're shifting in data to MSB, shift data to be aligned for returning the value
value >>= 32-k;
- for (l = 0; l<k; l += 8)
+ for (l = 0; l < k; l += 8)
{
inBuffer[(j + l)/8]=(value >> l)&0xff;
}
{
inBuffer[(j + l)/8]=(value >> l)&0xff;
}
/* execute num_cycles, 32 at the time. */
int i;
/* execute num_cycles, 32 at the time. */
int i;
- for (i = 0; i<num_cycles; i += 32)
+ for (i = 0; i < num_cycles; i += 32)
+ if (num_cycles-i < num)
got_data=&t;
*got_data = 0;
got_data=&t;
*got_data = 0;
- if (gdb_con->buf_cnt>0)
+ if (gdb_con->buf_cnt > 0)
{
*got_data = 1;
return ERROR_OK;
{
*got_data = 1;
return ERROR_OK;
/* This can typically be because a "monitor" command took too long
* before printing any progress messages
*/
/* This can typically be because a "monitor" command took too long
* before printing any progress messages
*/
{
return ERROR_GDB_TIMEOUT;
} else
{
return ERROR_GDB_TIMEOUT;
} else
return ERROR_GDB_BUFFER_TOO_SMALL;
hex_buffer[0] = 'O';
return ERROR_GDB_BUFFER_TOO_SMALL;
hex_buffer[0] = 'O';
- for (i = 0; i<bin_size; i++)
+ for (i = 0; i < bin_size; i++)
snprintf(hex_buffer + 1 + i*2, 3, "%2.2x", line[i]);
hex_buffer[bin_size*2 + 1] = 0;
snprintf(hex_buffer + 1 + i*2, 3, "%2.2x", line[i]);
hex_buffer[bin_size*2 + 1] = 0;
LOG_DEBUG("addr: 0x%8.8" PRIx32 ", len: 0x%8.8" PRIx32 "", addr, len);
LOG_DEBUG("addr: 0x%8.8" PRIx32 ", len: 0x%8.8" PRIx32 "", addr, len);
- for (i = 0; i<len; i++)
+ for (i = 0; i < len; i++)
{
uint32_t tmp;
sscanf(separator + 2*i, "%2" SCNx32 , &tmp);
{
uint32_t tmp;
sscanf(separator + 2*i, "%2" SCNx32 , &tmp);
if (b1->base == b2->base)
{
return 0;
if (b1->base == b2->base)
{
return 0;
- } else if (b1->base>b2->base)
+ } else if (b1->base > b2->base)
xml_printf(&retval, &buffer, &pos, &size,
"PacketSize=%x;qXfer:memory-map:read%c;qXfer:features:read-;QStartNoAckMode+",
xml_printf(&retval, &buffer, &pos, &size,
"PacketSize=%x;qXfer:memory-map:read%c;qXfer:features:read-;QStartNoAckMode+",
- (GDB_BUFFER_SIZE - 1), ((gdb_use_memory_map == 1) && (flash_get_bank_count()>0)) ? '+' : '-');
+ (GDB_BUFFER_SIZE - 1), ((gdb_use_memory_map == 1) && (flash_get_bank_count() > 0)) ? '+' : '-');
if (retval != ERROR_OK)
{
if (retval != ERROR_OK)
{
- else if (strstr(packet, "qXfer:memory-map:read::") && (flash_get_bank_count()>0))
+ else if (strstr(packet, "qXfer:memory-map:read::") && (flash_get_bank_count() > 0))
{
/* We get away with only specifying flash here. Regions that are not
* specified are treated as if we provided no memory map(if not we
{
/* We get away with only specifying flash here. Regions that are not
* specified are treated as if we provided no memory map(if not we
flash_bank_t **banks = malloc(sizeof(flash_bank_t *)*flash_get_bank_count());
int i;
flash_bank_t **banks = malloc(sizeof(flash_bank_t *)*flash_get_bank_count());
int i;
- for (i = 0; i<flash_get_bank_count(); i++)
+ for (i = 0; i < flash_get_bank_count(); i++)
{
p = get_flash_bank_by_num(i);
if (p == NULL)
{
p = get_flash_bank_by_num(i);
if (p == NULL)
qsort(banks, flash_get_bank_count(), sizeof(flash_bank_t *), compare_bank);
uint32_t ram_start = 0;
qsort(banks, flash_get_bank_count(), sizeof(flash_bank_t *), compare_bank);
uint32_t ram_start = 0;
- for (i = 0; i<flash_get_bank_count(); i++)
+ for (i = 0; i < flash_get_bank_count(); i++)
+ if (ram_start < p->base)
{
xml_printf(&retval, &xml, &pos, &size, "<memory type=\"ram\" start=\"0x%x\" length=\"0x%x\"/>\n",
ram_start, p->base-ram_start);
{
xml_printf(&retval, &xml, &pos, &size, "<memory type=\"ram\" start=\"0x%x\" length=\"0x%x\"/>\n",
ram_start, p->base-ram_start);
}
xml_printf(&retval, &xml, &pos, &size, \
}
xml_printf(&retval, &xml, &pos, &size, \
- "l<target version=\"1.0\">\n<architecture>arm</architecture>\n</target>\n");
+ "l < target version=\"1.0\">\n < architecture > arm</architecture>\n</target>\n");
if (retval != ERROR_OK)
{
if (retval != ERROR_OK)
{
#include <pthread.h>
#include <signal.h>
#include <pthread.h>
#include <signal.h>
-#define PAGE_NOT_FOUND "<html><head><title>File not found</title></head><body>File not found</body></html>"
+#define PAGE_NOT_FOUND "<html><head><title > File not found</title></head><body > File not found</body></html>"
int loadFile(const char *name, void **data, size_t *len);
int loadFile(const char *name, void **data, size_t *len);
t = appendf(t, "Runtime error, file \"%s\", line %d:<br>",
interp->errorFileName, interp->errorLine);
t = appendf(t, "Runtime error, file \"%s\", line %d:<br>",
interp->errorFileName, interp->errorLine);
- t = appendf(t, " %s<br>", Jim_GetString(interp->result, NULL));
+ t = appendf(t, " %s < br>", Jim_GetString(interp->result, NULL));
Jim_ListLength(interp, interp->stackTrace, &len);
for (i = 0; i < len; i += 3)
{
Jim_ListLength(interp, interp->stackTrace, &len);
for (i = 0; i < len; i += 3)
{
file = Jim_GetString(objPtr, NULL);
Jim_ListIndex(interp, interp->stackTrace, i + 2, &objPtr, JIM_NONE);
line = Jim_GetString(objPtr, NULL);
file = Jim_GetString(objPtr, NULL);
Jim_ListIndex(interp, interp->stackTrace, i + 2, &objPtr, JIM_NONE);
line = Jim_GetString(objPtr, NULL);
- t = appendf(t, "In procedure '%s' called at file \"%s\", line %s<br>",
+ t = appendf(t, "In procedure '%s' called at file \"%s\", line %s < br>",
proc, file, line);
}
t = appendf(t, "</html></body>\n");
proc, file, line);
}
t = appendf(t, "</html></body>\n");
/* clear the command line */
telnet_write(connection, "\r", 1);
/* clear the command line */
telnet_write(connection, "\r", 1);
- for (i = strlen(t_con->prompt) + t_con->line_size; i>0; i -= 16)
- telnet_write(connection, " ", i>16 ? 16 : i);
+ for (i = strlen(t_con->prompt) + t_con->line_size; i > 0; i -= 16)
+ telnet_write(connection, " ", i > 16 ? 16 : i);
telnet_write(connection, "\r", 1);
/* output the message */
telnet_write(connection, "\r", 1);
/* output the message */
/* put the command line to its previous state */
telnet_prompt(connection);
telnet_write(connection, t_con->line, t_con->line_size);
/* put the command line to its previous state */
telnet_prompt(connection);
telnet_write(connection, t_con->line, t_con->line_size);
- for (i = t_con->line_size; i>t_con->line_cursor; i--)
+ for (i = t_con->line_size; i > t_con->line_cursor; i--)
telnet_write(connection, "\b", 1);
}
telnet_write(connection, "\b", 1);
}
* \param arm11 Target state variable.
* \param num_bits Length of the data field
* \param out_data pointer to the data that will be sent out
* \param arm11 Target state variable.
* \param num_bits Length of the data field
* \param out_data pointer to the data that will be sent out
- * <em>(data is read when it is added to the JTAG queue)</em>
+ * <em > (data is read when it is added to the JTAG queue)</em>
* \param in_data pointer to the memory that will receive data that was clocked in
* \param in_data pointer to the memory that will receive data that was clocked in
- * <em>(data is written when the JTAG queue is executed)</em>
+ * <em > (data is written when the JTAG queue is executed)</em>
* \param field target data structure that will be initialized
*/
void arm11_setup_field(arm11_common_t * arm11, int num_bits, void * out_data, void * in_data, scan_field_t * field)
* \param field target data structure that will be initialized
*/
void arm11_setup_field(arm11_common_t * arm11, int num_bits, void * out_data, void * in_data, scan_field_t * field)
long long then = timeval_ms();
int timeout;
long long then = timeval_ms();
int timeout;
- while (!(timeout = ((timeval_ms()-then)>1000)))
+ while (!(timeout = ((timeval_ms()-then) > 1000)))
{
if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0)
{
{
if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0)
{
long long then = timeval_ms();
int timeout;
long long then = timeval_ms();
int timeout;
- while (!(timeout = ((timeval_ms()-then)>1000)))
+ while (!(timeout = ((timeval_ms()-then) > 1000)))
{
/* read debug status register */
embeddedice_read_reg(dbg_stat);
{
/* read debug status register */
embeddedice_read_reg(dbg_stat);
* what happens:
*
* <table>
* what happens:
*
* <table>
- * <tr><th>State</th><th>Action</th></tr>
- * <tr><td>TARGET_RUNNING | TARGET_RESET</td><td>Enters debug mode. If TARGET_RESET, pc may be checked</td></tr>
- * <tr><td>TARGET_UNKNOWN</td><td>Warning is logged</td></tr>
- * <tr><td>TARGET_DEBUG_RUNNING</td><td>Enters debug mode</td></tr>
- * <tr><td>TARGET_HALTED</td><td>Nothing</td></tr>
+ * <tr><th > State</th><th > Action</th></tr>
+ * <tr><td > TARGET_RUNNING | TARGET_RESET</td><td > Enters debug mode. If TARGET_RESET, pc may be checked</td></tr>
+ * <tr><td > TARGET_UNKNOWN</td><td > Warning is logged</td></tr>
+ * <tr><td > TARGET_DEBUG_RUNNING</td><td > Enters debug mode</td></tr>
+ * <tr><td > TARGET_HALTED</td><td > Nothing</td></tr>
* </table>
*
* If the target does not end up in the halted state, a warning is produced. If
* </table>
*
* If the target does not end up in the halted state, a warning is produced. If
long long then = timeval_ms();
int timeout;
long long then = timeval_ms();
int timeout;
- while (!(timeout = ((timeval_ms()-then)>1000)))
+ while (!(timeout = ((timeval_ms()-then) > 1000)))
{
if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) != 0)
break;
{
if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) != 0)
break;
int little = target->endianness == TARGET_LITTLE_ENDIAN;
int count = dcc_count;
uint8_t *buffer = dcc_buffer;
int little = target->endianness == TARGET_LITTLE_ENDIAN;
int count = dcc_count;
uint8_t *buffer = dcc_buffer;
{
/* Handle first & last using standard embeddedice_write_reg and the middle ones w/the
* core function repeated. */
{
/* Handle first & last using standard embeddedice_write_reg and the middle ones w/the
* core function repeated. */
long long then = timeval_ms();
int timeout;
long long then = timeval_ms();
int timeout;
- while (!(timeout = ((timeval_ms()-then)>1000)))
+ while (!(timeout = ((timeval_ms()-then) > 1000)))
{
if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0)
{
{
if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0)
{
long long then = timeval_ms();
int timeout;
long long then = timeval_ms();
int timeout;
- while (!(timeout = ((timeval_ms()-then)>1000)))
+ while (!(timeout = ((timeval_ms()-then) > 1000)))
{
if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0)
{
{
if (buf_get_u32(dbg_stat->value, EICE_DBG_STATUS_DBGACK, 1) == 0)
{
command_print(cmd_ctx, "\t\tEnd of ROM table");
}
entry_offset += 4;
command_print(cmd_ctx, "\t\tEnd of ROM table");
}
entry_offset += 4;
+ } while (romentry > 0);
int x = (opcode & 0x20) >> 5;
int y = (opcode & 0x40) >> 6;
int x = (opcode & 0x20) >> 5;
int y = (opcode & 0x40) >> 6;
if ((opcode & 0x00600000) == 0x00000000)
{
uint8_t Rd, Rm, Rs, Rn;
if ((opcode & 0x00600000) == 0x00000000)
{
uint8_t Rd, Rm, Rs, Rn;
if ((opcode & 0x00600000) == 0x00400000)
{
uint8_t RdLow, RdHi, Rm, Rs;
if ((opcode & 0x00600000) == 0x00400000)
{
uint8_t RdLow, RdHi, Rm, Rs;
if (((opcode & 0x00600000) == 0x00100000) && (x == 0))
{
uint8_t Rd, Rm, Rs, Rn;
if (((opcode & 0x00600000) == 0x00100000) && (x == 0))
{
uint8_t Rd, Rm, Rs, Rn;
if ((opcode & 0x00600000) == 0x00300000)
{
uint8_t Rd, Rm, Rs;
if ((opcode & 0x00600000) == 0x00300000)
{
uint8_t Rd, Rm, Rs;
if (((opcode & 0x00600000) == 0x00100000) && (x == 1))
{
uint8_t Rd, Rm, Rs;
if (((opcode & 0x00600000) == 0x00100000) && (x == 1))
{
uint8_t Rd, Rm, Rs;
if (reg_list & (1 << i))
reg_names_p += snprintf(reg_names_p, (reg_names + 40 - reg_names_p), "r%i, ", i);
}
if (reg_list & (1 << i))
reg_names_p += snprintf(reg_names_p, (reg_names + 40 - reg_names_p), "r%i, ", i);
}
- if (reg_names_p>reg_names)
+ if (reg_names_p > reg_names)
reg_names_p[-2] = '\0';
else /* invalid op : no registers */
reg_names[0] = '\0';
reg_names_p[-2] = '\0';
else /* invalid op : no registers */
reg_names[0] = '\0';
/* count useful segments (loadable), ignore BSS section */
image->num_sections = 0;
/* count useful segments (loadable), ignore BSS section */
image->num_sections = 0;
- for (i = 0;i<elf->segment_count;i++)
+ for (i = 0;i < elf->segment_count;i++)
if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0))
image->num_sections++;
/* alloc and fill sections array with loadable segments */
image->sections = malloc(image->num_sections * sizeof(image_section_t));
if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0))
image->num_sections++;
/* alloc and fill sections array with loadable segments */
image->sections = malloc(image->num_sections * sizeof(image_section_t));
- for (i = 0,j = 0;i<elf->segment_count;i++)
+ for (i = 0,j = 0;i < elf->segment_count;i++)
{
if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0))
{
{
if ((field32(elf, elf->segments[i].p_type) == PT_LOAD) && (field32(elf, elf->segments[i].p_filesz) != 0))
{
LOG_DEBUG("load segment %d at 0x%" PRIx32 " (sz = 0x%" PRIx32 ")",section,offset,size);
/* read initialized data in current segment if any */
LOG_DEBUG("load segment %d at 0x%" PRIx32 " (sz = 0x%" PRIx32 ")",section,offset,size);
/* read initialized data in current segment if any */
- if (offset<field32(elf,segment->p_filesz))
+ if (offset < field32(elf,segment->p_filesz))
{
/* maximal size present in file for the current segment */
read_size = MIN(size, field32(elf,segment->p_filesz)-offset);
{
/* maximal size present in file for the current segment */
read_size = MIN(size, field32(elf,segment->p_filesz)-offset);
- for (i = 0; i<count; i++) {
+ for (i = 0; i < count; i++) {
if ((retval = ejtag_dma_read(ejtag_info, addr + i*sizeof(*buf), &buf[i])) != ERROR_OK)
return retval;
}
if ((retval = ejtag_dma_read(ejtag_info, addr + i*sizeof(*buf), &buf[i])) != ERROR_OK)
return retval;
}
- for (i = 0; i<count; i++) {
+ for (i = 0; i < count; i++) {
if ((retval = ejtag_dma_read_h(ejtag_info, addr + i*sizeof(*buf), &buf[i])) != ERROR_OK)
return retval;
}
if ((retval = ejtag_dma_read_h(ejtag_info, addr + i*sizeof(*buf), &buf[i])) != ERROR_OK)
return retval;
}
- for (i = 0; i<count; i++) {
+ for (i = 0; i < count; i++) {
if ((retval = ejtag_dma_read_b(ejtag_info, addr + i*sizeof(*buf), &buf[i])) != ERROR_OK)
return retval;
}
if ((retval = ejtag_dma_read_b(ejtag_info, addr + i*sizeof(*buf), &buf[i])) != ERROR_OK)
return retval;
}
- for (i = 0; i<count; i++) {
+ for (i = 0; i < count; i++) {
if ((retval = ejtag_dma_write(ejtag_info, addr + i*sizeof(*buf), buf[i])) != ERROR_OK)
return retval;
}
if ((retval = ejtag_dma_write(ejtag_info, addr + i*sizeof(*buf), buf[i])) != ERROR_OK)
return retval;
}
- for (i = 0; i<count; i++) {
+ for (i = 0; i < count; i++) {
if ((retval = ejtag_dma_write_h(ejtag_info, addr + i*sizeof(*buf), buf[i])) != ERROR_OK)
return retval;
}
if ((retval = ejtag_dma_write_h(ejtag_info, addr + i*sizeof(*buf), buf[i])) != ERROR_OK)
return retval;
}
- for (i = 0; i<count; i++) {
+ for (i = 0; i < count; i++) {
if ((retval = ejtag_dma_write_b(ejtag_info, addr + i*sizeof(*buf), buf[i])) != ERROR_OK)
return retval;
}
if ((retval = ejtag_dma_write_b(ejtag_info, addr + i*sizeof(*buf), buf[i])) != ERROR_OK)
return retval;
}
Jim_Nvp_value2name_simple(nvp_target_state,state)->name);
}
Jim_Nvp_value2name_simple(nvp_target_state,state)->name);
}
{
LOG_ERROR("timed out while waiting for target %s",
Jim_Nvp_value2name_simple(nvp_target_state,state)->name);
{
LOG_ERROR("timed out while waiting for target %s",
Jim_Nvp_value2name_simple(nvp_target_state,state)->name);
/* DANGER!!! beware of unsigned comparision here!!! */
if ((image.sections[i].base_address + buf_cnt >= min_address)&&
/* DANGER!!! beware of unsigned comparision here!!! */
if ((image.sections[i].base_address + buf_cnt >= min_address)&&
- (image.sections[i].base_address<max_address))
+ (image.sections[i].base_address < max_address))
- if (image.sections[i].base_address<min_address)
+ if (image.sections[i].base_address < min_address)
{
/* clip addresses below */
offset += min_address-image.sections[i].base_address;
length -= offset;
}
{
/* clip addresses below */
offset += min_address-image.sections[i].base_address;
length -= offset;
}
- if (image.sections[i].base_address + buf_cnt>max_address)
+ if (image.sections[i].base_address + buf_cnt > max_address)
{
length -= (image.sections[i].base_address + buf_cnt)-max_address;
}
{
length -= (image.sections[i].base_address + buf_cnt)-max_address;
}
static void writeLong(FILE *f, int l)
{
int i;
static void writeLong(FILE *f, int l)
{
int i;
+ for (i = 0; i < 4; i++)
{
char c = (l >> (i*8))&0xff;
writeData(f, &c, 1);
{
char c = (l >> (i*8))&0xff;
writeData(f, &c, 1);
/* figure out bucket size */
uint32_t min = samples[0];
uint32_t max = samples[0];
/* figure out bucket size */
uint32_t min = samples[0];
uint32_t max = samples[0];
- for (i = 0; i<sampleNum; i++)
+ for (i = 0; i < sampleNum; i++)
return;
}
memset(buckets, 0, sizeof(int)*length);
return;
}
memset(buckets, 0, sizeof(int)*length);
- for (i = 0; i<sampleNum;i++)
+ for (i = 0; i < sampleNum;i++)
{
uint32_t address = samples[i];
long long a = address-min;
{
uint32_t address = samples[i];
long long a = address-min;
writeLong(f, length); /* # of samples */
writeLong(f, 64000000); /* 64MHz */
writeString(f, "seconds");
writeLong(f, length); /* # of samples */
writeLong(f, 64000000); /* 64MHz */
writeString(f, "seconds");
- for (i = 0; i<(15-strlen("seconds")); i++)
+ for (i = 0; i < (15-strlen("seconds")); i++)
writeData(f, &zero, 1);
writeString(f, "s");
writeData(f, &zero, 1);
writeString(f, "s");
char *data = malloc(2*length);
if (data != NULL)
{
char *data = malloc(2*length);
if (data != NULL)
{
- for (i = 0; i<length;i++)
+ for (i = 0; i < length;i++)
{
int val;
val = buckets[i];
{
int val;
val = buckets[i];
if (fastload != NULL)
{
int i;
if (fastload != NULL)
{
int i;
- for (i = 0; i<fastload_num; i++)
+ for (i = 0; i < fastload_num; i++)
{
if (fastload[i].data)
free(fastload[i].data);
{
if (fastload[i].data)
free(fastload[i].data);
/* DANGER!!! beware of unsigned comparision here!!! */
if ((image.sections[i].base_address + buf_cnt >= min_address)&&
/* DANGER!!! beware of unsigned comparision here!!! */
if ((image.sections[i].base_address + buf_cnt >= min_address)&&
- (image.sections[i].base_address<max_address))
+ (image.sections[i].base_address < max_address))
- if (image.sections[i].base_address<min_address)
+ if (image.sections[i].base_address < min_address)
{
/* clip addresses below */
offset += min_address-image.sections[i].base_address;
length -= offset;
}
{
/* clip addresses below */
offset += min_address-image.sections[i].base_address;
length -= offset;
}
- if (image.sections[i].base_address + buf_cnt>max_address)
+ if (image.sections[i].base_address + buf_cnt > max_address)
{
length -= (image.sections[i].base_address + buf_cnt)-max_address;
}
{
length -= (image.sections[i].base_address + buf_cnt)-max_address;
}
static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
{
return ERROR_COMMAND_SYNTAX_ERROR;
if (fastload == NULL)
{
return ERROR_COMMAND_SYNTAX_ERROR;
if (fastload == NULL)
{
int ms = timeval_ms();
int size = 0;
int retval = ERROR_OK;
int ms = timeval_ms();
int size = 0;
int retval = ERROR_OK;
- for (i = 0; i<fastload_num;i++)
+ for (i = 0; i < fastload_num;i++)
{
target_t *target = get_current_target(cmd_ctx);
command_print(cmd_ctx, "Write to 0x%08x, length 0x%08x",
{
target_t *target = get_current_target(cmd_ctx);
command_print(cmd_ctx, "Write to 0x%08x, length 0x%08x",
LOG_DEBUG("%s %d", op_name, xsdrsize);
LOG_DEBUG("%s %d", op_name, xsdrsize);
- for ( attempt = 0; attempt<limit; ++attempt )
+ for ( attempt = 0; attempt < limit; ++attempt )
{
/* perform the XC9500 exception handling sequence shown in xapp067.pdf and
illustrated in psuedo code at end of this file. We start from state
{
/* perform the XC9500 exception handling sequence shown in xapp067.pdf and
illustrated in psuedo code at end of this file. We start from state
if (limit < 1)
limit = 1;
if (limit < 1)
limit = 1;
- for ( attempt = 0; attempt<limit; ++attempt )
+ for ( attempt = 0; attempt < limit; ++attempt )
- for (i = 0; i<1000; i++)
+ for (i = 0; i < 1000; i++)
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)