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

openbsd: map si_addr inside struct siginfo_t #109

Merged
merged 1 commit into from
Dec 20, 2015

Conversation

semarie
Copy link
Contributor

@semarie semarie commented Dec 19, 2015

formally, under OpenBSD, si_addr is part of a C union. As we don't use
others members of the union inside struct siginfo_t, it should be safe
to directly map the field.

cc @mmcco

@alexcrichton
Copy link
Member

Thanks! Due to the use of a union here in C it's a bit difficult to represent in Rust, so you may want to do something similar to what's currently defined on Linux. The size of the struct should be the same as C in both cases.

Better yet, if you could run cargo run inside of the libc-test directory on OpenBSD, it'll tell you whether you're right or wrong! (and I also suspect there may be a number of other failures)

@semarie
Copy link
Contributor Author

semarie commented Dec 19, 2015

I have added padding to match the size of the C struct.
I will try to get a running cargo to do the test. But I suspect it will take some times...

@semarie
Copy link
Contributor Author

semarie commented Dec 19, 2015

The pad value have been computed using C code:

#include <sys/siginfo.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
  printf("pad = %llu\n", sizeof(siginfo_t) - 3*sizeof(int) - sizeof(void *));
  return 0;
}

siginfo definition: http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/sys/siginfo.h?rev=1.11&content-type=text/x-cvsweb-markup

@mmcco
Copy link
Contributor

mmcco commented Dec 20, 2015

@semarie Looks like a stray ksh error message found its way into that commit...

@semarie
Copy link
Contributor Author

semarie commented Dec 20, 2015

@MMCo thanks for pointing it.

formally, under OpenBSD, `si_addr` is part of a C union. As we don't use
others members of the union inside `struct siginfo_t`, it should be safe
to directly map the field.
alexcrichton added a commit that referenced this pull request Dec 20, 2015
openbsd: map `si_addr` inside `struct siginfo_t`
@alexcrichton alexcrichton merged commit e0c0bf4 into rust-lang:master Dec 20, 2015
@semarie semarie deleted the openbsd-si_addr branch December 20, 2015 18:38
danielverkamp pushed a commit to danielverkamp/libc that referenced this pull request Apr 28, 2020
* avx: _mm256_loadu_pd

* avx: _mm256_storeu_pd

* avx: _mm256_loadu_ps

* avx: _mm256_storeu_ps

* avx: fix _mm256_storeu_pd and _mm256_storeu_ps

* avx: _mm256_loadu_si256

* avx: _mm256_undefined_si256

* avx: _mm256_maskload_pd

* avx: _mm256_maskstore_pd

* Attempt to fix CI (rust-lang#108)

Need to bring codegen units back to only one for now

* [x86] sse4.2 add docs for _SIDD_EQUAL_RANGES (rust-lang#107)

- Add docs for the _SIDD_EQUAL_RANGES mode

* Add _MM_TRANSPOSE4_PS pseudo-macro. (rust-lang#106)

This adds a strange macro, which I've replaced with a function, because it
seems there are not many better alternatives.

Also adds a test, and `#[allow(non_snake_case)]` to `#[simd_test]`.

* Fix i586 tests

* Implement bitwise SSE ops & _mm_cmp*_ss  (rust-lang#103)

* Add _mm_{and,andnot,or,xor}_ps

* Add _mm_cmpeq_ss

* Add _mm_cmplt_ss

* Add _mm_cmple_ss

* Add _mm_cmpgt_ss

* Add _mm_cmpge_ss

* Add _mm_cmpneq_ss

* Add _mm_cmpnlt_ss

* Add _mm_cmpnle_ss

* Add _mm_cmpngt_ss

* Add _mm_cmpnge_ss

* Add _mm_cmpord_ss

* Add _mm_cmpunord_ss

* Fix _mm_{and,andnot,or,xor}_ps tests for i586

LLVM for i586 doesn't seem to generate `andps`, and instead generates 4
`and`s. Similar for the other operations.

* avx: _mm_maskload_pd

* avx: _mm_maskstore_pd

* avx: _mm256_maskload_ps

* avx: _mm256_maskstore_ps

* avx: _mm_maskload_ps, _mm_maskstore_ps

* avx: _mm256_movehdup_ps

* avx: _mm256_moveldup_ps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants