Fix store_index

This commit is contained in:
Lander Gallastegi 2025-04-30 08:07:05 +02:00 committed by Lander Gallastegi
parent 59ea5f8cfe
commit 5947526a4d

View File

@ -33,10 +33,10 @@ void main() {
uint bit = findLSB(word);
word &= word - 1;
uint page = base_bit + bit;
uint store_index = atomicAdd(download_buffer32[0], 1u);
uint store_index = atomicAdd(download_buffer32[0], 1u) + 1u;
// It is very unlikely, but should we check for overflow?
if (store_index < 1024u) { // only support 1024 page faults
download_buffer[store_index] = uint64_t(page) << CACHING_PAGEBITS;
}
}
}
}