-
Notifications
You must be signed in to change notification settings - Fork 46
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
simplelink: wifi: avoid re-declaring pthread_self() #44
simplelink: wifi: avoid re-declaring pthread_self() #44
Conversation
extern void * pthread_self(void); | ||
extern pthread_t pthread_self(void); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not work since this header does not include any headers that would provide the typedef for pthread_t
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the contrary - it does work:
twister -i -p cc3220sf_launchxl -s samples/net/sockets/http_get/sample.net.sockets.http_get.offload.simplelink
Renaming output directory to /Users/cfriedt/workspace/zephyrproject/zephyr/twister-out.21
INFO - Using Ninja..
INFO - Zephyr version: zephyr-v3.2.0-987-gad7ffc405d9a
INFO - Using 'zephyr' toolchain.
INFO - Building initial testsuite list...
INFO - Writing JSON report /Users/cfriedt/workspace/zephyrproject/zephyr/twister-out/testplan.json
INFO - JOBS: 8
INFO - Adding tasks to the queue...
INFO - Added initial list of jobs to queue
INFO - Total complete: 1/ 1 100% skipped: 0, failed: 0
INFO - 1 test scenarios (1 test instances) selected, 0 configurations skipped (0 by static filter, 0 at runtime).
INFO - 1 of 1 test configurations passed (100.00%), 0 failed, 0 skipped with 0 warnings in 35.05 seconds
INFO - In total 0 test cases were executed, 1 skipped on 1 out of total 510 platforms (0.20%)
INFO - 0 test configurations executed on platforms, 1 test configurations were only built.
INFO - Saving reports...
INFO - Writing JSON report /Users/cfriedt/workspace/zephyrproject/zephyr/twister-out/twister.json
INFO - Writing xunit report /Users/cfriedt/workspace/zephyrproject/zephyr/twister-out/twister.xml...
INFO - Writing xunit report /Users/cfriedt/workspace/zephyrproject/zephyr/twister-out/twister_report.xml...
INFO - Run completed
See also passing CI
zephyrproject-rtos/zephyr#51784
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then that is purely by luck because some C files that include this header happen to include POSIX headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then that is purely by luck because some C files that include this header happen to include POSIX headers.
also that brings the question of, why is this pthread_self
forward declaration necessary if the POSIX headers can be included in this scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also that brings the question of, why is this pthread_self forward declaration necessary if the POSIX headers can be included in this scope?
As you are aware, Zephyr POSIX headers cannot be portably included in this scope. That is the issue fixed by zephyrproject-rtos/zephyr#51771, which now indirectly depends on this PR.
Let's not make this a chicken-egg problem please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
until then, this header should be including zephyr/posix/pthread.h
(assuming pthread.h
is include-able in this scope).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in fact, I just removed this extern pthread_t pthread_self(void);
entirely, and it works, meaning pthread.h
is already included somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like pthread.h
is included here:
#include <zephyr/posix/pthread.h> |
also why is this HAL using the pthread functions?
A proper port ought to be using the native Zephyr APIs here. |
@stephanosio - that's a great question to ask TI. However, POSIX is not evil - it's actually a great interface to use for portable code to different operating systems (Portable Operating System Interface) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the assumption is not wrong.
a header must include the headers that provides the dependencies it makes use of.
no, when adding support for this chipset, the porting layer should have been updated to use the Zephyr native API. In that sense, this port is incomplete. |
@stephanosio - that is WELL beyond the scope of this change. Feel free to create an issue though. |
agreed. just pointing out that there is something fishy about this port. |
POSIX is not evil, but as long as Zephyr's native API is not POSIX, it will come with the added footprint, which is evil. |
ea84987
to
5802cd2
Compare
The normative spec says this returns `pthread_t`, not `void *`. It's probably better to simply `#include <pthread.h>` outside of this file explicitly (due to current non-standard prefixed path in Zerphy) than to re-declare it with a potentially conflicting signature. Signed-off-by: Chris Friedt <[email protected]>
5802cd2
to
34ef193
Compare
@stephanosio - removed the conflicting declaration |
@stephanosio - does this look OK now? Please ack if so. |
yes, but can you please update the Zephyr-side PR so CI can run on it? |
There isn't anything to update until this PR is merged. |
did zephyrproject-rtos/zephyr#51784 run with the latest iteration of this PR? I just want to make sure that nothing else broke because of the latest change. |
@stephanosio I just force-pushed again to be sure |
The normative spec says this returns
pthread_t
, notvoid *
.It's probably better to simply
#include <pthread.h>
outside of this file explicitly (due to current non-standard prefixed path in Zerphy) than to re-declare it with a potentially conflicting signature.