Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPARCv9: make more tests pass #9853

Merged
merged 3 commits into from
Nov 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions lib/std/Thread.zig
Original file line number Diff line number Diff line change
Expand Up @@ -813,12 +813,11 @@ const LinuxThreadImpl = struct {
\\ # force-deactivate it by running `restore` until
\\ # all frames are cleared.
\\ 1:
\\ cmp %%sp, 0
\\ cmp %%fp, 0
\\ beq 2f
\\ nop
\\ ba 1b
\\ restore
\\ ba 1f
\\ nop
\\ 2:
\\ mov 73, %%g1
\\ mov %[ptr], %%o0
Expand Down
244 changes: 195 additions & 49 deletions lib/std/os/linux.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2005,8 +2005,8 @@ pub const SOCK = struct {
pub const SEQPACKET = 5;
pub const DCCP = 6;
pub const PACKET = 10;
pub const CLOEXEC = 0o2000000;
pub const NONBLOCK = if (is_mips) 0o200 else 0o4000;
pub const CLOEXEC = if (is_sparc) 0o20000000 else 0o2000000;
pub const NONBLOCK = if (is_mips) 0o200 else if (is_sparc) 0o40000 else 0o4000;
};

pub const TCP = struct {
Expand Down Expand Up @@ -2218,6 +2218,47 @@ pub const SO = struct {
pub const PEERSEC = 30;
pub const SNDBUFFORCE = 31;
pub const RCVBUFFORCE = 33;
pub const SECURITY_AUTHENTICATION = 22;
pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
pub const SECURITY_ENCRYPTION_NETWORK = 24;
pub const BINDTODEVICE = 25;
pub const ATTACH_FILTER = 26;
pub const DETACH_FILTER = 27;
pub const GET_FILTER = ATTACH_FILTER;
pub const PEERNAME = 28;
pub const TIMESTAMP_OLD = 29;
pub const PASSSEC = 34;
pub const TIMESTAMPNS_OLD = 35;
pub const MARK = 36;
pub const TIMESTAMPING_OLD = 37;
pub const RXQ_OVFL = 40;
pub const WIFI_STATUS = 41;
pub const PEEK_OFF = 42;
pub const NOFCS = 43;
pub const LOCK_FILTER = 44;
pub const SELECT_ERR_QUEUE = 45;
pub const BUSY_POLL = 46;
pub const MAX_PACING_RATE = 47;
pub const BPF_EXTENSIONS = 48;
pub const INCOMING_CPU = 49;
pub const ATTACH_BPF = 50;
pub const DETACH_BPF = DETACH_FILTER;
pub const ATTACH_REUSEPORT_CBPF = 51;
pub const ATTACH_REUSEPORT_EBPF = 52;
pub const CNX_ADVICE = 53;
pub const MEMINFO = 55;
pub const INCOMING_NAPI_ID = 56;
pub const COOKIE = 57;
pub const PEERGROUPS = 59;
pub const ZEROCOPY = 60;
pub const TXTIME = 61;
pub const BINDTOIFINDEX = 62;
pub const TIMESTAMP_NEW = 63;
pub const TIMESTAMPNS_NEW = 64;
pub const TIMESTAMPING_NEW = 65;
pub const RCVTIMEO_NEW = 66;
pub const SNDTIMEO_NEW = 67;
pub const DETACH_REUSEPORT_BPF = 68;
} else if (is_ppc or is_ppc64) struct {
pub const DEBUG = 1;
pub const REUSEADDR = 2;
Expand Down Expand Up @@ -2246,6 +2287,116 @@ pub const SO = struct {
pub const RCVBUFFORCE = 33;
pub const PROTOCOL = 38;
pub const DOMAIN = 39;
pub const SECURITY_AUTHENTICATION = 22;
pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
pub const SECURITY_ENCRYPTION_NETWORK = 24;
pub const BINDTODEVICE = 25;
pub const ATTACH_FILTER = 26;
pub const DETACH_FILTER = 27;
pub const GET_FILTER = ATTACH_FILTER;
pub const PEERNAME = 28;
pub const TIMESTAMP_OLD = 29;
pub const PASSSEC = 34;
pub const TIMESTAMPNS_OLD = 35;
pub const MARK = 36;
pub const TIMESTAMPING_OLD = 37;
pub const RXQ_OVFL = 40;
pub const WIFI_STATUS = 41;
pub const PEEK_OFF = 42;
pub const NOFCS = 43;
pub const LOCK_FILTER = 44;
pub const SELECT_ERR_QUEUE = 45;
pub const BUSY_POLL = 46;
pub const MAX_PACING_RATE = 47;
pub const BPF_EXTENSIONS = 48;
pub const INCOMING_CPU = 49;
pub const ATTACH_BPF = 50;
pub const DETACH_BPF = DETACH_FILTER;
pub const ATTACH_REUSEPORT_CBPF = 51;
pub const ATTACH_REUSEPORT_EBPF = 52;
pub const CNX_ADVICE = 53;
pub const MEMINFO = 55;
pub const INCOMING_NAPI_ID = 56;
pub const COOKIE = 57;
pub const PEERGROUPS = 59;
pub const ZEROCOPY = 60;
pub const TXTIME = 61;
pub const BINDTOIFINDEX = 62;
pub const TIMESTAMP_NEW = 63;
pub const TIMESTAMPNS_NEW = 64;
pub const TIMESTAMPING_NEW = 65;
pub const RCVTIMEO_NEW = 66;
pub const SNDTIMEO_NEW = 67;
pub const DETACH_REUSEPORT_BPF = 68;
} else if (is_sparc) struct {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need some codestyle suggestions for this part, since SPARC has an entirely different set of constants for those.
Should I split it into a different file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to you, whatever you think is better. Thanks for the patch!

pub const DEBUG = 1;
pub const REUSEADDR = 4;
pub const TYPE = 4104;
pub const ERROR = 4103;
pub const DONTROUTE = 16;
pub const BROADCAST = 32;
pub const SNDBUF = 4097;
pub const RCVBUF = 4098;
pub const KEEPALIVE = 8;
pub const OOBINLINE = 256;
pub const NO_CHECK = 11;
pub const PRIORITY = 12;
pub const LINGER = 128;
pub const BSDCOMPAT = 1024;
pub const REUSEPORT = 512;
pub const PASSCRED = 2;
pub const PEERCRED = 64;
pub const RCVLOWAT = 2048;
pub const SNDLOWAT = 4096;
pub const RCVTIMEO = 8192;
pub const SNDTIMEO = 16384;
pub const ACCEPTCONN = 32768;
pub const PEERSEC = 30;
pub const SNDBUFFORCE = 4106;
pub const RCVBUFFORCE = 4107;
pub const PROTOCOL = 4136;
pub const DOMAIN = 4137;
pub const SECURITY_AUTHENTICATION = 20481;
pub const SECURITY_ENCRYPTION_TRANSPORT = 20482;
pub const SECURITY_ENCRYPTION_NETWORK = 20484;
pub const BINDTODEVICE = 13;
pub const ATTACH_FILTER = 26;
pub const DETACH_FILTER = 27;
pub const GET_FILTER = 26;
pub const PEERNAME = 28;
pub const TIMESTAMP_OLD = 29;
pub const PASSSEC = 31;
pub const TIMESTAMPNS_OLD = 33;
pub const MARK = 34;
pub const TIMESTAMPING_OLD = 35;
pub const RXQ_OVFL = 36;
pub const WIFI_STATUS = 37;
pub const PEEK_OFF = 38;
pub const NOFCS = 39;
pub const LOCK_FILTER = 40;
pub const SELECT_ERR_QUEUE = 41;
pub const BUSY_POLL = 48;
pub const MAX_PACING_RATE = 49;
pub const BPF_EXTENSIONS = 50;
pub const INCOMING_CPU = 51;
pub const ATTACH_BPF = 52;
pub const DETACH_BPF = 27;
pub const ATTACH_REUSEPORT_CBPF = 53;
pub const ATTACH_REUSEPORT_EBPF = 54;
pub const CNX_ADVICE = 55;
pub const MEMINFO = 57;
pub const INCOMING_NAPI_ID = 58;
pub const COOKIE = 59;
pub const PEERGROUPS = 61;
pub const ZEROCOPY = 62;
pub const TXTIME = 63;
pub const BINDTOIFINDEX = 65;
pub const TIMESTAMP_NEW = 70;
pub const TIMESTAMPNS_NEW = 66;
pub const TIMESTAMPING_NEW = 67;
pub const RCVTIMEO_NEW = 68;
pub const SNDTIMEO_NEW = 69;
pub const DETACH_REUSEPORT_BPF = 71;
} else struct {
pub const DEBUG = 1;
pub const REUSEADDR = 2;
Expand Down Expand Up @@ -2274,53 +2425,48 @@ pub const SO = struct {
pub const RCVBUFFORCE = 33;
pub const PROTOCOL = 38;
pub const DOMAIN = 39;
pub const SECURITY_AUTHENTICATION = 22;
pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
pub const SECURITY_ENCRYPTION_NETWORK = 24;
pub const BINDTODEVICE = 25;
pub const ATTACH_FILTER = 26;
pub const DETACH_FILTER = 27;
pub const GET_FILTER = ATTACH_FILTER;
pub const PEERNAME = 28;
pub const TIMESTAMP_OLD = 29;
pub const PASSSEC = 34;
pub const TIMESTAMPNS_OLD = 35;
pub const MARK = 36;
pub const TIMESTAMPING_OLD = 37;
pub const RXQ_OVFL = 40;
pub const WIFI_STATUS = 41;
pub const PEEK_OFF = 42;
pub const NOFCS = 43;
pub const LOCK_FILTER = 44;
pub const SELECT_ERR_QUEUE = 45;
pub const BUSY_POLL = 46;
pub const MAX_PACING_RATE = 47;
pub const BPF_EXTENSIONS = 48;
pub const INCOMING_CPU = 49;
pub const ATTACH_BPF = 50;
pub const DETACH_BPF = DETACH_FILTER;
pub const ATTACH_REUSEPORT_CBPF = 51;
pub const ATTACH_REUSEPORT_EBPF = 52;
pub const CNX_ADVICE = 53;
pub const MEMINFO = 55;
pub const INCOMING_NAPI_ID = 56;
pub const COOKIE = 57;
pub const PEERGROUPS = 59;
pub const ZEROCOPY = 60;
pub const TXTIME = 61;
pub const BINDTOIFINDEX = 62;
pub const TIMESTAMP_NEW = 63;
pub const TIMESTAMPNS_NEW = 64;
pub const TIMESTAMPING_NEW = 65;
pub const RCVTIMEO_NEW = 66;
pub const SNDTIMEO_NEW = 67;
pub const DETACH_REUSEPORT_BPF = 68;
};

pub const SECURITY_AUTHENTICATION = 22;
pub const SECURITY_ENCRYPTION_TRANSPORT = 23;
pub const SECURITY_ENCRYPTION_NETWORK = 24;

pub const BINDTODEVICE = 25;

pub const ATTACH_FILTER = 26;
pub const DETACH_FILTER = 27;
pub const GET_FILTER = ATTACH_FILTER;

pub const PEERNAME = 28;
pub const TIMESTAMP_OLD = 29;
pub const PASSSEC = 34;
pub const TIMESTAMPNS_OLD = 35;
pub const MARK = 36;
pub const TIMESTAMPING_OLD = 37;

pub const RXQ_OVFL = 40;
pub const WIFI_STATUS = 41;
pub const PEEK_OFF = 42;
pub const NOFCS = 43;
pub const LOCK_FILTER = 44;
pub const SELECT_ERR_QUEUE = 45;
pub const BUSY_POLL = 46;
pub const MAX_PACING_RATE = 47;
pub const BPF_EXTENSIONS = 48;
pub const INCOMING_CPU = 49;
pub const ATTACH_BPF = 50;
pub const DETACH_BPF = DETACH_FILTER;
pub const ATTACH_REUSEPORT_CBPF = 51;
pub const ATTACH_REUSEPORT_EBPF = 52;
pub const CNX_ADVICE = 53;
pub const MEMINFO = 55;
pub const INCOMING_NAPI_ID = 56;
pub const COOKIE = 57;
pub const PEERGROUPS = 59;
pub const ZEROCOPY = 60;
pub const TXTIME = 61;
pub const BINDTOIFINDEX = 62;
pub const TIMESTAMP_NEW = 63;
pub const TIMESTAMPNS_NEW = 64;
pub const TIMESTAMPING_NEW = 65;
pub const RCVTIMEO_NEW = 66;
pub const SNDTIMEO_NEW = 67;
pub const DETACH_REUSEPORT_BPF = 68;
};

pub const SCM = struct {
Expand All @@ -2331,7 +2477,7 @@ pub const SCM = struct {
};

pub const SOL = struct {
pub const SOCKET = if (is_mips) 65535 else 1;
pub const SOCKET = if (is_mips or is_sparc) 65535 else 1;

pub const IP = 0;
pub const IPV6 = 41;
Expand Down
2 changes: 1 addition & 1 deletion lib/std/os/linux/sparc64.zig
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ pub const Stat = extern struct {

pub const timeval = extern struct {
tv_sec: isize,
tv_usec: isize,
tv_usec: i32,
};

pub const timezone = extern struct {
Expand Down