Change the done_so_far array count type to size_t.
Change SYSCALL_IDX_* types to enums so the debugger can print them symbolically.
Fix the function in a comment.