forked from auracaster/openocd
- Fixes '[<>]' whitespace
- 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
This commit is contained in:
@@ -75,9 +75,9 @@ int arm11_add_dr_scan_vc(int num_fields, scan_field_t *fields, tap_state_t state
|
||||
* \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
|
||||
* <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)
|
||||
|
||||
@@ -375,7 +375,7 @@ int arm720t_soft_reset_halt(struct target_s *target)
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -702,7 +702,7 @@ int arm7_9_execute_sys_speed(struct target_s *target)
|
||||
|
||||
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);
|
||||
@@ -862,11 +862,11 @@ int arm7_9_handle_target_request(void *priv)
|
||||
* 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
|
||||
@@ -1152,7 +1152,7 @@ int arm7_9_soft_reset_halt(struct target_s *target)
|
||||
|
||||
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;
|
||||
@@ -2582,7 +2582,7 @@ static int arm7_9_dcc_completion(struct target_s *target, uint32_t exit_point, i
|
||||
int little = target->endianness == TARGET_LITTLE_ENDIAN;
|
||||
int count = dcc_count;
|
||||
uint8_t *buffer = dcc_buffer;
|
||||
if (count>2)
|
||||
if (count > 2)
|
||||
{
|
||||
/* Handle first & last using standard embeddedice_write_reg and the middle ones w/the
|
||||
* core function repeated. */
|
||||
|
||||
@@ -574,7 +574,7 @@ int arm920t_soft_reset_halt(struct target_s *target)
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -574,7 +574,7 @@ int arm926ejs_soft_reset_halt(struct target_s *target)
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -1118,7 +1118,7 @@ int dap_info_command(struct command_context_s *cmd_ctx, swjdp_common_t *swjdp, i
|
||||
command_print(cmd_ctx, "\t\tEnd of ROM table");
|
||||
}
|
||||
entry_offset += 4;
|
||||
} while (romentry>0);
|
||||
} while (romentry > 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -891,7 +891,7 @@ int evaluate_misc_instr(uint32_t opcode, uint32_t address, arm_instruction_t *in
|
||||
int x = (opcode & 0x20) >> 5;
|
||||
int y = (opcode & 0x40) >> 6;
|
||||
|
||||
/* SMLA<x><y> */
|
||||
/* SMLA < x><y> */
|
||||
if ((opcode & 0x00600000) == 0x00000000)
|
||||
{
|
||||
uint8_t Rd, Rm, Rs, Rn;
|
||||
@@ -906,7 +906,7 @@ int evaluate_misc_instr(uint32_t opcode, uint32_t address, arm_instruction_t *in
|
||||
Rd, Rm, Rs, Rn);
|
||||
}
|
||||
|
||||
/* SMLAL<x><y> */
|
||||
/* SMLAL < x><y> */
|
||||
if ((opcode & 0x00600000) == 0x00400000)
|
||||
{
|
||||
uint8_t RdLow, RdHi, Rm, Rs;
|
||||
@@ -921,7 +921,7 @@ int evaluate_misc_instr(uint32_t opcode, uint32_t address, arm_instruction_t *in
|
||||
RdLow, RdHi, Rm, Rs);
|
||||
}
|
||||
|
||||
/* SMLAW<y> */
|
||||
/* SMLAW < y> */
|
||||
if (((opcode & 0x00600000) == 0x00100000) && (x == 0))
|
||||
{
|
||||
uint8_t Rd, Rm, Rs, Rn;
|
||||
@@ -936,7 +936,7 @@ int evaluate_misc_instr(uint32_t opcode, uint32_t address, arm_instruction_t *in
|
||||
Rd, Rm, Rs, Rn);
|
||||
}
|
||||
|
||||
/* SMUL<x><y> */
|
||||
/* SMUL < x><y> */
|
||||
if ((opcode & 0x00600000) == 0x00300000)
|
||||
{
|
||||
uint8_t Rd, Rm, Rs;
|
||||
@@ -950,7 +950,7 @@ int evaluate_misc_instr(uint32_t opcode, uint32_t address, arm_instruction_t *in
|
||||
Rd, Rm, Rs);
|
||||
}
|
||||
|
||||
/* SMULW<y> */
|
||||
/* SMULW < y> */
|
||||
if (((opcode & 0x00600000) == 0x00100000) && (x == 1))
|
||||
{
|
||||
uint8_t Rd, Rm, Rs;
|
||||
@@ -1922,7 +1922,7 @@ int evaluate_load_store_multiple_thumb(uint16_t opcode, uint32_t address, arm_in
|
||||
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';
|
||||
|
||||
@@ -414,12 +414,12 @@ static int image_elf_read_headers(image_t *image)
|
||||
|
||||
/* 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));
|
||||
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))
|
||||
{
|
||||
@@ -449,7 +449,7 @@ static int image_elf_read_section(image_t *image, int section, uint32_t offset,
|
||||
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);
|
||||
@@ -1015,10 +1015,10 @@ int image_calculate_checksum(uint8_t* buffer, uint32_t nbytes, uint32_t* checksu
|
||||
crc32_table[i] = c;
|
||||
}
|
||||
|
||||
while (nbytes>0)
|
||||
while (nbytes > 0)
|
||||
{
|
||||
int run = nbytes;
|
||||
if (run>32768)
|
||||
if (run > 32768)
|
||||
{
|
||||
run = 32768;
|
||||
}
|
||||
|
||||
@@ -369,7 +369,7 @@ int mips32_dmaacc_read_mem32(mips_ejtag_t *ejtag_info, uint32_t addr, int count,
|
||||
int i;
|
||||
int retval;
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -382,7 +382,7 @@ int mips32_dmaacc_read_mem16(mips_ejtag_t *ejtag_info, uint32_t addr, int count,
|
||||
int i;
|
||||
int 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;
|
||||
}
|
||||
@@ -395,7 +395,7 @@ int mips32_dmaacc_read_mem8(mips_ejtag_t *ejtag_info, uint32_t addr, int count,
|
||||
int i;
|
||||
int 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;
|
||||
}
|
||||
@@ -423,7 +423,7 @@ int mips32_dmaacc_write_mem32(mips_ejtag_t *ejtag_info, uint32_t addr, int count
|
||||
int i;
|
||||
int 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;
|
||||
}
|
||||
@@ -436,7 +436,7 @@ int mips32_dmaacc_write_mem16(mips_ejtag_t *ejtag_info, uint32_t addr, int count
|
||||
int i;
|
||||
int 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;
|
||||
}
|
||||
@@ -449,7 +449,7 @@ int mips32_dmaacc_write_mem8(mips_ejtag_t *ejtag_info, uint32_t addr, int count,
|
||||
int i;
|
||||
int 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;
|
||||
}
|
||||
|
||||
@@ -1924,12 +1924,12 @@ int target_wait_state(target_t *target, enum target_state state, int ms)
|
||||
Jim_Nvp_value2name_simple(nvp_target_state,state)->name);
|
||||
}
|
||||
|
||||
if (cur-then>500)
|
||||
if (cur-then > 500)
|
||||
{
|
||||
keep_alive();
|
||||
}
|
||||
|
||||
if ((cur-then)>ms)
|
||||
if ((cur-then) > ms)
|
||||
{
|
||||
LOG_ERROR("timed out while waiting for target %s",
|
||||
Jim_Nvp_value2name_simple(nvp_target_state,state)->name);
|
||||
@@ -2280,16 +2280,16 @@ static int handle_load_image_command(struct command_context_s *cmd_ctx, char *cm
|
||||
/* 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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -2790,7 +2790,7 @@ static void writeData(FILE *f, const void *data, size_t len)
|
||||
static void writeLong(FILE *f, int l)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i<4; i++)
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
char c = (l >> (i*8))&0xff;
|
||||
writeData(f, &c, 1);
|
||||
@@ -2822,13 +2822,13 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, char *filename)
|
||||
/* 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++)
|
||||
{
|
||||
if (min>samples[i])
|
||||
if (min > samples[i])
|
||||
{
|
||||
min = samples[i];
|
||||
}
|
||||
if (max<samples[i])
|
||||
if (max < samples[i])
|
||||
{
|
||||
max = samples[i];
|
||||
}
|
||||
@@ -2849,7 +2849,7 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, char *filename)
|
||||
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;
|
||||
@@ -2865,7 +2865,7 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, char *filename)
|
||||
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");
|
||||
|
||||
@@ -2874,11 +2874,11 @@ static void writeGmon(uint32_t *samples, uint32_t sampleNum, char *filename)
|
||||
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];
|
||||
if (val>65535)
|
||||
if (val > 65535)
|
||||
{
|
||||
val = 65535;
|
||||
}
|
||||
@@ -4389,7 +4389,7 @@ static void free_fastload(void)
|
||||
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);
|
||||
@@ -4461,16 +4461,16 @@ static int handle_fast_load_image_command(struct command_context_s *cmd_ctx, cha
|
||||
/* 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;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -4514,7 +4514,7 @@ static int handle_fast_load_image_command(struct command_context_s *cmd_ctx, cha
|
||||
|
||||
static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
|
||||
{
|
||||
if (argc>0)
|
||||
if (argc > 0)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
if (fastload == NULL)
|
||||
{
|
||||
@@ -4525,7 +4525,7 @@ static int handle_fast_load_command(struct command_context_s *cmd_ctx, char *cmd
|
||||
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",
|
||||
|
||||
Reference in New Issue
Block a user