You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(16) |
Sep
|
Oct
|
Nov
|
Dec
|
From: <zw...@ma...> - 2009-06-24 00:37:18
|
Author: zwelch Date: 2009-06-24 00:36:56 +0200 (Wed, 24 Jun 2009) New Revision: 2359 Modified: trunk/src/flash/cfi.c trunk/src/flash/ecos.c trunk/src/flash/flash.c trunk/src/flash/mflash.c trunk/src/flash/stm32x.c trunk/src/helper/jim.c trunk/src/helper/jim.h trunk/src/jtag/interface.c trunk/src/jtag/rlink/rlink.c trunk/src/jtag/tcl.c trunk/src/jtag/vsllink.c trunk/src/server/gdb_server.c trunk/src/svf/svf.c trunk/src/target/arm_disassembler.c trunk/src/target/image.c trunk/src/target/mips_m4k.c trunk/src/target/target.c trunk/src/target/xscale.c trunk/src/xsvf/xsvf.c Log: - Replace 'switch(' with 'switch ('. Modified: trunk/src/flash/cfi.c =================================================================== --- trunk/src/flash/cfi.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/flash/cfi.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -806,7 +806,7 @@ if (cfi_info->qry[0] != 'Q') return ERROR_FLASH_BANK_NOT_PROBED; - switch(cfi_info->pri_id) + switch (cfi_info->pri_id) { case 1: case 3: @@ -958,7 +958,7 @@ if (cfi_info->qry[0] != 'Q') return ERROR_FLASH_BANK_NOT_PROBED; - switch(cfi_info->pri_id) + switch (cfi_info->pri_id) { case 1: case 3: @@ -1601,7 +1601,7 @@ bank->base, address, cfi_info->max_buf_write_size); return ERROR_FLASH_OPERATION_FAILED; } - switch(bank->chip_width) + switch (bank->chip_width) { case 4 : bufferwsize = buffersize / 4; break; case 2 : bufferwsize = buffersize / 2; break; @@ -1740,7 +1740,7 @@ LOG_ERROR("Write address at base 0x%" PRIx32 ", address %" PRIx32 " not aligned to 2^%d boundary", bank->base, address, cfi_info->max_buf_write_size); return ERROR_FLASH_OPERATION_FAILED; } - switch(bank->chip_width) + switch (bank->chip_width) { case 4 : bufferwsize = buffersize / 4; break; case 2 : bufferwsize = buffersize / 2; break; @@ -1817,7 +1817,7 @@ { cfi_flash_bank_t *cfi_info = bank->driver_priv; - switch(cfi_info->pri_id) + switch (cfi_info->pri_id) { case 1: case 3: @@ -1838,7 +1838,7 @@ { cfi_flash_bank_t *cfi_info = bank->driver_priv; - switch(cfi_info->pri_id) + switch (cfi_info->pri_id) { case 1: case 3: @@ -1927,7 +1927,7 @@ /* handle blocks of bus_size aligned bytes */ blk_count = count & ~(bank->bus_width - 1); /* round down, leave tail bytes */ - switch(cfi_info->pri_id) + switch (cfi_info->pri_id) { /* try block writes (fails without working area) */ case 1: @@ -1958,7 +1958,7 @@ uint32_t buffermask = buffersize-1; uint32_t bufferwsize; - switch(bank->chip_width) + switch (bank->chip_width) { case 4 : bufferwsize = buffersize / 4; break; case 2 : bufferwsize = buffersize / 2; break; @@ -2293,7 +2293,7 @@ /* We need to read the primary algorithm extended query table before calculating * the sector layout to be able to apply fixups */ - switch(cfi_info->pri_id) + switch (cfi_info->pri_id) { /* Intel command set (standard and extended) */ case 0x0001: @@ -2326,7 +2326,7 @@ } /* end CFI case */ /* apply fixups depending on the primary command set */ - switch(cfi_info->pri_id) + switch (cfi_info->pri_id) { /* Intel command set (standard and extended) */ case 0x0001: @@ -2490,7 +2490,7 @@ if (cfi_info->qry[0] != 'Q') return ERROR_FLASH_BANK_NOT_PROBED; - switch(cfi_info->pri_id) + switch (cfi_info->pri_id) { case 1: case 3: @@ -2567,7 +2567,7 @@ buf += printed; buf_size -= printed; - switch(cfi_info->pri_id) + switch (cfi_info->pri_id) { case 1: case 3: Modified: trunk/src/flash/ecos.c =================================================================== --- trunk/src/flash/ecos.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/flash/ecos.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -392,7 +392,7 @@ static uint32_t ecosflash_address(struct flash_bank_s *bank, uint32_t address) { uint32_t retval = 0; - switch(bank->bus_width) + switch (bank->bus_width) { case 4: retval = address & 0xfffffffc; Modified: trunk/src/flash/flash.c =================================================================== --- trunk/src/flash/flash.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/flash/flash.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -751,7 +751,7 @@ if (count == 0) return ERROR_OK; - switch(cmd[4]) + switch (cmd[4]) { case 'w': wordsize=4; @@ -767,7 +767,7 @@ } chunk_count = MIN(count, (1024 / wordsize)); - switch(wordsize) + switch (wordsize) { case 4: for(i = 0; i < chunk_count; i++) Modified: trunk/src/flash/mflash.c =================================================================== --- trunk/src/flash/mflash.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/flash/mflash.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -232,7 +232,7 @@ if (wait == mg_io_wait_bsy) return ERROR_OK; } else { - switch(wait) + switch (wait) { case mg_io_wait_not_bsy: return ERROR_OK; Modified: trunk/src/flash/stm32x.c =================================================================== --- trunk/src/flash/stm32x.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/flash/stm32x.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -848,7 +848,7 @@ buf += printed; buf_size -= printed; - switch(device_id >> 16) + switch (device_id >> 16) { case 0x0000: snprintf(buf, buf_size, "A"); @@ -877,7 +877,7 @@ buf += printed; buf_size -= printed; - switch(device_id >> 16) + switch (device_id >> 16) { case 0x1000: snprintf(buf, buf_size, "A"); @@ -894,7 +894,7 @@ buf += printed; buf_size -= printed; - switch(device_id >> 16) + switch (device_id >> 16) { case 0x1000: snprintf(buf, buf_size, "A"); @@ -915,7 +915,7 @@ buf += printed; buf_size -= printed; - switch(device_id >> 16) + switch (device_id >> 16) { case 0x1000: snprintf(buf, buf_size, "A"); Modified: trunk/src/helper/jim.c =================================================================== --- trunk/src/helper/jim.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/helper/jim.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -246,7 +246,7 @@ const char *string, int stringLen, int nocase) { while (patternLen) { - switch(pattern[0]) { + switch (pattern[0]) { case '*': while (pattern[1] == '*') { pattern++; @@ -1189,7 +1189,7 @@ pc->eof = 1; return JIM_OK; } - switch(*(pc->p)) { + switch (*(pc->p)) { case '\\': if (*(pc->p+1) == '\n') return JimParseSep(pc); @@ -1427,7 +1427,7 @@ pc->tt = JIM_TT_ESC; return JIM_OK; } - switch(*pc->p) { + switch (*pc->p) { case '\\': if (pc->state == JIM_PS_DEF && *(pc->p+1) == '\n') { @@ -1518,9 +1518,9 @@ slen = strlen(s); for (i = 0; i < slen; i++) { - switch(s[i]) { + switch (s[i]) { case '\\': - switch(s[i+1]) { + switch (s[i+1]) { case 'a': *p++ = 0x7; i++; break; case 'b': *p++ = 0x8; i++; break; case 'f': *p++ = 0xc; i++; break; @@ -1709,7 +1709,7 @@ pc->eof = 1; return JIM_OK; } - switch(*pc->p) { + switch (*pc->p) { case ' ': case '\n': case '\t': @@ -1757,7 +1757,7 @@ pc->tt = JIM_TT_ESC; return JIM_OK; } - switch(*pc->p) { + switch (*pc->p) { case '\\': pc->p++; pc->len--; break; @@ -2286,7 +2286,7 @@ if ( fmtLen <= 0 ){ break; } - switch( *fmt ){ + switch ( *fmt ){ /* terminals */ case 'b': /* binary - not all printfs() do this */ case 's': /* string */ @@ -2436,7 +2436,7 @@ /* here we do the work */ /* actually - we make sprintf() do it for us */ - switch(*fmt) { + switch (*fmt) { case 's': *cp++ = 's'; *cp = 0; @@ -5030,7 +5030,7 @@ goto testbrace; } for (i = 0; i < len; i++) { - switch(s[i]) { + switch (s[i]) { case ' ': case '$': case '"': @@ -5057,7 +5057,7 @@ s[len-1] == ']') return JIM_ELESTR_QUOTE; level = 0; for (i = 0; i < len; i++) { - switch(s[i]) { + switch (s[i]) { case '{': level++; break; case '}': level--; if (level < 0) return JIM_ELESTR_QUOTE; @@ -5073,7 +5073,7 @@ if (level == 0) { if (!trySimple) return JIM_ELESTR_BRACE; for (i = 0; i < len; i++) { - switch(s[i]) { + switch (s[i]) { case ' ': case '$': case '"': @@ -5164,7 +5164,7 @@ const char *strRep = Jim_GetString(ele[i], &len); char *q; - switch(quotingType[i]) { + switch (quotingType[i]) { case JIM_ELESTR_SIMPLE: memcpy(p, strRep, len); p += len; @@ -5739,7 +5739,7 @@ const char *strRep = Jim_GetString(objv[i], &len); char *q; - switch(quotingType[i]) { + switch (quotingType[i]) { case JIM_ELESTR_SIMPLE: memcpy(p, strRep, len); p += len; @@ -6291,7 +6291,7 @@ pc->eof = 1; return JIM_OK; } - switch(*(pc->p)) { + switch (*(pc->p)) { case '(': pc->tstart = pc->tend = pc->p; pc->tline = pc->linenr; @@ -6508,7 +6508,7 @@ * and make sure at the end of the program there is * a single result on the stack. */ for (i = 0; i < expr->len; i++) { - switch(expr->opcode[i]) { + switch (expr->opcode[i]) { case JIM_EXPROP_NUMBER: case JIM_EXPROP_STRING: case JIM_EXPROP_SUBST: @@ -6624,7 +6624,7 @@ leftindex = index-1; arity = 1; while (arity) { - switch(expr->opcode[leftindex]) { + switch (expr->opcode[leftindex]) { case JIM_EXPROP_NUMBER: case JIM_EXPROP_COMMAND: case JIM_EXPROP_VARIABLE: @@ -6710,7 +6710,7 @@ Jim_Free(token); break; } - switch(type) { + switch (type) { case JIM_TT_STR: ExprObjAddInstr(interp, expr, JIM_EXPROP_STRING, token, len); break; @@ -6949,7 +6949,7 @@ } Jim_DecrRefCount(interp, A); Jim_DecrRefCount(interp, B); - switch(expr->opcode[i]) { + switch (expr->opcode[i]) { case JIM_EXPROP_ADD: wC = wA+wB; break; case JIM_EXPROP_SUB: wC = wA-wB; break; case JIM_EXPROP_MUL: wC = wA*wB; break; @@ -7040,7 +7040,7 @@ } Jim_DecrRefCount(interp, A); Jim_DecrRefCount(interp, B); - switch(expr->opcode[i]) { + switch (expr->opcode[i]) { case JIM_EXPROP_ROTL: case JIM_EXPROP_ROTR: case JIM_EXPROP_LSHIFT: @@ -7097,7 +7097,7 @@ retry_as_string: sA = Jim_GetString(A, &Alen); sB = Jim_GetString(B, &Blen); - switch(opcode) { + switch (opcode) { case JIM_EXPROP_STREQ: if (Alen == Blen && memcmp(sA, sB, Alen) ==0) wC = 1; @@ -7134,7 +7134,7 @@ goto trydouble_unary; } Jim_DecrRefCount(interp, A); - switch(expr->opcode[i]) { + switch (expr->opcode[i]) { case JIM_EXPROP_NOT: wC = !wA; break; case JIM_EXPROP_BITNOT: wC = ~wA; break; case JIM_EXPROP_LOGICAND_RIGHT: @@ -7155,7 +7155,7 @@ goto err; } Jim_DecrRefCount(interp, A); - switch(expr->opcode[i]) { + switch (expr->opcode[i]) { case JIM_EXPROP_NOT: dC = !dA; break; case JIM_EXPROP_LOGICAND_RIGHT: case JIM_EXPROP_LOGICOR_RIGHT: dC = (dA != 0); break; @@ -8454,7 +8454,7 @@ /* Compute every token forming the argument * in the intv objects vector. */ for (i = 0; i < tokens; i++) { - switch(token[i].type) { + switch (token[i].type) { case JIM_TT_ESC: case JIM_TT_STR: intv[i] = token[i].objPtr; @@ -8628,7 +8628,7 @@ if (tokens == 1) { /* Fast path if the token does not * need interpolation */ - switch(token[i].type) { + switch (token[i].type) { case JIM_TT_ESC: case JIM_TT_STR: argv[j] = token[i].objPtr; @@ -9020,7 +9020,7 @@ pc->eof = 1; return JIM_OK; } - switch(*pc->p) { + switch (*pc->p) { case '[': retval = JimParseCmd(pc); if (flags & JIM_SUBST_NOCMD) { @@ -9170,7 +9170,7 @@ for (i = 0; i < len; i++) { Jim_Obj *objPtr; - switch(token[i].type) { + switch (token[i].type) { case JIM_TT_STR: case JIM_TT_ESC: Jim_AppendObj(interp, resObjPtr, token[i].objPtr); @@ -9773,7 +9773,7 @@ if ((expr = Jim_GetExpression(interp, argv[1])) == NULL) goto noopt; if (expr->len <= 0 || expr->len > 3) goto noopt; - switch(expr->len) { + switch (expr->len) { case 1: if (expr->opcode[0] != JIM_EXPROP_VARIABLE && expr->opcode[0] != JIM_EXPROP_NUMBER) @@ -9789,7 +9789,7 @@ (expr->opcode[1] != JIM_EXPROP_NUMBER && expr->opcode[1] != JIM_EXPROP_VARIABLE)) goto noopt; - switch(expr->opcode[2]) { + switch (expr->opcode[2]) { case JIM_EXPROP_LT: case JIM_EXPROP_LTE: case JIM_EXPROP_GT: @@ -9834,7 +9834,7 @@ } if (!wideValue) break; if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) { - switch(retval) { + switch (retval) { case JIM_BREAK: if (varAObjPtr) Jim_DecrRefCount(interp, varAObjPtr); @@ -9885,7 +9885,7 @@ goto noopt; } } - switch(cmpType) { + switch (cmpType) { case JIM_EXPROP_LT: cmpRes = wideValueA < wideValueB; break; case JIM_EXPROP_LTE: @@ -9901,7 +9901,7 @@ } if (!cmpRes) break; if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) { - switch(retval) { + switch (retval) { case JIM_BREAK: Jim_DecrRefCount(interp, varAObjPtr); if (varBObjPtr) @@ -9941,7 +9941,7 @@ return retval; if (!boolean) break; if ((retval = Jim_EvalObj(interp, argv[2])) != JIM_OK) { - switch(retval) { + switch (retval) { case JIM_BREAK: goto out; break; @@ -10078,7 +10078,7 @@ } /* Eval body */ if ((retval = Jim_EvalObj(interp, argv[4])) != JIM_OK) { - switch(retval) { + switch (retval) { case JIM_BREAK: if (stopVarNamePtr) Jim_DecrRefCount(interp, stopVarNamePtr); @@ -10147,7 +10147,7 @@ if (!boolean) break; /* Eval body */ if ((retval = Jim_EvalObj(interp, argv[4])) != JIM_OK) { - switch(retval) { + switch (retval) { case JIM_BREAK: goto out; break; @@ -10161,7 +10161,7 @@ evalnext: /* Eval next */ if ((retval = Jim_EvalObj(interp, argv[3])) != JIM_OK) { - switch(retval) { + switch (retval) { case JIM_BREAK: goto out; break; @@ -10615,7 +10615,7 @@ if (Jim_GetEnum(interp, argv[i], options, &option, "option", JIM_ERRMSG) != JIM_OK) return JIM_ERR; - switch(option) { + switch (option) { case OPT_ASCII: lsortType = JIM_LSORT_ASCII; break; case OPT_NOCASE: lsortType = JIM_LSORT_NOCASE; break; case OPT_INCREASING: decreasing = 0; break; @@ -10623,7 +10623,7 @@ } } if (decreasing) { - switch(lsortType) { + switch (lsortType) { case JIM_LSORT_ASCII: lsortType = JIM_LSORT_ASCII_DECR; break; case JIM_LSORT_NOCASE: lsortType = JIM_LSORT_NOCASE_DECR; break; } @@ -10800,7 +10800,7 @@ const char *type; Jim_ExprOperator *op; - switch(expr->opcode[i]) { + switch (expr->opcode[i]) { case JIM_EXPROP_NUMBER: type = "number"; break; case JIM_EXPROP_COMMAND: type = "command"; break; case JIM_EXPROP_VARIABLE: type = "variable"; break; Modified: trunk/src/helper/jim.h =================================================================== --- trunk/src/helper/jim.h 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/helper/jim.h 2009-06-23 22:36:56 UTC (rev 2359) @@ -992,7 +992,7 @@ * return e; * } * - * switch( n->value ){ + * switch ( n->value ){ * case ALIVE: * printf("Option ALIVE specified\n"); * break; @@ -1112,7 +1112,7 @@ * return e; * } * - * switch( n->value ){ + * switch ( n->value ){ * case OPT_SEX: * // handle: --sex male|female|lots|needmore * e = Jim_GetOpt_Nvp( &goi, &nvp_sex, &n ); Modified: trunk/src/jtag/interface.c =================================================================== --- trunk/src/jtag/interface.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/jtag/interface.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -77,7 +77,7 @@ int ndx; - switch( astate ) + switch ( astate ) { case TAP_RESET: ndx = 0; break; case TAP_DRSHIFT: ndx = 2; break; @@ -209,10 +209,10 @@ { bool is_stable; - /* A switch() is used because it is symbol dependent + /* A switch () is used because it is symbol dependent (not value dependent like an array), and can also check bounds. */ - switch( astate ) + switch ( astate ) { case TAP_RESET: case TAP_IDLE: @@ -331,7 +331,7 @@ { const char* ret; - switch( state ) + switch ( state ) { case TAP_RESET: ret = "RESET"; break; case TAP_IDLE: ret = "RUN/IDLE"; break; Modified: trunk/src/jtag/rlink/rlink.c =================================================================== --- trunk/src/jtag/rlink/rlink.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/jtag/rlink/rlink.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -363,7 +363,7 @@ exit(1); } - switch(header->type) { + switch (header->type) { case DTCLOAD_COMMENT: break; @@ -1243,7 +1243,7 @@ /* chunk_bits is a multiple of 8, so there are no rounding issues. */ chunk_bytes = chunk_bits / 8; - switch(type) { + switch (type) { case SCAN_IN: x = DTC_CMD_SHIFT_TDO_BYTES(chunk_bytes); break; Modified: trunk/src/jtag/tcl.c =================================================================== --- trunk/src/jtag/tcl.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/jtag/tcl.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -374,7 +374,7 @@ return e; } LOG_DEBUG("Processing option: %s", n->name ); - switch( n->value ){ + switch ( n->value ){ case NTAP_OPT_ENABLED: pTap->disabled_after_reset = false; break; @@ -414,7 +414,7 @@ Jim_SetResult_sprintf( goi->interp, "option: %s bad parameter", n->name ); return e; } - switch(n->value){ + switch (n->value){ case NTAP_OPT_IRLEN: if (w > (jim_wide) (8 * sizeof(pTap->ir_capture_value))) LOG_WARNING("huge IR length %d", (int) w); @@ -440,7 +440,7 @@ reqbits &= (~(NTREQ_IRCAPTURE)); break; } - } /* switch(n->value) */ + } /* switch (n->value) */ } /* while ( goi->argc ) */ /* default is enabled-after-reset */ @@ -540,7 +540,7 @@ return e; } Jim_SetEmptyResult( goi.interp ); - switch( n->value ){ + switch ( n->value ){ case JTAG_CMD_INTERFACE: /* return the name of the interface */ /* TCL code might need to know the exact type... */ Modified: trunk/src/jtag/vsllink.c =================================================================== --- trunk/src/jtag/vsllink.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/jtag/vsllink.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -362,7 +362,7 @@ case JTAG_STABLECLOCKS: DEBUG_JTAG_IO("add %d clocks", cmd->cmd.stableclocks->num_cycles); - switch(tap_get_state()) + switch (tap_get_state()) { case TAP_RESET: // tms should be '1' to stay in TAP_RESET mode Modified: trunk/src/server/gdb_server.c =================================================================== --- trunk/src/server/gdb_server.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/server/gdb_server.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -188,7 +188,7 @@ #ifdef _WIN32 errno = WSAGetLastError(); - switch(errno) + switch (errno) { case WSAEWOULDBLOCK: usleep(1000); @@ -204,7 +204,7 @@ exit(-1); } #else - switch(errno) + switch (errno) { case EAGAIN: usleep(1000); @@ -1964,7 +1964,7 @@ int gdb_detach(connection_t *connection, target_t *target) { - switch( detach_mode ) + switch ( detach_mode ) { case GDB_DETACH_RESUME: target_handle_event( target, TARGET_EVENT_OLD_pre_resume ); Modified: trunk/src/svf/svf.c =================================================================== --- trunk/src/svf/svf.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/svf/svf.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -273,7 +273,7 @@ { const char* ret; - switch( state ) + switch ( state ) { case TAP_RESET: ret = "RESET"; break; case TAP_IDLE: ret = "IDLE"; break; @@ -507,7 +507,7 @@ while (!cmd_ok && (read(fd, &ch, 1) > 0) ) { - switch(ch) + switch (ch) { case '!': slash = 0; @@ -578,7 +578,7 @@ while (pos < len) { - switch(str[pos]) + switch (str[pos]) { case '\n': case '\r': @@ -832,7 +832,7 @@ } command = svf_find_string_in_array(argus[0], (char **)svf_command_name, dimof(svf_command_name)); - switch(command) + switch (command) { case ENDDR: case ENDIR: Modified: trunk/src/target/arm_disassembler.c =================================================================== --- trunk/src/target/arm_disassembler.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/target/arm_disassembler.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -1332,7 +1332,7 @@ target_address = address + 4 + (offset<<1); - switch(opc) + switch (opc) { /* unconditional branch */ case 0: @@ -1416,7 +1416,7 @@ uint8_t opc = (opcode >> 11) & 0x3; char *mnemonic = NULL; - switch(opc) + switch (opc) { case 0: instruction->type = ARM_MOV; @@ -1465,7 +1465,7 @@ instruction->info.data_proc.variant = 0; /*immediate*/ instruction->info.data_proc.shifter_operand.immediate.immediate = imm; - switch(opc) + switch (opc) { case 0: instruction->type = ARM_MOV; @@ -1679,7 +1679,7 @@ uint8_t opc = (opcode >> 9) & 0x7; char *mnemonic = NULL; - switch(opc) + switch (opc) { case 0: instruction->type = ARM_STR; Modified: trunk/src/target/image.c =================================================================== --- trunk/src/target/image.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/target/image.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -533,7 +533,7 @@ } else if (record_type >= 1 && record_type <= 3) { - switch( record_type ) + switch ( record_type ) { case 1: /* S1 - 16 bit address data record */ Modified: trunk/src/target/mips_m4k.c =================================================================== --- trunk/src/target/mips_m4k.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/target/mips_m4k.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -765,7 +765,7 @@ for(i = 0; i < (count*size); i += size) { - switch(size) + switch (size) { case 4: t32 = le_to_h_u32(&buffer[i]); @@ -810,7 +810,7 @@ for(i = 0; i < (count*size); i += size) { - switch(size) + switch (size) { case 4: t32 = be_to_h_u32(&buffer[i]); Modified: trunk/src/target/target.c =================================================================== --- trunk/src/target/target.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/target/target.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -2699,7 +2699,7 @@ return retval; // fall through case 3: - switch(args[2][0]) + switch (args[2][0]) { case 'r': type = WPT_READ; @@ -3460,7 +3460,7 @@ Jim_GetOpt_NvpUnknown( goi, nvp_config_opts, 0 ); return e; } - switch( n->value ){ + switch ( n->value ){ case TCFG_TYPE: /* not setable */ if ( goi->isconfigure ){ @@ -3763,7 +3763,7 @@ /* Assume blank result */ Jim_SetEmptyResult( goi.interp ); - switch( n->value ){ + switch ( n->value ){ case TS_CMD_CONFIGURE: if ( goi.argc < 2 ){ Jim_WrongNumArgs( goi.interp, goi.argc, goi.argv, "missing: -option VALUE ..."); @@ -3815,7 +3815,7 @@ c = 1; } - switch( n->value ){ + switch ( n->value ){ case TS_CMD_MWW: target_buffer_set_u32( target, target_buf, b ); b = 4; @@ -3866,7 +3866,7 @@ c = 1; } b = 1; /* shut up gcc */ - switch( n->value ){ + switch ( n->value ){ case TS_CMD_MDW: b = 4; break; @@ -3893,7 +3893,7 @@ } Jim_fprintf( interp, interp->cookie_stdout, "0x%08x ", (int)(a) ); - switch( b ){ + switch ( b ){ case 4: for( x = 0 ; (x < 16) && (x < y) ; x += 4 ){ z = target_buffer_get_u32( target, &(target_buf[ x * 4 ]) ); @@ -4296,7 +4296,7 @@ return r; } - switch(x){ + switch (x){ default: Jim_Panic(goi.interp,"Why am I here?"); return JIM_ERR; Modified: trunk/src/target/xscale.c =================================================================== --- trunk/src/target/xscale.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/target/xscale.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -3610,7 +3610,7 @@ { reg_no = strtoul(args[0], NULL, 0); /*translate from xscale cp15 register no to openocd register*/ - switch(reg_no) + switch (reg_no) { case 0: reg_no = XSCALE_MAINID; Modified: trunk/src/xsvf/xsvf.c =================================================================== --- trunk/src/xsvf/xsvf.c 2009-06-23 22:36:11 UTC (rev 2358) +++ trunk/src/xsvf/xsvf.c 2009-06-23 22:36:56 UTC (rev 2359) @@ -133,7 +133,7 @@ { tap_state_t ret; - switch( xsvf_state ) + switch ( xsvf_state ) { case XSV_RESET: ret = TAP_RESET; break; case XSV_IDLE: ret = TAP_IDLE; break; @@ -890,7 +890,7 @@ break; } - switch( trst_mode ) + switch ( trst_mode ) { case XTRST_ON: jtag_add_reset(1, 0); |
Author: zwelch Date: 2009-06-24 00:36:11 +0200 (Wed, 24 Jun 2009) New Revision: 2358 Modified: trunk/src/flash/avrf.c trunk/src/flash/pic32mx.c trunk/src/flash/stellaris.c trunk/src/flash/str7x.c trunk/src/flash/str9x.c trunk/src/flash/str9xpec.c trunk/src/helper/command.c trunk/src/helper/jim-eventloop.c trunk/src/helper/jim.c trunk/src/helper/jim.h trunk/src/jtag/core.c trunk/src/jtag/interface.c trunk/src/jtag/rlink/rlink.c trunk/src/jtag/tcl.c trunk/src/server/server.c trunk/src/target/arm11_dbgtap.c trunk/src/target/cortex_m3.c trunk/src/target/mips32_dmaacc.c trunk/src/target/mips_m4k.c trunk/src/target/target.c trunk/src/xsvf/xsvf.c trunk/testing/examples/PIC32/BlinkingLeds.c trunk/testing/examples/ledtest-imx27ads/test.c trunk/testing/examples/ledtest-imx31pdk/test.c Log: - Replace 'while(' with 'while ('. Modified: trunk/src/flash/avrf.c =================================================================== --- trunk/src/flash/avrf.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/flash/avrf.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -156,7 +156,7 @@ return ERROR_FAIL; } LOG_DEBUG("poll_value = 0x%04" PRIx32 "", poll_value); - }while(!(poll_value & 0x0200)); + }while (!(poll_value & 0x0200)); return ERROR_OK; } @@ -203,7 +203,7 @@ return ERROR_FAIL; } LOG_DEBUG("poll_value = 0x%04" PRIx32 "", poll_value); - }while(!(poll_value & 0x0200)); + }while (!(poll_value & 0x0200)); return ERROR_OK; } @@ -277,7 +277,7 @@ } cur_size = 0; - while(count > 0) + while (count > 0) { if (count > page_size) { Modified: trunk/src/flash/pic32mx.c =================================================================== --- trunk/src/flash/pic32mx.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/flash/pic32mx.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -452,7 +452,7 @@ target_free_working_area(target, source); - while(count > 0) + while (count > 0) { uint32_t value; memcpy(&value, buffer, sizeof(uint32_t)); Modified: trunk/src/flash/stellaris.c =================================================================== --- trunk/src/flash/stellaris.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/flash/stellaris.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -610,7 +610,7 @@ { target_read_u32(target, FLASH_FMC, &flash_fmc); } - while(flash_fmc & FMC_ERASE); + while (flash_fmc & FMC_ERASE); /* Check acess violations */ target_read_u32(target, FLASH_CRIS, &flash_cris); @@ -687,7 +687,7 @@ { target_read_u32(target, FLASH_FMC, &flash_fmc); } - while(flash_fmc & FMC_COMT); + while (flash_fmc & FMC_COMT); /* Check acess violations */ target_read_u32(target, FLASH_CRIS, &flash_cris); @@ -926,7 +926,7 @@ uint8_t last_word[4] = {0xff, 0xff, 0xff, 0xff}; int i = 0; - while(bytes_remaining > 0) + while (bytes_remaining > 0) { last_word[i++] = *(buffer + bytes_written); bytes_remaining--; Modified: trunk/src/flash/str7x.c =================================================================== --- trunk/src/flash/str7x.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/flash/str7x.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -578,7 +578,7 @@ uint8_t last_dword[8] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; int i = 0; - while(bytes_remaining > 0) + while (bytes_remaining > 0) { last_dword[i++] = *(buffer + bytes_written); bytes_remaining--; Modified: trunk/src/flash/str9x.c =================================================================== --- trunk/src/flash/str9x.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/flash/str9x.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -607,7 +607,7 @@ uint8_t last_halfword[2] = {0xff, 0xff}; int i = 0; - while(bytes_remaining > 0) + while (bytes_remaining > 0) { last_halfword[i++] = *(buffer + bytes_written); bytes_remaining--; Modified: trunk/src/flash/str9xpec.c =================================================================== --- trunk/src/flash/str9xpec.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/flash/str9xpec.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -542,7 +542,7 @@ jtag_add_dr_scan(1, &field, jtag_get_end_state()); jtag_execute_queue(); - } while(!(status & ISC_STATUS_BUSY)); + } while (!(status & ISC_STATUS_BUSY)); str9xpec_isc_disable(bank); @@ -722,7 +722,7 @@ status = buf_get_u32(scanbuf, 0, 8); - } while(!(status & ISC_STATUS_BUSY)); + } while (!(status & ISC_STATUS_BUSY)); if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS) return ERROR_FLASH_OPERATION_FAILED; @@ -740,7 +740,7 @@ uint8_t last_dword[8] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; int i = 0; - while(bytes_remaining > 0) + while (bytes_remaining > 0) { last_dword[i++] = *(buffer + bytes_written); bytes_remaining--; @@ -772,7 +772,7 @@ status = buf_get_u32(scanbuf, 0, 8); - } while(!(status & ISC_STATUS_BUSY)); + } while (!(status & ISC_STATUS_BUSY)); if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS) return ERROR_FLASH_OPERATION_FAILED; @@ -962,7 +962,7 @@ jtag_add_dr_scan(1, &field, jtag_get_end_state()); jtag_execute_queue(); - } while(!(status & ISC_STATUS_BUSY)); + } while (!(status & ISC_STATUS_BUSY)); str9xpec_isc_disable(bank); Modified: trunk/src/helper/command.c =================================================================== --- trunk/src/helper/command.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/helper/command.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -269,11 +269,11 @@ if (context == NULL) return ERROR_OK; - while(NULL != context->commands) + while (NULL != context->commands) { c = context->commands; - while(NULL != c->children) + while (NULL != c->children) { c2 = c->children; c->children = c->children->next; @@ -304,7 +304,7 @@ /* find command */ c = context->commands; - while(NULL != c) + while (NULL != c) { if (strcmp(name, c->name) == 0) { @@ -320,7 +320,7 @@ } /* unregister children */ - while(NULL != c->children) + while (NULL != c->children) { c2 = c->children; c->children = c->children->next; Modified: trunk/src/helper/jim-eventloop.c =================================================================== --- trunk/src/helper/jim-eventloop.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/helper/jim-eventloop.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -116,7 +116,7 @@ Jim_EventLoop *eventLoop = Jim_GetAssocData(interp, "eventloop"); fe = eventLoop->fileEventHead; - while(fe) { + while (fe) { if (fe->handle == handle) { if (prev == NULL) eventLoop->fileEventHead = fe->next; @@ -194,7 +194,7 @@ te = eventLoop->timeEventHead; if (id >= eventLoop->timeEventNextId) return -2; /* wrong event ID */ - while(te) { + while (te) { if (te->id == id) { remain = (te->when_sec - cur_sec) * 1000; remain += (te->when_ms - cur_ms) ; @@ -224,7 +224,7 @@ Jim_TimeEvent *te = eventLoop->timeEventHead; Jim_TimeEvent *nearest = NULL; - while(te) { + while (te) { if (!nearest || te->when_sec < nearest->when_sec || (te->when_sec == nearest->when_sec && te->when_ms < nearest->when_ms)) @@ -319,7 +319,7 @@ } } else if (retval > 0) { fe = eventLoop->fileEventHead; - while(fe != NULL) { + while (fe != NULL) { int fd = fileno((FILE*)fe->handle); // fprintf(stderr,"fd: %d mask: %02x \n",fd,fe->mask); @@ -361,7 +361,7 @@ /* Check time events */ te = eventLoop->timeEventHead; maxId = eventLoop->timeEventNextId-1; - while(te) { + while (te) { long now_sec, now_ms; jim_wide id; @@ -400,7 +400,7 @@ Jim_EventLoop *eventLoop = data; fe = eventLoop->fileEventHead; - while(fe) { + while (fe) { next = fe->next; if (fe->finalizerProc) fe->finalizerProc(interp, fe->clientData); @@ -409,7 +409,7 @@ } te = eventLoop->timeEventHead; - while(te) { + while (te) { next = te->next; if (te->finalizerProc) te->finalizerProc(interp, te->clientData); Modified: trunk/src/helper/jim.c =================================================================== --- trunk/src/helper/jim.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/helper/jim.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -245,7 +245,7 @@ static int JimStringMatch(const char *pattern, int patternLen, const char *string, int stringLen, int nocase) { - while(patternLen) { + while (patternLen) { switch(pattern[0]) { case '*': while (pattern[1] == '*') { @@ -254,7 +254,7 @@ } if (patternLen == 1) return 1; /* match */ - while(stringLen) { + while (stringLen) { if (JimStringMatch(pattern+1, patternLen-1, string, stringLen, nocase)) return 1; /* match */ @@ -281,7 +281,7 @@ patternLen--; } match = 0; - while(1) { + while (1) { if (pattern[0] == '\\') { pattern++; patternLen--; @@ -352,7 +352,7 @@ pattern++; patternLen--; if (stringLen == 0) { - while(*pattern == '*') { + while (*pattern == '*') { pattern++; patternLen--; } @@ -370,7 +370,7 @@ unsigned char *u1 = (unsigned char*) s1, *u2 = (unsigned char*) s2; if (nocase == 0) { - while(l1 && l2) { + while (l1 && l2) { if (*u1 != *u2) return (int)*u1-*u2; u1++; u2++; l1--; l2--; @@ -378,7 +378,7 @@ if (!l1 && !l2) return 0; return l1-l2; } else { - while(l1 && l2) { + while (l1 && l2) { if (tolower((int)*u1) != tolower((int)*u2)) return tolower((int)*u1)-tolower((int)*u2); u1++; u2++; l1--; l2--; @@ -424,7 +424,7 @@ if ((str[0] == '\0') || (str == endptr) ) return JIM_ERR; if (endptr[0] != '\0') { - while(*endptr) { + while (*endptr) { if (!isspace((int)*endptr)) return JIM_ERR; endptr++; @@ -441,7 +441,7 @@ if ( (str[0] == '\0') || (str == endptr) ) return JIM_ERR; if (endptr[0] != '\0') { - while(*endptr) { + while (*endptr) { if (!isspace((int)*endptr)) return JIM_ERR; endptr++; @@ -473,7 +473,7 @@ len = sprintf(buf, "%.17g", doubleValue); s = buf; - while(*s) { + while (*s) { if (*s == '.') return len; s++; } @@ -661,7 +661,7 @@ unsigned int Jim_GenHashFunction(const unsigned char *buf, int len) { unsigned int h = 0; - while(len--) + while (len--) h += (h<<3)+*buf++; return h; } @@ -729,7 +729,7 @@ /* For each hash entry on this slot... */ he = ht->table[i]; - while(he) { + while (he) { unsigned int h; nextHe = he->next; @@ -802,7 +802,7 @@ he = ht->table[h]; prevHe = NULL; - while(he) { + while (he) { if (Jim_CompareHashKeys(ht, key, he->key)) { /* Unlink the element from the list */ if (prevHe) @@ -831,7 +831,7 @@ Jim_HashEntry *he, *nextHe; if ((he = ht->table[i]) == NULL) continue; - while(he) { + while (he) { nextHe = he->next; Jim_FreeEntryKey(ht, he); Jim_FreeEntryVal(ht, he); @@ -855,7 +855,7 @@ if (ht->size == 0) return NULL; h = Jim_HashKey(ht, key) & ht->sizemask; he = ht->table[h]; - while(he) { + while (he) { if (Jim_CompareHashKeys(ht, key, he->key)) return he; he = he->next; @@ -916,7 +916,7 @@ if (size >= 2147483648U) return 2147483648U; - while(1) { + while (1) { if (i >= size) return i; i *= 2; @@ -938,7 +938,7 @@ h = Jim_HashKey(ht, key) & ht->sizemask; /* Search if this slot does not already contain the given key */ he = ht->table[h]; - while(he) { + while (he) { if (Jim_CompareHashKeys(ht, key, he->key)) return -1; he = he->next; @@ -1180,7 +1180,7 @@ int JimParseScript(struct JimParserCtx *pc) { - while(1) { /* the while is used to reiterate with continue if needed */ + while (1) { /* the while is used to reiterate with continue if needed */ if (!pc->len) { pc->tstart = pc->p; pc->tend = pc->p-1; @@ -1657,7 +1657,7 @@ int level = 0; int state = ' '; - while(len) { + while (len) { switch (*s) { case '\\': if (len > 1) @@ -2341,7 +2341,7 @@ case '8': case '9': accum = 0; - while( isdigit(*fmt) && (fmtLen > 0) ){ + while ( isdigit(*fmt) && (fmtLen > 0) ){ accum = (accum * 10) + (*fmt - '0'); fmt++; fmtLen--; } @@ -3029,7 +3029,7 @@ } JimParserInit(&parser, scriptText, scriptTextLen, initialLineNumber); - while(!JimParserEof(&parser)) { + while (!JimParserEof(&parser)) { char *token; int len, type, linenr; @@ -3621,7 +3621,7 @@ Jim_Obj *objPtr = targetNameObjPtr; Jim_Var *varPtr; /* Cycles are only possible with 'uplevel 0' */ - while(1) { + while (1) { if (Jim_StringEqObj(objPtr, nameObjPtr, 0)) { Jim_SetResultString(interp, "can't upvar from variable to itself", -1); @@ -4262,7 +4262,7 @@ * is of a type that can contain references. */ Jim_InitHashTable(&marks, &JimRefMarkHashTableType, NULL); objPtr = interp->liveList; - while(objPtr) { + while (objPtr) { if (objPtr->typePtr == NULL || objPtr->typePtr->flags & JIM_TYPE_REFERENCES) { const char *str, *p; @@ -4291,7 +4291,7 @@ continue; } /* Extract references from the object string repr. */ - while(1) { + while (1) { int i; jim_wide id; char buf[21]; @@ -4488,7 +4488,7 @@ Jim_FreeHashTable(&i->packages); Jim_Free(i->prngState); /* Free the call frames list */ - while(cf) { + while (cf) { prevcf = cf->parentCallFrame; JimFreeCallFrame(i, cf, JIM_FCF_NONE); cf = prevcf; @@ -4500,7 +4500,7 @@ Jim_fprintf( i, i->cookie_stdout,JIM_NL "-------------------------------------" JIM_NL); Jim_fprintf( i, i->cookie_stdout,"Objects still in the free list:" JIM_NL); - while(objPtr) { + while (objPtr) { const char *type = objPtr->typePtr ? objPtr->typePtr->name : ""; Jim_fprintf( i, i->cookie_stdout,"%p \"%-10s\": '%.20s' (refCount: %d)" JIM_NL, @@ -4526,7 +4526,7 @@ } /* Free cached CallFrame structures */ cf = i->freeFramesList; - while(cf) { + while (cf) { nextcf = cf->nextFramePtr; if (cf->vars.table != NULL) Jim_Free(cf->vars.table); @@ -5102,7 +5102,7 @@ char *q = Jim_Alloc(len*2+1), *p; p = q; - while(*s) { + while (*s) { switch (*s) { case ' ': case '$': @@ -5215,7 +5215,7 @@ /* Convert into a list */ JimParserInit(&parser, str, strLen, 1); - while(!JimParserEof(&parser)) { + while (!JimParserEof(&parser)) { char *token; int tokenLen, type; Jim_Obj *elementPtr; @@ -5794,7 +5794,7 @@ /* Convert into a dict */ JimParserInit(&parser, str, strLen, 1); i = 0; - while(!JimParserEof(&parser)) { + while (!JimParserEof(&parser)) { char *token; int tokenLen, type; @@ -6276,7 +6276,7 @@ int JimParseExpression(struct JimParserCtx *pc) { /* Discard spaces and quoted newline */ - while(*(pc->p) == ' ' || + while (*(pc->p) == ' ' || *(pc->p) == '\t' || *(pc->p) == '\r' || *(pc->p) == '\n' || @@ -6623,7 +6623,7 @@ /* Search for the end of the first operator */ leftindex = index-1; arity = 1; - while(arity) { + while (arity) { switch(expr->opcode[leftindex]) { case JIM_EXPROP_NUMBER: case JIM_EXPROP_COMMAND: @@ -6697,7 +6697,7 @@ Jim_InitStack(&stack); JimParserInit(&parser, exprText, exprTextLen, 1); - while(!JimParserEof(&parser)) { + while (!JimParserEof(&parser)) { char *token; int len, type; @@ -6731,7 +6731,7 @@ break; case JIM_TT_EXPR_OPERATOR: op = JimExprOperatorInfo(token); - while(1) { + while (1) { Jim_ExprOperator *stackTopOp; if (Jim_StackPeek(&stack) != NULL) { @@ -6758,7 +6758,7 @@ case JIM_TT_SUBEXPR_END: { int found = 0; - while(Jim_StackLen(&stack)) { + while (Jim_StackLen(&stack)) { char *opstr = Jim_StackPop(&stack); if (!strcmp(opstr, "(")) { Jim_Free(opstr); @@ -9094,7 +9094,7 @@ script->fileName = NULL; JimParserInit(&parser, scriptText, scriptTextLen, 1); - while(1) { + while (1) { char *token; int len, type, linenr; @@ -11138,7 +11138,7 @@ } str = Jim_GetString(objPtr, &strLen); /* Map it */ - while(strLen) { + while (strLen) { for (i = 0; i < numMaps; i++) { if (strLen >= keyLen[i] && keyLen[i]) { if (!JimStringCompare(str, keyLen[i], key[i], keyLen[i], @@ -11630,7 +11630,7 @@ return JIM_ERR; } i = argc-2; - while(i--) { + while (i--) { if (Jim_CompareStringImmediate(interp, argv[i+1], "-nobackslashes")) flags |= JIM_SUBST_NOESC; @@ -12283,7 +12283,7 @@ { int i = 0; - while(Jim_CoreCommandsTable[i].name != NULL) { + while (Jim_CoreCommandsTable[i].name != NULL) { Jim_CreateCommand(interp, Jim_CoreCommandsTable[i].name, Jim_CoreCommandsTable[i].cmdProc, @@ -12361,7 +12361,7 @@ Jim_fflush( interp, interp->cookie_stdout); scriptObjPtr = Jim_NewStringObj(interp, "", 0); Jim_IncrRefCount(scriptObjPtr); - while(1) { + while (1) { const char *str; char state; int len; @@ -12457,7 +12457,7 @@ Jim_Nvp * Jim_Nvp_name2value_simple( const Jim_Nvp *p, const char *name ) { - while( p->name ){ + while ( p->name ){ if ( 0 == strcmp( name, p->name ) ){ break; } @@ -12469,7 +12469,7 @@ Jim_Nvp * Jim_Nvp_name2value_nocase_simple( const Jim_Nvp *p, const char *name ) { - while( p->name ){ + while ( p->name ){ if ( 0 == strcasecmp( name, p->name ) ){ break; } @@ -12553,7 +12553,7 @@ Jim_Nvp * Jim_Nvp_value2name_simple( const Jim_Nvp *p, int value ) { - while( p->name ){ + while ( p->name ){ if ( value == p->value ){ break; } @@ -12792,7 +12792,7 @@ "Unknown param: %s, try one of: ", Jim_GetString( param_value, NULL ) ); } - while( nvp->name ){ + while ( nvp->name ){ const char *a; const char *b; Modified: trunk/src/helper/jim.h =================================================================== --- trunk/src/helper/jim.h 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/helper/jim.h 2009-06-23 22:36:11 UTC (rev 2358) @@ -241,7 +241,7 @@ entry->val = (ht)->type->valDup((ht)->privdata, _val_); \ else \ entry->val = (_val_); \ -} while(0) +} while (0) #define Jim_FreeEntryKey(ht, entry) \ if ((ht)->type->keyDestructor) \ @@ -252,7 +252,7 @@ entry->key = (ht)->type->keyDup((ht)->privdata, _key_); \ else \ entry->key = (_key_); \ -} while(0) +} while (0) #define Jim_CompareHashKeys(ht, key1, key2) \ (((ht)->type->keyCompare) ? \ @@ -555,7 +555,7 @@ Jim_IncrRefCount(_resultObjPtr_); \ Jim_DecrRefCount(i,(i)->result); \ (i)->result = _resultObjPtr_; \ -} while(0) +} while (0) /* Reference structure. The interpreter pointer is held within privdata member in HashTable */ #define JIM_REFERENCE_TAGLEN 7 /* The tag is fixed-length, because the reference @@ -985,7 +985,7 @@ * * Jim_GetOpt_Setup( &goi, interp, argc, argv ); * - * while( goi.argc ){ + * while ( goi.argc ){ * e = Jim_GetOpt_Nvp( &goi, nvp_options, &n ); * if ( e != JIM_OK ){ * Jim_GetOpt_NvpUnknown( &goi, nvp_options, 0 ); @@ -1102,7 +1102,7 @@ * Example: * \code * - * while( goi.argc ){ + * while ( goi.argc ){ * // Get the next option * e = Jim_GetOpt_Nvp( &goi, cmd_options, &n ); * if ( e != JIM_OK ){ Modified: trunk/src/jtag/core.c =================================================================== --- trunk/src/jtag/core.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/jtag/core.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -142,7 +142,7 @@ { jtag_tap_t *t = jtag_all_taps(); unsigned n = 0; - while(t) + while (t) { if (t->enabled) n++; @@ -157,7 +157,7 @@ t->abs_chain_position = jtag_num_taps++; jtag_tap_t **tap = &__jtag_all_taps; - while(*tap != NULL) + while (*tap != NULL) tap = &(*tap)->next_tap; *tap = t; } Modified: trunk/src/jtag/interface.c =================================================================== --- trunk/src/jtag/interface.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/jtag/interface.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -372,7 +372,7 @@ #ifdef _DEBUG_JTAG_IO_ #define JTAG_DEBUG_STATE_APPEND(buf, len, bit) \ - do { buf[len] = bit ? '1' : '0'; } while(0) + do { buf[len] = bit ? '1' : '0'; } while (0) #define JTAG_DEBUG_STATE_PRINT(a, b, astr, bstr) \ DEBUG_JTAG_IO("TAP/SM: %9s -> %5s\tTMS: %s\tTDI: %s", \ tap_state_name(a), tap_state_name(b), astr, bstr) Modified: trunk/src/jtag/rlink/rlink.c =================================================================== --- trunk/src/jtag/rlink/rlink.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/jtag/rlink/rlink.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -128,7 +128,7 @@ usb_buffer_p = usb_buffer; va_start(ap, length); - while(length > 0) { + while (length > 0) { *usb_buffer_p++ = va_arg(ap, int); length--; } @@ -175,7 +175,7 @@ remain = length; count = 0; - while(remain) { + while (remain) { if (remain > sizeof(usb_buffer)) { length = sizeof(usb_buffer); } else { @@ -236,7 +236,7 @@ remain = length; count = 0; - while(remain) { + while (remain) { if (remain > (sizeof(usb_buffer) - 4)) { length = (sizeof(usb_buffer) - 4); } else { @@ -299,7 +299,7 @@ buffer_p = buffer; va_start(ap, length); - while(remain > 0) { + while (remain > 0) { *buffer_p++ = va_arg(ap, int); remain--; } @@ -348,7 +348,7 @@ ); if (usb_err < 0) return(usb_err); - while(length) { + while (length) { if (length < sizeof(*header)) { LOG_ERROR("Malformed DTC image\n"); exit(1); @@ -1169,7 +1169,7 @@ x = 0; dtc_mask = 1 << (extra_bits - 1); - while(extra_bits--) { + while (extra_bits--) { if (*tdi_p & tdi_mask) { x |= dtc_mask; } @@ -1190,7 +1190,7 @@ } /* Loop scheduling full bytes into the DTC command buffer */ - while(byte_bits) { + while (byte_bits) { if (type == SCAN_IN) { /* make sure there's room for stop and byte op */ x = (dtc_queue.cmd_index >= sizeof(dtc_queue.cmd_buffer) - (1 + 1)); @@ -1260,7 +1260,7 @@ x = 0; dtc_mask = 1 << (8 - 1); - while(chunk_bits--) { + while (chunk_bits--) { if (*tdi_p & tdi_mask) { x |= dtc_mask; } @@ -1315,7 +1315,7 @@ x = 0; dtc_mask = 1 << (8 - 1); - while(extra_bits--) { + while (extra_bits--) { if (*tdi_p & tdi_mask) { x |= dtc_mask; } @@ -1682,7 +1682,7 @@ LOG_DEBUG("interface claimed!\n"); break; } - } while(--retries); + } while (--retries); if (!i) { @@ -1695,7 +1695,7 @@ success=1; } } - } while(0); + } while (0); } } } Modified: trunk/src/jtag/tcl.c =================================================================== --- trunk/src/jtag/tcl.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/jtag/tcl.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -367,7 +367,7 @@ /* clear them as we find them */ reqbits = (NTREQ_IRLEN | NTREQ_IRCAPTURE | NTREQ_IRMASK); - while( goi->argc ){ + while ( goi->argc ){ e = Jim_GetOpt_Nvp( goi, opts, &n ); if ( e != JIM_OK ){ Jim_GetOpt_NvpUnknown( goi, opts, 0 ); @@ -441,7 +441,7 @@ break; } } /* switch(n->value) */ - } /* while( goi->argc ) */ + } /* while ( goi->argc ) */ /* default is enabled-after-reset */ pTap->enabled = !pTap->disabled_after_reset; @@ -861,7 +861,7 @@ command_print(cmd_ctx, " TapName | Enabled | IdCode Expected IrLen IrCap IrMask Instr "); command_print(cmd_ctx, "---|--------------------|---------|------------|------------|------|------|------|---------"); - while( tap ){ + while ( tap ){ uint32_t expected, expected_mask, cur_instr, ii; expected = buf_get_u32(tap->expected, 0, tap->ir_length); expected_mask = buf_get_u32(tap->expected_mask, 0, tap->ir_length); Modified: trunk/src/server/server.c =================================================================== --- trunk/src/server/server.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/server/server.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -116,7 +116,7 @@ connection_t *c; /* find connection */ - while((c = *p)) + while ((c = *p)) { if (c->fd == connection->fd) { @@ -237,7 +237,7 @@ service_t *c; /* find service */ - while((c = *p)) + while ((c = *p)) { if (c->port == port) { @@ -264,7 +264,7 @@ service_t *c = services; /* loop service */ - while(c) + while (c) { service_t *next = c->next; @@ -310,7 +310,7 @@ tv.tv_sec = 0; tv.tv_usec = 10000; - while(!shutdown_openocd) + while (!shutdown_openocd) { /* monitor sockets for acitvity */ fd_max = 0; Modified: trunk/src/target/arm11_dbgtap.c =================================================================== --- trunk/src/target/arm11_dbgtap.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/target/arm11_dbgtap.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -30,7 +30,7 @@ #if 0 #define JTAG_DEBUG(expr ...) DEBUG(expr) #else -#define JTAG_DEBUG(expr ...) do {} while(0) +#define JTAG_DEBUG(expr ...) do {} while (0) #endif /* Modified: trunk/src/target/cortex_m3.c =================================================================== --- trunk/src/target/cortex_m3.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/target/cortex_m3.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -908,7 +908,7 @@ if (breakpoint->type == BKPT_HARD) { - while(comparator_list[fp_num].used && (fp_num < cortex_m3->fp_num_code)) + while (comparator_list[fp_num].used && (fp_num < cortex_m3->fp_num_code)) fp_num++; if (fp_num >= cortex_m3->fp_num_code) { @@ -1091,7 +1091,7 @@ if (watchpoint->mask == 0xffffffffu) { - while(comparator_list[dwt_num].used && (dwt_num < cortex_m3->dwt_num_comp)) + while (comparator_list[dwt_num].used && (dwt_num < cortex_m3->dwt_num_comp)) dwt_num++; if (dwt_num >= cortex_m3->dwt_num_comp) { Modified: trunk/src/target/mips32_dmaacc.c =================================================================== --- trunk/src/target/mips32_dmaacc.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/target/mips32_dmaacc.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -61,7 +61,7 @@ do { ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl; mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl); - } while(ejtag_ctrl & EJTAG_CTRL_DSTRT); + } while (ejtag_ctrl & EJTAG_CTRL_DSTRT); /* Read Data */ mips_ejtag_set_instr(ejtag_info, EJTAG_INST_DATA, NULL); @@ -107,7 +107,7 @@ do { ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl; mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl); - } while(ejtag_ctrl & EJTAG_CTRL_DSTRT); + } while (ejtag_ctrl & EJTAG_CTRL_DSTRT); /* Read Data */ mips_ejtag_set_instr(ejtag_info, EJTAG_INST_DATA, NULL); @@ -159,7 +159,7 @@ do { ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl; mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl); - } while(ejtag_ctrl & EJTAG_CTRL_DSTRT); + } while (ejtag_ctrl & EJTAG_CTRL_DSTRT); /* Read Data */ mips_ejtag_set_instr(ejtag_info, EJTAG_INST_DATA, NULL); @@ -226,7 +226,7 @@ do { ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl; mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl); - } while(ejtag_ctrl & EJTAG_CTRL_DSTRT); + } while (ejtag_ctrl & EJTAG_CTRL_DSTRT); /* Clear DMA & Check DERR */ mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL, NULL); @@ -277,7 +277,7 @@ do { ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl; mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl); - } while(ejtag_ctrl & EJTAG_CTRL_DSTRT); + } while (ejtag_ctrl & EJTAG_CTRL_DSTRT); /* Clear DMA & Check DERR */ mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL, NULL); @@ -329,7 +329,7 @@ do { ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl; mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl); - } while(ejtag_ctrl & EJTAG_CTRL_DSTRT); + } while (ejtag_ctrl & EJTAG_CTRL_DSTRT); /* Clear DMA & Check DERR */ mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL, NULL); Modified: trunk/src/target/mips_m4k.c =================================================================== --- trunk/src/target/mips_m4k.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/target/mips_m4k.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -509,7 +509,7 @@ { int bp_num = 0; - while(comparator_list[bp_num].used && (bp_num < mips32->num_inst_bpoints)) + while (comparator_list[bp_num].used && (bp_num < mips32->num_inst_bpoints)) bp_num++; if (bp_num >= mips32->num_inst_bpoints) { Modified: trunk/src/target/target.c =================================================================== --- trunk/src/target/target.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/target/target.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -244,7 +244,7 @@ x = -1; t = all_targets; - while( t ){ + while ( t ){ if ( x < t->target_number ){ x = (t->target_number)+1; } @@ -262,7 +262,7 @@ /* number is 0 based */ x = -1; t = all_targets; - while(t){ + while (t){ if ( x < t->target_number ){ x = t->target_number; } @@ -1728,7 +1728,7 @@ reg_cache_t *cache = target->reg_cache; count = 0; - while(cache) + while (cache) { int i; for (i = 0; i < cache->num_regs; i++) @@ -1759,7 +1759,7 @@ reg_cache_t *cache = target->reg_cache; count = 0; - while(cache) + while (cache) { int i; for (i = 0; i < cache->num_regs; i++) @@ -3378,7 +3378,7 @@ teap = target->event_action; done = 0; - while( teap ){ + while ( teap ){ if ( teap->event == e ){ done = 1; LOG_DEBUG( "target: (%d) %s (%s) event: %d (%s) action: %s\n", @@ -3437,7 +3437,7 @@ int e; /* parse config or cget options ... */ - while( goi->argc > 0 ){ + while ( goi->argc > 0 ){ Jim_SetEmptyResult( goi->interp ); /* Jim_GetOpt_Debug( goi ); */ @@ -3505,7 +3505,7 @@ teap = target->event_action; /* replace existing? */ - while( teap ){ + while ( teap ){ if ( teap->event == (enum target_event)n->value ){ break; } @@ -3687,7 +3687,7 @@ /* loop for more e*/ break; } - } /* while( goi->argc ) */ + } /* while ( goi->argc ) */ /* done - we return */ @@ -3881,7 +3881,7 @@ /* convert to "bytes" */ c = c * b; /* count is now in 'BYTES' */ - while( c > 0 ){ + while ( c > 0 ){ y = c; if ( y > 16 ){ y = 16; @@ -3934,7 +3934,7 @@ } } /* space pad */ - while( x < 16 ){ + while ( x < 16 ){ target_buf[x] = ' '; x++; } @@ -4063,7 +4063,7 @@ target->cmd_name ); command_print( cmd_ctx, "%-25s | Body", "Event"); command_print( cmd_ctx, "------------------------- | ----------------------------------------"); - while( teap ){ + while ( teap ){ command_print( cmd_ctx, "%-25s | %s", Jim_Nvp_value2name_simple( nvp_target_event, teap->event )->name, @@ -4236,7 +4236,7 @@ { target_t **tpp; tpp = &(all_targets); - while( *tpp ){ + while ( *tpp ){ tpp = &( (*tpp)->next ); } *tpp = target; @@ -4326,7 +4326,7 @@ } Jim_SetResult( goi.interp, Jim_NewListObj( goi.interp, NULL, 0 ) ); target = all_targets; - while( target ){ + while ( target ){ Jim_ListAppendElement( goi.interp, Jim_GetResult(goi.interp), Jim_NewStringObj( goi.interp, target->cmd_name, -1 ) ); Modified: trunk/src/xsvf/xsvf.c =================================================================== --- trunk/src/xsvf/xsvf.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/src/xsvf/xsvf.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -261,7 +261,7 @@ LOG_USER("xsvf processing file: \"%s\"", filename); - while( read(xsvf_fd, &opcode, 1) > 0 ) + while ( read(xsvf_fd, &opcode, 1) > 0 ) { /* record the position of the just read opcode within the file */ file_offset = lseek(xsvf_fd, 0, SEEK_CUR) - 1; Modified: trunk/testing/examples/PIC32/BlinkingLeds.c =================================================================== --- trunk/testing/examples/PIC32/BlinkingLeds.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/testing/examples/PIC32/BlinkingLeds.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -9,7 +9,7 @@ mPORTDClearBits(BIT_2); mPORTDSetPinsDigitalOut(BIT_2); - while(1) + while (1) { for(i = 0; i < 500000; i++) mPORTDToggleBits(BIT_0); Modified: trunk/testing/examples/ledtest-imx27ads/test.c =================================================================== --- trunk/testing/examples/ledtest-imx27ads/test.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/testing/examples/ledtest-imx27ads/test.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -48,13 +48,13 @@ void exit(int exit_code) { - while(1); + while (1); } /* EXIT */ atexit() { - while(1); + while (1); } /* ATEXIT */ Modified: trunk/testing/examples/ledtest-imx31pdk/test.c =================================================================== --- trunk/testing/examples/ledtest-imx31pdk/test.c 2009-06-23 22:35:09 UTC (rev 2357) +++ trunk/testing/examples/ledtest-imx31pdk/test.c 2009-06-23 22:36:11 UTC (rev 2358) @@ -29,7 +29,7 @@ { volatile unsigned char *led = ((volatile unsigned char *)0xB6020000); - while(1) + while (1) { *led = 0xFF; delay(); @@ -46,13 +46,13 @@ void exit(int exit_code) { - while(1); + while (1); } /* EXIT */ atexit() { - while(1); + while (1); } /* ATEXIT */ |
From: <zw...@ma...> - 2009-06-24 00:36:05
|
Author: zwelch Date: 2009-06-24 00:35:09 +0200 (Wed, 24 Jun 2009) New Revision: 2357 Modified: trunk/src/flash/at91sam7.c trunk/src/flash/cfi.c trunk/src/flash/ecos.c trunk/src/flash/flash.c trunk/src/flash/lpc2000.c trunk/src/flash/lpc288x.c trunk/src/flash/mflash.c trunk/src/flash/pic32mx.c trunk/src/flash/stellaris.c trunk/src/flash/stm32x.c trunk/src/flash/str9x.c trunk/src/flash/str9xpec.c trunk/src/helper/command.c trunk/src/helper/fileio.c trunk/src/helper/ioutil.c trunk/src/helper/jim.c trunk/src/helper/jim.h trunk/src/helper/log.c trunk/src/helper/options.c trunk/src/jtag/arm-jtag-ew.c trunk/src/jtag/bitbang.c trunk/src/jtag/core.c trunk/src/jtag/dummy.c trunk/src/jtag/interface.c trunk/src/jtag/rlink/rlink.c trunk/src/jtag/tcl.c trunk/src/jtag/usbprog.c trunk/src/jtag/vsllink.c trunk/src/jtag/zy1000/zy1000.c trunk/src/server/gdb_server.c trunk/src/target/arm720t.c trunk/src/target/arm7_9_common.c trunk/src/target/arm7tdmi.c trunk/src/target/arm_jtag.c trunk/src/target/arm_simulator.c trunk/src/target/armv7m.c trunk/src/target/cortex_m3.c trunk/src/target/feroceon.c trunk/src/target/image.c trunk/src/target/mips32_pracc.c trunk/src/target/mips_ejtag.c trunk/src/target/mips_m4k.c trunk/src/target/oocd_trace.c trunk/src/target/target.c trunk/src/target/xscale.c trunk/src/xsvf/xsvf.c Log: - Replace 'if(' with 'if ('. Modified: trunk/src/flash/at91sam7.c =================================================================== --- trunk/src/flash/at91sam7.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/at91sam7.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -890,7 +890,7 @@ at91sam7_read_clock_info(bank); at91sam7_set_flash_mode(bank, FMR_TIMING_FLASH); - if(erase_all) + if (erase_all) { if (at91sam7_flash_command(bank, EA, 0) != ERROR_OK) { @@ -1027,7 +1027,7 @@ /* Write one block to the PageWriteBuffer */ buffer_pos = (pagen-first_page)*dst_min_alignment; wcount = CEIL(count,4); - if((retval = target_write_memory(target, bank->base+pagen*dst_min_alignment, 4, wcount, buffer+buffer_pos)) != ERROR_OK) + if ((retval = target_write_memory(target, bank->base+pagen*dst_min_alignment, 4, wcount, buffer+buffer_pos)) != ERROR_OK) { return retval; } Modified: trunk/src/flash/cfi.c =================================================================== --- trunk/src/flash/cfi.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/cfi.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -114,7 +114,7 @@ { cfi_flash_bank_t *cfi_info = bank->driver_priv; - if(cfi_info->x16_as_x8) offset*=2; + if (cfi_info->x16_as_x8) offset*=2; /* while the sector list isn't built, only accesses to sector 0 work */ if (sector == 0) @@ -209,7 +209,7 @@ cfi_flash_bank_t *cfi_info = bank->driver_priv; uint8_t data[CFI_MAX_BUS_WIDTH * 2]; - if(cfi_info->x16_as_x8) + if (cfi_info->x16_as_x8) { uint8_t i; for(i=0;i<2;i++) @@ -231,7 +231,7 @@ cfi_flash_bank_t *cfi_info = bank->driver_priv; uint8_t data[CFI_MAX_BUS_WIDTH * 4]; - if(cfi_info->x16_as_x8) + if (cfi_info->x16_as_x8) { uint8_t i; for(i=0;i<4;i++) @@ -356,12 +356,12 @@ if ((pri_ext->pri[0] != 'P') || (pri_ext->pri[1] != 'R') || (pri_ext->pri[2] != 'I')) { cfi_command(bank, 0xf0, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0xff, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -422,7 +422,7 @@ if ((pri_ext->pri[0] != 'P') || (pri_ext->pri[1] != 'R') || (pri_ext->pri[2] != 'I')) { cfi_command(bank, 0xf0, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -495,7 +495,7 @@ if ((atmel_pri_ext.pri[0] != 'P') || (atmel_pri_ext.pri[1] != 'R') || (atmel_pri_ext.pri[2] != 'I')) { cfi_command(bank, 0xf0, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -691,13 +691,13 @@ for (i = first; i <= last; i++) { cfi_command(bank, 0x20, command); - if((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0xd0, command); - if((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -707,7 +707,7 @@ else { cfi_command(bank, 0xff, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -734,37 +734,37 @@ for (i = first; i <= last; i++) { cfi_command(bank, 0xaa, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x55, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock2), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock2), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x80, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0xaa, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x55, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock2), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock2), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x30, command); - if((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -774,7 +774,7 @@ else { cfi_command(bank, 0xf0, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -845,7 +845,7 @@ { cfi_command(bank, 0x60, command); LOG_DEBUG("address: 0x%4.4" PRIx32 ", command: 0x%4.4" PRIx32, flash_address(bank, i, 0x0), target_buffer_get_u32(target, command)); - if((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -853,7 +853,7 @@ { cfi_command(bank, 0x01, command); LOG_DEBUG("address: 0x%4.4" PRIx32 ", command: 0x%4.4" PRIx32 , flash_address(bank, i, 0x0), target_buffer_get_u32(target, command)); - if((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -863,7 +863,7 @@ { cfi_command(bank, 0xd0, command); LOG_DEBUG("address: 0x%4.4" PRIx32 ", command: 0x%4.4" PRIx32, flash_address(bank, i, 0x0), target_buffer_get_u32(target, command)); - if((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -881,7 +881,7 @@ uint8_t block_status; /* read block lock bit, to verify status */ cfi_command(bank, 0x90, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x55), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x55), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -891,7 +891,7 @@ { LOG_ERROR("couldn't change block lock status (set = %i, block_status = 0x%2.2x)", set, block_status); cfi_command(bank, 0x70, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x55), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x55), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -920,13 +920,13 @@ cfi_intel_clear_status_register(bank); cfi_command(bank, 0x60, command); - if((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x01, command); - if((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, i, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -1214,7 +1214,7 @@ uint32_t thisrun_count = (count > buffer_size) ? buffer_size : count; uint32_t wsm_error; - if((retval = target_write_buffer(target, source->address, thisrun_count, buffer)) != ERROR_OK) + if ((retval = target_write_buffer(target, source->address, thisrun_count, buffer)) != ERROR_OK) { goto cleanup; } @@ -1461,7 +1461,7 @@ } /* write algorithm code to working area */ - if((retval = target_write_buffer(target, cfi_info->write_algorithm->address, + if ((retval = target_write_buffer(target, cfi_info->write_algorithm->address, target_code_size, target_code)) != ERROR_OK) { free(target_code); @@ -1557,12 +1557,12 @@ cfi_intel_clear_status_register(bank); cfi_command(bank, 0x40, command); - if((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) { return retval; } - if((retval = target_write_memory(target, address, bank->bus_width, 1, word)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, 1, word)) != ERROR_OK) { return retval; } @@ -1570,7 +1570,7 @@ if (cfi_intel_wait_status_busy(bank, 1000 * (1 << cfi_info->word_write_timeout_max)) != 0x80) { cfi_command(bank, 0xff, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -1626,14 +1626,14 @@ /* Initiate buffer operation _*/ cfi_command(bank, 0xE8, command); - if((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) { return retval; } if (cfi_intel_wait_status_busy(bank, 1000 * (1 << cfi_info->buf_write_timeout_max)) != 0x80) { cfi_command(bank, 0xff, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -1644,26 +1644,26 @@ /* Write buffer wordcount-1 and data words */ cfi_command(bank, bufferwsize-1, command); - if((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) { return retval; } - if((retval = target_write_memory(target, address, bank->bus_width, bufferwsize, word)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, bufferwsize, word)) != ERROR_OK) { return retval; } /* Commit write operation */ cfi_command(bank, 0xd0, command); - if((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) { return retval; } if (cfi_intel_wait_status_busy(bank, 1000 * (1 << cfi_info->buf_write_timeout_max)) != 0x80) { cfi_command(bank, 0xff, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -1684,24 +1684,24 @@ uint8_t command[8]; cfi_command(bank, 0xaa, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x55, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock2), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock2), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0xa0, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } - if((retval = target_write_memory(target, address, bank->bus_width, 1, word)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, 1, word)) != ERROR_OK) { return retval; } @@ -1709,7 +1709,7 @@ if (cfi_spansion_wait_status_busy(bank, 1000 * (1 << cfi_info->word_write_timeout_max)) != ERROR_OK) { cfi_command(bank, 0xf0, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -1761,39 +1761,39 @@ // Unlock cfi_command(bank, 0xaa, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x55, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock2), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock2), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } // Buffer load command cfi_command(bank, 0x25, command); - if((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) { return retval; } /* Write buffer wordcount-1 and data words */ cfi_command(bank, bufferwsize-1, command); - if((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) { return retval; } - if((retval = target_write_memory(target, address, bank->bus_width, bufferwsize, word)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, bufferwsize, word)) != ERROR_OK) { return retval; } /* Commit write operation */ cfi_command(bank, 0x29, command); - if((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, address, bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -1801,7 +1801,7 @@ if (cfi_spansion_wait_status_busy(bank, 1000 * (1 << cfi_info->word_write_timeout_max)) != ERROR_OK) { cfi_command(bank, 0xf0, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -1893,7 +1893,7 @@ for (i = 0; i < align; ++i, ++copy_p) { uint8_t byte; - if((retval = target_read_memory(target, copy_p, 1, 1, &byte)) != ERROR_OK) + if ((retval = target_read_memory(target, copy_p, 1, 1, &byte)) != ERROR_OK) { return retval; } @@ -1912,7 +1912,7 @@ for (; (count == 0) && (i < bank->bus_width); ++i, ++copy_p) { uint8_t byte; - if((retval = target_read_memory(target, copy_p, 1, 1, &byte)) != ERROR_OK) + if ((retval = target_read_memory(target, copy_p, 1, 1, &byte)) != ERROR_OK) { return retval; } @@ -2016,12 +2016,12 @@ /* return to read array mode, so we can read from flash again for padding */ cfi_command(bank, 0xf0, current_word); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, current_word)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, current_word)) != ERROR_OK) { return retval; } cfi_command(bank, 0xff, current_word); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, current_word)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, current_word)) != ERROR_OK) { return retval; } @@ -2043,7 +2043,7 @@ for (; i < bank->bus_width; ++i, ++copy_p) { uint8_t byte; - if((retval = target_read_memory(target, copy_p, 1, 1, &byte)) != ERROR_OK) + if ((retval = target_read_memory(target, copy_p, 1, 1, &byte)) != ERROR_OK) { return retval; } @@ -2056,7 +2056,7 @@ /* return to read array mode */ cfi_command(bank, 0xf0, current_word); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, current_word)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, current_word)) != ERROR_OK) { return retval; } @@ -2137,17 +2137,17 @@ /* switch to read identifier codes mode ("AUTOSELECT") */ cfi_command(bank, 0xaa, command); - if((retval = target_write_memory(target, flash_address(bank, 0, unlock1), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, unlock1), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x55, command); - if((retval = target_write_memory(target, flash_address(bank, 0, unlock2), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, unlock2), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x90, command); - if((retval = target_write_memory(target, flash_address(bank, 0, unlock1), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, unlock1), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -2155,11 +2155,11 @@ if (bank->chip_width == 1) { uint8_t manufacturer, device_id; - if((retval = target_read_u8(target, flash_address(bank, 0, 0x00), &manufacturer)) != ERROR_OK) + if ((retval = target_read_u8(target, flash_address(bank, 0, 0x00), &manufacturer)) != ERROR_OK) { return retval; } - if((retval = target_read_u8(target, flash_address(bank, 0, 0x01), &device_id)) != ERROR_OK) + if ((retval = target_read_u8(target, flash_address(bank, 0, 0x01), &device_id)) != ERROR_OK) { return retval; } @@ -2168,11 +2168,11 @@ } else if (bank->chip_width == 2) { - if((retval = target_read_u16(target, flash_address(bank, 0, 0x00), &cfi_info->manufacturer)) != ERROR_OK) + if ((retval = target_read_u16(target, flash_address(bank, 0, 0x00), &cfi_info->manufacturer)) != ERROR_OK) { return retval; } - if((retval = target_read_u16(target, flash_address(bank, 0, 0x02), &cfi_info->device_id)) != ERROR_OK) + if ((retval = target_read_u16(target, flash_address(bank, 0, 0x02), &cfi_info->device_id)) != ERROR_OK) { return retval; } @@ -2181,12 +2181,12 @@ LOG_INFO("Flash Manufacturer/Device: 0x%04x 0x%04x", cfi_info->manufacturer, cfi_info->device_id); /* switch back to read array mode */ cfi_command(bank, 0xf0, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x00), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x00), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0xff, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x00), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x00), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -2207,7 +2207,7 @@ * SST flashes clearly violate this, and we will consider them incompatbile for now */ cfi_command(bank, 0x98, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x55), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x55), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -2221,12 +2221,12 @@ if ((cfi_info->qry[0] != 'Q') || (cfi_info->qry[1] != 'R') || (cfi_info->qry[2] != 'Y')) { cfi_command(bank, 0xf0, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0xff, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -2314,12 +2314,12 @@ * we use both reset commands, as some Intel flashes fail to recognize the 0xF0 command */ cfi_command(bank, 0xf0, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0xff, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x0), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -2417,7 +2417,7 @@ return ERROR_FLASH_OPERATION_FAILED; cfi_command(bank, 0x90, command); - if((retval = target_write_memory(target, flash_address(bank, 0, 0x55), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, 0x55), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } @@ -2446,19 +2446,19 @@ int i; cfi_command(bank, 0xaa, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x55, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock2), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock2), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } cfi_command(bank, 0x90, command); - if((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) + if ((retval = target_write_memory(target, flash_address(bank, 0, pri_ext->_unlock1), bank->bus_width, 1, command)) != ERROR_OK) { return retval; } Modified: trunk/src/flash/ecos.c =================================================================== --- trunk/src/flash/ecos.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/ecos.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -139,7 +139,7 @@ } info = malloc(sizeof(ecosflash_flash_bank_t)); - if(info == NULL) + if (info == NULL) { LOG_ERROR("no memory for flash bank info"); exit(-1); Modified: trunk/src/flash/flash.c =================================================================== --- trunk/src/flash/flash.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/flash.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -748,7 +748,7 @@ pattern = strtoul(args[1], NULL, 0); count = strtoul(args[2], NULL, 0); - if(count == 0) + if (count == 0) return ERROR_OK; switch(cmd[4]) @@ -796,7 +796,7 @@ cur_size = MIN( (count*wordsize - wrote), sizeof(chunk) ); flash_bank_t *bank; bank = get_flash_bank_by_addr(target, address); - if(bank == NULL) + if (bank == NULL) { return ERROR_FAIL; } @@ -826,7 +826,7 @@ return retval; } - if(err == ERROR_OK) + if (err == ERROR_OK) { float speed; speed=wrote / 1024.0; @@ -994,7 +994,7 @@ } } - if( first == -1 || last == -1 ) + if ( first == -1 || last == -1 ) return ERROR_OK; return flash_driver_erase(c, first, last); Modified: trunk/src/flash/lpc2000.c =================================================================== --- trunk/src/flash/lpc2000.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/lpc2000.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -258,7 +258,7 @@ /* write IAP code to working area */ target_buffer_set_u32(target, jump_gate, ARMV4_5_BX(12)); target_buffer_set_u32(target, jump_gate + 4, ARMV4_5_B(0xfffffe, 0)); - if((retval = target_write_memory(target, lpc2000_info->iap_working_area->address, 4, 2, jump_gate)) != ERROR_OK) + if ((retval = target_write_memory(target, lpc2000_info->iap_working_area->address, 4, 2, jump_gate)) != ERROR_OK) { return retval; } Modified: trunk/src/flash/lpc288x.c =================================================================== --- trunk/src/flash/lpc288x.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/lpc288x.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -129,7 +129,7 @@ target_read_u32(target, F_STAT, &status); }while (((status & FS_DONE) == 0) && timeout); - if(timeout == 0) + if (timeout == 0) { LOG_DEBUG("Timedout!"); return ERROR_FLASH_OPERATION_FAILED; Modified: trunk/src/flash/mflash.c =================================================================== --- trunk/src/flash/mflash.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/mflash.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -298,7 +298,7 @@ if ((ret = target_read_u8(target, mg_task_reg + MG_REG_DRV_CTRL, &value)) != ERROR_OK) return ret; - if(on) { + if (on) { value |= (mg_io_rbit_devc_srst); } else { value &= ~mg_io_rbit_devc_srst; @@ -892,7 +892,7 @@ int i, NO; for (i = 0, NO = 1; i < 2; ++i, output_div >>= 1) - if(output_div & 1) + if (output_div & 1) NO = NO << 1; return NO; Modified: trunk/src/flash/pic32mx.c =================================================================== --- trunk/src/flash/pic32mx.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/pic32mx.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -151,7 +151,7 @@ LOG_DEBUG("status: 0x%" PRIx32, status ); alive_sleep(1); } - if(timeout <= 0) + if (timeout <= 0) LOG_DEBUG("timeout: status: 0x%" PRIx32, status ); return status; @@ -194,11 +194,11 @@ } target_read_u32(target, PIC32MX_DEVCFG0, &devcfg0); - if((devcfg0 & (1<<28)) == 0) /* code protect bit */ + if ((devcfg0 & (1<<28)) == 0) /* code protect bit */ num_pages = 0xffff; /* All pages protected */ - else if(bank->base == PIC32MX_KSEG1_BOOT_FLASH) + else if (bank->base == PIC32MX_KSEG1_BOOT_FLASH) { - if(devcfg0 & (1<<24)) + if (devcfg0 & (1<<24)) num_pages = 0; /* All pages unprotected */ else num_pages = 0xffff; /* All pages protected */ @@ -229,25 +229,25 @@ { LOG_DEBUG("Erasing entire program flash"); status = pic32mx_nvm_exec(bank, NVMCON_OP_PFM_ERASE, 50); - if( status & NVMCON_NVMERR ) + if ( status & NVMCON_NVMERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & NVMCON_LVDERR ) + if ( status & NVMCON_LVDERR ) return ERROR_FLASH_OPERATION_FAILED; return ERROR_OK; } for (i = first; i <= last; i++) { - if(bank->base >= PIC32MX_KSEG1_PGM_FLASH) + if (bank->base >= PIC32MX_KSEG1_PGM_FLASH) target_write_u32(target, PIC32MX_NVMADDR, KS1Virt2Phys(bank->base + bank->sectors[i].offset)); else target_write_u32(target, PIC32MX_NVMADDR, KS0Virt2Phys(bank->base + bank->sectors[i].offset)); status = pic32mx_nvm_exec(bank, NVMCON_OP_PAGE_ERASE, 10); - if( status & NVMCON_NVMERR ) + if ( status & NVMCON_NVMERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & NVMCON_LVDERR ) + if ( status & NVMCON_LVDERR ) return ERROR_FLASH_OPERATION_FAILED; bank->sectors[i].is_erased = 1; } @@ -313,7 +313,7 @@ reg = (i / pic32mx_info->ppage_size) / 8; bit = (i / pic32mx_info->ppage_size) - (reg * 8); - if( set ) + if ( set ) prot_reg[reg] &= ~(1 << bit); else prot_reg[reg] |= (1 << bit); @@ -327,7 +327,7 @@ reg = (i / pic32mx_info->ppage_size) / 8; bit = (i / pic32mx_info->ppage_size) - (reg * 8); - if( set ) + if ( set ) prot_reg[reg] &= ~(1 << bit); else prot_reg[reg] |= (1 << bit); @@ -434,12 +434,12 @@ } #endif status = pic32mx_write_row(bank, address, source->address); - if( status & NVMCON_NVMERR ) { + if ( status & NVMCON_NVMERR ) { LOG_ERROR("Flash write error NVMERR (status=0x%08" PRIx32 ")", status); retval = ERROR_FLASH_OPERATION_FAILED; break; } - if( status & NVMCON_LVDERR ) { + if ( status & NVMCON_LVDERR ) { LOG_ERROR("Flash write error LVDERR (status=0x%08" PRIx32 ")", status); retval = ERROR_FLASH_OPERATION_FAILED; break; @@ -458,12 +458,12 @@ memcpy(&value, buffer, sizeof(uint32_t)); uint32_t status = pic32mx_write_word(bank, address, value); - if( status & NVMCON_NVMERR ) { + if ( status & NVMCON_NVMERR ) { LOG_ERROR("Flash write error NVMERR (status=0x%08" PRIx32 ")", status); retval = ERROR_FLASH_OPERATION_FAILED; break; } - if( status & NVMCON_LVDERR ) { + if ( status & NVMCON_LVDERR ) { LOG_ERROR("Flash write error LVDERR (status=0x%08" PRIx32 ")", status); retval = ERROR_FLASH_OPERATION_FAILED; break; @@ -481,7 +481,7 @@ { target_t *target = bank->target; - if(bank->base >= PIC32MX_KSEG1_PGM_FLASH) + if (bank->base >= PIC32MX_KSEG1_PGM_FLASH) target_write_u32(target, PIC32MX_NVMADDR, KS1Virt2Phys(address)); else target_write_u32(target, PIC32MX_NVMADDR, KS0Virt2Phys(address)); @@ -499,11 +499,11 @@ LOG_DEBUG("addr: 0x%08" PRIx32 " srcaddr: 0x%08" PRIx32 "", address, srcaddr); - if(address >= PIC32MX_KSEG1_PGM_FLASH) + if (address >= PIC32MX_KSEG1_PGM_FLASH) target_write_u32(target, PIC32MX_NVMADDR, KS1Virt2Phys(address)); else target_write_u32(target, PIC32MX_NVMADDR, KS0Virt2Phys(address)); - if(srcaddr >= PIC32MX_KSEG1_RAM) + if (srcaddr >= PIC32MX_KSEG1_RAM) target_write_u32(target, PIC32MX_NVMSRCADDR, KS1Virt2Phys(srcaddr)); else target_write_u32(target, PIC32MX_NVMSRCADDR, KS0Virt2Phys(srcaddr)); @@ -564,9 +564,9 @@ memcpy(&value, buffer + bytes_written, sizeof(uint32_t)); status = pic32mx_write_word(bank, address, value); - if( status & NVMCON_NVMERR ) + if ( status & NVMCON_NVMERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & NVMCON_LVDERR ) + if ( status & NVMCON_LVDERR ) return ERROR_FLASH_OPERATION_FAILED; bytes_written += 4; @@ -580,9 +580,9 @@ memcpy(&value, buffer + bytes_written, bytes_remaining); status = pic32mx_write_word(bank, address, value); - if( status & NVMCON_NVMERR ) + if ( status & NVMCON_NVMERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & NVMCON_LVDERR ) + if ( status & NVMCON_LVDERR ) return ERROR_FLASH_OPERATION_FAILED; } @@ -609,23 +609,23 @@ (unsigned)((device_id>>12)&0xff), (unsigned)((device_id>>20)&0xfff) ); - if(((device_id>>1)&0x7ff) != PIC32MX_MANUF_ID) { + if (((device_id>>1)&0x7ff) != PIC32MX_MANUF_ID) { LOG_WARNING( "Cannot identify target as a PIC32MX family." ); return ERROR_FLASH_OPERATION_FAILED; } page_size = 4096; - if(bank->base == PIC32MX_KSEG1_BOOT_FLASH || bank->base == 1) { + if (bank->base == PIC32MX_KSEG1_BOOT_FLASH || bank->base == 1) { /* 0xBFC00000: Boot flash size fixed at 12k */ num_pages = 12; } else { /* 0xBD000000: Program flash size varies with device */ for(i=0; pic32mx_devs[i].name != NULL; i++) - if(pic32mx_devs[i].devid == ((device_id >> 12) & 0xff)) { + if (pic32mx_devs[i].devid == ((device_id >> 12) & 0xff)) { num_pages = pic32mx_devs[i].pfm_size; break; } - if(pic32mx_devs[i].name == NULL) { + if (pic32mx_devs[i].name == NULL) { LOG_WARNING( "Cannot identify target as a PIC32MX family." ); return ERROR_FLASH_OPERATION_FAILED; } @@ -651,8 +651,8 @@ /* calculate numbers of pages */ num_pages /= (page_size / 1024); - if(bank->base == 0) bank->base = PIC32MX_KSEG1_PGM_FLASH; - if(bank->base == 1) bank->base = PIC32MX_KSEG1_BOOT_FLASH; + if (bank->base == 0) bank->base = PIC32MX_KSEG1_PGM_FLASH; + if (bank->base == 1) bank->base = PIC32MX_KSEG1_BOOT_FLASH; bank->size = (num_pages * page_size); bank->num_sectors = num_pages; bank->chip_width = 4; @@ -697,7 +697,7 @@ device_id = ejtag_info->idcode; - if(((device_id>>1)&0x7ff) != PIC32MX_MANUF_ID) { + if (((device_id>>1)&0x7ff) != PIC32MX_MANUF_ID) { snprintf(buf, buf_size, "Cannot identify target as a PIC32MX family (manufacturer 0x%03d != 0x%03d)\n", (unsigned)((device_id>>1)&0x7ff), @@ -705,11 +705,11 @@ return ERROR_FLASH_OPERATION_FAILED; } for(i=0; pic32mx_devs[i].name != NULL; i++) - if(pic32mx_devs[i].devid == ((device_id >> 12) & 0xff)) { + if (pic32mx_devs[i].devid == ((device_id >> 12) & 0xff)) { printed = snprintf(buf, buf_size, "PIC32MX%s", pic32mx_devs[i].name); break; } - if(pic32mx_devs[i].name == NULL) { + if (pic32mx_devs[i].name == NULL) { snprintf(buf, buf_size, "Cannot identify target as a PIC32MX family\n"); return ERROR_FLASH_OPERATION_FAILED; } @@ -847,13 +847,13 @@ target_write_u32(target, PIC32MX_FLASH_CR, FLASH_LOCK); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) { LOG_ERROR("pic32mx device protected"); return ERROR_OK; } - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) { LOG_ERROR("pic32mx device programming failed"); return ERROR_OK; @@ -931,9 +931,9 @@ res = ERROR_OK; status = pic32mx_write_word(bank, address, value); - if( status & NVMCON_NVMERR ) + if ( status & NVMCON_NVMERR ) res = ERROR_FLASH_OPERATION_FAILED; - if( status & NVMCON_LVDERR ) + if ( status & NVMCON_LVDERR ) res = ERROR_FLASH_OPERATION_FAILED; if (res == ERROR_OK) Modified: trunk/src/flash/stellaris.c =================================================================== --- trunk/src/flash/stellaris.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/stellaris.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -468,7 +468,7 @@ did0, did1, stellaris_info->dc0, stellaris_info->dc1); ver = did0 >> 28; - if((ver != 0) && (ver != 1)) + if ((ver != 0) && (ver != 1)) { LOG_WARNING("Unknown did0 version, cannot identify target"); return ERROR_FLASH_OPERATION_FAILED; @@ -482,7 +482,7 @@ ver = did1 >> 28; fam = (did1 >> 24) & 0xF; - if(((ver != 0) && (ver != 1)) || (fam != 0)) + if (((ver != 0) && (ver != 1)) || (fam != 0)) { LOG_WARNING("Unknown did1 version/family, cannot positively identify target as a Stellaris"); } @@ -614,7 +614,7 @@ /* Check acess violations */ target_read_u32(target, FLASH_CRIS, &flash_cris); - if(flash_cris & (AMASK)) + if (flash_cris & (AMASK)) { LOG_WARNING("Error erasing flash page %i, flash_cris 0x%" PRIx32 "", banknr, flash_cris); target_write_u32(target, FLASH_CRIS, 0); @@ -691,7 +691,7 @@ /* Check acess violations */ target_read_u32(target, FLASH_CRIS, &flash_cris); - if(flash_cris & (AMASK)) + if (flash_cris & (AMASK)) { LOG_WARNING("Error setting flash page protection, flash_cris 0x%" PRIx32 "", flash_cris); target_write_u32(target, FLASH_CRIS, 0); Modified: trunk/src/flash/stm32x.c =================================================================== --- trunk/src/flash/stm32x.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/stm32x.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -182,9 +182,9 @@ status = stm32x_wait_status_busy(bank, 10); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) return ERROR_FLASH_OPERATION_FAILED; /* clear readout protection and complementary option bytes @@ -218,9 +218,9 @@ status = stm32x_wait_status_busy(bank, 10); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) return ERROR_FLASH_OPERATION_FAILED; /* write protection byte 1 */ @@ -228,9 +228,9 @@ status = stm32x_wait_status_busy(bank, 10); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) return ERROR_FLASH_OPERATION_FAILED; /* write protection byte 2 */ @@ -238,9 +238,9 @@ status = stm32x_wait_status_busy(bank, 10); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) return ERROR_FLASH_OPERATION_FAILED; /* write protection byte 3 */ @@ -248,9 +248,9 @@ status = stm32x_wait_status_busy(bank, 10); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) return ERROR_FLASH_OPERATION_FAILED; /* write protection byte 4 */ @@ -258,9 +258,9 @@ status = stm32x_wait_status_busy(bank, 10); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) return ERROR_FLASH_OPERATION_FAILED; /* write readout protection bit */ @@ -268,9 +268,9 @@ status = stm32x_wait_status_busy(bank, 10); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) return ERROR_FLASH_OPERATION_FAILED; target_write_u32(target, STM32_FLASH_CR, FLASH_LOCK); @@ -338,7 +338,7 @@ { set = 1; - if( protection & (1 << i)) + if ( protection & (1 << i)) set = 0; for (s = 0; s < stm32x_info->ppage_size; s++) @@ -378,9 +378,9 @@ status = stm32x_wait_status_busy(bank, 10); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) return ERROR_FLASH_OPERATION_FAILED; - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) return ERROR_FLASH_OPERATION_FAILED; bank->sectors[i].is_erased = 1; } @@ -445,7 +445,7 @@ reg = (i / stm32x_info->ppage_size) / 8; bit = (i / stm32x_info->ppage_size) - (reg * 8); - if( set ) + if ( set ) prot_reg[reg] &= ~(1 << bit); else prot_reg[reg] |= (1 << bit); @@ -459,7 +459,7 @@ reg = (i / stm32x_info->ppage_size) / 8; bit = (i / stm32x_info->ppage_size) - (reg * 8); - if( set ) + if ( set ) prot_reg[reg] &= ~(1 << bit); else prot_reg[reg] |= (1 << bit); @@ -658,12 +658,12 @@ status = stm32x_wait_status_busy(bank, 5); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) { LOG_ERROR("flash memory not erased before writing"); return ERROR_FLASH_OPERATION_FAILED; } - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) { LOG_ERROR("flash memory write protected"); return ERROR_FLASH_OPERATION_FAILED; @@ -684,12 +684,12 @@ status = stm32x_wait_status_busy(bank, 5); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) { LOG_ERROR("flash memory not erased before writing"); return ERROR_FLASH_OPERATION_FAILED; } - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) { LOG_ERROR("flash memory write protected"); return ERROR_FLASH_OPERATION_FAILED; @@ -1188,13 +1188,13 @@ target_write_u32(target, STM32_FLASH_CR, FLASH_LOCK); - if( status & FLASH_WRPRTERR ) + if ( status & FLASH_WRPRTERR ) { LOG_ERROR("stm32x device protected"); return ERROR_OK; } - if( status & FLASH_PGERR ) + if ( status & FLASH_PGERR ) { LOG_ERROR("stm32x device programming failed"); return ERROR_OK; Modified: trunk/src/flash/str9x.c =================================================================== --- trunk/src/flash/str9x.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/str9x.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -305,7 +305,7 @@ { return retval; } - if( status & 0x80 ) + if ( status & 0x80 ) break; alive_sleep(1); } @@ -327,7 +327,7 @@ return retval; } - if( status & 0x22 ) + if ( status & 0x22 ) { LOG_ERROR("error erasing flash bank, status: 0x%x", status); return ERROR_FLASH_OPERATION_FAILED; @@ -365,7 +365,7 @@ adr = bank->base + bank->sectors[i].offset; target_write_u16(target, adr, 0x60); - if( set ) + if ( set ) target_write_u16(target, adr, 0x01); else target_write_u16(target, adr, 0xD0); @@ -578,7 +578,7 @@ for (timeout=0; timeout<1000; timeout++) { target_read_u8(target, bank_adr, &status); - if( status & 0x80 ) + if ( status & 0x80 ) break; alive_sleep(1); } @@ -627,7 +627,7 @@ for (timeout=0; timeout<1000; timeout++) { target_read_u8(target, bank_adr, &status); - if( status & 0x80 ) + if ( status & 0x80 ) break; alive_sleep(1); } Modified: trunk/src/flash/str9xpec.c =================================================================== --- trunk/src/flash/str9xpec.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/flash/str9xpec.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -101,7 +101,7 @@ int str9xpec_set_instr(jtag_tap_t *tap, uint32_t new_instr, tap_state_t end_state) { - if( tap == NULL ){ + if ( tap == NULL ){ return ERROR_TARGET_INVALID; } @@ -575,7 +575,7 @@ /* last bank: 0xFF signals a full device protect */ if (last == 0xFF) { - if( set ) + if ( set ) { status = str9xpec_lock_device(bank); } @@ -589,7 +589,7 @@ { for (i = first; i <= last; i++) { - if( set ) + if ( set ) buf_set_u32(str9xpec_info->options, str9xpec_info->sector_bits[i], 1, 1); else buf_set_u32(str9xpec_info->options, str9xpec_info->sector_bits[i], 1, 0); Modified: trunk/src/helper/command.c =================================================================== --- trunk/src/helper/command.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/helper/command.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -348,7 +348,7 @@ void command_output_text(command_context_t *context, const char *data) { - if( context && context->output_handler && data ){ + if ( context && context->output_handler && data ){ context->output_handler( context, data ); } } Modified: trunk/src/helper/fileio.c =================================================================== --- trunk/src/helper/fileio.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/helper/fileio.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -182,7 +182,7 @@ static inline int fileio_local_fgets(fileio_t *fileio, uint32_t size, char *buffer) { - if( fgets(buffer, size, fileio->file) == NULL) + if ( fgets(buffer, size, fileio->file) == NULL) return ERROR_FILEIO_OPERATION_FAILED; return ERROR_OK; Modified: trunk/src/helper/ioutil.c =================================================================== --- trunk/src/helper/ioutil.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/helper/ioutil.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -340,19 +340,19 @@ break; } - if( done == 0 ) break; + if ( done == 0 ) break; wrote = write(fd1, buf, done); - if( wrote != done ) SHOW_RESULT( write, wrote ); + if ( wrote != done ) SHOW_RESULT( write, wrote ); - if( wrote != done ) break; + if ( wrote != done ) break; } err = close(fd1); - if( err < 0 ) SHOW_RESULT( close, err ); + if ( err < 0 ) SHOW_RESULT( close, err ); err = close(fd2); - if( err < 0 ) SHOW_RESULT( close, err ); + if ( err < 0 ) SHOW_RESULT( close, err ); } @@ -372,7 +372,7 @@ } dirp = opendir(name); - if( dirp == NULL ) SHOW_RESULT( opendir, -1 ); + if ( dirp == NULL ) SHOW_RESULT( opendir, -1 ); for (;;) { @@ -421,7 +421,7 @@ } err = closedir(dirp); - if( err < 0 ) SHOW_RESULT( stat, err ); + if ( err < 0 ) SHOW_RESULT( stat, err ); } Modified: trunk/src/helper/jim.c =================================================================== --- trunk/src/helper/jim.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/helper/jim.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -544,7 +544,7 @@ #endif /* This may actually crash... we do it last */ - if( interp && interp->cookie_stderr ){ + if ( interp && interp->cookie_stderr ){ Jim_fprintf( interp, interp->cookie_stderr, JIM_NL "JIM INTERPRETER PANIC: "); Jim_vfprintf( interp, interp->cookie_stderr, fmt, ap ); Jim_fprintf( interp, interp->cookie_stderr, JIM_NL JIM_NL ); @@ -2064,7 +2064,7 @@ buf = jim_vasprintf( fmt, ap ); va_end(ap); - if( buf ){ + if ( buf ){ Jim_AppendString( interp, objPtr, buf, -1 ); jim_vasprintf_done(buf); } @@ -2283,7 +2283,7 @@ haveprec = 0; prec = -1; /* not found yet */ next_fmt: - if( fmtLen <= 0 ){ + if ( fmtLen <= 0 ){ break; } switch( *fmt ){ @@ -2345,7 +2345,7 @@ accum = (accum * 10) + (*fmt - '0'); fmt++; fmtLen--; } - if( inprec ){ + if ( inprec ){ haveprec = 1; prec = accum; } else { @@ -2356,24 +2356,24 @@ /* suck up the next item as an integer */ fmt++; fmtLen--; objc--; - if( objc <= 0 ){ + if ( objc <= 0 ){ goto not_enough_args; } - if( Jim_GetWide(interp,objv[0],&wideValue )== JIM_ERR ){ + if ( Jim_GetWide(interp,objv[0],&wideValue )== JIM_ERR ){ Jim_FreeNewObj(interp, resObjPtr ); return NULL; } - if( inprec ){ + if ( inprec ){ haveprec = 1; prec = wideValue; - if( prec < 0 ){ + if ( prec < 0 ){ /* man 3 printf says */ /* if prec is negative, it is zero */ prec = 0; } } else { width = wideValue; - if( width < 0 ){ + if ( width < 0 ){ ljust = 1; width = -width; } @@ -2402,32 +2402,32 @@ */ cp = fmt_str; *cp++ = '%'; - if( altfm ){ + if ( altfm ){ *cp++ = '#'; } - if( forceplus ){ + if ( forceplus ){ *cp++ = '+'; - } else if( spad ){ + } else if ( spad ){ /* PLUS overrides */ *cp++ = ' '; } - if( ljust ){ + if ( ljust ){ *cp++ = '-'; } - if( zpad ){ + if ( zpad ){ *cp++ = '0'; } - if( width > 0 ){ + if ( width > 0 ){ sprintf( cp, "%d", width ); /* skip ahead */ cp = strchr(cp,0); } /* did we find a period? */ - if( inprec ){ + if ( inprec ){ /* then add it */ *cp++ = '.'; /* did something occur after the period? */ - if( haveprec ){ + if ( haveprec ){ sprintf( cp, "%d", prec ); } cp = strchr(cp,0); @@ -2461,7 +2461,7 @@ case 'E': *cp++ = *fmt; *cp = 0; - if( Jim_GetDouble( interp, objv[0], &doubleValue ) == JIM_ERR ){ + if ( Jim_GetDouble( interp, objv[0], &doubleValue ) == JIM_ERR ){ Jim_FreeNewObj( interp, resObjPtr ); return NULL; } @@ -2475,7 +2475,7 @@ case 'x': case 'X': /* jim widevaluse are 64bit */ - if( sizeof(jim_wide) == sizeof(long long) ){ + if ( sizeof(jim_wide) == sizeof(long long) ){ *cp++ = 'l'; *cp++ = 'l'; } else { @@ -2627,12 +2627,12 @@ int e; e = Jim_Nvp_name2value_obj( interp, nvp_table, objPtr, &n ); - if( e == JIM_ERR ){ + if ( e == JIM_ERR ){ return e; } /* Success? found? */ - if( n->name ){ + if ( n->name ){ /* remove const */ *result = (Jim_Nvp *)n; return JIM_OK; @@ -8104,17 +8104,17 @@ { DIR *dir = 0; - if(name && name[0]) { + if (name && name[0]) { size_t base_length = strlen(name); const char *all = /* search pattern must end with suitable wildcard */ strchr("/\\", name[base_length - 1]) ? "*" : "/*"; - if((dir = (DIR *) Jim_Alloc(sizeof *dir)) != 0 && + if ((dir = (DIR *) Jim_Alloc(sizeof *dir)) != 0 && (dir->name = (char *) Jim_Alloc(base_length + strlen(all) + 1)) != 0) { strcat(strcpy(dir->name, name), all); - if((dir->handle = (long) _findfirst(dir->name, &dir->info)) != -1) + if ((dir->handle = (long) _findfirst(dir->name, &dir->info)) != -1) dir->result.d_name = 0; else { /* rollback */ Jim_Free(dir->name); @@ -8136,13 +8136,13 @@ { int result = -1; - if(dir) { - if(dir->handle != -1) + if (dir) { + if (dir->handle != -1) result = _findclose(dir->handle); Jim_Free(dir->name); Jim_Free(dir); } - if(result == -1) /* map all errors to EBADF */ + if (result == -1) /* map all errors to EBADF */ errno = EBADF; return result; } @@ -8151,8 +8151,8 @@ { struct dirent *result = 0; - if(dir && dir->handle != -1) { - if(!dir->result.d_name || _findnext(dir->handle, &dir->info) != -1) { + if (dir && dir->handle != -1) { + if (!dir->result.d_name || _findnext(dir->handle, &dir->info) != -1) { result = &dir->result; result->d_name = dir->info.name; } @@ -8894,7 +8894,7 @@ Jim_IncrRefCount(scriptObjPtr); - if( filename ){ + if ( filename ){ JimSetSourceInfo( interp, scriptObjPtr, filename, lineno ); } @@ -12412,7 +12412,7 @@ int Jim_vfprintf( Jim_Interp *interp, void *cookie, const char *fmt, va_list ap ) { - if( (interp == NULL) || (interp->cb_vfprintf == NULL) ){ + if ( (interp == NULL) || (interp->cb_vfprintf == NULL) ){ errno = ENOTSUP; return -1; } @@ -12421,7 +12421,7 @@ size_t Jim_fwrite( Jim_Interp *interp, const void *ptr, size_t size, size_t n, void *cookie ) { - if( (interp == NULL) || (interp->cb_fwrite == NULL) ){ + if ( (interp == NULL) || (interp->cb_fwrite == NULL) ){ errno = ENOTSUP; return 0; } @@ -12430,7 +12430,7 @@ size_t Jim_fread( Jim_Interp *interp, void *ptr, size_t size, size_t n, void *cookie ) { - if( (interp == NULL) || (interp->cb_fread == NULL) ){ + if ( (interp == NULL) || (interp->cb_fread == NULL) ){ errno = ENOTSUP; return 0; } @@ -12439,7 +12439,7 @@ int Jim_fflush( Jim_Interp *interp, void *cookie ) { - if( (interp == NULL) || (interp->cb_fflush == NULL) ){ + if ( (interp == NULL) || (interp->cb_fflush == NULL) ){ /* pretend all is well */ return 0; } @@ -12448,7 +12448,7 @@ char* Jim_fgets( Jim_Interp *interp, char *s, int size, void *cookie ) { - if( (interp == NULL) || (interp->cb_fgets == NULL) ){ + if ( (interp == NULL) || (interp->cb_fgets == NULL) ){ errno = ENOTSUP; return NULL; } @@ -12458,7 +12458,7 @@ Jim_Nvp_name2value_simple( const Jim_Nvp *p, const char *name ) { while( p->name ){ - if( 0 == strcmp( name, p->name ) ){ + if ( 0 == strcmp( name, p->name ) ){ break; } p++; @@ -12470,7 +12470,7 @@ Jim_Nvp_name2value_nocase_simple( const Jim_Nvp *p, const char *name ) { while( p->name ){ - if( 0 == strcasecmp( name, p->name ) ){ + if ( 0 == strcasecmp( name, p->name ) ){ break; } p++; @@ -12499,12 +12499,12 @@ p = Jim_Nvp_name2value_simple( _p, name ); /* result */ - if( result ){ + if ( result ){ *result = (Jim_Nvp *)(p); } /* found? */ - if( p->name ){ + if ( p->name ){ return JIM_OK; } else { return JIM_ERR; @@ -12524,11 +12524,11 @@ p = Jim_Nvp_name2value_nocase_simple( _p, name ); - if( puthere ){ + if ( puthere ){ *puthere = (Jim_Nvp *)(p); } /* found */ - if( p->name ){ + if ( p->name ){ return JIM_OK; } else { return JIM_ERR; @@ -12543,7 +12543,7 @@ jim_wide w; e = Jim_GetWide( interp, o, &w ); - if( e != JIM_OK ){ + if ( e != JIM_OK ){ return e; } @@ -12554,7 +12554,7 @@ Jim_Nvp_value2name_simple( const Jim_Nvp *p, int value ) { while( p->name ){ - if( value == p->value ){ + if ( value == p->value ){ break; } p++; @@ -12570,11 +12570,11 @@ p = Jim_Nvp_value2name_simple( _p, value ); - if( result ){ + if ( result ){ *result = (Jim_Nvp *)(p); } - if( p->name ){ + if ( p->name ){ return JIM_OK; } else { return JIM_ERR; @@ -12615,16 +12615,16 @@ Jim_Obj *o; o = NULL; // failure - if( goi->argc ){ + if ( goi->argc ){ // success o = goi->argv[0]; goi->argc -= 1; goi->argv += 1; } - if( puthere ){ + if ( puthere ){ *puthere = o; } - if( o != NULL ){ + if ( o != NULL ){ return JIM_OK; } else { return JIM_ERR; @@ -12640,9 +12640,9 @@ r = Jim_GetOpt_Obj( goi, &o ); - if( r == JIM_OK ){ + if ( r == JIM_OK ){ cp = Jim_GetString( o, len ); - if( puthere ){ + if ( puthere ){ /* remove const */ *puthere = (char *)(cp); } @@ -12657,14 +12657,14 @@ Jim_Obj *o; double _safe; - if( puthere == NULL ){ + if ( puthere == NULL ){ puthere = &_safe; } r = Jim_GetOpt_Obj( goi, &o ); - if( r == JIM_OK ){ + if ( r == JIM_OK ){ r = Jim_GetDouble( goi->interp, o, puthere ); - if( r != JIM_OK ){ + if ( r != JIM_OK ){ Jim_SetResult_sprintf( goi->interp, "not a number: %s", Jim_GetString( o, NULL ) ); @@ -12680,12 +12680,12 @@ Jim_Obj *o; jim_wide _safe; - if( puthere == NULL ){ + if ( puthere == NULL ){ puthere = &_safe; } r = Jim_GetOpt_Obj( goi, &o ); - if( r == JIM_OK ){ + if ( r == JIM_OK ){ r = Jim_GetWide( goi->interp, o, puthere ); } return r; @@ -12699,12 +12699,12 @@ Jim_Obj *o; int e; - if( puthere == NULL ){ + if ( puthere == NULL ){ puthere = &_safe; } e = Jim_GetOpt_Obj( goi, &o ); - if( e == JIM_OK ){ + if ( e == JIM_OK ){ e = Jim_Nvp_name2value_obj( goi->interp, nvp, o, @@ -12719,7 +12719,7 @@ const Jim_Nvp *nvptable, int hadprefix ) { - if( hadprefix ){ + if ( hadprefix ){ Jim_SetResult_NvpUnknown( goi->interp, goi->argv[-2], goi->argv[-1], @@ -12742,11 +12742,11 @@ Jim_Obj *o; int e; - if( puthere == NULL ){ + if ( puthere == NULL ){ puthere = &_safe; } e = Jim_GetOpt_Obj( goi, &o ); - if( e == JIM_OK ){ + if ( e == JIM_OK ){ e = Jim_GetEnum( goi->interp, o, lookup, @@ -12768,7 +12768,7 @@ va_start(ap,fmt); buf = jim_vasprintf( fmt, ap ); va_end(ap); - if( buf ){ + if ( buf ){ Jim_SetResultString( interp, buf, -1 ); jim_vasprintf_done(buf); } @@ -12782,7 +12782,7 @@ Jim_Obj *param_value, const Jim_Nvp *nvp ) { - if( param_name ){ + if ( param_name ){ Jim_SetResult_sprintf( interp, "%s: Unknown: %s, try one of: ", Jim_GetString( param_name, NULL ), @@ -12796,7 +12796,7 @@ const char *a; const char *b; - if( (nvp+1)->name ){ + if ( (nvp+1)->name ){ a = nvp->name; b = ", "; } else { @@ -12818,7 +12818,7 @@ { int x; - if( debug_string_obj ){ + if ( debug_string_obj ){ Jim_FreeObj( interp, debug_string_obj ); } Modified: trunk/src/helper/jim.h =================================================================== --- trunk/src/helper/jim.h 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/helper/jim.h 2009-06-23 22:35:09 UTC (rev 2357) @@ -987,7 +987,7 @@ * * while( goi.argc ){ * e = Jim_GetOpt_Nvp( &goi, nvp_options, &n ); - * if( e != JIM_OK ){ + * if ( e != JIM_OK ){ * Jim_GetOpt_NvpUnknown( &goi, nvp_options, 0 ); * return e; * } @@ -997,7 +997,7 @@ * printf("Option ALIVE specified\n"); * break; * case FIRST: - * if( goi.argc < 1 ){ + * if ( goi.argc < 1 ){ * .. not enough args error .. * } * Jim_GetOpt_String( &goi, &cp, NULL ); @@ -1008,7 +1008,7 @@ * break; * case POLITICS: * e = Jim_GetOpt_Nvp( &goi, nvp_politics, &n ); - * if( e != JIM_OK ){ + * if ( e != JIM_OK ){ * Jim_GetOpt_NvpUnknown( &goi, nvp_politics, 1 ); * return e; * } @@ -1105,7 +1105,7 @@ * while( goi.argc ){ * // Get the next option * e = Jim_GetOpt_Nvp( &goi, cmd_options, &n ); - * if( e != JIM_OK ){ + * if ( e != JIM_OK ){ * // option was not recognized * // pass 'hadprefix=0' because there is no prefix * Jim_GetOpt_NvpUnknown( &goi, cmd_options, 0 ); @@ -1116,7 +1116,7 @@ * case OPT_SEX: * // handle: --sex male|female|lots|needmore * e = Jim_GetOpt_Nvp( &goi, &nvp_sex, &n ); - * if( e != JIM_OK ){ + * if ( e != JIM_OK ){ * Jim_GetOpt_NvpUnknown( &ogi, nvp_sex, 1 ); * return e; * } Modified: trunk/src/helper/log.c =================================================================== --- trunk/src/helper/log.c 2009-06-23 07:38:01 UTC (rev 2356) +++ trunk/src/helper/log.c 2009-06-23 22:35:09 UTC (rev 2357) @@ -109,7 +109,7 @@ #endif string); } - else if(server_use_pipes == 0) + else if (server_use_pipes == 0... [truncated message content] |
From: oharboe at B. <oh...@ma...> - 2009-06-23 09:38:02
|
Author: oharboe Date: 2009-06-23 09:38:01 +0200 (Tue, 23 Jun 2009) New Revision: 2356 Modified: trunk/src/helper/types.h Log: update w/missing eCos definitions after latest round of compiler formatting warnings fixes Modified: trunk/src/helper/types.h =================================================================== --- trunk/src/helper/types.h 2009-06-22 22:37:04 UTC (rev 2355) +++ trunk/src/helper/types.h 2009-06-23 07:38:01 UTC (rev 2356) @@ -124,8 +124,18 @@ } #ifdef __ECOS +/* eCos plain lacks these definition... A series of upstream patches + * could probably repair it, but it seems like too much work to be + * worth it. + */ -/* eCos plain lacks this definition... */ + +#define PRIx32 "x" +#define PRId32 "d" +#define SCNx32 "x" +#define PRIi32 "i" +#define PRIu32 "u" + typedef CYG_ADDRWORD intptr_t; typedef int64_t intmax_t; typedef uint64_t uintmax_t; |
From: <zw...@ma...> - 2009-06-23 00:37:13
|
Author: zwelch Date: 2009-06-23 00:37:04 +0200 (Tue, 23 Jun 2009) New Revision: 2355 Modified: trunk/doc/openocd.texi Log: David Brownell <da...@pa...>: Move the short chapter about JIM-Tcl earlier, so that we can reasonably assume it's been introduced before we start presenting things that presume such an introduction. Plus a few minor typo-level fixes. Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2009-06-22 22:36:53 UTC (rev 2354) +++ trunk/doc/openocd.texi 2009-06-22 22:37:04 UTC (rev 2355) @@ -63,10 +63,10 @@ * Developers:: OpenOCD Developers * Building OpenOCD:: Building OpenOCD From SVN * JTAG Hardware Dongles:: JTAG Hardware Dongles +* About JIM-Tcl:: About JIM-Tcl * Running:: Running OpenOCD * OpenOCD Project Setup:: OpenOCD Project Setup * Config File Guidelines:: Config File Guidelines -* About JIM-Tcl:: About JIM-Tcl * Daemon Configuration:: Daemon Configuration * Interface - Dongle Configuration:: Interface - Dongle Configuration * Reset Configuration:: Reset Configuration @@ -659,6 +659,50 @@ @end itemize +@node About JIM-Tcl +@chapter About JIM-Tcl +@cindex JIM Tcl +@cindex tcl + +OpenOCD includes a small ``Tcl Interpreter'' known as JIM-Tcl. +This programming language provides a simple and extensible +command interpreter. + +All commands presented in this Guide are extensions to JIM-Tcl. +You can use them as simple commands, without needing to learn +much of anything about Tcl. +Alternatively, can write Tcl programs with them. + +You can learn more about JIM at its website, @url{http://jim.berlios.de}. + +@itemize @bullet +@item @b{JIM vs. Tcl} +@* JIM-TCL is a stripped down version of the well known Tcl language, +which can be found here: @url{http://www.tcl.tk}. JIM-Tcl has far +fewer features. JIM-Tcl is a single .C file and a single .H file and +implements the basic Tcl command set. In contrast: Tcl 8.6 is a +4.2 MB .zip file containing 1540 files. + +@item @b{Missing Features} +@* Our practice has been: Add/clone the real Tcl feature if/when +needed. We welcome JIM Tcl improvements, not bloat. + +@item @b{Scripts} +@* OpenOCD configuration scripts are JIM Tcl Scripts. OpenOCD's +command interpreter today is a mixture of (newer) +JIM-Tcl commands, and (older) the orginal command interpreter. + +@item @b{Commands} +@* At the OpenOCD telnet command line (or via the GDB mon command) one +can type a Tcl for() loop, set variables, etc. + +@item @b{Historical Note} +@* JIM-Tcl was introduced to OpenOCD in spring 2008. + +@item @b{Need a crash course in Tcl?} +@*@xref{Tcl Crash Course}. +@end itemize + @node Running @chapter Running @cindex command line options @@ -693,7 +737,7 @@ If you are having problems, you can enable internal debug messages via the ``-d'' option. -Also it is possible to interleave commands w/config scripts using the +Also it is possible to interleave JIM-Tcl commands w/config scripts using the @option{-c} command line switch. To enable debug output (when reporting problems or working on OpenOCD @@ -808,7 +852,7 @@ When you start OpenOCD from that directory, it searches there first for configuration files and for code you upload to the target board. -It is also be the natural place to write files, +It is also the natural place to write files, such as log files and data you download from the board. @section Configuration Basics @@ -848,7 +892,7 @@ You could wrap such long command lines in shell scripts, each supporting a different development task. -One might re-flash the board with specific firmware version. +One might re-flash the board with a specific firmware version. Another might set up a particular debugging or run-time environment. Here we will focus on the simpler solution: one user config @@ -1456,42 +1500,6 @@ @item pxa270 - again - CS0 flash - it goes in the board file. @end itemize -@node About JIM-Tcl -@chapter About JIM-Tcl -@cindex JIM Tcl -@cindex tcl - -OpenOCD includes a small ``TCL Interpreter'' known as JIM-TCL. You can -learn more about JIM here: @url{http://jim.berlios.de} - -@itemize @bullet -@item @b{JIM vs. Tcl} -@* JIM-TCL is a stripped down version of the well known Tcl language, -which can be found here: @url{http://www.tcl.tk}. JIM-Tcl has far -fewer features. JIM-Tcl is a single .C file and a single .H file and -impliments the basic Tcl command set along. In contrast: Tcl 8.6 is a -4.2 MB .zip file containing 1540 files. - -@item @b{Missing Features} -@* Our practice has been: Add/clone the real Tcl feature if/when -needed. We welcome JIM Tcl improvements, not bloat. - -@item @b{Scripts} -@* OpenOCD configuration scripts are JIM Tcl Scripts. OpenOCD's -command interpreter today is a mixture of (newer) -JIM-Tcl commands, and (older) the orginal command interpreter. - -@item @b{Commands} -@* At the OpenOCD telnet command line (or via the GDB mon command) one -can type a Tcl for() loop, set variables, etc. - -@item @b{Historical Note} -@* JIM-Tcl was introduced to OpenOCD in spring 2008. - -@item @b{Need a crash course in Tcl?} -@*@xref{Tcl Crash Course}. -@end itemize - @node Daemon Configuration @chapter Daemon Configuration @cindex initialization |
From: <zw...@ma...> - 2009-06-23 00:37:02
|
Author: zwelch Date: 2009-06-23 00:36:53 +0200 (Tue, 23 Jun 2009) New Revision: 2354 Modified: trunk/doc/openocd.texi Log: David Brownell <da...@pa...>: This should be my last significant update of the User's Guide for this release. Mostly it's a rework of the config file chapter's presentation of board and target config files. - Give the new path for scripts! - Move board-config material out of the target-config section - Add more board-config info, notably for reset-init events - Link out of the board-config section to NAND, NOR, and Reset chapters - Emphasize target input vs. output naming conventions - Other textual improvements Plus some other updates, like adding my copyright (now that I've basically rewritten much of this). Modified: trunk/doc/openocd.texi =================================================================== --- trunk/doc/openocd.texi 2009-06-22 19:22:10 UTC (rev 2353) +++ trunk/doc/openocd.texi 2009-06-22 22:36:53 UTC (rev 2354) @@ -23,6 +23,7 @@ @item Copyright @copyright{} 2007-2008 Spencer Oliver @email{spen@@spen-soft.co.uk} @item Copyright @copyright{} 2008 Oyvind Harboe @email{oyvind.harboe@@zylin.com} @item Copyright @copyright{} 2008 Duane Ellis @email{openocd@@duaneellis.com} +@item Copyright @copyright{} 2009 David Brownell @end itemize @quotation @@ -943,6 +944,10 @@ during some debug sessions, but don't make everyone use that either. Keep those kinds of debugging aids in your user config file. +TCP/IP port configuration is another example of something which +is environment-specific, and should only appear in +a user config file. @xref{TCP/IP Ports}. + @section Project-Specific Utilities A few project-specific utility @@ -1015,21 +1020,21 @@ needs to get a new board working smoothly. It provides guidelines for creating those files. -You should find the following directories under @t{$(INSTALLDIR)/lib/openocd} : +You should find the following directories under @t{$(INSTALLDIR)/scripts}: @itemize @bullet -@item @b{interface} -@*Think JTAG Dongle. Files that configure the JTAG dongle go here. -@item @b{board} -@* Think Circuit Board, PWA, PCB, they go by many names. Board files -contain initialization items that are specific to a board - for -example: The SDRAM initialization sequence for the board, or the type -of external flash and what address it is found at. Any initialization +@item @file{interface} ... +think JTAG Dongle. Files that configure JTAG adapters go here. +@item @file{board} ... +think Circuit Board, PWA, PCB, they go by many names. Board files +contain initialization items that are specific to a board. For +example, the SDRAM initialization sequence for the board, or the type +of external flash and what address it uses. Any initialization sequence to enable that external flash or SDRAM should be found in the -board file. Boards may also contain multiple targets, i.e.: Two CPUs, or +board file. Boards may also contain multiple targets: two CPUs; or a CPU and an FPGA or CPLD. -@item @b{target} -@* Think chip. The ``target'' directory represents the JTAG TAPs +@item @file{target} ... +think chip. The ``target'' directory represents the JTAG TAPs on a chip which OpenOCD should control, not a board. Two common types of targets are ARM chips and FPGA or CPLD chips. @@ -1045,7 +1050,7 @@ @section Interface Config Files The user config file -should be able to source one of these files via a command like this: +should be able to source one of these files with a command like this: @example source [find interface/FOOBAR.cfg] @@ -1060,179 +1065,250 @@ Read the OpenOCD source code if you have a new kind of hardware interface and need to provide a driver for it. -Interface files should be found in @t{$(INSTALLDIR)/lib/openocd/interface} - @section Board Config Files @cindex config file, board @cindex board config file The user config file -should be able to source one of these files via a command like this: +should be able to source one of these files with a command like this: @example source [find board/FOOBAR.cfg] @end example -The board config file should contain one or more @command{source [find -target/FOO.cfg]} statements along with any board specific things. - +The point of a board config file is to package everything +about a given board that user config files need to know. In summary the board files should contain (if present) @enumerate -@item External flash configuration (i.e.: NOR flash on CS0, two NANDs on CS2) -@item SDRAM configuration (size, speed, etc. -@item Board specific IO configuration (i.e.: GPIO pins might disable a 2nd flash) -@item Multiple TARGET source statements -@item Reset configuration +@item One or more @command{source [target/...cfg]} statements +@item NOR flash configuration (@pxref{NOR Configuration}) +@item NAND flash configuration (@pxref{NAND Configuration}) +@item Target @code{reset} handlers for SDRAM and I/O configuration +@item JTAG adapter reset configuration (@pxref{Reset Configuration}) @item All things that are not ``inside a chip'' -@item Things inside a chip go in a 'target' file @end enumerate -@section Target Config Files -@cindex config file, target -@cindex target config file +Generic things inside target chips belong in target config files, +not board config files. So for example a @code{reset-init} event +handler should know board-specific oscillator and PLL parameters, +which it passes to target-specific utility code. -Board config files should be able to source one or more -target config files via a command like this: +The most complex task of a board config file is creating such a +@code{reset-init} event handler. +Define those handlers last, after you verify the rest of the board +configuration works. +@subsection Communication Between Config files + +In addition to target-specific utility code, another way that +board and target config files communicate is by following a +convention on how to use certain variables. + +The full Tcl/Tk language supports ``namespaces'', but JIM-Tcl does not. +Thus the rule we follow in OpenOCD is this: Variables that begin with +a leading underscore are temporary in nature, and can be modified and +used at will within a target configuration file. + +Complex board config files can do the things like this, +for a board with three chips: + @example -source [find target/FOOBAR.cfg] +# Chip #1: PXA270 for network side, big endian +set CHIPNAME network +set ENDIAN big +source [find target/pxa270.cfg] +# on return: _TARGETNAME = network.cpu +# other commands can refer to the "network.cpu" target. +$_TARGETNAME configure .... events for this CPU.. + +# Chip #2: PXA270 for video side, little endian +set CHIPNAME video +set ENDIAN little +source [find target/pxa270.cfg] +# on return: _TARGETNAME = video.cpu +# other commands can refer to the "video.cpu" target. +$_TARGETNAME configure .... events for this CPU.. + +# Chip #3: Xilinx FPGA for glue logic +set CHIPNAME xilinx +unset ENDIAN +source [find target/spartan3.cfg] @end example -In summary the target files should contain +That example is oversimplified because it doesn't show any flash memory, +or the @code{reset-init} event handlers to initialize external DRAM +or (assuming it needs it) load a configuration into the FPGA. +Such features are usually needed for low-level work with many boards, +where ``low level'' implies that the board initialization software may +not be working. (That's a common reason to need JTAG tools. Another +is to enable working with microcontroller-based systems, which often +have no debugging support except a JTAG connector.) -@enumerate -@item Set defaults -@item Add TAPs to the scan chain -@item Add CPU targets (includes GDB support) -@item CPU/Chip/CPU-Core specific features -@item On-Chip flash -@end enumerate +Target config files may also export utility functions to board and user +config files. Such functions should use name prefixes, to help avoid +naming collisions. -As a rule of thumb, a target file sets up only one chip. -For a microcontroller, that will often include a single TAP, -which is a CPU needing a GDB target; and its on-chip flash. +Board files could also accept input variables from user config files. +For example, there might be a @code{J4_JUMPER} setting used to identify +what kind of flash memory a development board is using, or how to set +up other clocks and peripherals. -More complex chips may include multiple TAPs, and the target -config file may need to define them all before OpenOCD -can talk to the chip. -For example, some phone chips have JTAG scan chains that include -an ARM core for operating system use, a DSP, -another ARM core embedded in an image processing engine, -and other processing engines. +@subsection Variable Naming Convention +@cindex variable names -@subsection Important variable names - -Most boards will have only one instance of a chip. +Most boards have only one instance of a chip. However, it should be easy to create a board with more than -one such chip. -Accordingly, we encourage some conventions for naming -variables associated with different TAPs, to promote -consistency and -so that board files can override target defaults, and +one such chip (as shown above). +Accordingly, we encourage these conventions for naming +variables associated with different @file{target.cfg} files, +to promote consistency and +so that board files can override target defaults. +Inputs to target config files include: + @itemize @bullet -@item @b{CHIPNAME} -@* This gives a name to the overall chip, and is used as part of the -tap identifier dotted name. -It's normally provided by the chip manufacturer. -@item @b{ENDIAN} -@* By default little - unless the chip or board is not normally used that way. +@item @code{CHIPNAME} ... +This gives a name to the overall chip, and is used as part of +tap identifier dotted names. +While the default is normally provided by the chip manufacturer, +board files may need to distinguish between instances of a chip. +@item @code{ENDIAN} ... +By default @option{little} - although chips may hard-wire @option{big}. Chips that can't change endianness don't need to use this variable. -@item @b{CPUTAPID} -@* When OpenOCD examines the JTAG chain, it will attempt to identify -every chip. If the @t{-expected-id} is nonzero, OpenOCD attempts -to verify the tap id number verses configuration file and may issue an -error or warning like this. The hope is that this will help to pinpoint -problems in OpenOCD configurations. +@item @code{CPUTAPID} ... +When OpenOCD examines the JTAG chain, it can be told verify the +chips against the JTAG IDCODE register. +The target file will hold one or more defaults, but sometimes the +chip in a board will use a different ID (perhaps a newer revision). +@end itemize -@example -Info: JTAG tap: sam7x256.cpu tap/device found: 0x3f0f0f0f - (Manufacturer: 0x787, Part: 0xf0f0, Version: 0x3) -Error: ERROR: Tap: sam7x256.cpu - Expected id: 0x12345678, - Got: 0x3f0f0f0f -Error: ERROR: expected: mfg: 0x33c, part: 0x2345, ver: 0x1 -Error: ERROR: got: mfg: 0x787, part: 0xf0f0, ver: 0x3 -@end example +Outputs from target config files include: -@item @b{_TARGETNAME} -@* By convention, this variable is created by the target configuration +@itemize @bullet +@item @code{_TARGETNAME} ... +By convention, this variable is created by the target configuration script. The board configuration file may make use of this variable to configure things like a ``reset init'' script, or other things specific to that board and that target. +If the chip has 2 targets, the names are @code{_TARGETNAME0}, +@code{_TARGETNAME1}, ... etc. +@end itemize -If the chip has 2 targets, use the names @b{_TARGETNAME0}, -@b{_TARGETNAME1}, ... etc. +@subsection The reset-init Event Handler +@cindex event, reset-init +@cindex reset-init handler -@emph{Remember:} The ``board file'' may include multiple targets. -The user (or board) config file should reasonably be able to: +Board config files run in the OpenOCD configuration stage; +they can't use TAPs or targets, since they haven't been +fully set up yet. +This means you can't write memory or access chip registers; +you can't even verify that a flash chip is present. +That's done later in event handlers, of which the target @code{reset-init} +handler is one of the most important. -@example -source [find target/FOO.cfg] -$_TARGETNAME configure ... FOO specific parameters +Except on microcontrollers, the basic job of @code{reset-init} event +handlers is setting up flash and DRAM, as normally handled by boot loaders. +Microcontrollers rarely use boot loaders; they run right out of their +on-chip flash and SRAM memory. But they may want to use one of these +handlers too, if just for developer convenience. -source [find target/BAR.cfg] -$_TARGETNAME configure ... BAR specific parameters -@end example +@quotation Note +Because this is so very board-specific, and chip-specific, no examples +are included here. +Instead, look at the board config files distributed with OpenOCD. +If you have a boot loader, its source code may also be useful. +@end quotation -@end itemize +Some of this code could probably be shared between different boards. +For example, setting up a DRAM controller often doesn't differ by +much except the bus width (16 bits or 32?) and memory timings, so a +reusable TCL procedure loaded by the @file{target.cfg} file might take +those as parameters. +Similarly with oscillator, PLL, and clock setup; +and disabling the watchdog. +Structure the code cleanly, and provide comments to help +the next developer doing such work. +(@emph{You might be that next person} trying to reuse init code!) -@subsection Tcl Variables Guide Line -The Full Tcl/Tk language supports ``namespaces'' - JIM-Tcl does not. +The last thing normally done in a @code{reset-init} handler is probing +whatever flash memory was configured. For most chips that needs to be +done while the associated target is halted, either because JTAG memory +access uses the CPU or to prevent conflicting CPU access. -Thus the rule we follow in OpenOCD is this: Variables that begin with -a leading underscore are temporary in nature, and can be modified and -used at will within a ?TARGET? configuration file. +@subsection JTAG Clock Rate -@b{EXAMPLE:} The user config file should be able to do this: +Before your @code{reset-init} handler has set up +the PLLs and clocking, you may need to use +a low JTAG clock rate; then you'd increase it later. +(The rule of thumb for ARM-based processors is 1/8 the CPU clock.) +If the board supports adaptive clocking, use the @command{jtag_rclk} +command, in case your board is used with JTAG adapter which +also supports it. Otherwise use @command{jtag_khz}. +Set the slow rate at the beginning of the reset sequence, +and the faster rate as soon as the clocks are at full speed. +@section Target Config Files +@cindex config file, target +@cindex target config file + +Board config files communicate with target config files using +naming conventions as described above, and may source one or +more target config files like this: + @example - # Board has 3 chips, - # PXA270 #1 network side, big endian - # PXA270 #2 video side, little endian - # Xilinx Glue logic - set CHIPNAME network - set ENDIAN big - source [find target/pxa270.cfg] - # variable: _TARGETNAME = network.cpu - # other commands can refer to the "network.cpu" tap. - $_TARGETNAME configure .... params for this CPU.. +source [find target/FOOBAR.cfg] +@end example - set ENDIAN little - set CHIPNAME video - source [find target/pxa270.cfg] - # variable: _TARGETNAME = video.cpu - # other commands can refer to the "video.cpu" tap. - $_TARGETNAME configure .... params for this CPU.. +The point of a target config file is to package everything +about a given chip that board config files need to know. +In summary the target files should contain - unset ENDIAN - set CHIPNAME xilinx - source [find target/spartan3.cfg] +@enumerate +@item Set defaults +@item Add TAPs to the scan chain +@item Add CPU targets (includes GDB support) +@item CPU/Chip/CPU-Core specific features +@item On-Chip flash +@end enumerate - # Since $_TARGETNAME is temporal.. - # these names still work! - network.cpu configure ... params - video.cpu configure ... params -@end example +As a rule of thumb, a target file sets up only one chip. +For a microcontroller, that will often include a single TAP, +which is a CPU needing a GDB target, and its on-chip flash. +More complex chips may include multiple TAPs, and the target +config file may need to define them all before OpenOCD +can talk to the chip. +For example, some phone chips have JTAG scan chains that include +an ARM core for operating system use, a DSP, +another ARM core embedded in an image processing engine, +and other processing engines. + @subsection Default Value Boiler Plate Code -All target configuration files should start with this (or a modified form) +All target configuration files should start with code like this, +letting board config files express environment-specific +differences in how things should be set up. @example -# SIMPLE example +# Boards may override chip names, perhaps based on role, +# but the default should match what the vendor uses if @{ [info exists CHIPNAME] @} @{ set _CHIPNAME $CHIPNAME @} else @{ set _CHIPNAME sam7x256 @} +# ONLY use ENDIAN with targets that can change it. if @{ [info exists ENDIAN] @} @{ set _ENDIAN $ENDIAN @} else @{ set _ENDIAN little @} +# TAP identifiers may change as chips mature, for example with +# new revision fields (the "3" here). Pick a good default; you +# can pass several such identifiers to the "jtag newtap" command. if @{ [info exists CPUTAPID ] @} @{ set _CPUTAPID $CPUTAPID @} else @{ @@ -1240,6 +1316,19 @@ @} @end example +@emph{Remember:} Board config files may include multiple target +config files, or the same target file multiple times +(changing at least @code{CHIPNAME}). + +Likewise, the target configuration file should define +@code{_TARGETNAME} (or @code{_TARGETNAME0} etc) and +use it later on when defining debug targets: + +@example +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME arm7tdmi -chain-position $_TARGETNAME +@end example + @subsection Adding TAPs to the Scan Chain After the ``defaults'' are set up, add the TAPs on each chip to the JTAG scan chain. @@ -1261,12 +1350,25 @@ values for @code{CHIPNAME}, so it adds a different TAP each time. +If there are one or more nonzero @option{-expected-id} values, +OpenOCD attempts to verify the actual tap id against those values. +It will issue error messages if there is mismatch, which +can help to pinpoint problems in OpenOCD configurations. + +@example +JTAG tap: sam7x256.cpu tap/device found: 0x3f0f0f0f + (Manufacturer: 0x787, Part: 0xf0f0, Version: 0x3) +ERROR: Tap: sam7x256.cpu - Expected id: 0x12345678, Got: 0x3f0f0f0f +ERROR: expected: mfg: 0x33c, part: 0x2345, ver: 0x1 +ERROR: got: mfg: 0x787, part: 0xf0f0, ver: 0x3 +@end example + There are more complex examples too, with chips that have multiple TAPs. Ones worth looking at include: @itemize -@item @file{target/omap3530.cfg} -- with a disabled ARM, and a JRC -(there's a DSP too, which is not listed) +@item @file{target/omap3530.cfg} -- with disabled ARM and DSP, +plus a JRC to enable them @item @file{target/str912.cfg} -- with flash, CPU, and boundary scan @item @file{target/ti_dm355.cfg} -- with ETM, ARM, and JRC (this JRC is not currently used) @@ -1277,7 +1379,9 @@ After adding a TAP for a CPU, you should set it up so that GDB and other commands can use it. @xref{CPU Configuration}. -For the at91sam7 example above, the command can look like this: +For the at91sam7 example above, the command can look like this; +note that @code{$_ENDIAN} is not needed, since OpenOCD defaults +to little endian, and this chip doesn't support changing that. @example set _TARGETNAME $_CHIPNAME.cpu @@ -1428,6 +1532,7 @@ the memory read/write commands. This includes @command{nand probe}. @end deffn +@anchor{TCP/IP Ports} @section TCP/IP Ports @cindex TCP port @cindex server @@ -3023,11 +3128,12 @@ @end enumerate Many CPUs have the ablity to ``boot'' from the first flash bank. -This means that misprograming that bank can ``brick'' a system, +This means that misprogramming that bank can ``brick'' a system, so that it can't boot. JTAG tools, like OpenOCD, are often then used to ``de-brick'' the board by (re)installing working boot firmware. +@anchor{NOR Configuration} @section Flash Configuration Commands @cindex flash configuration @@ -3716,6 +3822,7 @@ Some larger devices will work, since they are actually multi-chip modules with two smaller chips and individual chipselect lines. +@anchor{NAND Configuration} @section NAND Configuration Commands @cindex NAND configuration |
From: <oh...@ma...> - 2009-06-22 21:22:12
|
Author: oharboe Date: 2009-06-22 21:22:10 +0200 (Mon, 22 Jun 2009) New Revision: 2353 Modified: trunk/tcl/target/ti_dm365.cfg Log: fix eol native Modified: trunk/tcl/target/ti_dm365.cfg =================================================================== --- trunk/tcl/target/ti_dm365.cfg 2009-06-22 17:32:17 UTC (rev 2352) +++ trunk/tcl/target/ti_dm365.cfg 2009-06-22 19:22:10 UTC (rev 2353) @@ -1,97 +1,97 @@ -# -# Texas Instruments DaVinci family: TMS320DM365 -# -if { [info exists CHIPNAME] } { - set _CHIPNAME $CHIPNAME -} else { - set _CHIPNAME dm365 -} - -# -# For now, expect EMU0/EMU1 jumpered LOW (not TI's default) so ARM and ETB -# are enabled without making ICEpick route ARM and ETB into the JTAG chain. -# -# Also note: when running without RTCK before the PLLs are set up, you -# may need to slow the JTAG clock down quite a lot (under 2 MHz). -# -source [find target/icepick.cfg] -set EMU01 "-enable" -#set EMU01 "-disable" - -# Subsidiary TAP: ARM ETB11, with scan chain for 4K of ETM trace buffer -if { [info exists ETB_TAPID ] } { - set _ETB_TAPID $ETB_TAPID -} else { - set _ETB_TAPID 0x2b900f0f -} -jtag newtap $_CHIPNAME etb -irlen 4 -ircapture 0x1 -irmask 0xf \ - -expected-id $_ETB_TAPID $EMU01 -jtag configure $_CHIPNAME.etb -event tap-enable \ - "icepick_c_tapenable $_CHIPNAME.jrc 1" - -# Subsidiary TAP: ARM926ejs with scan chains for ARM Debug, EmbeddedICE-RT, ETM. -if { [info exists CPU_TAPID ] } { - set _CPU_TAPID $CPU_TAPID -} else { - set _CPU_TAPID 0x0792602f -} -jtag newtap $_CHIPNAME arm -irlen 4 -ircapture 0x1 -irmask 0xf \ - -expected-id $_CPU_TAPID $EMU01 -jtag configure $_CHIPNAME.arm -event tap-enable \ - "icepick_c_tapenable $_CHIPNAME.jrc 0" - -# Primary TAP: ICEpick (JTAG route controller) and boundary scan -if { [info exists JRC_TAPID ] } { - set _JRC_TAPID $JRC_TAPID -} else { - set _JRC_TAPID 0x0b83e02f -} -jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f \ - -expected-id $_JRC_TAPID - -################ - -# various symbol definitions, to avoid hard-wiring addresses -# and enable some sharing of DaVinci-family utility code -global dm365 -set dm365 [ dict create ] - -# Physical addresses for controllers and memory -# (Some of these are valid for many DaVinci family chips) -dict set dm365 sram0 0x00010000 -dict set dm365 sram1 0x00014000 -dict set dm365 sysbase 0x01c40000 -dict set dm365 pllc1 0x01c40800 -dict set dm365 pllc2 0x01c40c00 -dict set dm365 psc 0x01c41000 -dict set dm365 gpio 0x01c67000 -dict set dm365 a_emif 0x01d10000 -dict set dm365 a_emif_cs0 0x02000000 -dict set dm365 a_emif_cs1 0x04000000 -dict set dm365 ddr_emif 0x20000000 -dict set dm365 ddr 0x80000000 - -source [find target/davinci.cfg] - -################ -# GDB target: the ARM, using SRAM1 for scratch. SRAM0 (also 16K) -# and the ETB memory (4K) are other options, while trace is unused. -set _TARGETNAME $_CHIPNAME.arm - -target create $_TARGETNAME arm926ejs -chain-position $_TARGETNAME - -# NOTE that work-area-virt presumes a Linux 2.6.30-rc2+ kernel, -# and that the work area is used only with a kernel mmu context ... -$_TARGETNAME configure \ - -work-area-virt [expr 0xfffe0000 + 0x4000] \ - -work-area-phys [dict get $dm365 sram1] \ - -work-area-size 0x4000 \ - -work-area-backup 0 - -arm7_9 dbgrq enable -arm7_9 fast_memory_access enable -arm7_9 dcc_downloads enable - -# trace setup -etm config $_TARGETNAME 16 normal full etb -etb config $_TARGETNAME $_CHIPNAME.etb +# +# Texas Instruments DaVinci family: TMS320DM365 +# +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME dm365 +} + +# +# For now, expect EMU0/EMU1 jumpered LOW (not TI's default) so ARM and ETB +# are enabled without making ICEpick route ARM and ETB into the JTAG chain. +# +# Also note: when running without RTCK before the PLLs are set up, you +# may need to slow the JTAG clock down quite a lot (under 2 MHz). +# +source [find target/icepick.cfg] +set EMU01 "-enable" +#set EMU01 "-disable" + +# Subsidiary TAP: ARM ETB11, with scan chain for 4K of ETM trace buffer +if { [info exists ETB_TAPID ] } { + set _ETB_TAPID $ETB_TAPID +} else { + set _ETB_TAPID 0x2b900f0f +} +jtag newtap $_CHIPNAME etb -irlen 4 -ircapture 0x1 -irmask 0xf \ + -expected-id $_ETB_TAPID $EMU01 +jtag configure $_CHIPNAME.etb -event tap-enable \ + "icepick_c_tapenable $_CHIPNAME.jrc 1" + +# Subsidiary TAP: ARM926ejs with scan chains for ARM Debug, EmbeddedICE-RT, ETM. +if { [info exists CPU_TAPID ] } { + set _CPU_TAPID $CPU_TAPID +} else { + set _CPU_TAPID 0x0792602f +} +jtag newtap $_CHIPNAME arm -irlen 4 -ircapture 0x1 -irmask 0xf \ + -expected-id $_CPU_TAPID $EMU01 +jtag configure $_CHIPNAME.arm -event tap-enable \ + "icepick_c_tapenable $_CHIPNAME.jrc 0" + +# Primary TAP: ICEpick (JTAG route controller) and boundary scan +if { [info exists JRC_TAPID ] } { + set _JRC_TAPID $JRC_TAPID +} else { + set _JRC_TAPID 0x0b83e02f +} +jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f \ + -expected-id $_JRC_TAPID + +################ + +# various symbol definitions, to avoid hard-wiring addresses +# and enable some sharing of DaVinci-family utility code +global dm365 +set dm365 [ dict create ] + +# Physical addresses for controllers and memory +# (Some of these are valid for many DaVinci family chips) +dict set dm365 sram0 0x00010000 +dict set dm365 sram1 0x00014000 +dict set dm365 sysbase 0x01c40000 +dict set dm365 pllc1 0x01c40800 +dict set dm365 pllc2 0x01c40c00 +dict set dm365 psc 0x01c41000 +dict set dm365 gpio 0x01c67000 +dict set dm365 a_emif 0x01d10000 +dict set dm365 a_emif_cs0 0x02000000 +dict set dm365 a_emif_cs1 0x04000000 +dict set dm365 ddr_emif 0x20000000 +dict set dm365 ddr 0x80000000 + +source [find target/davinci.cfg] + +################ +# GDB target: the ARM, using SRAM1 for scratch. SRAM0 (also 16K) +# and the ETB memory (4K) are other options, while trace is unused. +set _TARGETNAME $_CHIPNAME.arm + +target create $_TARGETNAME arm926ejs -chain-position $_TARGETNAME + +# NOTE that work-area-virt presumes a Linux 2.6.30-rc2+ kernel, +# and that the work area is used only with a kernel mmu context ... +$_TARGETNAME configure \ + -work-area-virt [expr 0xfffe0000 + 0x4000] \ + -work-area-phys [dict get $dm365 sram1] \ + -work-area-size 0x4000 \ + -work-area-backup 0 + +arm7_9 dbgrq enable +arm7_9 fast_memory_access enable +arm7_9 dcc_downloads enable + +# trace setup +etm config $_TARGETNAME 16 normal full etb +etb config $_TARGETNAME $_CHIPNAME.etb Property changes on: trunk/tcl/target/ti_dm365.cfg ___________________________________________________________________ Name: svn:eol-style + native |
From: <oh...@ma...> - 2009-06-22 19:32:21
|
Author: oharboe Date: 2009-06-22 19:32:17 +0200 (Mon, 22 Jun 2009) New Revision: 2352 Modified: trunk/tcl/board/hitex_stm32-performancestick.cfg Log: David Brownell <da...@pa...> Make the Hitex STM32-PerformanceStick board config behave better: source the STM32 target config instead of using a private clone Modified: trunk/tcl/board/hitex_stm32-performancestick.cfg =================================================================== --- trunk/tcl/board/hitex_stm32-performancestick.cfg 2009-06-22 17:31:12 UTC (rev 2351) +++ trunk/tcl/board/hitex_stm32-performancestick.cfg 2009-06-22 17:32:17 UTC (rev 2352) @@ -1,50 +1,9 @@ # Hitex stm32 performance stick -if { [info exists CHIPNAME] } { - set _CHIPNAME $CHIPNAME -} else { - set _CHIPNAME stm32_hitex -} +set CHIPNAME stm32_hitex +source [find target/stm32.cfg] -if { [info exists ENDIAN] } { - set _ENDIAN $ENDIAN -} else { - set _ENDIAN little -} - -# set jtag speed -jtag_khz 500 - -jtag_nsrst_delay 100 -jtag_ntrst_delay 100 - -#use combined on interfaces or targets that can't set TRST/SRST separately -reset_config trst_and_srst - -#jtag scan chain -# The CPU -if { [info exists CPUTAPID ] } { - set _CPUTAPID $CPUTAPID -} else { - # See STM Document RM0008 - # Section 26.6.3 - set _CPUTAPID 0x3ba00477 -} -jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID - -# The boundery scan register, leave the "expected-id" undefined. -jtag newtap $_CHIPNAME bs -irlen 5 -ircapture 0x1 -irmask 0x1 - # configure str750 connected to jtag chain +# FIXME -- source [find target/str750.cfg] after cleaning that up jtag newtap $_CHIPNAME unknown -irlen 4 -ircapture 0x1 -irmask 0x0f -set _TARGETNAME [format "%s.cpu" $_CHIPNAME] -target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME - -$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x20000000 -work-area-size 16384 -work-area-backup 0 - -# -flash bank stm32x 0 0 0 0 0 - -# For more information about the configuration files, take a look at: -# openocd.texi |
From: <oh...@ma...> - 2009-06-22 19:31:15
|
Author: oharboe Date: 2009-06-22 19:31:12 +0200 (Mon, 22 Jun 2009) New Revision: 2351 Added: trunk/tcl/target/ti_dm365.cfg Log: David Brownell <da...@pa...> target config file for newish DM365 chip. Think of this as an improved DM355, integrating much better HD video support, Ethernet, and other goodies. Added: trunk/tcl/target/ti_dm365.cfg =================================================================== --- trunk/tcl/target/ti_dm365.cfg 2009-06-21 21:20:10 UTC (rev 2350) +++ trunk/tcl/target/ti_dm365.cfg 2009-06-22 17:31:12 UTC (rev 2351) @@ -0,0 +1,97 @@ +# +# Texas Instruments DaVinci family: TMS320DM365 +# +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME dm365 +} + +# +# For now, expect EMU0/EMU1 jumpered LOW (not TI's default) so ARM and ETB +# are enabled without making ICEpick route ARM and ETB into the JTAG chain. +# +# Also note: when running without RTCK before the PLLs are set up, you +# may need to slow the JTAG clock down quite a lot (under 2 MHz). +# +source [find target/icepick.cfg] +set EMU01 "-enable" +#set EMU01 "-disable" + +# Subsidiary TAP: ARM ETB11, with scan chain for 4K of ETM trace buffer +if { [info exists ETB_TAPID ] } { + set _ETB_TAPID $ETB_TAPID +} else { + set _ETB_TAPID 0x2b900f0f +} +jtag newtap $_CHIPNAME etb -irlen 4 -ircapture 0x1 -irmask 0xf \ + -expected-id $_ETB_TAPID $EMU01 +jtag configure $_CHIPNAME.etb -event tap-enable \ + "icepick_c_tapenable $_CHIPNAME.jrc 1" + +# Subsidiary TAP: ARM926ejs with scan chains for ARM Debug, EmbeddedICE-RT, ETM. +if { [info exists CPU_TAPID ] } { + set _CPU_TAPID $CPU_TAPID +} else { + set _CPU_TAPID 0x0792602f +} +jtag newtap $_CHIPNAME arm -irlen 4 -ircapture 0x1 -irmask 0xf \ + -expected-id $_CPU_TAPID $EMU01 +jtag configure $_CHIPNAME.arm -event tap-enable \ + "icepick_c_tapenable $_CHIPNAME.jrc 0" + +# Primary TAP: ICEpick (JTAG route controller) and boundary scan +if { [info exists JRC_TAPID ] } { + set _JRC_TAPID $JRC_TAPID +} else { + set _JRC_TAPID 0x0b83e02f +} +jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f \ + -expected-id $_JRC_TAPID + +################ + +# various symbol definitions, to avoid hard-wiring addresses +# and enable some sharing of DaVinci-family utility code +global dm365 +set dm365 [ dict create ] + +# Physical addresses for controllers and memory +# (Some of these are valid for many DaVinci family chips) +dict set dm365 sram0 0x00010000 +dict set dm365 sram1 0x00014000 +dict set dm365 sysbase 0x01c40000 +dict set dm365 pllc1 0x01c40800 +dict set dm365 pllc2 0x01c40c00 +dict set dm365 psc 0x01c41000 +dict set dm365 gpio 0x01c67000 +dict set dm365 a_emif 0x01d10000 +dict set dm365 a_emif_cs0 0x02000000 +dict set dm365 a_emif_cs1 0x04000000 +dict set dm365 ddr_emif 0x20000000 +dict set dm365 ddr 0x80000000 + +source [find target/davinci.cfg] + +################ +# GDB target: the ARM, using SRAM1 for scratch. SRAM0 (also 16K) +# and the ETB memory (4K) are other options, while trace is unused. +set _TARGETNAME $_CHIPNAME.arm + +target create $_TARGETNAME arm926ejs -chain-position $_TARGETNAME + +# NOTE that work-area-virt presumes a Linux 2.6.30-rc2+ kernel, +# and that the work area is used only with a kernel mmu context ... +$_TARGETNAME configure \ + -work-area-virt [expr 0xfffe0000 + 0x4000] \ + -work-area-phys [dict get $dm365 sram1] \ + -work-area-size 0x4000 \ + -work-area-backup 0 + +arm7_9 dbgrq enable +arm7_9 fast_memory_access enable +arm7_9 dcc_downloads enable + +# trace setup +etm config $_TARGETNAME 16 normal full etb +etb config $_TARGETNAME $_CHIPNAME.etb |
From: ntfreak at B. <nt...@ma...> - 2009-06-21 23:20:12
|
Author: ntfreak Date: 2009-06-21 23:20:10 +0200 (Sun, 21 Jun 2009) New Revision: 2350 Modified: trunk/src/helper/log.c Log: - fix break caused by r2208 when using --pipe option - issue is gdb stdin buffer gets full before we redirect openocd output Modified: trunk/src/helper/log.c =================================================================== --- trunk/src/helper/log.c 2009-06-21 21:06:23 UTC (rev 2349) +++ trunk/src/helper/log.c 2009-06-21 21:20:10 UTC (rev 2350) @@ -205,8 +205,6 @@ else if (argc > 1) return ERROR_COMMAND_SYNTAX_ERROR; - command_print(cmd_ctx, "debug_level: %i", debug_level); - if (debug_level >= LOG_LVL_DEBUG && server_use_pipes == 1) { /* if we are enabling debug info then we need to write to a log file @@ -219,6 +217,8 @@ } } + command_print(cmd_ctx, "debug_level: %i", debug_level); + return ERROR_OK; } |
From: <oh...@ma...> - 2009-06-21 23:06:26
|
Author: oharboe Date: 2009-06-21 23:06:23 +0200 (Sun, 21 Jun 2009) New Revision: 2349 Added: trunk/tcl/target/cs351x.cfg Log: Paulius Zaleckas <pau...@gm...> Add config for CS351x CPUs Added: trunk/tcl/target/cs351x.cfg =================================================================== --- trunk/tcl/target/cs351x.cfg 2009-06-21 04:58:53 UTC (rev 2348) +++ trunk/tcl/target/cs351x.cfg 2009-06-21 21:06:23 UTC (rev 2349) @@ -0,0 +1,30 @@ +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME cs351x +} + +if { [info exists ENDIAN] } { + set _ENDIAN $ENDIAN +} else { + set _ENDIAN little +} + +if { [info exists CPUTAPID ] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x00526fa1 +} + +jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID + +# Create the GDB Target. +set _TARGETNAME [format "%s.cpu" $_CHIPNAME] +target create $_TARGETNAME fa526 -endian $_ENDIAN -chain-position $_TARGETNAME -variant fa526 +# There is 16K of SRAM on this chip +# FIXME: flash programming is not working by using this work area. So comment this out for now. +#$_TARGETNAME configure -work-area-virt 0x00000000 -work-area-phys 0x00000000 -work-area-size 0x4000 -work-area-backup 1 + +# This chip has a DCC ... use it +arm7_9 dcc_downloads enable + |
From: <zw...@ma...> - 2009-06-21 06:59:18
|
Author: zwelch Date: 2009-06-21 06:58:53 +0200 (Sun, 21 Jun 2009) New Revision: 2348 Modified: trunk/src/target/target.c Log: Oleksandr Tymoshenko <go...@bl...>: Resume command works only if resume address is provided. Modified: trunk/src/target/target.c =================================================================== --- trunk/src/target/target.c 2009-06-21 03:24:35 UTC (rev 2347) +++ trunk/src/target/target.c 2009-06-21 04:58:53 UTC (rev 2348) @@ -1996,6 +1996,7 @@ static int handle_resume_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) { + int current = 1; if (argc > 1) return ERROR_COMMAND_SYNTAX_ERROR; @@ -2011,9 +2012,10 @@ int retval = parse_u32(args[0], &addr); if (ERROR_OK != retval) return retval; + current = 0; } - return target_resume(target, 0, addr, 1, 0); + return target_resume(target, current, addr, 1, 0); } static int handle_step_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc) |
From: <du...@ma...> - 2009-06-21 05:24:37
|
Author: duane Date: 2009-06-21 05:24:35 +0200 (Sun, 21 Jun 2009) New Revision: 2347 Modified: trunk/src/flash/nand.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/nand.c =================================================================== --- trunk/src/flash/nand.c 2009-06-21 03:24:12 UTC (rev 2346) +++ trunk/src/flash/nand.c 2009-06-21 03:24:35 UTC (rev 2347) @@ -1138,9 +1138,13 @@ else bad_state = " (block condition unknown)"; - command_print(cmd_ctx, "\t#%i: 0x%8.8x (%dkB) %s%s", - j, p->blocks[j].offset, p->blocks[j].size / 1024, - erase_state, bad_state); + command_print(cmd_ctx, + "\t#%i: 0x%8.8" PRIx32 " (%" PRId32 "kB) %s%s", + j, + p->blocks[j].offset, + p->blocks[j].size / 1024, + erase_state, + bad_state); } } else @@ -1449,7 +1453,7 @@ if (nand_write_page(p, offset / p->page_size, page, page_size, oob, oob_size) != ERROR_OK) { - command_print(cmd_ctx, "failed writing file %s to NAND flash %s at offset 0x%8.8x", + command_print(cmd_ctx, "failed writing file %s to NAND flash %s at offset 0x%8.8" PRIx32 "", args[1], args[0], offset); fileio_close(&fileio); @@ -1467,7 +1471,7 @@ oob = NULL; page = NULL; duration_stop_measure(&duration, &duration_text); - command_print(cmd_ctx, "wrote file %s to NAND flash %s up to offset 0x%8.8x in %s", + command_print(cmd_ctx, "wrote file %s to NAND flash %s up to offset 0x%8.8" PRIx32 " in %s", args[1], args[0], offset, duration_text); free(duration_text); duration_text = NULL; |
From: <du...@ma...> - 2009-06-21 05:24:15
|
Author: duane Date: 2009-06-21 05:24:12 +0200 (Sun, 21 Jun 2009) New Revision: 2346 Modified: trunk/src/flash/at91sam7.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/at91sam7.c =================================================================== --- trunk/src/flash/at91sam7.c 2009-06-21 03:23:28 UTC (rev 2345) +++ trunk/src/flash/at91sam7.c 2009-06-21 03:24:12 UTC (rev 2346) @@ -239,7 +239,7 @@ if (at91sam7_info->mck_freq > 30000000ul) fws = 1; - LOG_DEBUG("fmcn[%i]: %i", bank->bank_number, fmcn); + LOG_DEBUG("fmcn[%i]: %i", bank->bank_number, (int)(fmcn)); fmr = fmcn << 16 | fws << 8; target_write_u32(target, MC_FMR[bank->bank_number], fmr); } @@ -253,15 +253,15 @@ while ((!((status = at91sam7_get_flash_status(bank->target, bank->bank_number)) & waitbits)) && (timeout-- > 0)) { - LOG_DEBUG("status[%i]: 0x%x", bank->bank_number, status); + LOG_DEBUG("status[%i]: 0x%" PRIx32 "", (int)bank->bank_number, status); alive_sleep(1); } - LOG_DEBUG("status[%i]: 0x%x", bank->bank_number, status); + LOG_DEBUG("status[%i]: 0x%" PRIx32 "", bank->bank_number, status); if (status & 0x0C) { - LOG_ERROR("status register: 0x%x", status); + LOG_ERROR("status register: 0x%" PRIx32 "", status); if (status & 0x4) LOG_ERROR("Lock Error Bit Detected, Operation Abort"); if (status & 0x8) @@ -282,7 +282,7 @@ fcr = (0x5A<<24) | ((pagen&0x3FF)<<8) | cmd; target_write_u32(target, MC_FCR[bank->bank_number], fcr); - LOG_DEBUG("Flash command: 0x%x, flash bank: %i, page number: %u", fcr, bank->bank_number+1, pagen); + LOG_DEBUG("Flash command: 0x%" PRIx32 ", flash bank: %i, page number: %u", fcr, bank->bank_number+1, pagen); if ((at91sam7_info->cidr_arch == 0x60)&&((cmd==SLB)|(cmd==CLB))) { @@ -1000,7 +1000,7 @@ if (offset % dst_min_alignment) { - LOG_WARNING("offset 0x%x breaks required alignment 0x%x", offset, dst_min_alignment); + LOG_WARNING("offset 0x%" PRIx32 " breaks required alignment 0x%" PRIx32 "", offset, dst_min_alignment); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; } @@ -1010,7 +1010,7 @@ first_page = offset/dst_min_alignment; last_page = CEIL(offset + count, dst_min_alignment); - LOG_DEBUG("first_page: %i, last_page: %i, count %i", first_page, last_page, count); + LOG_DEBUG("first_page: %i, last_page: %i, count %i", (int)first_page, (int)last_page, (int)count); /* Configure the flash controller timing */ at91sam7_read_clock_info(bank); @@ -1037,7 +1037,7 @@ { return ERROR_FLASH_OPERATION_FAILED; } - LOG_DEBUG("Write flash bank:%i page number:%i", bank->bank_number, pagen); + LOG_DEBUG("Write flash bank:%i page number:%" PRIi32 "", bank->bank_number, pagen); } return ERROR_OK; @@ -1079,17 +1079,21 @@ buf += printed; buf_size -= printed; - printed = snprintf(buf, buf_size, - " Cidr: 0x%8.8x | Arch: 0x%4.4x | Eproc: %s | Version: 0x%3.3x | Flashsize: 0x%8.8x\n", - at91sam7_info->cidr, at91sam7_info->cidr_arch, EPROC[at91sam7_info->cidr_eproc], - at91sam7_info->cidr_version, bank->size); + printed = snprintf(buf, + buf_size, + " Cidr: 0x%8.8" PRIx32 " | Arch: 0x%4.4x | Eproc: %s | Version: 0x%3.3x | Flashsize: 0x%8.8" PRIx32 "\n", + at91sam7_info->cidr, + at91sam7_info->cidr_arch, + EPROC[at91sam7_info->cidr_eproc], + at91sam7_info->cidr_version, + bank->size); buf += printed; buf_size -= printed; printed = snprintf(buf, buf_size, " Master clock (estimated): %u KHz | External clock: %u KHz\n", - at91sam7_info->mck_freq / 1000, at91sam7_info->ext_freq / 1000); + (unsigned)(at91sam7_info->mck_freq / 1000), (unsigned)(at91sam7_info->ext_freq / 1000)); buf += printed; buf_size -= printed; @@ -1195,7 +1199,7 @@ /* GPNVM and SECURITY bits apply only for MC_FSR of EFC0 */ status = at91sam7_get_flash_status(bank->target, 0); - LOG_DEBUG("at91sam7_handle_gpnvm_command: cmd 0x%x, value 0x%x, status 0x%x \n", flashcmd, bit, status); + LOG_DEBUG("at91sam7_handle_gpnvm_command: cmd 0x%x, value %d, status 0x%" PRIx32 " \n", flashcmd, bit, status); /* check protect state */ at91sam7_protect_check(bank); |
From: <du...@ma...> - 2009-06-21 05:23:31
|
Author: duane Date: 2009-06-21 05:23:28 +0200 (Sun, 21 Jun 2009) New Revision: 2345 Modified: trunk/src/flash/flash.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/flash.c =================================================================== --- trunk/src/flash/flash.c 2009-06-21 03:22:10 UTC (rev 2344) +++ trunk/src/flash/flash.c 2009-06-21 03:23:28 UTC (rev 2345) @@ -92,7 +92,8 @@ retval=bank->driver->write(bank, buffer, offset, count); if (retval!=ERROR_OK) { - LOG_ERROR("error writing to flash at address 0x%08x at offset 0x%8.8x (%d)", bank->base, offset, retval); + LOG_ERROR("error writing to flash at address 0x%08" PRIx32 " at offset 0x%8.8" PRIx32 " (%d)", + bank->base, offset, retval); } return retval; @@ -292,7 +293,7 @@ if ((retval=flash_drivers[i]->flash_bank_command(cmd_ctx, cmd, args, argc, c)) != ERROR_OK) { - LOG_ERROR("'%s' driver rejected flash bank at 0x%8.8x", args[0], c->base); + LOG_ERROR("'%s' driver rejected flash bank at 0x%8.8" PRIx32 , args[0], c->base); free(c); return retval; } @@ -349,8 +350,14 @@ if ((retval = p->driver->auto_probe(p)) != ERROR_OK) return retval; - command_print(cmd_ctx, "#%i: %s at 0x%8.8x, size 0x%8.8x, buswidth %i, chipwidth %i", - i, p->driver->name, p->base, p->size, p->bus_width, p->chip_width); + command_print(cmd_ctx, + "#%" PRIi32 " : %s at 0x%8.8" PRIx32 ", size 0x%8.8" PRIx32 ", buswidth %i, chipwidth %i", + i, + p->driver->name, + p->base, + p->size, + p->bus_width, + p->chip_width); for (j = 0; j < p->num_sectors; j++) { char *protect_state; @@ -362,9 +369,13 @@ else protect_state = "protection state unknown"; - command_print(cmd_ctx, "\t#%3i: 0x%8.8x (0x%x %ikB) %s", - j, p->sectors[j].offset, p->sectors[j].size, p->sectors[j].size>>10, - protect_state); + command_print(cmd_ctx, + "\t#%3i: 0x%8.8" PRIx32 " (0x%" PRIx32 " %" PRIi32 "kB) %s", + j, + p->sectors[j].offset, + p->sectors[j].size, + p->sectors[j].size>>10, + protect_state); } *buf = '\0'; /* initialize buffer, otherwise it migh contain garbage if driver function fails */ @@ -393,16 +404,16 @@ { if ((retval = p->driver->probe(p)) == ERROR_OK) { - command_print(cmd_ctx, "flash '%s' found at 0x%8.8x", p->driver->name, p->base); + command_print(cmd_ctx, "flash '%s' found at 0x%8.8" PRIx32, p->driver->name, p->base); } else if (retval == ERROR_FLASH_BANK_INVALID) { - command_print(cmd_ctx, "probing failed for flash bank '#%s' at 0x%8.8x", + command_print(cmd_ctx, "probing failed for flash bank '#%s' at 0x%8.8" PRIx32, args[0], p->base); } else { - command_print(cmd_ctx, "unknown error when probing flash bank '#%s' at 0x%8.8x", + command_print(cmd_ctx, "unknown error when probing flash bank '#%s' at 0x%8.8" PRIx32, args[0], p->base); } } @@ -434,7 +445,7 @@ } else { - command_print(cmd_ctx, "unknown error when checking erase state of flash bank #%s at 0x%8.8x", + command_print(cmd_ctx, "unknown error when checking erase state of flash bank #%s at 0x%8.8" PRIx32, args[0], p->base); } @@ -449,9 +460,13 @@ else erase_state = "erase state unknown"; - command_print(cmd_ctx, "\t#%3i: 0x%8.8x (0x%x %ikB) %s", - j, p->sectors[j].offset, p->sectors[j].size, p->sectors[j].size>>10, - erase_state); + command_print(cmd_ctx, + "\t#%3i: 0x%8.8" PRIx32 " (0x%" PRIx32 " %" PRIi32 "kB) %s", + j, + p->sectors[j].offset, + p->sectors[j].size, + p->sectors[j].size>>10, + erase_state); } } @@ -525,11 +540,11 @@ } else if (retval == ERROR_FLASH_OPERATION_FAILED) { - command_print(cmd_ctx, "checking protection state failed (possibly unsupported) by flash #%s at 0x%8.8x", args[0], p->base); + command_print(cmd_ctx, "checking protection state failed (possibly unsupported) by flash #%s at 0x%8.8" PRIx32, args[0], p->base); } else { - command_print(cmd_ctx, "unknown error when checking protection state of flash bank '#%s' at 0x%8.8x", args[0], p->base); + command_print(cmd_ctx, "unknown error when checking protection state of flash bank '#%s' at 0x%8.8" PRIx32, args[0], p->base); } } else @@ -693,9 +708,12 @@ } if (retval == ERROR_OK) { - command_print(cmd_ctx, "wrote %u byte from file %s in %s (%f kb/s)", - written, args[0], duration_text, - (float)written / 1024.0 / ((float)duration.duration.tv_sec + ((float)duration.duration.tv_usec / 1000000.0))); + command_print(cmd_ctx, + "wrote %" PRIu32 " byte from file %s in %s (%f kb/s)", + written, + args[0], + duration_text, + (float)written / 1024.0 / ((float)duration.duration.tv_sec + ((float)duration.duration.tv_usec / 1000000.0))); } free(duration_text); @@ -795,7 +813,8 @@ { if (readback[i]!=chunk[i]) { - LOG_ERROR("Verfication error address 0x%08x, read back 0x%02x, expected 0x%02x", address + wrote + i, readback[i], chunk[i]); + LOG_ERROR("Verfication error address 0x%08" PRIx32 ", read back 0x%02x, expected 0x%02x", + address + wrote + i, readback[i], chunk[i]); return ERROR_FAIL; } } @@ -812,9 +831,12 @@ float speed; speed=wrote / 1024.0; speed/=((float)duration.duration.tv_sec + ((float)duration.duration.tv_usec / 1000000.0)); - command_print(cmd_ctx, "wrote %d bytes to 0x%8.8x in %s (%f kb/s)", - count*wordsize, address, duration_text, - speed); + command_print(cmd_ctx, + "wrote %" PRId32 " bytes to 0x%8.8" PRIx32 " in %s (%f kb/s)", + count*wordsize, + address, + duration_text, + speed); } free(duration_text); return ERROR_OK; @@ -874,9 +896,14 @@ } if (retval==ERROR_OK) { - command_print(cmd_ctx, "wrote %lld byte from file %s to flash bank %li at offset 0x%8.8x in %s (%f kb/s)", - fileio.size, args[1], strtoul(args[0], NULL, 0), offset, duration_text, - (float)fileio.size / 1024.0 / ((float)duration.duration.tv_sec + ((float)duration.duration.tv_usec / 1000000.0))); + command_print(cmd_ctx, + "wrote %lld byte from file %s to flash bank %li at offset 0x%8.8" PRIx32 " in %s (%f kb/s)", + fileio.size, + args[1], + strtoul(args[0], NULL, 0), + offset, + duration_text, + (float)fileio.size / 1024.0 / ((float)duration.duration.tv_sec + ((float)duration.duration.tv_usec / 1000000.0))); } free(duration_text); @@ -920,7 +947,7 @@ if ((addr >= c->base) && (addr <= c->base + (c->size - 1)) && target == c->target) return c; } - LOG_ERROR("No flash at address 0x%08x\n", addr); + LOG_ERROR("No flash at address 0x%08" PRIx32 "\n", addr); return NULL; } @@ -1056,7 +1083,7 @@ if (run_address + run_size - 1 > c->base + c->size - 1) { LOG_WARNING("writing %d bytes only - as image section is %d bytes and bank is only %d bytes", \ - c->base + c->size - run_address, run_size, c->size); + (int)(c->base + c->size - run_address), (int)(run_size), (int)(c->size)); run_size = c->base + c->size - run_address; } |
From: <du...@ma...> - 2009-06-21 05:22:13
|
Author: duane Date: 2009-06-21 05:22:10 +0200 (Sun, 21 Jun 2009) New Revision: 2344 Modified: trunk/src/flash/str9x.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/str9x.c =================================================================== --- trunk/src/flash/str9x.c 2009-06-21 03:22:04 UTC (rev 2343) +++ trunk/src/flash/str9x.c 2009-06-21 03:22:10 UTC (rev 2344) @@ -514,7 +514,7 @@ if (offset & 0x1) { - LOG_WARNING("offset 0x%x breaks required 2-byte alignment", offset); + LOG_WARNING("offset 0x%" PRIx32 " breaks required 2-byte alignment", offset); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; } |
From: <du...@ma...> - 2009-06-21 05:22:07
|
Author: duane Date: 2009-06-21 05:22:04 +0200 (Sun, 21 Jun 2009) New Revision: 2343 Modified: trunk/src/flash/ecos.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/ecos.c =================================================================== --- trunk/src/flash/ecos.c 2009-06-21 03:21:59 UTC (rev 2342) +++ trunk/src/flash/ecos.c 2009-06-21 03:22:04 UTC (rev 2343) @@ -205,7 +205,7 @@ } target_write_buffer(target, image.sections[i].base_address, buf_cnt, buffer); image_size += buf_cnt; - LOG_DEBUG("%u byte written at address 0x%8.8x", buf_cnt, image.sections[i].base_address); + LOG_DEBUG("%" PRIu32 " byte written at address 0x%8.8" PRIx32 "", buf_cnt, image.sections[i].base_address); free(buffer); } @@ -287,7 +287,7 @@ if (flashErr != 0x0) { - LOG_ERROR("Flash erase failed with %d (%s)\n", flashErr, flash_errmsg(flashErr)); + LOG_ERROR("Flash erase failed with %d (%s)\n", (int)flashErr, flash_errmsg(flashErr)); return ERROR_FAIL; } @@ -346,7 +346,7 @@ if (flashErr != 0x0) { - LOG_ERROR("Flash prog failed with %d (%s)\n", flashErr, flash_errmsg(flashErr)); + LOG_ERROR("Flash prog failed with %d (%s)\n", (int)flashErr, flash_errmsg(flashErr)); return ERROR_FAIL; } } |
From: <du...@ma...> - 2009-06-21 05:22:03
|
Author: duane Date: 2009-06-21 05:21:59 +0200 (Sun, 21 Jun 2009) New Revision: 2342 Modified: trunk/src/flash/str7x.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/str7x.c =================================================================== --- trunk/src/flash/str7x.c 2009-06-21 03:21:55 UTC (rev 2341) +++ trunk/src/flash/str7x.c 2009-06-21 03:21:59 UTC (rev 2342) @@ -259,7 +259,7 @@ sectors |= str7x_info->sector_bits[i]; } - LOG_DEBUG("sectors: 0x%x", sectors); + LOG_DEBUG("sectors: 0x%" PRIx32 "", sectors); /* clear FLASH_ER register */ target_write_u32(target, str7x_get_flash_adr(bank, FLASH_ER), 0x0); @@ -281,7 +281,7 @@ if (retval) { - LOG_ERROR("error erasing flash bank, FLASH_ER: 0x%x", retval); + LOG_ERROR("error erasing flash bank, FLASH_ER: 0x%" PRIx32 "", retval); return ERROR_FLASH_OPERATION_FAILED; } @@ -335,7 +335,7 @@ retval = str7x_result(bank); - LOG_DEBUG("retval: 0x%8.8x", retval); + LOG_DEBUG("retval: 0x%8.8" PRIx32 "", retval); if (retval & FLASH_ERER) return ERROR_FLASH_SECTOR_NOT_ERASED; @@ -481,7 +481,7 @@ if (offset & 0x7) { - LOG_WARNING("offset 0x%x breaks required 8-byte alignment", offset); + LOG_WARNING("offset 0x%" PRIx32 " breaks required 8-byte alignment", offset); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; } |
From: <du...@ma...> - 2009-06-21 05:21:57
|
Author: duane Date: 2009-06-21 05:21:55 +0200 (Sun, 21 Jun 2009) New Revision: 2341 Modified: trunk/src/flash/ocl.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/ocl.c =================================================================== --- trunk/src/flash/ocl.c 2009-06-21 03:21:50 UTC (rev 2340) +++ trunk/src/flash/ocl.c 2009-06-21 03:21:55 UTC (rev 2341) @@ -145,9 +145,9 @@ if (dcc_buffer[1] != OCL_CMD_DONE) { if (dcc_buffer[0] == OCL_ERASE_ALL) - LOG_ERROR("loader response to OCL_ERASE_ALL 0x%08X", dcc_buffer[1]); + LOG_ERROR("loader response to OCL_ERASE_ALL 0x%08" PRIx32 "", dcc_buffer[1]); else - LOG_ERROR("loader response to OCL_ERASE_BLOCK 0x%08X", dcc_buffer[1]); + LOG_ERROR("loader response to OCL_ERASE_BLOCK 0x%08" PRIx32 "", dcc_buffer[1]); return ERROR_FLASH_OPERATION_FAILED; } @@ -253,7 +253,7 @@ if (dcc_buffer[0] != OCL_CMD_DONE) { - LOG_ERROR("loader response to OCL_FLASH_BLOCK 0x%08X", dcc_buffer[0]); + LOG_ERROR("loader response to OCL_FLASH_BLOCK 0x%08" PRIx32 "", dcc_buffer[0]); free(dcc_buffer); return ERROR_FLASH_OPERATION_FAILED; } @@ -295,7 +295,7 @@ if (dcc_buffer[0] != OCL_CMD_DONE) { - LOG_ERROR("loader response to OCL_PROBE 0x%08X", dcc_buffer[0]); + LOG_ERROR("loader response to OCL_PROBE 0x%08" PRIx32 "", dcc_buffer[0]); return ERROR_FLASH_OPERATION_FAILED; } |
From: <du...@ma...> - 2009-06-21 05:21:53
|
Author: duane Date: 2009-06-21 05:21:50 +0200 (Sun, 21 Jun 2009) New Revision: 2340 Modified: trunk/src/flash/pic32mx.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/pic32mx.c =================================================================== --- trunk/src/flash/pic32mx.c 2009-06-21 03:20:46 UTC (rev 2339) +++ trunk/src/flash/pic32mx.c 2009-06-21 03:21:50 UTC (rev 2340) @@ -148,11 +148,11 @@ /* wait for busy to clear */ while (((status = pic32mx_get_flash_status(bank)) & NVMCON_NVMWR) && (timeout-- > 0)) { - LOG_DEBUG("status: 0x%x", status); + LOG_DEBUG("status: 0x%" PRIx32, status ); alive_sleep(1); } if(timeout <= 0) - LOG_DEBUG("timeout: status: 0x%x", status); + LOG_DEBUG("timeout: status: 0x%" PRIx32, status ); return status; } @@ -410,7 +410,7 @@ uint32_t status; if ((retval = target_write_buffer(target, source->address, buffer_size, buffer))!=ERROR_OK) { - LOG_ERROR("Failed to write row buffer (%d words) to RAM", buffer_size/4); + LOG_ERROR("Failed to write row buffer (%d words) to RAM", (int)(buffer_size/4)); break; } @@ -435,12 +435,12 @@ #endif status = pic32mx_write_row(bank, address, source->address); if( status & NVMCON_NVMERR ) { - LOG_ERROR("Flash write error NVMERR (status=0x%08x)", status); + LOG_ERROR("Flash write error NVMERR (status=0x%08" PRIx32 ")", status); retval = ERROR_FLASH_OPERATION_FAILED; break; } if( status & NVMCON_LVDERR ) { - LOG_ERROR("Flash write error LVDERR (status=0x%08x)", status); + LOG_ERROR("Flash write error LVDERR (status=0x%08" PRIx32 ")", status); retval = ERROR_FLASH_OPERATION_FAILED; break; } @@ -459,12 +459,12 @@ uint32_t status = pic32mx_write_word(bank, address, value); if( status & NVMCON_NVMERR ) { - LOG_ERROR("Flash write error NVMERR (status=0x%08x)", status); + LOG_ERROR("Flash write error NVMERR (status=0x%08" PRIx32 ")", status); retval = ERROR_FLASH_OPERATION_FAILED; break; } if( status & NVMCON_LVDERR ) { - LOG_ERROR("Flash write error LVDERR (status=0x%08x)", status); + LOG_ERROR("Flash write error LVDERR (status=0x%08" PRIx32 ")", status); retval = ERROR_FLASH_OPERATION_FAILED; break; } @@ -497,7 +497,7 @@ { target_t *target = bank->target; - LOG_DEBUG("addr: 0x%08x srcaddr: 0x%08x", address, srcaddr); + LOG_DEBUG("addr: 0x%08" PRIx32 " srcaddr: 0x%08" PRIx32 "", address, srcaddr); if(address >= PIC32MX_KSEG1_PGM_FLASH) target_write_u32(target, PIC32MX_NVMADDR, KS1Virt2Phys(address)); @@ -528,7 +528,7 @@ if (offset & 0x3) { - LOG_WARNING("offset 0x%x breaks required 4-byte alignment", offset); + LOG_WARNING("offset 0x%" PRIx32 "breaks required 4-byte alignment", offset); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; } @@ -603,7 +603,11 @@ pic32mx_info->probed = 0; device_id = ejtag_info->idcode; - LOG_INFO( "device id = 0x%08x (manuf 0x%03x dev 0x%02x, ver 0x%03x)", device_id, (device_id>>1)&0x7ff, (device_id>>12)&0xff, (device_id>>20)&0xfff ); + LOG_INFO( "device id = 0x%08" PRIx32 " (manuf 0x%03x dev 0x%02x, ver 0x%03x)", + device_id, + (unsigned)((device_id>>1)&0x7ff), + (unsigned)((device_id>>12)&0xff), + (unsigned)((device_id>>20)&0xfff) ); if(((device_id>>1)&0x7ff) != PIC32MX_MANUF_ID) { LOG_WARNING( "Cannot identify target as a PIC32MX family." ); @@ -694,7 +698,10 @@ device_id = ejtag_info->idcode; if(((device_id>>1)&0x7ff) != PIC32MX_MANUF_ID) { - snprintf(buf, buf_size, "Cannot identify target as a PIC32MX family (manufacturer 0x%03d != 0x%03d)\n", (device_id>>1)&0x7ff, PIC32MX_MANUF_ID); + snprintf(buf, buf_size, + "Cannot identify target as a PIC32MX family (manufacturer 0x%03d != 0x%03d)\n", + (unsigned)((device_id>>1)&0x7ff), + PIC32MX_MANUF_ID); return ERROR_FLASH_OPERATION_FAILED; } for(i=0; pic32mx_devs[i].name != NULL; i++) @@ -708,7 +715,8 @@ } buf += printed; buf_size -= printed; - printed = snprintf(buf, buf_size, " Ver: 0x%03x", (device_id>>20)&0xfff); + printed = snprintf(buf, buf_size, " Ver: 0x%03x", + (unsigned)((device_id>>20)&0xfff)); return ERROR_OK; } |
From: <du...@ma...> - 2009-06-21 05:20:48
|
Author: duane Date: 2009-06-21 05:20:46 +0200 (Sun, 21 Jun 2009) New Revision: 2339 Modified: trunk/src/flash/lpc288x.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/lpc288x.c =================================================================== --- trunk/src/flash/lpc288x.c 2009-06-21 03:20:41 UTC (rev 2338) +++ trunk/src/flash/lpc288x.c 2009-06-21 03:20:46 UTC (rev 2339) @@ -155,7 +155,7 @@ if (cidr != 0x0102100A) { - LOG_WARNING("Cannot identify target as an LPC288X (%08X)",cidr); + LOG_WARNING("Cannot identify target as an LPC288X (%08" PRIx32 ")",cidr); return ERROR_FLASH_OPERATION_FAILED; } @@ -345,7 +345,7 @@ /* all writes must start on a sector boundary... */ if (offset % bank->sectors[i].size) { - LOG_INFO("offset 0x%x breaks required alignment 0x%x", offset, bank->sectors[i].size); + LOG_INFO("offset 0x%" PRIx32 " breaks required alignment 0x%" PRIx32 "", offset, bank->sectors[i].size); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; } } @@ -360,7 +360,7 @@ /* Range check... */ if (first_sector == 0xffffffff || last_sector == 0xffffffff) { - LOG_INFO("Range check failed %x %x", offset, count); + LOG_INFO("Range check failed %" PRIx32 " %" PRIx32 "", offset, count); return ERROR_FLASH_DST_OUT_OF_BANK; } @@ -408,7 +408,7 @@ #if 1 if (target_write_memory(target, offset + dest_offset, 4, 128, page_buffer) != ERROR_OK) { - LOG_ERROR("Write failed s %x p %x", sector, page); + LOG_ERROR("Write failed s %" PRIx32 " p %" PRIx32 "", sector, page); return ERROR_FLASH_OPERATION_FAILED; } #else |
From: <du...@ma...> - 2009-06-21 05:20:44
|
Author: duane Date: 2009-06-21 05:20:41 +0200 (Sun, 21 Jun 2009) New Revision: 2338 Modified: trunk/src/flash/stellaris.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/stellaris.c =================================================================== --- trunk/src/flash/stellaris.c 2009-06-21 03:20:35 UTC (rev 2337) +++ trunk/src/flash/stellaris.c 2009-06-21 03:20:41 UTC (rev 2338) @@ -292,24 +292,45 @@ { device_class = 0; } - printed = snprintf(buf, buf_size, "\nLMI Stellaris information: Chip is class %i(%s) %s v%c.%i\n", - device_class, StellarisClassname[device_class], stellaris_info->target_name, - 'A' + ((stellaris_info->did0>>8) & 0xFF), (stellaris_info->did0) & 0xFF); + printed = snprintf(buf, + buf_size, + "\nLMI Stellaris information: Chip is class %i(%s) %s v%c.%i\n", + device_class, + StellarisClassname[device_class], + stellaris_info->target_name, + (int)('A' + ((stellaris_info->did0>>8) & 0xFF)), + (int)((stellaris_info->did0) & 0xFF)); buf += printed; buf_size -= printed; - printed = snprintf(buf, buf_size, "did1: 0x%8.8x, arch: 0x%4.4x, eproc: %s, ramsize:%ik, flashsize: %ik\n", - stellaris_info->did1, stellaris_info->did1, "ARMV7M", (1+((stellaris_info->dc0>>16) & 0xFFFF))/4, (1+(stellaris_info->dc0 & 0xFFFF))*2); + printed = snprintf(buf, + buf_size, + "did1: 0x%8.8" PRIx32 ", arch: 0x%4.4" PRIx32 ", eproc: %s, ramsize:%ik, flashsize: %ik\n", + stellaris_info->did1, + stellaris_info->did1, + "ARMV7M", + (int)((1+((stellaris_info->dc0>>16) & 0xFFFF))/4), + (int)((1+(stellaris_info->dc0 & 0xFFFF))*2)); buf += printed; buf_size -= printed; - printed = snprintf(buf, buf_size, "master clock(estimated): %ikHz, rcc is 0x%x \n", stellaris_info->mck_freq / 1000, stellaris_info->rcc); + printed = snprintf(buf, + buf_size, + "master clock(estimated): %ikHz, rcc is 0x%" PRIx32 " \n", + (int)(stellaris_info->mck_freq / 1000), + stellaris_info->rcc); buf += printed; buf_size -= printed; if (stellaris_info->num_lockbits>0) { - printed = snprintf(buf, buf_size, "pagesize: %i, lockbits: %i 0x%4.4x, pages in lock region: %i \n", stellaris_info->pagesize, stellaris_info->num_lockbits, stellaris_info->lockbits,stellaris_info->num_pages/stellaris_info->num_lockbits); + printed = snprintf(buf, + buf_size, + "pagesize: %" PRIi32 ", lockbits: %i 0x%4.4" PRIx32 ", pages in lock region: %i \n", + stellaris_info->pagesize, + stellaris_info->num_lockbits, + stellaris_info->lockbits, + (int)(stellaris_info->num_pages/stellaris_info->num_lockbits)); buf += printed; buf_size -= printed; } @@ -340,9 +361,9 @@ unsigned long mainfreq; target_read_u32(target, SCB_BASE|RCC, &rcc); - LOG_DEBUG("Stellaris RCC %x", rcc); + LOG_DEBUG("Stellaris RCC %" PRIx32 "", rcc); target_read_u32(target, SCB_BASE|PLLCFG, &pllcfg); - LOG_DEBUG("Stellaris PLLCFG %x", pllcfg); + LOG_DEBUG("Stellaris PLLCFG %" PRIx32 "", pllcfg); stellaris_info->rcc = rcc; sysdiv = (rcc>>23) & 0xF; @@ -390,7 +411,7 @@ target_t *target = bank->target; uint32_t usecrl = (stellaris_info->mck_freq/1000000ul-1); - LOG_DEBUG("usecrl = %i",usecrl); + LOG_DEBUG("usecrl = %i",(int)(usecrl)); target_write_u32(target, SCB_BASE|USECRL, usecrl); } @@ -443,7 +464,8 @@ target_read_u32(target, SCB_BASE|DID1, &did1); target_read_u32(target, SCB_BASE|DC0, &stellaris_info->dc0); target_read_u32(target, SCB_BASE|DC1, &stellaris_info->dc1); - LOG_DEBUG("did0 0x%x, did1 0x%x, dc0 0x%x, dc1 0x%x", did0, did1, stellaris_info->dc0, stellaris_info->dc1); + LOG_DEBUG("did0 0x%" PRIx32 ", did1 0x%" PRIx32 ", dc0 0x%" PRIx32 ", dc1 0x%" PRIx32 "", + did0, did1, stellaris_info->dc0, stellaris_info->dc1); ver = did0 >> 28; if((ver != 0) && (ver != 1)) @@ -594,7 +616,7 @@ target_read_u32(target, FLASH_CRIS, &flash_cris); if(flash_cris & (AMASK)) { - LOG_WARNING("Error erasing flash page %i, flash_cris 0x%x", banknr, flash_cris); + LOG_WARNING("Error erasing flash page %i, flash_cris 0x%" PRIx32 "", banknr, flash_cris); target_write_u32(target, FLASH_CRIS, 0); return ERROR_FLASH_OPERATION_FAILED; } @@ -652,7 +674,7 @@ target_write_u32(target, FLASH_CIM, 0); target_write_u32(target, FLASH_MISC, PMISC|AMISC); - LOG_DEBUG("fmppe 0x%x",fmppe); + LOG_DEBUG("fmppe 0x%" PRIx32 "",fmppe); target_write_u32(target, SCB_BASE|FMPPE, fmppe); /* Commit FMPPE */ target_write_u32(target, FLASH_FMA, 1); @@ -671,7 +693,7 @@ target_read_u32(target, FLASH_CRIS, &flash_cris); if(flash_cris & (AMASK)) { - LOG_WARNING("Error setting flash page protection, flash_cris 0x%x", flash_cris); + LOG_WARNING("Error setting flash page protection, flash_cris 0x%" PRIx32 "", flash_cris); target_write_u32(target, FLASH_CRIS, 0); return ERROR_FLASH_OPERATION_FAILED; } @@ -732,7 +754,7 @@ armv7m_algorithm_t armv7m_info; int retval = ERROR_OK; - LOG_DEBUG("(bank=%p buffer=%p offset=%08X wcount=%08X)", + LOG_DEBUG("(bank=%p buffer=%p offset=%08" PRIx32 " wcount=%08" PRIx32 "", bank, buffer, offset, wcount); /* flash write code */ @@ -747,7 +769,7 @@ /* memory buffer */ while (target_alloc_working_area(target, buffer_size, &source) != ERROR_OK) { - LOG_DEBUG("called target_alloc_working_area(target=%p buffer_size=%08X source=%p)", + LOG_DEBUG("called target_alloc_working_area(target=%p buffer_size=%08" PRIx32 " source=%p)", target, buffer_size, source); buffer_size /= 2; if (buffer_size <= 256) @@ -777,8 +799,8 @@ buf_set_u32(reg_params[0].value, 0, 32, source->address); buf_set_u32(reg_params[1].value, 0, 32, address); buf_set_u32(reg_params[2].value, 0, 32, 4*thisrun_count); - LOG_INFO("Algorithm flash write %i words to 0x%x, %i remaining", thisrun_count, address, wcount); - LOG_DEBUG("Algorithm flash write %i words to 0x%x, %i remaining", thisrun_count, address, wcount); + LOG_INFO("Algorithm flash write %" PRIi32 " words to 0x%" PRIx32 ", %" PRIi32 " remaining", thisrun_count, address, wcount); + LOG_DEBUG("Algorithm flash write %" PRIi32 " words to 0x%" PRIx32 ", %" PRIi32 " remaining", thisrun_count, address, wcount); if ((retval = target_run_algorithm(target, 0, NULL, 3, reg_params, write_algorithm->address, write_algorithm->address + sizeof(stellaris_write_code)-10, 10000, &armv7m_info)) != ERROR_OK) { LOG_ERROR("error executing stellaris flash write algorithm"); @@ -818,7 +840,7 @@ return ERROR_TARGET_NOT_HALTED; } - LOG_DEBUG("(bank=%p buffer=%p offset=%08X count=%08X)", + LOG_DEBUG("(bank=%p buffer=%p offset=%08" PRIx32 " count=%08" PRIx32 "", bank, buffer, offset, count); if (stellaris_info->did1 == 0) @@ -866,7 +888,7 @@ /* if an error occured, we examine the reason, and quit */ target_read_u32(target, FLASH_CRIS, &flash_cris); - LOG_ERROR("flash writing failed with CRIS: 0x%x", flash_cris); + LOG_ERROR("flash writing failed with CRIS: 0x%" PRIx32 "", flash_cris); return ERROR_FLASH_OPERATION_FAILED; } } @@ -881,7 +903,7 @@ while (words_remaining > 0) { if (!(address & 0xff)) - LOG_DEBUG("0x%x", address); + LOG_DEBUG("0x%" PRIx32 "", address); /* Program one word */ target_write_u32(target, FLASH_FMA, address); @@ -912,7 +934,7 @@ } if (!(address & 0xff)) - LOG_DEBUG("0x%x", address); + LOG_DEBUG("0x%" PRIx32 "", address); /* Program one word */ target_write_u32(target, FLASH_FMA, address); @@ -930,7 +952,7 @@ target_read_u32(target, FLASH_CRIS, &flash_cris); if (flash_cris & (AMASK)) { - LOG_DEBUG("flash_cris 0x%x", flash_cris); + LOG_DEBUG("flash_cris 0x%" PRIx32 "", flash_cris); return ERROR_FLASH_OPERATION_FAILED; } return ERROR_OK; |
From: <du...@ma...> - 2009-06-21 05:20:39
|
Author: duane Date: 2009-06-21 05:20:35 +0200 (Sun, 21 Jun 2009) New Revision: 2337 Modified: trunk/src/flash/avrf.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/avrf.c =================================================================== --- trunk/src/flash/avrf.c 2009-06-21 03:20:31 UTC (rev 2336) +++ trunk/src/flash/avrf.c 2009-06-21 03:20:35 UTC (rev 2337) @@ -155,7 +155,7 @@ { return ERROR_FAIL; } - LOG_DEBUG("poll_value = 0x%04X", poll_value); + LOG_DEBUG("poll_value = 0x%04" PRIx32 "", poll_value); }while(!(poll_value & 0x0200)); return ERROR_OK; @@ -202,7 +202,7 @@ { return ERROR_FAIL; } - LOG_DEBUG("poll_value = 0x%04X", poll_value); + LOG_DEBUG("poll_value = 0x%04" PRIx32 "", poll_value); }while(!(poll_value & 0x0200)); return ERROR_OK; @@ -264,12 +264,12 @@ page_size = bank->sectors[0].size; if ((offset % page_size) != 0) { - LOG_WARNING("offset 0x%x breaks required %d-byte alignment", offset, page_size); + LOG_WARNING("offset 0x%" PRIx32 " breaks required %" PRIu32 "-byte alignment", offset, page_size); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; } - LOG_DEBUG("offset is 0x%08X", offset); - LOG_DEBUG("count is %d", count); + LOG_DEBUG("offset is 0x%08" PRIx32 "", offset); + LOG_DEBUG("count is %" PRId32 "", count); if (ERROR_OK != avr_jtagprg_enterprogmode(avr)) { @@ -323,10 +323,10 @@ return ERROR_FAIL; } - LOG_INFO( "device id = 0x%08x", device_id ); + LOG_INFO( "device id = 0x%08" PRIx32 "", device_id ); if (EXTRACT_MFG(device_id) != 0x1F) { - LOG_ERROR("0x%X is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F); + LOG_ERROR("0x%" PRIx32 " is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F); } for (i = 0; i < (int)(sizeof(avft_chips_info) / sizeof(avft_chips_info[0])); i++) @@ -361,7 +361,7 @@ else { // chip not supported - LOG_ERROR("0x%X is not support for avr", EXTRACT_PART(device_id)); + LOG_ERROR("0x%" PRIx32 " is not support for avr", EXTRACT_PART(device_id)); avrf_info->probed = 1; return ERROR_FAIL; @@ -402,10 +402,10 @@ return ERROR_FAIL; } - LOG_INFO( "device id = 0x%08x", device_id ); + LOG_INFO( "device id = 0x%08" PRIx32 "", device_id ); if (EXTRACT_MFG(device_id) != 0x1F) { - LOG_ERROR("0x%X is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F); + LOG_ERROR("0x%" PRIx32 " is invalid Manufacturer for avr, 0x%X is expected", EXTRACT_MFG(device_id), 0x1F); } for (i = 0; i < (int)(sizeof(avft_chips_info) / sizeof(avft_chips_info[0])); i++) @@ -422,7 +422,7 @@ if (avr_info != NULL) { // chip found - snprintf(buf, buf_size, "%s - Rev: 0x%X", avr_info->name, EXTRACT_VER(device_id)); + snprintf(buf, buf_size, "%s - Rev: 0x%" PRIx32 "", avr_info->name, EXTRACT_VER(device_id)); return ERROR_OK; } else |
From: <du...@ma...> - 2009-06-21 05:20:35
|
Author: duane Date: 2009-06-21 05:20:31 +0200 (Sun, 21 Jun 2009) New Revision: 2336 Modified: trunk/src/flash/lpc3180_nand_controller.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/lpc3180_nand_controller.c =================================================================== --- trunk/src/flash/lpc3180_nand_controller.c 2009-06-21 03:20:26 UTC (rev 2335) +++ trunk/src/flash/lpc3180_nand_controller.c 2009-06-21 03:20:31 UTC (rev 2336) @@ -750,11 +750,11 @@ { if (mlc_isr & 0x40) { - LOG_ERROR("uncorrectable error detected: 0x%2.2x", mlc_isr); + LOG_ERROR("uncorrectable error detected: 0x%2.2x", (unsigned)mlc_isr); return ERROR_NAND_OPERATION_FAILED; } - LOG_WARNING("%i symbol error detected and corrected", ((mlc_isr & 0x30) >> 4) + 1); + LOG_WARNING("%i symbol error detected and corrected", ((int)(((mlc_isr & 0x30) >> 4) + 1))); } if (data) |
From: <du...@ma...> - 2009-06-21 05:20:35
|
Author: duane Date: 2009-06-21 05:20:26 +0200 (Sun, 21 Jun 2009) New Revision: 2335 Modified: trunk/src/flash/str9xpec.c Log: C99 printf() -Werror fixes Modified: trunk/src/flash/str9xpec.c =================================================================== --- trunk/src/flash/str9xpec.c 2009-06-21 03:20:17 UTC (rev 2334) +++ trunk/src/flash/str9xpec.c 2009-06-21 03:20:26 UTC (rev 2335) @@ -652,7 +652,7 @@ if (offset & 0x7) { - LOG_WARNING("offset 0x%x breaks required 8-byte alignment", offset); + LOG_WARNING("offset 0x%" PRIx32 " breaks required 8-byte alignment", offset); return ERROR_FLASH_DST_BREAKS_ALIGNMENT; } @@ -831,7 +831,7 @@ idcode = buf_get_u32(buffer, 0, 32); - command_print(cmd_ctx, "str9xpec part id: 0x%8.8x", idcode); + command_print(cmd_ctx, "str9xpec part id: 0x%8.8" PRIx32 "", idcode); free(buffer); |