kboot: Save the upper limit of the call stack.

The location of argc argument is a fine limit for the extent of the
stack traceback. We could save the location of return address for the
call to _start_c, but we'd have to move that into MD assembler. While
not hard, it wouldn't improve the traces we can get. And the math to
find it is architecture dependent (though the same for both arm64 and
amd64).

Sponsored by:		Netflix
Reviewed by:		kevans, andrew,	jhibbits
Differential Revision:	https://reviews.freebsd.org/D49858
This commit is contained in:
Warner Losh
2025-04-16 22:03:48 -06:00
parent 5fb044c885
commit f0f44cdb69
+3
View File
@@ -57,6 +57,8 @@ extern int main(int, const char **, char **);
#include "start_arch.h"
void *stack_upper_limit;
void
_start_c(long *p)
{
@@ -64,6 +66,7 @@ _start_c(long *p)
const char **argv;
char **envp;
stack_upper_limit = p; /* Save the upper limit of call stack */
argc = p[0];
argv = (const char **)(p + 1);
envp = (char **)argv + argc + 1;