Introduce FreeBSD ARM64 support

It's 100% passing test fleet. Solid as a rock.
This commit is contained in:
Justine Tunney 2023-12-29 20:11:23 -08:00
parent 43fe5956ad
commit 83107f78ed
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
455 changed files with 778 additions and 551 deletions

View file

@ -78,7 +78,8 @@ static const char *DecodeMagnum(const char *p, long *r) {
return *r = x, p;
}
wontreturn textstartup void cosmo(long *sp, struct Syslib *m1, char *exename) {
wontreturn textstartup void cosmo(long *sp, struct Syslib *m1, char *exename,
long *is_freebsd) {
// get startup timestamp as early as possible
// its used by --strace and also kprintf() %T
@ -95,6 +96,11 @@ wontreturn textstartup void cosmo(long *sp, struct Syslib *m1, char *exename) {
};
__set_tls(&tib);
// check for freebsd
if (is_freebsd) {
sp = is_freebsd;
}
// extracts arguments from old sysv stack abi
int argc = *sp;
char **argv = (char **)(sp + 1);
@ -114,7 +120,10 @@ wontreturn textstartup void cosmo(long *sp, struct Syslib *m1, char *exename) {
// detect apple m1 environment
const char *magnums;
if (SupportsXnu() && (__syslib = m1)) {
if (SupportsFreebsd() && is_freebsd) {
hostos = _HOSTFREEBSD;
magnums = syscon_freebsd;
} else if (SupportsXnu() && (__syslib = m1)) {
hostos = _HOSTXNU;
magnums = syscon_xnu;
} else if (SupportsLinux()) {