diff options
4 files changed, 621 insertions, 1 deletions
diff --git a/meta/recipes-core/uclibc/uclibc-0.9.32/uClibc.distro b/meta/recipes-core/uclibc/uclibc-0.9.32/uClibc.distro index c633ca1860..5638d47dab 100644 --- a/meta/recipes-core/uclibc/uclibc-0.9.32/uClibc.distro +++ b/meta/recipes-core/uclibc/uclibc-0.9.32/uClibc.distro | |||
| @@ -179,3 +179,6 @@ UCLIBC_HAS_FLOATS=y | |||
| 179 | 179 | ||
| 180 | # COMPILE_IN_THUMB_MODE is not set | 180 | # COMPILE_IN_THUMB_MODE is not set |
| 181 | 181 | ||
| 182 | # needed by systemd | ||
| 183 | UCLIBC_HAS_UTMPX=y | ||
| 184 | |||
diff --git a/meta/recipes-core/uclibc/uclibc-0.9.32/uclibc-execvpe.patch b/meta/recipes-core/uclibc/uclibc-0.9.32/uclibc-execvpe.patch new file mode 100644 index 0000000000..cd90a09205 --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-0.9.32/uclibc-execvpe.patch | |||
| @@ -0,0 +1,160 @@ | |||
| 1 | From d20556adadea03bff0bba051172caf0314a35471 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Henning Heinold <heinold@inf.fu-berlin.de> | ||
| 3 | Date: Sat, 4 Jun 2011 21:23:15 +0200 | ||
| 4 | Subject: [PATCH 2/2] libc: add non standard execvpe function | ||
| 5 | |||
| 6 | |||
| 7 | Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de> | ||
| 8 | --- | ||
| 9 | include/unistd.h | 6 ++++++ | ||
| 10 | libc/unistd/exec.c | 38 +++++++++++++++++++++++++++++++++----- | ||
| 11 | libc/unistd/execvpe.c | 7 +++++++ | ||
| 12 | 3 files changed, 46 insertions(+), 5 deletions(-) | ||
| 13 | create mode 100644 libc/unistd/execvpe.c | ||
| 14 | |||
| 15 | diff --git a/include/unistd.h b/include/unistd.h | ||
| 16 | index 9568790..070e4f2 100644 | ||
| 17 | --- a/include/unistd.h | ||
| 18 | +++ b/include/unistd.h | ||
| 19 | @@ -557,6 +557,12 @@ extern int execvp (__const char *__file, char *__const __argv[]) | ||
| 20 | __THROW __nonnull ((1)); | ||
| 21 | libc_hidden_proto(execvp) | ||
| 22 | |||
| 23 | +/* Execute FILE, searching in the `PATH' environment variable if it contains | ||
| 24 | + no slashes, with arguments ARGV and environment from a pointer */ | ||
| 25 | +extern int execvpe (__const char *__file, char *__const __argv[], char *__const __envp[]) | ||
| 26 | + __THROW __nonnull ((1)); | ||
| 27 | +libc_hidden_proto(execvpe) | ||
| 28 | + | ||
| 29 | /* Execute FILE, searching in the `PATH' environment variable if | ||
| 30 | it contains no slashes, with all arguments after FILE until a | ||
| 31 | NULL pointer and environment from `environ'. */ | ||
| 32 | diff --git a/libc/unistd/exec.c b/libc/unistd/exec.c | ||
| 33 | index 7d24072..802a174 100644 | ||
| 34 | --- a/libc/unistd/exec.c | ||
| 35 | +++ b/libc/unistd/exec.c | ||
| 36 | @@ -32,6 +32,8 @@ | ||
| 37 | /**********************************************************************/ | ||
| 38 | #define EXEC_FUNC_COMMON 0 | ||
| 39 | #define EXEC_FUNC_EXECVP 1 | ||
| 40 | +#define EXEC_FUNC_EXECVPE 2 | ||
| 41 | + | ||
| 42 | #if defined(__ARCH_USE_MMU__) | ||
| 43 | |||
| 44 | /* We have an MMU, so use alloca() to grab space for buffers and arg lists. */ | ||
| 45 | @@ -58,6 +60,7 @@ | ||
| 46 | * execle(a) -> execve(-) | ||
| 47 | * execv(-) -> execve(-) | ||
| 48 | * execvp(a) -> execve(-) | ||
| 49 | + * execvpe(a) -> execve(-) | ||
| 50 | */ | ||
| 51 | |||
| 52 | # define EXEC_ALLOC_SIZE(VAR) /* nothing to do */ | ||
| 53 | @@ -219,15 +222,18 @@ libc_hidden_def(execlp) | ||
| 54 | |||
| 55 | #endif | ||
| 56 | /**********************************************************************/ | ||
| 57 | -#ifdef L_execvp | ||
| 58 | +#if defined (L_execvp) || defined(L_execvpe) | ||
| 59 | |||
| 60 | |||
| 61 | /* Use a default path that matches glibc behavior, since SUSv3 says | ||
| 62 | * this is implementation-defined. The default is current working dir, | ||
| 63 | * /bin, and then /usr/bin. */ | ||
| 64 | static const char default_path[] = ":/bin:/usr/bin"; | ||
| 65 | - | ||
| 66 | +#if defined (L_execvp) | ||
| 67 | int execvp(const char *path, char *const argv[]) | ||
| 68 | +#elif defined (L_execvpe) | ||
| 69 | +int execvpe(const char *path, char *const argv[], char *const envp[]) | ||
| 70 | +#endif | ||
| 71 | { | ||
| 72 | char *buf = NULL; | ||
| 73 | char *p; | ||
| 74 | @@ -245,7 +251,11 @@ int execvp(const char *path, char *const argv[]) | ||
| 75 | } | ||
| 76 | |||
| 77 | if (strchr(path, '/')) { | ||
| 78 | +#if defined (L_execvp) | ||
| 79 | execve(path, argv, __environ); | ||
| 80 | +#elif defined (L_execvpe) | ||
| 81 | + execve(path, argv, envp); | ||
| 82 | +#endif | ||
| 83 | if (errno == ENOEXEC) { | ||
| 84 | char **nargv; | ||
| 85 | EXEC_ALLOC_SIZE(size2) /* Do NOT add a semicolon! */ | ||
| 86 | @@ -254,11 +264,19 @@ int execvp(const char *path, char *const argv[]) | ||
| 87 | /* Need the dimension - 1. We omit counting the trailing | ||
| 88 | * NULL but we actually omit the first entry. */ | ||
| 89 | for (n=0 ; argv[n] ; n++) {} | ||
| 90 | +#if defined (L_execvp) | ||
| 91 | nargv = (char **) EXEC_ALLOC((n+2) * sizeof(char *), size2, EXEC_FUNC_EXECVP); | ||
| 92 | +#elif defined (L_execvpe) | ||
| 93 | + nargv = (char **) EXEC_ALLOC((n+2) * sizeof(char *), size2, EXEC_FUNC_EXECVPE); | ||
| 94 | +#endif | ||
| 95 | nargv[0] = argv[0]; | ||
| 96 | nargv[1] = (char *)path; | ||
| 97 | memcpy(nargv+2, argv+1, n*sizeof(char *)); | ||
| 98 | +#if defined (L_execvp) | ||
| 99 | execve("/bin/sh", nargv, __environ); | ||
| 100 | +#elif defined (L_execvpe) | ||
| 101 | + execve("/bin/sh", nargv, envp); | ||
| 102 | +#endif | ||
| 103 | EXEC_FREE(nargv, size2); | ||
| 104 | } | ||
| 105 | } else { | ||
| 106 | @@ -277,8 +295,11 @@ int execvp(const char *path, char *const argv[]) | ||
| 107 | return -1; | ||
| 108 | } | ||
| 109 | len = (FILENAME_MAX - 1) - plen; | ||
| 110 | - | ||
| 111 | +#if defined (L_execvp) | ||
| 112 | buf = EXEC_ALLOC(FILENAME_MAX, size, EXEC_FUNC_EXECVP); | ||
| 113 | +#elif defined (L_execvpe) | ||
| 114 | + buf = EXEC_ALLOC(FILENAME_MAX, size, EXEC_FUNC_EXECVPE); | ||
| 115 | +#endif | ||
| 116 | { | ||
| 117 | int seen_small = 0; | ||
| 118 | s0 = buf + len; | ||
| 119 | @@ -300,8 +321,11 @@ int execvp(const char *path, char *const argv[]) | ||
| 120 | s[plen-1] = '/'; | ||
| 121 | } | ||
| 122 | |||
| 123 | +#if defined (L_execvp) | ||
| 124 | execve(s, argv, __environ); | ||
| 125 | - | ||
| 126 | +#elif defined (L_execvpe) | ||
| 127 | + execve(s, argv, envp); | ||
| 128 | +#endif | ||
| 129 | seen_small = 1; | ||
| 130 | |||
| 131 | if (errno == ENOEXEC) { | ||
| 132 | @@ -325,7 +349,11 @@ int execvp(const char *path, char *const argv[]) | ||
| 133 | |||
| 134 | return -1; | ||
| 135 | } | ||
| 136 | +#if defined (L_execvp) | ||
| 137 | libc_hidden_def(execvp) | ||
| 138 | - | ||
| 139 | +#elif defined (L_execvpe) | ||
| 140 | +libc_hidden_def(execvpe) | ||
| 141 | #endif | ||
| 142 | + | ||
| 143 | +#endif /* #if defined (L_execvp) || defined(L_execvpe) */ | ||
| 144 | /**********************************************************************/ | ||
| 145 | diff --git a/libc/unistd/execvpe.c b/libc/unistd/execvpe.c | ||
| 146 | new file mode 100644 | ||
| 147 | index 0000000..5c1ce06 | ||
| 148 | --- /dev/null | ||
| 149 | +++ b/libc/unistd/execvpe.c | ||
| 150 | @@ -0,0 +1,7 @@ | ||
| 151 | +/* Copyright (C) 2011 Hennning Heinold <heinold@inf.fu-berlin.de> | ||
| 152 | + * | ||
| 153 | + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. | ||
| 154 | + */ | ||
| 155 | + | ||
| 156 | +#define L_execvpe | ||
| 157 | +#include "exec.c" | ||
| 158 | -- | ||
| 159 | 1.7.5.3 | ||
| 160 | |||
diff --git a/meta/recipes-core/uclibc/uclibc-0.9.32/uclibc_scheduler_update.patch b/meta/recipes-core/uclibc/uclibc-0.9.32/uclibc_scheduler_update.patch new file mode 100644 index 0000000000..78401bd2ad --- /dev/null +++ b/meta/recipes-core/uclibc/uclibc-0.9.32/uclibc_scheduler_update.patch | |||
| @@ -0,0 +1,455 @@ | |||
| 1 | From 2becc16ecbef71c496644d9dc6cbd7383d7cdca3 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Henning Heinold <heinold@inf.fu-berlin.de> | ||
| 3 | Date: Sat, 4 Jun 2011 21:21:41 +0200 | ||
| 4 | Subject: [PATCH 1/2] libc: updates the linux scheduler functions, most stuff | ||
| 5 | was taken from the eglibc | ||
| 6 | |||
| 7 | |||
| 8 | Signed-off-by: Henning Heinold <heinold@inf.fu-berlin.de> | ||
| 9 | --- | ||
| 10 | include/sched.h | 52 ++++++++++++---- | ||
| 11 | libc/sysdeps/linux/common/Makefile.in | 4 +- | ||
| 12 | libc/sysdeps/linux/common/bits/sched.h | 96 +++++++++++++++++++++++----- | ||
| 13 | libc/sysdeps/linux/common/sched_cpualloc.c | 27 ++++++++ | ||
| 14 | libc/sysdeps/linux/common/sched_cpucount.c | 60 +++++++++++++++++ | ||
| 15 | libc/sysdeps/linux/common/sched_cpufree.c | 27 ++++++++ | ||
| 16 | libc/sysdeps/linux/common/sched_getcpu.c | 37 +++++++++++ | ||
| 17 | libc/sysdeps/linux/common/unshare.c | 12 ++++ | ||
| 18 | 8 files changed, 286 insertions(+), 29 deletions(-) | ||
| 19 | create mode 100644 libc/sysdeps/linux/common/sched_cpualloc.c | ||
| 20 | create mode 100644 libc/sysdeps/linux/common/sched_cpucount.c | ||
| 21 | create mode 100644 libc/sysdeps/linux/common/sched_cpufree.c | ||
| 22 | create mode 100644 libc/sysdeps/linux/common/sched_getcpu.c | ||
| 23 | create mode 100644 libc/sysdeps/linux/common/unshare.c | ||
| 24 | |||
| 25 | diff --git a/include/sched.h b/include/sched.h | ||
| 26 | index 0d110c3..e265b84 100644 | ||
| 27 | --- a/include/sched.h | ||
| 28 | +++ b/include/sched.h | ||
| 29 | @@ -1,5 +1,5 @@ | ||
| 30 | /* Definitions for POSIX 1003.1b-1993 (aka POSIX.4) scheduling interface. | ||
| 31 | - Copyright (C) 1996,1997,1999,2001-2003,2004 Free Software Foundation, Inc. | ||
| 32 | + Copyright (C) 1996,1997,1999,2001-2004,2007 Free Software Foundation, Inc. | ||
| 33 | This file is part of the GNU C Library. | ||
| 34 | |||
| 35 | The GNU C Library is free software; you can redistribute it and/or | ||
| 36 | @@ -25,6 +25,9 @@ | ||
| 37 | /* Get type definitions. */ | ||
| 38 | #include <bits/types.h> | ||
| 39 | |||
| 40 | +#define __need_size_t | ||
| 41 | +#include <stddef.h> | ||
| 42 | + | ||
| 43 | #define __need_timespec | ||
| 44 | #include <time.h> | ||
| 45 | |||
| 46 | @@ -65,11 +68,42 @@ extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __THROW; | ||
| 47 | |||
| 48 | #if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ | ||
| 49 | /* Access macros for `cpu_set'. */ | ||
| 50 | -#define CPU_SETSIZE __CPU_SETSIZE | ||
| 51 | -#define CPU_SET(cpu, cpusetp) __CPU_SET (cpu, cpusetp) | ||
| 52 | -#define CPU_CLR(cpu, cpusetp) __CPU_CLR (cpu, cpusetp) | ||
| 53 | -#define CPU_ISSET(cpu, cpusetp) __CPU_ISSET (cpu, cpusetp) | ||
| 54 | -#define CPU_ZERO(cpusetp) __CPU_ZERO (cpusetp) | ||
| 55 | +# define CPU_SETSIZE __CPU_SETSIZE | ||
| 56 | +# define CPU_SET(cpu, cpusetp) __CPU_SET_S (cpu, sizeof (cpu_set_t), cpusetp) | ||
| 57 | +# define CPU_CLR(cpu, cpusetp) __CPU_CLR_S (cpu, sizeof (cpu_set_t), cpusetp) | ||
| 58 | +# define CPU_ISSET(cpu, cpusetp) __CPU_ISSET_S (cpu, sizeof (cpu_set_t), \ | ||
| 59 | + cpusetp) | ||
| 60 | +# define CPU_ZERO(cpusetp) __CPU_ZERO_S (sizeof (cpu_set_t), cpusetp) | ||
| 61 | +# define CPU_COUNT(cpusetp) __CPU_COUNT_S (sizeof (cpu_set_t), cpusetp) | ||
| 62 | + | ||
| 63 | +# define CPU_SET_S(cpu, setsize, cpusetp) __CPU_SET_S (cpu, setsize, cpusetp) | ||
| 64 | +# define CPU_CLR_S(cpu, setsize, cpusetp) __CPU_CLR_S (cpu, setsize, cpusetp) | ||
| 65 | +# define CPU_ISSET_S(cpu, setsize, cpusetp) __CPU_ISSET_S (cpu, setsize, \ | ||
| 66 | + cpusetp) | ||
| 67 | +# define CPU_ZERO_S(setsize, cpusetp) __CPU_ZERO_S (setsize, cpusetp) | ||
| 68 | +# define CPU_COUNT_S(setsize, cpusetp) __CPU_COUNT_S (setsize, cpusetp) | ||
| 69 | + | ||
| 70 | +# define CPU_EQUAL(cpusetp1, cpusetp2) \ | ||
| 71 | + __CPU_EQUAL_S (sizeof (cpu_set_t), cpusetp1, cpusetp2) | ||
| 72 | +# define CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ | ||
| 73 | + __CPU_EQUAL_S (setsize, cpusetp1, cpusetp2) | ||
| 74 | + | ||
| 75 | +# define CPU_AND(destset, srcset1, srcset2) \ | ||
| 76 | + __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, &) | ||
| 77 | +# define CPU_OR(destset, srcset1, srcset2) \ | ||
| 78 | + __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, |) | ||
| 79 | +# define CPU_XOR(destset, srcset1, srcset2) \ | ||
| 80 | + __CPU_OP_S (sizeof (cpu_set_t), destset, srcset1, srcset2, ^) | ||
| 81 | +# define CPU_AND_S(setsize, destset, srcset1, srcset2) \ | ||
| 82 | + __CPU_OP_S (setsize, destset, srcset1, srcset2, &) | ||
| 83 | +# define CPU_OR_S(setsize, destset, srcset1, srcset2) \ | ||
| 84 | + __CPU_OP_S (setsize, destset, srcset1, srcset2, |) | ||
| 85 | +# define CPU_XOR_S(setsize, destset, srcset1, srcset2) \ | ||
| 86 | + __CPU_OP_S (setsize, destset, srcset1, srcset2, ^) | ||
| 87 | + | ||
| 88 | +# define CPU_ALLOC_SIZE(count) __CPU_ALLOC_SIZE (count) | ||
| 89 | +# define CPU_ALLOC(count) __CPU_ALLOC (count) | ||
| 90 | +# define CPU_FREE(cpuset) __CPU_FREE (cpuset) | ||
| 91 | |||
| 92 | |||
| 93 | /* Set the CPU affinity for a task */ | ||
| 94 | @@ -79,12 +113,6 @@ extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize, | ||
| 95 | /* Get the CPU affinity for a task */ | ||
| 96 | extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize, | ||
| 97 | cpu_set_t *__cpuset) __THROW; | ||
| 98 | - | ||
| 99 | -extern int __clone (int (*__fn) (void *__arg), void *__child_stack, | ||
| 100 | - int __flags, void *__arg, ...); | ||
| 101 | -extern int __clone2 (int (*__fn) (void *__arg), void *__child_stack_base, | ||
| 102 | - size_t __child_stack_size, int __flags, void *__arg, ...); | ||
| 103 | - | ||
| 104 | #endif | ||
| 105 | |||
| 106 | __END_DECLS | ||
| 107 | diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in | ||
| 108 | index 8f936ff..cb8c153 100644 | ||
| 109 | --- a/libc/sysdeps/linux/common/Makefile.in | ||
| 110 | +++ b/libc/sysdeps/linux/common/Makefile.in | ||
| 111 | @@ -22,9 +22,11 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += capget.c capset.c inotify.c ioperm.c iopl.c \ | ||
| 112 | modify_ldt.c pipe2.c personality.c ppoll.c prctl.c \ | ||
| 113 | readahead.c reboot.c \ | ||
| 114 | remap_file_pages.c sched_getaffinity.c sched_setaffinity.c \ | ||
| 115 | + sched_cpualloc.c sched_cpucount.c sched_cpufree.c \ | ||
| 116 | sendfile64.c sendfile.c setfsgid.c setfsuid.c setresuid.c \ | ||
| 117 | splice.c vmsplice.c tee.c signalfd.c swapoff.c swapon.c \ | ||
| 118 | - sync_file_range.c sysctl.c sysinfo.c timerfd.c uselib.c vhangup.c | ||
| 119 | + sync_file_range.c sysctl.c sysinfo.c timerfd.c unshare.c \ | ||
| 120 | + uselib.c vhangup.c | ||
| 121 | # NPTL needs these internally: madvise.c | ||
| 122 | CSRC-$(findstring y,$(UCLIBC_LINUX_SPECIFIC)$(UCLIBC_HAS_THREADS_NATIVE)) += madvise.c | ||
| 123 | ifeq ($(UCLIBC_HAS_THREADS_NATIVE),y) | ||
| 124 | diff --git a/libc/sysdeps/linux/common/bits/sched.h b/libc/sysdeps/linux/common/bits/sched.h | ||
| 125 | index b48a0c8..fea66a8 100644 | ||
| 126 | --- a/libc/sysdeps/linux/common/bits/sched.h | ||
| 127 | +++ b/libc/sysdeps/linux/common/bits/sched.h | ||
| 128 | @@ -1,6 +1,7 @@ | ||
| 129 | /* Definitions of constants and data structure for POSIX 1003.1b-1993 | ||
| 130 | scheduling interface. | ||
| 131 | - Copyright (C) 1996-1999,2001-2003,2005,2006 Free Software Foundation, Inc. | ||
| 132 | + Copyright (C) 1996-1999,2001-2003,2005,2006,2007,2008 | ||
| 133 | + Free Software Foundation, Inc. | ||
| 134 | This file is part of the GNU C Library. | ||
| 135 | |||
| 136 | The GNU C Library is free software; you can redistribute it and/or | ||
| 137 | @@ -58,7 +59,13 @@ | ||
| 138 | force CLONE_PTRACE on this clone. */ | ||
| 139 | # define CLONE_CHILD_SETTID 0x01000000 /* Store TID in userlevel buffer in | ||
| 140 | the child. */ | ||
| 141 | -# define CLONE_STOPPED 0x02000000 /* Start in stopped state. */ | ||
| 142 | +# define CLONE_STOPPED 0x02000000 /* Start in stopped state. */ | ||
| 143 | +# define CLONE_NEWUTS 0x04000000 /* New utsname group. */ | ||
| 144 | +# define CLONE_NEWIPC 0x08000000 /* New ipcs. */ | ||
| 145 | +# define CLONE_NEWUSER 0x10000000 /* New user namespace. */ | ||
| 146 | +# define CLONE_NEWPID 0x20000000 /* New pid namespace. */ | ||
| 147 | +# define CLONE_NEWNET 0x40000000 /* New network namespace. */ | ||
| 148 | +# define CLONE_IO 0x80000000 /* Clone I/O context. */ | ||
| 149 | #endif | ||
| 150 | |||
| 151 | /* The official definition. */ | ||
| 152 | @@ -74,10 +81,11 @@ __BEGIN_DECLS | ||
| 153 | extern int clone (int (*__fn) (void *__arg), void *__child_stack, | ||
| 154 | int __flags, void *__arg, ...) __THROW; | ||
| 155 | |||
| 156 | -#if 0 | ||
| 157 | /* Unshare the specified resources. */ | ||
| 158 | extern int unshare (int __flags) __THROW; | ||
| 159 | -#endif | ||
| 160 | + | ||
| 161 | +/* Get index of currently used CPU. */ | ||
| 162 | +extern int sched_getcpu (void) __THROW; | ||
| 163 | #endif | ||
| 164 | |||
| 165 | __END_DECLS | ||
| 166 | @@ -102,7 +110,7 @@ struct __sched_param | ||
| 167 | # define __CPU_SETSIZE 1024 | ||
| 168 | # define __NCPUBITS (8 * sizeof (__cpu_mask)) | ||
| 169 | |||
| 170 | -/* Type for array elements in 'cpu_set'. */ | ||
| 171 | +/* Type for array elements in 'cpu_set_t'. */ | ||
| 172 | typedef unsigned long int __cpu_mask; | ||
| 173 | |||
| 174 | /* Basic access functions. */ | ||
| 175 | @@ -116,17 +124,73 @@ typedef struct | ||
| 176 | } cpu_set_t; | ||
| 177 | |||
| 178 | /* Access functions for CPU masks. */ | ||
| 179 | -# define __CPU_ZERO(cpusetp) \ | ||
| 180 | +# define __CPU_ZERO_S(setsize, cpusetp) \ | ||
| 181 | do { \ | ||
| 182 | - unsigned int __i; \ | ||
| 183 | - cpu_set_t *__arr = (cpusetp); \ | ||
| 184 | - for (__i = 0; __i < sizeof (cpu_set_t) / sizeof (__cpu_mask); ++__i) \ | ||
| 185 | - __arr->__bits[__i] = 0; \ | ||
| 186 | + size_t __i; \ | ||
| 187 | + size_t __imax = (setsize) / sizeof (__cpu_mask); \ | ||
| 188 | + __cpu_mask *__bits = (cpusetp)->__bits; \ | ||
| 189 | + for (__i = 0; __i < __imax; ++__i) \ | ||
| 190 | + __bits[__i] = 0; \ | ||
| 191 | } while (0) | ||
| 192 | -# define __CPU_SET(cpu, cpusetp) \ | ||
| 193 | - ((cpusetp)->__bits[__CPUELT (cpu)] |= __CPUMASK (cpu)) | ||
| 194 | -# define __CPU_CLR(cpu, cpusetp) \ | ||
| 195 | - ((cpusetp)->__bits[__CPUELT (cpu)] &= ~__CPUMASK (cpu)) | ||
| 196 | -# define __CPU_ISSET(cpu, cpusetp) \ | ||
| 197 | - (((cpusetp)->__bits[__CPUELT (cpu)] & __CPUMASK (cpu)) != 0) | ||
| 198 | +# define __CPU_SET_S(cpu, setsize, cpusetp) \ | ||
| 199 | + (__extension__ \ | ||
| 200 | + ({ size_t __cpu = (cpu); \ | ||
| 201 | + __cpu < 8 * (setsize) \ | ||
| 202 | + ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ | ||
| 203 | + |= __CPUMASK (__cpu)) \ | ||
| 204 | + : 0; })) | ||
| 205 | +# define __CPU_CLR_S(cpu, setsize, cpusetp) \ | ||
| 206 | + (__extension__ \ | ||
| 207 | + ({ size_t __cpu = (cpu); \ | ||
| 208 | + __cpu < 8 * (setsize) \ | ||
| 209 | + ? (((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ | ||
| 210 | + &= ~__CPUMASK (__cpu)) \ | ||
| 211 | + : 0; })) | ||
| 212 | +# define __CPU_ISSET_S(cpu, setsize, cpusetp) \ | ||
| 213 | + (__extension__ \ | ||
| 214 | + ({ size_t __cpu = (cpu); \ | ||
| 215 | + __cpu < 8 * (setsize) \ | ||
| 216 | + ? ((((__cpu_mask *) ((cpusetp)->__bits))[__CPUELT (__cpu)] \ | ||
| 217 | + & __CPUMASK (__cpu))) != 0 \ | ||
| 218 | + : 0; })) | ||
| 219 | + | ||
| 220 | +# define __CPU_COUNT_S(setsize, cpusetp) \ | ||
| 221 | + __sched_cpucount (setsize, cpusetp) | ||
| 222 | + | ||
| 223 | +# define __CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ | ||
| 224 | + (__extension__ \ | ||
| 225 | + ({ __cpu_mask *__arr1 = (cpusetp1)->__bits; \ | ||
| 226 | + __cpu_mask *__arr2 = (cpusetp2)->__bits; \ | ||
| 227 | + size_t __imax = (setsize) / sizeof (__cpu_mask); \ | ||
| 228 | + size_t __i; \ | ||
| 229 | + for (__i = 0; __i < __imax; ++__i) \ | ||
| 230 | + if (__arr1[__i] != __arr2[__i]) \ | ||
| 231 | + break; \ | ||
| 232 | + __i == __imax; })) | ||
| 233 | + | ||
| 234 | +# define __CPU_OP_S(setsize, destset, srcset1, srcset2, op) \ | ||
| 235 | + (__extension__ \ | ||
| 236 | + ({ cpu_set_t *__dest = (destset); \ | ||
| 237 | + __cpu_mask *__arr1 = (srcset1)->__bits; \ | ||
| 238 | + __cpu_mask *__arr2 = (srcset2)->__bits; \ | ||
| 239 | + size_t __imax = (setsize) / sizeof (__cpu_mask); \ | ||
| 240 | + size_t __i; \ | ||
| 241 | + for (__i = 0; __i < __imax; ++__i) \ | ||
| 242 | + ((__cpu_mask *) __dest->__bits)[__i] = __arr1[__i] op __arr2[__i]; \ | ||
| 243 | + __dest; })) | ||
| 244 | + | ||
| 245 | +# define __CPU_ALLOC_SIZE(count) \ | ||
| 246 | + ((((count) + __NCPUBITS - 1) / __NCPUBITS) * sizeof (__cpu_mask)) | ||
| 247 | +# define __CPU_ALLOC(count) __sched_cpualloc (count) | ||
| 248 | +# define __CPU_FREE(cpuset) __sched_cpufree (cpuset) | ||
| 249 | + | ||
| 250 | +__BEGIN_DECLS | ||
| 251 | + | ||
| 252 | +extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp) | ||
| 253 | + __THROW; | ||
| 254 | +extern cpu_set_t *__sched_cpualloc (size_t __count) __THROW __wur; | ||
| 255 | +extern void __sched_cpufree (cpu_set_t *__set) __THROW; | ||
| 256 | + | ||
| 257 | +__END_DECLS | ||
| 258 | + | ||
| 259 | #endif | ||
| 260 | diff --git a/libc/sysdeps/linux/common/sched_cpualloc.c b/libc/sysdeps/linux/common/sched_cpualloc.c | ||
| 261 | new file mode 100644 | ||
| 262 | index 0000000..2642a80 | ||
| 263 | --- /dev/null | ||
| 264 | +++ b/libc/sysdeps/linux/common/sched_cpualloc.c | ||
| 265 | @@ -0,0 +1,27 @@ | ||
| 266 | +/* Copyright (C) 2007 Free Software Foundation, Inc. | ||
| 267 | + This file is part of the GNU C Library. | ||
| 268 | + | ||
| 269 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 270 | + modify it under the terms of the GNU Lesser General Public | ||
| 271 | + License as published by the Free Software Foundation; either | ||
| 272 | + version 2.1 of the License, or (at your option) any later version. | ||
| 273 | + | ||
| 274 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 275 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 276 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 277 | + Lesser General Public License for more details. | ||
| 278 | + | ||
| 279 | + You should have received a copy of the GNU Lesser General Public | ||
| 280 | + License along with the GNU C Library; if not, write to the Free | ||
| 281 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 282 | + 02111-1307 USA. */ | ||
| 283 | + | ||
| 284 | +#include <sched.h> | ||
| 285 | +#include <stdlib.h> | ||
| 286 | + | ||
| 287 | + | ||
| 288 | +cpu_set_t * | ||
| 289 | +__sched_cpualloc (size_t count) | ||
| 290 | +{ | ||
| 291 | + return malloc (CPU_ALLOC_SIZE (count)); | ||
| 292 | +} | ||
| 293 | diff --git a/libc/sysdeps/linux/common/sched_cpucount.c b/libc/sysdeps/linux/common/sched_cpucount.c | ||
| 294 | new file mode 100644 | ||
| 295 | index 0000000..331c0b8 | ||
| 296 | --- /dev/null | ||
| 297 | +++ b/libc/sysdeps/linux/common/sched_cpucount.c | ||
| 298 | @@ -0,0 +1,60 @@ | ||
| 299 | +/* Copyright (C) 2007 Free Software Foundation, Inc. | ||
| 300 | + This file is part of the GNU C Library. | ||
| 301 | + | ||
| 302 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 303 | + modify it under the terms of the GNU Lesser General Public | ||
| 304 | + License as published by the Free Software Foundation; either | ||
| 305 | + version 2.1 of the License, or (at your option) any later version. | ||
| 306 | + | ||
| 307 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 308 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 309 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 310 | + Lesser General Public License for more details. | ||
| 311 | + | ||
| 312 | + You should have received a copy of the GNU Lesser General Public | ||
| 313 | + License along with the GNU C Library; if not, write to the Free | ||
| 314 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 315 | + 02111-1307 USA. */ | ||
| 316 | + | ||
| 317 | +#include <limits.h> | ||
| 318 | +#include <sched.h> | ||
| 319 | + | ||
| 320 | + | ||
| 321 | +int | ||
| 322 | +__sched_cpucount (size_t setsize, const cpu_set_t *setp) | ||
| 323 | +{ | ||
| 324 | + int s = 0; | ||
| 325 | + const __cpu_mask *p = setp->__bits; | ||
| 326 | + const __cpu_mask *end = &setp->__bits[setsize / sizeof (__cpu_mask)]; | ||
| 327 | + | ||
| 328 | + while (p < end) | ||
| 329 | + { | ||
| 330 | + __cpu_mask l = *p++; | ||
| 331 | + | ||
| 332 | +#ifdef POPCNT | ||
| 333 | + s += POPCNT (l); | ||
| 334 | +#else | ||
| 335 | + if (l == 0) | ||
| 336 | + continue; | ||
| 337 | + | ||
| 338 | +# if LONG_BIT > 32 | ||
| 339 | + l = (l & 0x5555555555555555ul) + ((l >> 1) & 0x5555555555555555ul); | ||
| 340 | + l = (l & 0x3333333333333333ul) + ((l >> 2) & 0x3333333333333333ul); | ||
| 341 | + l = (l & 0x0f0f0f0f0f0f0f0ful) + ((l >> 4) & 0x0f0f0f0f0f0f0f0ful); | ||
| 342 | + l = (l & 0x00ff00ff00ff00fful) + ((l >> 8) & 0x00ff00ff00ff00fful); | ||
| 343 | + l = (l & 0x0000ffff0000fffful) + ((l >> 16) & 0x0000ffff0000fffful); | ||
| 344 | + l = (l & 0x00000000fffffffful) + ((l >> 32) & 0x00000000fffffffful); | ||
| 345 | +# else | ||
| 346 | + l = (l & 0x55555555ul) + ((l >> 1) & 0x55555555ul); | ||
| 347 | + l = (l & 0x33333333ul) + ((l >> 2) & 0x33333333ul); | ||
| 348 | + l = (l & 0x0f0f0f0ful) + ((l >> 4) & 0x0f0f0f0ful); | ||
| 349 | + l = (l & 0x00ff00fful) + ((l >> 8) & 0x00ff00fful); | ||
| 350 | + l = (l & 0x0000fffful) + ((l >> 16) & 0x0000fffful); | ||
| 351 | +# endif | ||
| 352 | + | ||
| 353 | + s += l; | ||
| 354 | +#endif | ||
| 355 | + } | ||
| 356 | + | ||
| 357 | + return s; | ||
| 358 | +} | ||
| 359 | diff --git a/libc/sysdeps/linux/common/sched_cpufree.c b/libc/sysdeps/linux/common/sched_cpufree.c | ||
| 360 | new file mode 100644 | ||
| 361 | index 0000000..dd4c613 | ||
| 362 | --- /dev/null | ||
| 363 | +++ b/libc/sysdeps/linux/common/sched_cpufree.c | ||
| 364 | @@ -0,0 +1,27 @@ | ||
| 365 | +/* Copyright (C) 2007 Free Software Foundation, Inc. | ||
| 366 | + This file is part of the GNU C Library. | ||
| 367 | + | ||
| 368 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 369 | + modify it under the terms of the GNU Lesser General Public | ||
| 370 | + License as published by the Free Software Foundation; either | ||
| 371 | + version 2.1 of the License, or (at your option) any later version. | ||
| 372 | + | ||
| 373 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 374 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 375 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 376 | + Lesser General Public License for more details. | ||
| 377 | + | ||
| 378 | + You should have received a copy of the GNU Lesser General Public | ||
| 379 | + License along with the GNU C Library; if not, write to the Free | ||
| 380 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 381 | + 02111-1307 USA. */ | ||
| 382 | + | ||
| 383 | +#include <sched.h> | ||
| 384 | +#include <stdlib.h> | ||
| 385 | + | ||
| 386 | + | ||
| 387 | +void | ||
| 388 | +__sched_cpufree (cpu_set_t *set) | ||
| 389 | +{ | ||
| 390 | + free (set); | ||
| 391 | +} | ||
| 392 | diff --git a/libc/sysdeps/linux/common/sched_getcpu.c b/libc/sysdeps/linux/common/sched_getcpu.c | ||
| 393 | new file mode 100644 | ||
| 394 | index 0000000..b193d65 | ||
| 395 | --- /dev/null | ||
| 396 | +++ b/libc/sysdeps/linux/common/sched_getcpu.c | ||
| 397 | @@ -0,0 +1,37 @@ | ||
| 398 | +/* Copyright (C) 2007 Free Software Foundation, Inc. | ||
| 399 | + This file is part of the GNU C Library. | ||
| 400 | + | ||
| 401 | + The GNU C Library is free software; you can redistribute it and/or | ||
| 402 | + modify it under the terms of the GNU Lesser General Public | ||
| 403 | + License as published by the Free Software Foundation; either | ||
| 404 | + version 2.1 of the License, or (at your option) any later version. | ||
| 405 | + | ||
| 406 | + The GNU C Library is distributed in the hope that it will be useful, | ||
| 407 | + but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 408 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 409 | + Lesser General Public License for more details. | ||
| 410 | + | ||
| 411 | + You should have received a copy of the GNU Lesser General Public | ||
| 412 | + License along with the GNU C Library; if not, write to the Free | ||
| 413 | + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
| 414 | + 02111-1307 USA. */ | ||
| 415 | + | ||
| 416 | +#include <stdlib.h> | ||
| 417 | +#include <errno.h> | ||
| 418 | +#include <sched.h> | ||
| 419 | +#include <sysdep.h> | ||
| 420 | + | ||
| 421 | + | ||
| 422 | +int | ||
| 423 | +sched_getcpu (void) | ||
| 424 | +{ | ||
| 425 | +#ifdef __NR_getcpu | ||
| 426 | + unsigned int cpu; | ||
| 427 | + int r = INLINE_SYSCALL (getcpu, 3, &cpu, NULL, NULL); | ||
| 428 | + | ||
| 429 | + return r == -1 ? r : cpu; | ||
| 430 | +#else | ||
| 431 | + __set_errno (ENOSYS); | ||
| 432 | + return -1; | ||
| 433 | +#endif | ||
| 434 | +} | ||
| 435 | diff --git a/libc/sysdeps/linux/common/unshare.c b/libc/sysdeps/linux/common/unshare.c | ||
| 436 | new file mode 100644 | ||
| 437 | index 0000000..485bf88 | ||
| 438 | --- /dev/null | ||
| 439 | +++ b/libc/sysdeps/linux/common/unshare.c | ||
| 440 | @@ -0,0 +1,12 @@ | ||
| 441 | +/* vi: set sw=4 ts=4: */ | ||
| 442 | +/* | ||
| 443 | + * unshare() for uClibc | ||
| 444 | + * | ||
| 445 | + * Copyright (C) 2011 Henning Heinold <heinold@inf.fu-berlin.de> | ||
| 446 | + * | ||
| 447 | + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. | ||
| 448 | + */ | ||
| 449 | + | ||
| 450 | +#include <sys/syscall.h> | ||
| 451 | +#include <sched.h> | ||
| 452 | +_syscall1(int, unshare, int, flags) | ||
| 453 | -- | ||
| 454 | 1.7.5.3 | ||
| 455 | |||
diff --git a/meta/recipes-core/uclibc/uclibc_0.9.32.bb b/meta/recipes-core/uclibc/uclibc_0.9.32.bb index 0b2befae24..b9592796f3 100644 --- a/meta/recipes-core/uclibc/uclibc_0.9.32.bb +++ b/meta/recipes-core/uclibc/uclibc_0.9.32.bb | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | SRCREV="9152c4d67c763fde5712e2d181d92c0d7e1e2ab9" | 1 | SRCREV="9152c4d67c763fde5712e2d181d92c0d7e1e2ab9" |
| 2 | 2 | ||
| 3 | require uclibc.inc | 3 | require uclibc.inc |
| 4 | PR = "${INC_PR}.0" | 4 | PR = "${INC_PR}.1" |
| 5 | PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc" | 5 | PROVIDES += "virtual/${TARGET_PREFIX}libc-for-gcc" |
| 6 | 6 | ||
| 7 | SRC_URI = "git://uclibc.org/uClibc.git;branch=${PV};protocol=git \ | 7 | SRC_URI = "git://uclibc.org/uClibc.git;branch=${PV};protocol=git \ |
| @@ -26,5 +26,7 @@ SRC_URI = "git://uclibc.org/uClibc.git;branch=${PV};protocol=git \ | |||
| 26 | file://rtld_no.patch \ | 26 | file://rtld_no.patch \ |
| 27 | file://0001-Config.in.arch-Free-UCLIBC_HAS_FPU-setting-from-depe.patch \ | 27 | file://0001-Config.in.arch-Free-UCLIBC_HAS_FPU-setting-from-depe.patch \ |
| 28 | file://0001-mips-signalfd.h-SFD_NONBLOCK-for-mips-is-0200-unlike.patch \ | 28 | file://0001-mips-signalfd.h-SFD_NONBLOCK-for-mips-is-0200-unlike.patch \ |
| 29 | file://uclibc-execvpe.patch \ | ||
| 30 | file://uclibc_scheduler_update.patch \ | ||
| 29 | " | 31 | " |
| 30 | S = "${WORKDIR}/git" | 32 | S = "${WORKDIR}/git" |
