public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] sched: Move Cygwin cpuset definitions into Cygwin-specific header
@ 2019-06-28 14:15 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2019-06-28 14:15 UTC (permalink / raw)
  To: cygwin-cvs, newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=383e19ca552234fa9af47e80cb00d843a96de9e3

commit 383e19ca552234fa9af47e80cb00d843a96de9e3
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Jun 26 15:08:57 2019 +0200

    sched: Move Cygwin cpuset definitions into Cygwin-specific header
    
    This avoids build breakage on RTEMS.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/libc/include/sched.h               | 18 ------------------
 winsup/cygwin/include/sys/_pthreadtypes.h |  5 +++--
 winsup/cygwin/include/sys/cpuset.h        | 25 +++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 20 deletions(-)

diff --git a/newlib/libc/include/sched.h b/newlib/libc/include/sched.h
index fc44209..79b775e 100644
--- a/newlib/libc/include/sched.h
+++ b/newlib/libc/include/sched.h
@@ -93,24 +93,6 @@ int sched_yield( void );
 #if __GNU_VISIBLE
 int sched_getcpu(void);
 
-/* Affinity-related definitions, here until numerous enough to separate out */
-#ifdef __x86_64__
-typedef uint64_t __cpu_mask;
-#else
-typedef uint32_t __cpu_mask;
-#endif
-#define __CPU_SETSIZE 1024  // maximum number of logical processors tracked
-#define __NCPUBITS (8 * sizeof (__cpu_mask))  // max size of processor group
-#define __CPU_GROUPMAX (__CPU_SETSIZE / __NCPUBITS)  // maximum group number
-
-#define __CPUELT(cpu)	((cpu) / __NCPUBITS)
-#define __CPUMASK(cpu)	((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
-
-typedef struct
-{
-  __cpu_mask __bits[__CPU_GROUPMAX];
-} cpu_set_t;
-
 int sched_getaffinity (pid_t, size_t, cpu_set_t *);
 int sched_get_thread_affinity (void *, size_t, cpu_set_t *);
 int sched_setaffinity (pid_t, size_t, const cpu_set_t *);
diff --git a/winsup/cygwin/include/sys/_pthreadtypes.h b/winsup/cygwin/include/sys/_pthreadtypes.h
index 3063e83..e951fee 100644
--- a/winsup/cygwin/include/sys/_pthreadtypes.h
+++ b/winsup/cygwin/include/sys/_pthreadtypes.h
@@ -1,5 +1,4 @@
-/* machine/types.h
-   Written by Robert Collins <rbtcollins@hotmail.com>
+/* sys/_pthreadtypes.h
 
 This file is part of Cygwin.
 
@@ -10,6 +9,8 @@ details. */
 #ifndef _SYS__PTHREADTYPES_H_
 #define	_SYS__PTHREADTYPES_H_
 
+#include <sys/cpuset.h>
+
 #if !defined(__INSIDE_CYGWIN__) || !defined(__cplusplus)
 
 typedef struct __pthread_t {char __dummy;} *pthread_t;
diff --git a/winsup/cygwin/include/sys/cpuset.h b/winsup/cygwin/include/sys/cpuset.h
new file mode 100644
index 0000000..a83163d
--- /dev/null
+++ b/winsup/cygwin/include/sys/cpuset.h
@@ -0,0 +1,25 @@
+/* sys/cpuset.h
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license.  Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#ifndef _SYS_CPUSET_H_
+#define _SYS_CPUSET_H_
+
+typedef __SIZE_TYPE__ __cpu_mask;
+#define __CPU_SETSIZE 1024  // maximum number of logical processors tracked
+#define __NCPUBITS (8 * sizeof (__cpu_mask))  // max size of processor group
+#define __CPU_GROUPMAX (__CPU_SETSIZE / __NCPUBITS)  // maximum group number
+
+#define __CPUELT(cpu)   ((cpu) / __NCPUBITS)
+#define __CPUMASK(cpu)  ((__cpu_mask) 1 << ((cpu) % __NCPUBITS))
+
+typedef struct
+{
+  __cpu_mask __bits[__CPU_GROUPMAX];
+} cpu_set_t;
+
+#endif /* _SYS_CPUSET_H_ */


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-06-28 14:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 14:15 [newlib-cygwin] sched: Move Cygwin cpuset definitions into Cygwin-specific header Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).