memory initialization

This commit is contained in:
Andreas Abel
2022-08-13 20:56:54 +02:00
parent 0dcae1fc1e
commit b0d03d6ad7
2 changed files with 10 additions and 0 deletions

View File

@@ -1050,6 +1050,11 @@ static int __init nb_init(void) {
pr_err("Could not allocate memory for runtime_r*\n");
return -1;
}
memset(runtime_r14, 0, RUNTIME_R_SIZE);
memset(runtime_rbp, 0, RUNTIME_R_SIZE);
memset(runtime_rdi, 0, RUNTIME_R_SIZE);
memset(runtime_rsi, 0, RUNTIME_R_SIZE);
memset(runtime_rsp, 0, RUNTIME_R_SIZE);
runtime_r14 += RUNTIME_R_SIZE/2;
runtime_rbp += RUNTIME_R_SIZE/2;
runtime_rdi += RUNTIME_R_SIZE/2;

View File

@@ -222,6 +222,11 @@ int main(int argc, char **argv) {
fprintf(stderr, "Error: Could not allocate memory for runtime_r*\n");
return 1;
}
memset(runtime_r14, 0, RUNTIME_R_SIZE);
memset(runtime_rbp, 0, RUNTIME_R_SIZE);
memset(runtime_rdi, 0, RUNTIME_R_SIZE);
memset(runtime_rsi, 0, RUNTIME_R_SIZE);
memset(runtime_rsp, 0, RUNTIME_R_SIZE);
runtime_r14 += RUNTIME_R_SIZE/2;
runtime_rbp += RUNTIME_R_SIZE/2;
runtime_rdi += RUNTIME_R_SIZE/2;