diff options
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/stack.c.gen | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/build-aux/stack.c.gen b/build-aux/stack.c.gen index 576e446..11c5854 100755 --- a/build-aux/stack.c.gen +++ b/build-aux/stack.c.gen @@ -1470,10 +1470,11 @@ def main( print_group("Interrupt handlers") print("*/") overhead = max(v.nstatic for v in result.groups["Interrupt handlers"].rows.values()) + stack_guard_size = 16 * 2 rows: list[tuple[str, int, int]] = [] for funcname, val in result.groups["Threads"].rows.items(): base = val.nstatic - size = next_power_of_2(base + overhead) + size = next_power_of_2(base + overhead + stack_guard_size) - stack_guard_size rows.append((str(funcname.base()), base, size)) namelen = max(len(r[0]) for r in rows) baselen = max(len(str(r[1])) for r in rows) @@ -1484,7 +1485,9 @@ def main( print("const size_t CONFIG_COROUTINE_STACK_SIZE_", end="") print(f"{row[0].ljust(namelen)} =", end="") print(f" {str(row[2]).rjust(sizelen)};", end="") - print(f" /* LM_NEXT_POWER_OF_2({str(row[1]).rjust(baselen)}+{overhead}) */") + print( + f" /* LM_NEXT_POWER_OF_2({str(row[1]).rjust(baselen)}+{overhead}+{stack_guard_size})-{stack_guard_size} */" + ) print() print("/*") print_group("Misc") |