Mega-commit to bring in memory tagging.

Each memory image byte is now tagged as it's being read from a file.
Only bytes read from a file will be written or verified (modulo page
granularity requirements).



git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@1007 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
Joerg Wunsch
2011-09-14 21:49:42 +00:00
parent 0926a2cbd7
commit d742827da1
18 changed files with 489 additions and 469 deletions

View File

@@ -233,6 +233,12 @@ int avr_initmem(AVRPART * p)
progname, m->desc, m->size);
return -1;
}
m->tags = (unsigned char *) malloc(m->size);
if (m->tags == NULL) {
fprintf(stderr, "%s: can't alloc buffer for %s size of %d bytes\n",
progname, m->desc, m->size);
return -1;
}
}
return 0;
@@ -254,7 +260,16 @@ AVRMEM * avr_dup_mem(AVRMEM * m)
n->size);
exit(1);
}
memset(n->buf, 0, n->size);
memcpy(n->buf, m->buf, n->size);
n->tags = (unsigned char *)malloc(n->size);
if (n->tags == NULL) {
fprintf(stderr,
"avr_dup_mem(): out of memory (memsize=%d)\n",
n->size);
exit(1);
}
memcpy(n->tags, m->tags, n->size);
return n;
}