24 files changed:
return ERROR_FAIL;
}
LOG_DEBUG("poll_value = 0x%04" PRIx32 "", poll_value);
return ERROR_FAIL;
}
LOG_DEBUG("poll_value = 0x%04" PRIx32 "", poll_value);
- }while(!(poll_value & 0x0200));
+ }while (!(poll_value & 0x0200));
return ERROR_FAIL;
}
LOG_DEBUG("poll_value = 0x%04" PRIx32 "", poll_value);
return ERROR_FAIL;
}
LOG_DEBUG("poll_value = 0x%04" PRIx32 "", poll_value);
- }while(!(poll_value & 0x0200));
+ }while (!(poll_value & 0x0200));
{
if (count > page_size)
{
{
if (count > page_size)
{
target_free_working_area(target, source);
target_free_working_area(target, source);
{
uint32_t value;
memcpy(&value, buffer, sizeof(uint32_t));
{
uint32_t value;
memcpy(&value, buffer, sizeof(uint32_t));
{
target_read_u32(target, FLASH_FMC, &flash_fmc);
}
{
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);
/* Check acess violations */
target_read_u32(target, FLASH_CRIS, &flash_cris);
{
target_read_u32(target, FLASH_FMC, &flash_fmc);
}
{
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);
/* Check acess violations */
target_read_u32(target, FLASH_CRIS, &flash_cris);
uint8_t last_word[4] = {0xff, 0xff, 0xff, 0xff};
int i = 0;
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--;
{
last_word[i++] = *(buffer + bytes_written);
bytes_remaining--;
uint8_t last_dword[8] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
int i = 0;
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--;
{
last_dword[i++] = *(buffer + bytes_written);
bytes_remaining--;
uint8_t last_halfword[2] = {0xff, 0xff};
int i = 0;
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--;
{
last_halfword[i++] = *(buffer + bytes_written);
bytes_remaining--;
jtag_add_dr_scan(1, &field, jtag_get_end_state());
jtag_execute_queue();
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);
str9xpec_isc_disable(bank);
status = buf_get_u32(scanbuf, 0, 8);
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;
if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS)
return ERROR_FLASH_OPERATION_FAILED;
uint8_t last_dword[8] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
int i = 0;
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--;
{
last_dword[i++] = *(buffer + bytes_written);
bytes_remaining--;
status = buf_get_u32(scanbuf, 0, 8);
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;
if ((status & ISC_STATUS_ERROR) != STR9XPEC_ISC_SUCCESS)
return ERROR_FLASH_OPERATION_FAILED;
jtag_add_dr_scan(1, &field, jtag_get_end_state());
jtag_execute_queue();
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);
str9xpec_isc_disable(bank);
if (context == NULL)
return ERROR_OK;
if (context == NULL)
return ERROR_OK;
- while(NULL != context->commands)
+ while (NULL != context->commands)
- while(NULL != c->children)
+ while (NULL != c->children)
{
c2 = c->children;
c->children = c->children->next;
{
c2 = c->children;
c->children = c->children->next;
/* find command */
c = context->commands;
/* find command */
c = context->commands;
{
if (strcmp(name, c->name) == 0)
{
{
if (strcmp(name, c->name) == 0)
{
}
/* unregister children */
}
/* unregister children */
- while(NULL != c->children)
+ while (NULL != c->children)
{
c2 = c->children;
c->children = c->children->next;
{
c2 = c->children;
c->children = c->children->next;
Jim_EventLoop *eventLoop = Jim_GetAssocData(interp, "eventloop");
fe = eventLoop->fileEventHead;
Jim_EventLoop *eventLoop = Jim_GetAssocData(interp, "eventloop");
fe = eventLoop->fileEventHead;
if (fe->handle == handle) {
if (prev == NULL)
eventLoop->fileEventHead = fe->next;
if (fe->handle == handle) {
if (prev == NULL)
eventLoop->fileEventHead = fe->next;
te = eventLoop->timeEventHead;
if (id >= eventLoop->timeEventNextId)
return -2; /* wrong event ID */
te = eventLoop->timeEventHead;
if (id >= eventLoop->timeEventNextId)
return -2; /* wrong event ID */
if (te->id == id) {
remain = (te->when_sec - cur_sec) * 1000;
remain += (te->when_ms - cur_ms) ;
if (te->id == id) {
remain = (te->when_sec - cur_sec) * 1000;
remain += (te->when_ms - cur_ms) ;
Jim_TimeEvent *te = eventLoop->timeEventHead;
Jim_TimeEvent *nearest = NULL;
Jim_TimeEvent *te = eventLoop->timeEventHead;
Jim_TimeEvent *nearest = NULL;
if (!nearest || te->when_sec < nearest->when_sec ||
(te->when_sec == nearest->when_sec &&
te->when_ms < nearest->when_ms))
if (!nearest || te->when_sec < nearest->when_sec ||
(te->when_sec == nearest->when_sec &&
te->when_ms < nearest->when_ms))
}
} else if (retval > 0) {
fe = eventLoop->fileEventHead;
}
} else if (retval > 0) {
fe = eventLoop->fileEventHead;
int fd = fileno((FILE*)fe->handle);
// fprintf(stderr,"fd: %d mask: %02x \n",fd,fe->mask);
int fd = fileno((FILE*)fe->handle);
// fprintf(stderr,"fd: %d mask: %02x \n",fd,fe->mask);
/* Check time events */
te = eventLoop->timeEventHead;
maxId = eventLoop->timeEventNextId-1;
/* Check time events */
te = eventLoop->timeEventHead;
maxId = eventLoop->timeEventNextId-1;
long now_sec, now_ms;
jim_wide id;
long now_sec, now_ms;
jim_wide id;
Jim_EventLoop *eventLoop = data;
fe = eventLoop->fileEventHead;
Jim_EventLoop *eventLoop = data;
fe = eventLoop->fileEventHead;
next = fe->next;
if (fe->finalizerProc)
fe->finalizerProc(interp, fe->clientData);
next = fe->next;
if (fe->finalizerProc)
fe->finalizerProc(interp, fe->clientData);
}
te = eventLoop->timeEventHead;
}
te = eventLoop->timeEventHead;
next = te->next;
if (te->finalizerProc)
te->finalizerProc(interp, te->clientData);
next = te->next;
if (te->finalizerProc)
te->finalizerProc(interp, te->clientData);
static int JimStringMatch(const char *pattern, int patternLen,
const char *string, int stringLen, int nocase)
{
static int JimStringMatch(const char *pattern, int patternLen,
const char *string, int stringLen, int nocase)
{
switch(pattern[0]) {
case '*':
while (pattern[1] == '*') {
switch(pattern[0]) {
case '*':
while (pattern[1] == '*') {
}
if (patternLen == 1)
return 1; /* match */
}
if (patternLen == 1)
return 1; /* match */
if (JimStringMatch(pattern+1, patternLen-1,
string, stringLen, nocase))
return 1; /* match */
if (JimStringMatch(pattern+1, patternLen-1,
string, stringLen, nocase))
return 1; /* match */
patternLen--;
}
match = 0;
patternLen--;
}
match = 0;
if (pattern[0] == '\\') {
pattern++;
patternLen--;
if (pattern[0] == '\\') {
pattern++;
patternLen--;
pattern++;
patternLen--;
if (stringLen == 0) {
pattern++;
patternLen--;
if (stringLen == 0) {
- while(*pattern == '*') {
+ while (*pattern == '*') {
pattern++;
patternLen--;
}
pattern++;
patternLen--;
}
unsigned char *u1 = (unsigned char*) s1, *u2 = (unsigned char*) s2;
if (nocase == 0) {
unsigned char *u1 = (unsigned char*) s1, *u2 = (unsigned char*) s2;
if (nocase == 0) {
if (*u1 != *u2)
return (int)*u1-*u2;
u1++; u2++; l1--; l2--;
if (*u1 != *u2)
return (int)*u1-*u2;
u1++; u2++; l1--; l2--;
if (!l1 && !l2) return 0;
return l1-l2;
} else {
if (!l1 && !l2) return 0;
return l1-l2;
} else {
if (tolower((int)*u1) != tolower((int)*u2))
return tolower((int)*u1)-tolower((int)*u2);
u1++; u2++; l1--; l2--;
if (tolower((int)*u1) != tolower((int)*u2))
return tolower((int)*u1)-tolower((int)*u2);
u1++; u2++; l1--; l2--;
if ((str[0] == '\0') || (str == endptr) )
return JIM_ERR;
if (endptr[0] != '\0') {
if ((str[0] == '\0') || (str == endptr) )
return JIM_ERR;
if (endptr[0] != '\0') {
if (!isspace((int)*endptr))
return JIM_ERR;
endptr++;
if (!isspace((int)*endptr))
return JIM_ERR;
endptr++;
if ( (str[0] == '\0') || (str == endptr) )
return JIM_ERR;
if (endptr[0] != '\0') {
if ( (str[0] == '\0') || (str == endptr) )
return JIM_ERR;
if (endptr[0] != '\0') {
if (!isspace((int)*endptr))
return JIM_ERR;
endptr++;
if (!isspace((int)*endptr))
return JIM_ERR;
endptr++;
len = sprintf(buf, "%.17g", doubleValue);
s = buf;
len = sprintf(buf, "%.17g", doubleValue);
s = buf;
if (*s == '.') return len;
s++;
}
if (*s == '.') return len;
s++;
}
unsigned int Jim_GenHashFunction(const unsigned char *buf, int len)
{
unsigned int h = 0;
unsigned int Jim_GenHashFunction(const unsigned char *buf, int len)
{
unsigned int h = 0;
h += (h<<3)+*buf++;
return h;
}
h += (h<<3)+*buf++;
return h;
}
/* For each hash entry on this slot... */
he = ht->table[i];
/* For each hash entry on this slot... */
he = ht->table[i];
unsigned int h;
nextHe = he->next;
unsigned int h;
nextHe = he->next;
he = ht->table[h];
prevHe = NULL;
he = ht->table[h];
prevHe = NULL;
if (Jim_CompareHashKeys(ht, key, he->key)) {
/* Unlink the element from the list */
if (prevHe)
if (Jim_CompareHashKeys(ht, key, he->key)) {
/* Unlink the element from the list */
if (prevHe)
Jim_HashEntry *he, *nextHe;
if ((he = ht->table[i]) == NULL) continue;
Jim_HashEntry *he, *nextHe;
if ((he = ht->table[i]) == NULL) continue;
nextHe = he->next;
Jim_FreeEntryKey(ht, he);
Jim_FreeEntryVal(ht, he);
nextHe = he->next;
Jim_FreeEntryKey(ht, he);
Jim_FreeEntryVal(ht, he);
if (ht->size == 0) return NULL;
h = Jim_HashKey(ht, key) & ht->sizemask;
he = ht->table[h];
if (ht->size == 0) return NULL;
h = Jim_HashKey(ht, key) & ht->sizemask;
he = ht->table[h];
if (Jim_CompareHashKeys(ht, key, he->key))
return he;
he = he->next;
if (Jim_CompareHashKeys(ht, key, he->key))
return he;
he = he->next;
if (size >= 2147483648U)
return 2147483648U;
if (size >= 2147483648U)
return 2147483648U;
if (i >= size)
return i;
i *= 2;
if (i >= size)
return i;
i *= 2;
h = Jim_HashKey(ht, key) & ht->sizemask;
/* Search if this slot does not already contain the given key */
he = ht->table[h];
h = Jim_HashKey(ht, key) & ht->sizemask;
/* Search if this slot does not already contain the given key */
he = ht->table[h];
if (Jim_CompareHashKeys(ht, key, he->key))
return -1;
he = he->next;
if (Jim_CompareHashKeys(ht, key, he->key))
return -1;
he = he->next;
int JimParseScript(struct JimParserCtx *pc)
{
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;
if (!pc->len) {
pc->tstart = pc->p;
pc->tend = pc->p-1;
int level = 0;
int state = ' ';
int level = 0;
int state = ' ';
switch (*s) {
case '\\':
if (len > 1)
switch (*s) {
case '\\':
if (len > 1)
case '8':
case '9':
accum = 0;
case '8':
case '9':
accum = 0;
- while( isdigit(*fmt) && (fmtLen > 0) ){
+ while ( isdigit(*fmt) && (fmtLen > 0) ){
accum = (accum * 10) + (*fmt - '0');
fmt++; fmtLen--;
}
accum = (accum * 10) + (*fmt - '0');
fmt++; fmtLen--;
}
}
JimParserInit(&parser, scriptText, scriptTextLen, initialLineNumber);
}
JimParserInit(&parser, scriptText, scriptTextLen, initialLineNumber);
- while(!JimParserEof(&parser)) {
+ while (!JimParserEof(&parser)) {
char *token;
int len, type, linenr;
char *token;
int len, type, linenr;
Jim_Obj *objPtr = targetNameObjPtr;
Jim_Var *varPtr;
/* Cycles are only possible with 'uplevel 0' */
Jim_Obj *objPtr = targetNameObjPtr;
Jim_Var *varPtr;
/* Cycles are only possible with 'uplevel 0' */
if (Jim_StringEqObj(objPtr, nameObjPtr, 0)) {
Jim_SetResultString(interp,
"can't upvar from variable to itself", -1);
if (Jim_StringEqObj(objPtr, nameObjPtr, 0)) {
Jim_SetResultString(interp,
"can't upvar from variable to itself", -1);
* is of a type that can contain references. */
Jim_InitHashTable(&marks, &JimRefMarkHashTableType, NULL);
objPtr = interp->liveList;
* is of a type that can contain references. */
Jim_InitHashTable(&marks, &JimRefMarkHashTableType, NULL);
objPtr = interp->liveList;
if (objPtr->typePtr == NULL ||
objPtr->typePtr->flags & JIM_TYPE_REFERENCES) {
const char *str, *p;
if (objPtr->typePtr == NULL ||
objPtr->typePtr->flags & JIM_TYPE_REFERENCES) {
const char *str, *p;
continue;
}
/* Extract references from the object string repr. */
continue;
}
/* Extract references from the object string repr. */
int i;
jim_wide id;
char buf[21];
int i;
jim_wide id;
char buf[21];
Jim_FreeHashTable(&i->packages);
Jim_Free(i->prngState);
/* Free the call frames list */
Jim_FreeHashTable(&i->packages);
Jim_Free(i->prngState);
/* Free the call frames list */
prevcf = cf->parentCallFrame;
JimFreeCallFrame(i, cf, JIM_FCF_NONE);
cf = prevcf;
prevcf = cf->parentCallFrame;
JimFreeCallFrame(i, cf, JIM_FCF_NONE);
cf = prevcf;
Jim_fprintf( i, i->cookie_stdout,JIM_NL "-------------------------------------" JIM_NL);
Jim_fprintf( i, i->cookie_stdout,"Objects still in the free list:" JIM_NL);
Jim_fprintf( i, i->cookie_stdout,JIM_NL "-------------------------------------" JIM_NL);
Jim_fprintf( i, i->cookie_stdout,"Objects still in the free list:" JIM_NL);
const char *type = objPtr->typePtr ?
objPtr->typePtr->name : "";
Jim_fprintf( i, i->cookie_stdout,"%p \"%-10s\": '%.20s' (refCount: %d)" JIM_NL,
const char *type = objPtr->typePtr ?
objPtr->typePtr->name : "";
Jim_fprintf( i, i->cookie_stdout,"%p \"%-10s\": '%.20s' (refCount: %d)" JIM_NL,
}
/* Free cached CallFrame structures */
cf = i->freeFramesList;
}
/* Free cached CallFrame structures */
cf = i->freeFramesList;
nextcf = cf->nextFramePtr;
if (cf->vars.table != NULL)
Jim_Free(cf->vars.table);
nextcf = cf->nextFramePtr;
if (cf->vars.table != NULL)
Jim_Free(cf->vars.table);
char *q = Jim_Alloc(len*2+1), *p;
p = q;
char *q = Jim_Alloc(len*2+1), *p;
p = q;
switch (*s) {
case ' ':
case '$':
switch (*s) {
case ' ':
case '$':
/* Convert into a list */
JimParserInit(&parser, str, strLen, 1);
/* Convert into a list */
JimParserInit(&parser, str, strLen, 1);
- while(!JimParserEof(&parser)) {
+ while (!JimParserEof(&parser)) {
char *token;
int tokenLen, type;
Jim_Obj *elementPtr;
char *token;
int tokenLen, type;
Jim_Obj *elementPtr;
/* Convert into a dict */
JimParserInit(&parser, str, strLen, 1);
i = 0;
/* Convert into a dict */
JimParserInit(&parser, str, strLen, 1);
i = 0;
- while(!JimParserEof(&parser)) {
+ while (!JimParserEof(&parser)) {
char *token;
int tokenLen, type;
char *token;
int tokenLen, type;
int JimParseExpression(struct JimParserCtx *pc)
{
/* Discard spaces and quoted newline */
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' ||
*(pc->p) == '\t' ||
*(pc->p) == '\r' ||
*(pc->p) == '\n' ||
/* Search for the end of the first operator */
leftindex = index-1;
arity = 1;
/* Search for the end of the first operator */
leftindex = index-1;
arity = 1;
switch(expr->opcode[leftindex]) {
case JIM_EXPROP_NUMBER:
case JIM_EXPROP_COMMAND:
switch(expr->opcode[leftindex]) {
case JIM_EXPROP_NUMBER:
case JIM_EXPROP_COMMAND:
Jim_InitStack(&stack);
JimParserInit(&parser, exprText, exprTextLen, 1);
Jim_InitStack(&stack);
JimParserInit(&parser, exprText, exprTextLen, 1);
- while(!JimParserEof(&parser)) {
+ while (!JimParserEof(&parser)) {
char *token;
int len, type;
char *token;
int len, type;
break;
case JIM_TT_EXPR_OPERATOR:
op = JimExprOperatorInfo(token);
break;
case JIM_TT_EXPR_OPERATOR:
op = JimExprOperatorInfo(token);
Jim_ExprOperator *stackTopOp;
if (Jim_StackPeek(&stack) != NULL) {
Jim_ExprOperator *stackTopOp;
if (Jim_StackPeek(&stack) != NULL) {
case JIM_TT_SUBEXPR_END:
{
int found = 0;
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);
char *opstr = Jim_StackPop(&stack);
if (!strcmp(opstr, "(")) {
Jim_Free(opstr);
script->fileName = NULL;
JimParserInit(&parser, scriptText, scriptTextLen, 1);
script->fileName = NULL;
JimParserInit(&parser, scriptText, scriptTextLen, 1);
char *token;
int len, type, linenr;
char *token;
int len, type, linenr;
}
str = Jim_GetString(objPtr, &strLen);
/* Map it */
}
str = Jim_GetString(objPtr, &strLen);
/* Map it */
for (i = 0; i < numMaps; i++) {
if (strLen >= keyLen[i] && keyLen[i]) {
if (!JimStringCompare(str, keyLen[i], key[i], keyLen[i],
for (i = 0; i < numMaps; i++) {
if (strLen >= keyLen[i] && keyLen[i]) {
if (!JimStringCompare(str, keyLen[i], key[i], keyLen[i],
return JIM_ERR;
}
i = argc-2;
return JIM_ERR;
}
i = argc-2;
if (Jim_CompareStringImmediate(interp, argv[i+1],
"-nobackslashes"))
flags |= JIM_SUBST_NOESC;
if (Jim_CompareStringImmediate(interp, argv[i+1],
"-nobackslashes"))
flags |= JIM_SUBST_NOESC;
- while(Jim_CoreCommandsTable[i].name != NULL) {
+ while (Jim_CoreCommandsTable[i].name != NULL) {
Jim_CreateCommand(interp,
Jim_CoreCommandsTable[i].name,
Jim_CoreCommandsTable[i].cmdProc,
Jim_CreateCommand(interp,
Jim_CoreCommandsTable[i].name,
Jim_CoreCommandsTable[i].cmdProc,
Jim_fflush( interp, interp->cookie_stdout);
scriptObjPtr = Jim_NewStringObj(interp, "", 0);
Jim_IncrRefCount(scriptObjPtr);
Jim_fflush( interp, interp->cookie_stdout);
scriptObjPtr = Jim_NewStringObj(interp, "", 0);
Jim_IncrRefCount(scriptObjPtr);
const char *str;
char state;
int len;
const char *str;
char state;
int len;
Jim_Nvp *
Jim_Nvp_name2value_simple( const Jim_Nvp *p, const char *name )
{
Jim_Nvp *
Jim_Nvp_name2value_simple( const Jim_Nvp *p, const char *name )
{
if ( 0 == strcmp( name, p->name ) ){
break;
}
if ( 0 == strcmp( name, p->name ) ){
break;
}
Jim_Nvp *
Jim_Nvp_name2value_nocase_simple( const Jim_Nvp *p, const char *name )
{
Jim_Nvp *
Jim_Nvp_name2value_nocase_simple( const Jim_Nvp *p, const char *name )
{
if ( 0 == strcasecmp( name, p->name ) ){
break;
}
if ( 0 == strcasecmp( name, p->name ) ){
break;
}
Jim_Nvp *
Jim_Nvp_value2name_simple( const Jim_Nvp *p, int value )
{
Jim_Nvp *
Jim_Nvp_value2name_simple( const Jim_Nvp *p, int value )
{
if ( value == p->value ){
break;
}
if ( value == p->value ){
break;
}
"Unknown param: %s, try one of: ",
Jim_GetString( param_value, NULL ) );
}
"Unknown param: %s, try one of: ",
Jim_GetString( param_value, NULL ) );
}
const char *a;
const char *b;
const char *a;
const char *b;
entry->val = (ht)->type->valDup((ht)->privdata, _val_); \
else \
entry->val = (_val_); \
entry->val = (ht)->type->valDup((ht)->privdata, _val_); \
else \
entry->val = (_val_); \
#define Jim_FreeEntryKey(ht, entry) \
if ((ht)->type->keyDestructor) \
#define Jim_FreeEntryKey(ht, entry) \
if ((ht)->type->keyDestructor) \
entry->key = (ht)->type->keyDup((ht)->privdata, _key_); \
else \
entry->key = (_key_); \
entry->key = (ht)->type->keyDup((ht)->privdata, _key_); \
else \
entry->key = (_key_); \
#define Jim_CompareHashKeys(ht, key1, key2) \
(((ht)->type->keyCompare) ? \
#define Jim_CompareHashKeys(ht, key1, key2) \
(((ht)->type->keyCompare) ? \
Jim_IncrRefCount(_resultObjPtr_); \
Jim_DecrRefCount(i,(i)->result); \
(i)->result = _resultObjPtr_; \
Jim_IncrRefCount(_resultObjPtr_); \
Jim_DecrRefCount(i,(i)->result); \
(i)->result = _resultObjPtr_; \
/* 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
/* 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
*
* Jim_GetOpt_Setup( &goi, interp, argc, argv );
*
*
* Jim_GetOpt_Setup( &goi, interp, argc, argv );
*
* e = Jim_GetOpt_Nvp( &goi, nvp_options, &n );
* if ( e != JIM_OK ){
* Jim_GetOpt_NvpUnknown( &goi, nvp_options, 0 );
* e = Jim_GetOpt_Nvp( &goi, nvp_options, &n );
* if ( e != JIM_OK ){
* Jim_GetOpt_NvpUnknown( &goi, nvp_options, 0 );
* // Get the next option
* e = Jim_GetOpt_Nvp( &goi, cmd_options, &n );
* if ( e != JIM_OK ){
* // Get the next option
* e = Jim_GetOpt_Nvp( &goi, cmd_options, &n );
* if ( e != JIM_OK ){
{
jtag_tap_t *t = jtag_all_taps();
unsigned n = 0;
{
jtag_tap_t *t = jtag_all_taps();
unsigned n = 0;
t->abs_chain_position = jtag_num_taps++;
jtag_tap_t **tap = &__jtag_all_taps;
t->abs_chain_position = jtag_num_taps++;
jtag_tap_t **tap = &__jtag_all_taps;
tap = &(*tap)->next_tap;
*tap = t;
}
tap = &(*tap)->next_tap;
*tap = t;
}
#ifdef _DEBUG_JTAG_IO_
#define JTAG_DEBUG_STATE_APPEND(buf, len, bit) \
#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)
#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)
usb_buffer_p = usb_buffer;
va_start(ap, length);
usb_buffer_p = usb_buffer;
va_start(ap, length);
*usb_buffer_p++ = va_arg(ap, int);
length--;
}
*usb_buffer_p++ = va_arg(ap, int);
length--;
}
remain = length;
count = 0;
remain = length;
count = 0;
if (remain > sizeof(usb_buffer)) {
length = sizeof(usb_buffer);
} else {
if (remain > sizeof(usb_buffer)) {
length = sizeof(usb_buffer);
} else {
remain = length;
count = 0;
remain = length;
count = 0;
if (remain > (sizeof(usb_buffer) - 4)) {
length = (sizeof(usb_buffer) - 4);
} else {
if (remain > (sizeof(usb_buffer) - 4)) {
length = (sizeof(usb_buffer) - 4);
} else {
buffer_p = buffer;
va_start(ap, length);
buffer_p = buffer;
va_start(ap, length);
*buffer_p++ = va_arg(ap, int);
remain--;
}
*buffer_p++ = va_arg(ap, int);
remain--;
}
);
if (usb_err < 0) return(usb_err);
);
if (usb_err < 0) return(usb_err);
if (length < sizeof(*header)) {
LOG_ERROR("Malformed DTC image\n");
exit(1);
if (length < sizeof(*header)) {
LOG_ERROR("Malformed DTC image\n");
exit(1);
x = 0;
dtc_mask = 1 << (extra_bits - 1);
x = 0;
dtc_mask = 1 << (extra_bits - 1);
if (*tdi_p & tdi_mask) {
x |= dtc_mask;
}
if (*tdi_p & tdi_mask) {
x |= dtc_mask;
}
}
/* Loop scheduling full bytes into the DTC command buffer */
}
/* Loop scheduling full bytes into the DTC command buffer */
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));
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));
x = 0;
dtc_mask = 1 << (8 - 1);
x = 0;
dtc_mask = 1 << (8 - 1);
if (*tdi_p & tdi_mask) {
x |= dtc_mask;
}
if (*tdi_p & tdi_mask) {
x |= dtc_mask;
}
x = 0;
dtc_mask = 1 << (8 - 1);
x = 0;
dtc_mask = 1 << (8 - 1);
if (*tdi_p & tdi_mask) {
x |= dtc_mask;
}
if (*tdi_p & tdi_mask) {
x |= dtc_mask;
}
LOG_DEBUG("interface claimed!\n");
break;
}
LOG_DEBUG("interface claimed!\n");
break;
}
/* clear them as we find them */
reqbits = (NTREQ_IRLEN | NTREQ_IRCAPTURE | NTREQ_IRMASK);
/* clear them as we find them */
reqbits = (NTREQ_IRLEN | NTREQ_IRCAPTURE | NTREQ_IRMASK);
e = Jim_GetOpt_Nvp( goi, opts, &n );
if ( e != JIM_OK ){
Jim_GetOpt_NvpUnknown( goi, opts, 0 );
e = Jim_GetOpt_Nvp( goi, opts, &n );
if ( e != JIM_OK ){
Jim_GetOpt_NvpUnknown( goi, opts, 0 );
break;
}
} /* switch(n->value) */
break;
}
} /* switch(n->value) */
- } /* while( goi->argc ) */
+ } /* while ( goi->argc ) */
/* default is enabled-after-reset */
pTap->enabled = !pTap->disabled_after_reset;
/* default is enabled-after-reset */
pTap->enabled = !pTap->disabled_after_reset;
command_print(cmd_ctx, " TapName | Enabled | IdCode Expected IrLen IrCap IrMask Instr ");
command_print(cmd_ctx, "---|--------------------|---------|------------|------------|------|------|------|---------");
command_print(cmd_ctx, " TapName | Enabled | IdCode Expected IrLen IrCap IrMask Instr ");
command_print(cmd_ctx, "---|--------------------|---------|------------|------------|------|------|------|---------");
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);
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);
connection_t *c;
/* find connection */
connection_t *c;
/* find connection */
{
if (c->fd == connection->fd)
{
{
if (c->fd == connection->fd)
{
service_t *c;
/* find service */
service_t *c;
/* find service */
service_t *c = services;
/* loop service */
service_t *c = services;
/* loop service */
{
service_t *next = c->next;
{
service_t *next = c->next;
tv.tv_sec = 0;
tv.tv_usec = 10000;
tv.tv_sec = 0;
tv.tv_usec = 10000;
- while(!shutdown_openocd)
+ while (!shutdown_openocd)
{
/* monitor sockets for acitvity */
fd_max = 0;
{
/* monitor sockets for acitvity */
fd_max = 0;
#if 0
#define JTAG_DEBUG(expr ...) DEBUG(expr)
#else
#if 0
#define JTAG_DEBUG(expr ...) DEBUG(expr)
#else
-#define JTAG_DEBUG(expr ...) do {} while(0)
+#define JTAG_DEBUG(expr ...) do {} while (0)
if (breakpoint->type == BKPT_HARD)
{
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)
{
fp_num++;
if (fp_num >= cortex_m3->fp_num_code)
{
if (watchpoint->mask == 0xffffffffu)
{
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)
{
dwt_num++;
if (dwt_num >= cortex_m3->dwt_num_comp)
{
do {
ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl;
mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
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);
/* Read Data */
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_DATA, NULL);
do {
ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl;
mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
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);
/* Read Data */
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_DATA, NULL);
do {
ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl;
mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
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);
/* Read Data */
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_DATA, NULL);
do {
ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl;
mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
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);
/* Clear DMA & Check DERR */
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL, NULL);
do {
ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl;
mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
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);
/* Clear DMA & Check DERR */
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL, NULL);
do {
ejtag_ctrl = EJTAG_CTRL_DMAACC | ejtag_info->ejtag_ctrl;
mips_ejtag_drscan_32(ejtag_info, &ejtag_ctrl);
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);
/* Clear DMA & Check DERR */
mips_ejtag_set_instr(ejtag_info, EJTAG_INST_CONTROL, NULL);
- 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)
{
bp_num++;
if (bp_num >= mips32->num_inst_bpoints)
{
if ( x < t->target_number ){
x = (t->target_number)+1;
}
if ( x < t->target_number ){
x = (t->target_number)+1;
}
/* number is 0 based */
x = -1;
t = all_targets;
/* number is 0 based */
x = -1;
t = all_targets;
if ( x < t->target_number ){
x = t->target_number;
}
if ( x < t->target_number ){
x = t->target_number;
}
reg_cache_t *cache = target->reg_cache;
count = 0;
reg_cache_t *cache = target->reg_cache;
count = 0;
{
int i;
for (i = 0; i < cache->num_regs; i++)
{
int i;
for (i = 0; i < cache->num_regs; i++)
reg_cache_t *cache = target->reg_cache;
count = 0;
reg_cache_t *cache = target->reg_cache;
count = 0;
{
int i;
for (i = 0; i < cache->num_regs; i++)
{
int i;
for (i = 0; i < cache->num_regs; i++)
teap = target->event_action;
done = 0;
teap = target->event_action;
done = 0;
if ( teap->event == e ){
done = 1;
LOG_DEBUG( "target: (%d) %s (%s) event: %d (%s) action: %s\n",
if ( teap->event == e ){
done = 1;
LOG_DEBUG( "target: (%d) %s (%s) event: %d (%s) action: %s\n",
int e;
/* parse config or cget options ... */
int e;
/* parse config or cget options ... */
- while( goi->argc > 0 ){
+ while ( goi->argc > 0 ){
Jim_SetEmptyResult( goi->interp );
/* Jim_GetOpt_Debug( goi ); */
Jim_SetEmptyResult( goi->interp );
/* Jim_GetOpt_Debug( goi ); */
teap = target->event_action;
/* replace existing? */
teap = target->event_action;
/* replace existing? */
if ( teap->event == (enum target_event)n->value ){
break;
}
if ( teap->event == (enum target_event)n->value ){
break;
}
/* loop for more e*/
break;
}
/* loop for more e*/
break;
}
- } /* while( goi->argc ) */
+ } /* while ( goi->argc ) */
/* convert to "bytes" */
c = c * b;
/* count is now in 'BYTES' */
/* convert to "bytes" */
c = c * b;
/* count is now in 'BYTES' */
y = c;
if ( y > 16 ){
y = 16;
y = c;
if ( y > 16 ){
y = 16;
target_buf[x] = ' ';
x++;
}
target_buf[x] = ' ';
x++;
}
target->cmd_name );
command_print( cmd_ctx, "%-25s | Body", "Event");
command_print( cmd_ctx, "------------------------- | ----------------------------------------");
target->cmd_name );
command_print( cmd_ctx, "%-25s | Body", "Event");
command_print( cmd_ctx, "------------------------- | ----------------------------------------");
command_print( cmd_ctx,
"%-25s | %s",
Jim_Nvp_value2name_simple( nvp_target_event, teap->event )->name,
command_print( cmd_ctx,
"%-25s | %s",
Jim_Nvp_value2name_simple( nvp_target_event, teap->event )->name,
{
target_t **tpp;
tpp = &(all_targets);
{
target_t **tpp;
tpp = &(all_targets);
tpp = &( (*tpp)->next );
}
*tpp = target;
tpp = &( (*tpp)->next );
}
*tpp = target;
}
Jim_SetResult( goi.interp, Jim_NewListObj( goi.interp, NULL, 0 ) );
target = all_targets;
}
Jim_SetResult( goi.interp, Jim_NewListObj( goi.interp, NULL, 0 ) );
target = all_targets;
Jim_ListAppendElement( goi.interp,
Jim_GetResult(goi.interp),
Jim_NewStringObj( goi.interp, target->cmd_name, -1 ) );
Jim_ListAppendElement( goi.interp,
Jim_GetResult(goi.interp),
Jim_NewStringObj( goi.interp, target->cmd_name, -1 ) );
LOG_USER("xsvf processing file: \"%s\"", filename);
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;
{
/* record the position of the just read opcode within the file */
file_offset = lseek(xsvf_fd, 0, SEEK_CUR) - 1;
mPORTDClearBits(BIT_2);
mPORTDSetPinsDigitalOut(BIT_2);
mPORTDClearBits(BIT_2);
mPORTDSetPinsDigitalOut(BIT_2);
{
for(i = 0; i < 500000; i++)
mPORTDToggleBits(BIT_0);
{
for(i = 0; i < 500000; i++)
mPORTDToggleBits(BIT_0);
void exit(int exit_code)
{
void exit(int exit_code)
{
{
volatile unsigned char *led = ((volatile unsigned char *)0xB6020000);
{
volatile unsigned char *led = ((volatile unsigned char *)0xB6020000);
void exit(int exit_code)
{
void exit(int exit_code)
{
Linking to existing account procedure
If you already have an account and want to add another login method
you
MUST first sign in with your existing account and
then change URL to read
https://review.openocd.org/login/?link
to get to this page again but this time it'll work for linking. Thank you.
SSH host keys fingerprints
1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=.. |
|+o.. . |
|*.o . . |
|+B . . . |
|Bo. = o S |
|Oo.+ + = |
|oB=.* = . o |
| =+=.+ + E |
|. .=o . o |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)