kboot: simplify _start

_start can be implemented directly like this. The code generated is
identical. It's also portable.

Reviewed by:	md5
Sponsored by:	Netflix
This commit is contained in:
Warner Losh 2021-12-09 01:16:51 -07:00
parent d2de68811a
commit 1d66269db3

View File

@ -482,18 +482,7 @@ kboot_kseg_get(int *nseg, void **ptr)
void
_start(int argc, const char **argv, char **env)
{
// This makes error "variable 'sp' is uninitialized" be just a warning on clang.
// Initializing 'sp' is not desired here as it would overwrite "r1" original value
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic warning "-Wuninitialized"
#endif
register volatile void **sp asm("r1");
main((int)sp[0], (const char **)&sp[1]);
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
main(argc, argv);
}
/*