]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/glibc/glibc-rh929302.patch
dhcpcd: fix delay after dhcp down.
[ipfire-2.x.git] / src / patches / glibc / glibc-rh929302.patch
CommitLineData
bb330e25
AF
1From decadad73858bc108828eed5540c7955dc2a977b Mon Sep 17 00:00:00 2001
2From: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
3Date: Fri, 7 Jun 2013 14:44:58 -0500
4Subject: [PATCH 1/2] PowerPC: Change sched_getcpu to use vDSO getcpu instead of syscall.
5
6Backport of d5e0b9bd6e296f3ec5263fa296d39f3fed9b8fa2 from master.
7---
8 sysdeps/unix/sysv/linux/powerpc/Versions | 1 +
9 sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h | 2 +
10 sysdeps/unix/sysv/linux/powerpc/init-first.c | 3 ++
11 sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c | 30 ++++++++++++++++++++++
12 4 files changed, 36 insertions(+), 0 deletions(-)
13 create mode 100644 sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c
14
15diff --git a/sysdeps/unix/sysv/linux/powerpc/Versions b/sysdeps/unix/sysv/linux/powerpc/Versions
16index 1ef53b9..396a423 100644
17--- a/sysdeps/unix/sysv/linux/powerpc/Versions
18+++ b/sysdeps/unix/sysv/linux/powerpc/Versions
19@@ -3,5 +3,6 @@ libc {
20 __vdso_get_tbfreq;
21 __vdso_clock_gettime;
22 __vdso_clock_getres;
23+ __vdso_getcpu;
24 }
25 }
26diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
27index 746d9ce..c3026d5 100644
28--- a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
29+++ b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h
30@@ -31,6 +31,8 @@ extern void *__vdso_clock_getres;
31
32 extern void *__vdso_get_tbfreq;
33
34+extern void *__vdso_getcpu;
35+
36 #endif
37
38 #endif /* _LIBC_VDSO_H */
39diff --git a/sysdeps/unix/sysv/linux/powerpc/init-first.c b/sysdeps/unix/sysv/linux/powerpc/init-first.c
40index 92dacc7..cfed655 100644
41--- a/sysdeps/unix/sysv/linux/powerpc/init-first.c
42+++ b/sysdeps/unix/sysv/linux/powerpc/init-first.c
43@@ -27,6 +27,7 @@ void *__vdso_gettimeofday attribute_hidden;
44 void *__vdso_clock_gettime;
45 void *__vdso_clock_getres;
46 void *__vdso_get_tbfreq;
47+void *__vdso_getcpu;
48
49
50 static inline void
51@@ -41,6 +42,8 @@ _libc_vdso_platform_setup (void)
52 __vdso_clock_getres = _dl_vdso_vsym ("__kernel_clock_getres", &linux2615);
53
54 __vdso_get_tbfreq = _dl_vdso_vsym ("__kernel_vdso_get_tbfreq", &linux2615);
55+
56+ __vdso_getcpu = _dl_vdso_vsym ("__kernel_getcpu", &linux2615);
57 }
58
59 # define VDSO_SETUP _libc_vdso_platform_setup
60diff --git a/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c b/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c
61new file mode 100644
62index 0000000..617e6f1
63--- /dev/null
64+++ b/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c
65@@ -0,0 +1,30 @@
66+/* Copyright (C) 2013 Free Software Foundation, Inc.
67+ This file is part of the GNU C Library.
68+
69+ The GNU C Library is free software; you can redistribute it and/or
70+ modify it under the terms of the GNU Lesser General Public
71+ License as published by the Free Software Foundation; either
72+ version 2.1 of the License, or (at your option) any later version.
73+
74+ The GNU C Library is distributed in the hope that it will be useful,
75+ but WITHOUT ANY WARRANTY; without even the implied warranty of
76+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
77+ Lesser General Public License for more details.
78+
79+ You should have received a copy of the GNU Lesser General Public
80+ License along with the GNU C Library; if not, see
81+ <http://www.gnu.org/licenses/>. */
82+
83+#include <sched.h>
84+#include <sysdep.h>
85+#include <bits/libc-vdso.h>
86+
87+
88+int
89+sched_getcpu (void)
90+{
91+ unsigned int cpu;
92+ int r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL);
93+
94+ return r == -1 ? r : cpu;
95+}
96--
971.7.1
98