nvmutil copy/swap: actually set nvmPartModified

fsdg20230625
Leah Rowe 2022-11-26 23:48:01 +00:00
parent 82300f4f1e
commit 0108615f37
1 changed files with 11 additions and 3 deletions

View File

@ -337,21 +337,29 @@ cmd_swap(void)
part0 = validChecksum(0); part0 = validChecksum(0);
part1 = validChecksum(1); part1 = validChecksum(1);
if ((gbeFileModified = (part0 | part1))) { if ((part0 | part1)) {
for(part0 = 0; part0 < SIZE_4KB; part0++) { for(part0 = 0; part0 < SIZE_4KB; part0++) {
gbe[part0] ^= gbe[part1 = (part0 | SIZE_4KB)]; gbe[part0] ^= gbe[part1 = (part0 | SIZE_4KB)];
gbe[part1] ^= gbe[part0]; gbe[part1] ^= gbe[part0];
gbe[part0] ^= gbe[part1]; gbe[part0] ^= gbe[part1];
} }
gbeFileModified = 1;
nvmPartModified[0] = 1;
nvmPartModified[1] = 1;
} }
} }
void void
cmd_copy(void) cmd_copy(void)
{ {
if (validChecksum(part)) if (validChecksum(part)) {
memcpy(gbe + ((part ^ (gbeFileModified = 1)) << 12), memcpy(gbe + ((part ^ 1) << 12),
gbe + (part << 12), SIZE_4KB); gbe + (part << 12), SIZE_4KB);
gbeFileModified = 1;
nvmPartModified[part] = 1;
}
} }
int int