]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add __CPU_MASK_TYPE for __cpu_mask
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 1 Dec 2015 18:25:44 +0000 (10:25 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 1 Dec 2015 18:25:44 +0000 (10:25 -0800)
Since x86-64 and x32 use the same set of sched_XXX system call interface:

[hjl@gnu-6 linux-stable]$ grep sched_
arch/x86/entry/syscalls/syscall_64.tbl
24 common sched_yield sys_sched_yield
142 common sched_setparam sys_sched_setparam
143 common sched_getparam sys_sched_getparam
144 common sched_setscheduler sys_sched_setscheduler
145 common sched_getscheduler sys_sched_getscheduler
146 common sched_get_priority_max sys_sched_get_priority_max
147 common sched_get_priority_min sys_sched_get_priority_min
148 common sched_rr_get_interval sys_sched_rr_get_interval
203 common sched_setaffinity sys_sched_setaffinity
204 common sched_getaffinity sys_sched_getaffinity
314 common sched_setattr sys_sched_setattr
315 common sched_getattr sys_sched_getattr
[hjl@gnu-6 linux-stable]$

__cpu_mask should be unsigned long long, instead of unsigned long, for
x32.  This patch adds __CPU_MASK_TYPE so that each architecture can
define the proper type for __cpu_mask.

[BZ #19313]
* bits/typesizes.h (__CPU_MASK_TYPE): New.
* sysdeps/mach/hurd/bits/typesizes.h (__CPU_MASK_TYPE): Likewise.
* sysdeps/nacl/bits/typesizes.h (__CPU_MASK_TYPE): Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/typesizes.h (__CPU_MASK_TYPE):
Likewise.
* sysdeps/unix/sysv/linux/generic/bits/typesizes.h (__CPU_MASK_TYPE):
Likewise.
* sysdeps/unix/sysv/linux/s390/bits/typesizes.h (__CPU_MASK_TYPE):
Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/typesizes.h (__CPU_MASK_TYPE):
Likewise.
* sysdeps/unix/sysv/linux/x86/bits/typesizes.h (__CPU_MASK_TYPE):
* sysdeps/unix/sysv/linux/bits/sched.h (__cpu_mask): Replace
unsigned long int with __CPU_MASK_TYPE.

ChangeLog
bits/typesizes.h
sysdeps/mach/hurd/bits/typesizes.h
sysdeps/nacl/bits/typesizes.h
sysdeps/unix/sysv/linux/alpha/bits/typesizes.h
sysdeps/unix/sysv/linux/bits/sched.h
sysdeps/unix/sysv/linux/generic/bits/typesizes.h
sysdeps/unix/sysv/linux/s390/bits/typesizes.h
sysdeps/unix/sysv/linux/sparc/bits/typesizes.h
sysdeps/unix/sysv/linux/x86/bits/typesizes.h

index e22496ee49a27bbafc556a500e59d452ef9d1abf..9da4f3c75b8e1b0184695946d10cf3feb4f0c290 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2015-12-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #19313]
+       * bits/typesizes.h (__CPU_MASK_TYPE): New.
+       * sysdeps/mach/hurd/bits/typesizes.h (__CPU_MASK_TYPE): Likewise.
+       * sysdeps/nacl/bits/typesizes.h (__CPU_MASK_TYPE): Likewise.
+       * sysdeps/unix/sysv/linux/alpha/bits/typesizes.h (__CPU_MASK_TYPE):
+       Likewise.
+       * sysdeps/unix/sysv/linux/generic/bits/typesizes.h (__CPU_MASK_TYPE):
+       Likewise.
+       * sysdeps/unix/sysv/linux/s390/bits/typesizes.h (__CPU_MASK_TYPE):
+       Likewise.
+       * sysdeps/unix/sysv/linux/sparc/bits/typesizes.h (__CPU_MASK_TYPE):
+       Likewise.
+       * sysdeps/unix/sysv/linux/x86/bits/typesizes.h (__CPU_MASK_TYPE):
+       * sysdeps/unix/sysv/linux/bits/sched.h (__cpu_mask): Replace
+       unsigned long int with __CPU_MASK_TYPE.
+
 2015-12-01  Szabolcs Nagy  <szabolcs.nagy@arm.com>
 
        * sysdeps/aarch64/libm-test-ulps: Regenerated.
index 0c1e39c6a093e0482765815be9faddeb13c92ebb..ec5853d8059f7af78495396ff4f8f0e326e82c66 100644 (file)
@@ -59,6 +59,7 @@
 #define __SSIZE_T_TYPE         __SWORD_TYPE
 #define __SYSCALL_SLONG_TYPE   __SLONGWORD_TYPE
 #define __SYSCALL_ULONG_TYPE   __ULONGWORD_TYPE
+#define __CPU_MASK_TYPE        __ULONGWORD_TYPE
 
 #ifdef __LP64__
 /* Tell the libc code that off_t and off64_t are actually the same type
index 970e64e8f6d554a0e6e12cde4c810cad1aa5579d..948517ed37c77dccf0d7bd0c996142b6a1b402af 100644 (file)
@@ -59,6 +59,7 @@
 #define __SSIZE_T_TYPE         __SWORD_TYPE
 #define __SYSCALL_SLONG_TYPE   __SLONGWORD_TYPE
 #define __SYSCALL_ULONG_TYPE   __ULONGWORD_TYPE
+#define __CPU_MASK_TYPE        __ULONGWORD_TYPE
 
 /* Number of descriptors that can fit in an `fd_set'.  */
 #define        __FD_SETSIZE            256
index ed1b5dc7ab2d1e3cd2c7e7e7da09a9221571c540..572ff9fa91b3d9ca4a15cc9092fae36cd794221e 100644 (file)
@@ -59,6 +59,7 @@
 #define __SSIZE_T_TYPE         __SWORD_TYPE
 #define __SYSCALL_SLONG_TYPE   __SLONGWORD_TYPE
 #define __SYSCALL_ULONG_TYPE   __ULONGWORD_TYPE
+#define __CPU_MASK_TYPE        __ULONGWORD_TYPE
 
 /* All our foo64_t types match their foo_t counterparts.  */
 #define __OFF_T_MATCHES_OFF64_T        1
index b40a2c2f0b2d0c3975e7ee82bb25c81117cdc794..aa00287fdbadee69a7dcd24fb22b6290ca635043 100644 (file)
@@ -58,6 +58,7 @@
 #define __SSIZE_T_TYPE         __SWORD_TYPE
 #define __SYSCALL_SLONG_TYPE   __SLONGWORD_TYPE
 #define __SYSCALL_ULONG_TYPE   __ULONGWORD_TYPE
+#define __CPU_MASK_TYPE        __ULONGWORD_TYPE
 #define __FSWORD_T_TYPE                __S32_TYPE
 
 /* Tell the libc code that off_t and off64_t are actually the same type
index ae089df522f76d3b7462af3dc6177ed21fd39b54..7bee1b6cc4e4a1c4b1c4872502141a565dcbcd26 100644 (file)
@@ -115,7 +115,7 @@ struct __sched_param
 # define __NCPUBITS    (8 * sizeof (__cpu_mask))
 
 /* Type for array elements in 'cpu_set_t'.  */
-typedef unsigned long int __cpu_mask;
+typedef __CPU_MASK_TYPE __cpu_mask;
 
 /* Basic access functions.  */
 # define __CPUELT(cpu) ((cpu) / __NCPUBITS)
index de98a39017bb7d4a662cb5a0f588a9c65f2598e6..22d857ff5b5064bf6457748c5342a30960fd7a1d 100644 (file)
@@ -60,6 +60,7 @@
 #define __SSIZE_T_TYPE         __SWORD_TYPE
 #define __SYSCALL_SLONG_TYPE   __SLONGWORD_TYPE
 #define __SYSCALL_ULONG_TYPE   __ULONGWORD_TYPE
+#define __CPU_MASK_TYPE        __ULONGWORD_TYPE
 
 #ifdef __LP64__
 /* Tell the libc code that off_t and off64_t are actually the same type
index 78d377c8632b0a8f9899f6cec63a0ff2516a9e9f..38af1204e97cb0efc3d341f6e4a35e156bd8742e 100644 (file)
@@ -65,6 +65,7 @@
 #endif
 #define __SYSCALL_SLONG_TYPE   __SLONGWORD_TYPE
 #define __SYSCALL_ULONG_TYPE   __ULONGWORD_TYPE
+#define __CPU_MASK_TYPE        __ULONGWORD_TYPE
 
 #ifdef __s390x__
 /* Tell the libc code that off_t and off64_t are actually the same type
index 2167c28aeb4dd507d8463b9f11314c227320dd17..4b7cac66758f11a0ec501ee82390ce57e7a575e6 100644 (file)
@@ -59,6 +59,7 @@
 #define __SSIZE_T_TYPE         __SWORD_TYPE
 #define __SYSCALL_SLONG_TYPE   __SLONGWORD_TYPE
 #define __SYSCALL_ULONG_TYPE   __ULONGWORD_TYPE
+#define __CPU_MASK_TYPE        __ULONGWORD_TYPE
 
 #if defined __arch64__ || defined __sparcv9
 /* Tell the libc code that off_t and off64_t are actually the same type
index 8889bc0039098a9244eae1faf4a26dd8ce89e805..f89d9d27f7e75d64d470d5befd451e104f430bef 100644 (file)
@@ -71,6 +71,7 @@
 #define __BLKSIZE_T_TYPE       __SYSCALL_SLONG_TYPE
 #define __FSID_T_TYPE          struct { int __val[2]; }
 #define __SSIZE_T_TYPE         __SWORD_TYPE
+#define __CPU_MASK_TYPE        __SYSCALL_ULONG_TYPE
 
 #ifdef __x86_64__
 /* Tell the libc code that off_t and off64_t are actually the same type