diff --git a/src/arch/x86-64/jedino-jedro.zig b/src/arch/x86-64/jedino-jedro.zig index 9b5b15d..b9095a6 100644 --- a/src/arch/x86-64/jedino-jedro.zig +++ b/src/arch/x86-64/jedino-jedro.zig @@ -31,8 +31,6 @@ const int = @import("../../interpreter.zig"); const Word = int.Word; pub const RecursionLimit = int.RecursionLimit; -threadlocal var return_stack: [RecursionLimit + 1]Word = undefined; - // todo: Variant that pushes array of words. /// (iw | -- iw) pub fn opPushWord() callconv(.Naked) noreturn { @@ -117,7 +115,6 @@ pub fn opReturn() callconv(.Naked) noreturn { ); } -// todo: Make sure it's non reentry in one given thread. // todo: Allow passing initial stack via array of words. // todo: Ensure correctness. // todo: Use remaining stack as return. @@ -127,6 +124,8 @@ pub fn execute(binary: []const Word, entry_addr: usize) void { // https://wiki.osdev.org/System_V_ABI @setCold(true); + var return_stack: [RecursionLimit + 1]Word = undefined; + // Such device is used so that opReturn could be used for return. asm volatile ( \\ movq $0f, 8(%%r13)