Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
17
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
1c5718b3
Commit
1c5718b3
authored
4 years ago
by
dmitriy.gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[+] BSD variant of set/get cpu affinity calls
parent
dfc53020
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#7175
passed with stage
in 11 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap-sdk/net/core/dap_events.c
+12
-1
12 additions, 1 deletion
dap-sdk/net/core/dap_events.c
with
12 additions
and
1 deletion
dap-sdk/net/core/dap_events.c
+
12
−
1
View file @
1c5718b3
...
@@ -50,6 +50,13 @@
...
@@ -50,6 +50,13 @@
#include
<sys/timerfd.h>
#include
<sys/timerfd.h>
#endif
#endif
#include
<pthread.h>
#ifdef DAP_OS_BSD
#include
<pthread_np.h>
typedef
cpuset_t
cpu_set_t
;
// Adopt BSD CPU setstructure to POSIX variant
#endif
#if defined(DAP_OS_ANDROID)
#if defined(DAP_OS_ANDROID)
#define NO_POSIX_SHED
#define NO_POSIX_SHED
#define NO_TIMER
#define NO_TIMER
...
@@ -62,7 +69,7 @@
...
@@ -62,7 +69,7 @@
#include
<mswsock.h>
#include
<mswsock.h>
#include
<ws2tcpip.h>
#include
<ws2tcpip.h>
#include
<io.h>
#include
<io.h>
#include
<pthread.h>
#endif
#endif
#include
<utlist.h>
#include
<utlist.h>
...
@@ -93,7 +100,11 @@ uint32_t dap_get_cpu_count( )
...
@@ -93,7 +100,11 @@ uint32_t dap_get_cpu_count( )
#ifndef NO_POSIX_SHED
#ifndef NO_POSIX_SHED
cpu_set_t
cs
;
cpu_set_t
cs
;
CPU_ZERO
(
&
cs
);
CPU_ZERO
(
&
cs
);
#if defined (DAP_OS_ANDROID)
sched_getaffinity
(
0
,
sizeof
(
cs
),
&
cs
);
sched_getaffinity
(
0
,
sizeof
(
cs
),
&
cs
);
#else
pthread_getaffinity_np
(
pthread_self
(),
sizeof
(
cs
),
&
cs
);
#endif
uint32_t
count
=
0
;
uint32_t
count
=
0
;
for
(
int
i
=
0
;
i
<
32
;
i
++
){
for
(
int
i
=
0
;
i
<
32
;
i
++
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment