We have to pull rtdm/rtdm_driver.h before rtdm/rtcan.h, so that
arch-specific wrappers could be pulled in turn from low-level RTOS
headers, possibly for depolluting the namespace before rtcan
definitions are read.
This change is required for fixing arch-specific issues in kernel
header files (e.g. Blackfin for pre-2.6.31 releases).
Instead of reshuffling the inclusion order of header files, this
change deliberately picks the fathead conservative way for fixing the
issue.

PTHREAD_STACK_MIN varies a lot depending on architecture and versions of the
glibc, so, choose a reasonable default value of 32K for the default stack size
instead of relying on PTHREAD_STACK_MIN in case its value would be too small
for a simple printf.

Executing configure on a chroot which uses a modern equivalent of
_POSIX_VERSION breaks on scripts/prepare-kernel.sh:
patching file mm/vmalloc.c
head: `-1' option is obsolete; use `-n 1'
Try `head --help' for more information.
This patch converts prepare-kernel.sh to the new 'head -n' syntax.
Signed-off-by: Fabian Godehardt <fg@emlix.com>

In some conditions, while testing Xenomai in VirtualBox, I had the
error that xnarch_init_timeconv() is called from init_32.h with a
frequency of 0. That leads to a division by zero, followed by a system
oops.
Of course that is a bug in the virtualisation and Linux reports a CPU
frequency of 0 in /proc/cpuinfo. However, there's no harm if Xenomai
checks that instead of crashing the whole system.
Signed-off-by: Bernhard Walle <bernhard@bwalle.de>

The find_task_by_pid_ns() helper is no more exported starting with
2.6.31. Introduce a conditional implementation for find_task_by_pid()
which does not depend on that helper anymore, when compiling for >=
2.6.31.

The current layout of rtser_config is unfortunate as it may result in
different layout depending on the compiler alignment setting. Namely,
rx_timeout may be aligned on 8-byte boundaries in user land while it may
not be aligned in the kernel, or vice versa.
Avoid this ambiguity by adding a reserved padding field. Bump profile
revision number due to ABI breakage.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

nommu support requires the get_unmapped_area() handler to be available
from a character device fops, for getting a suggested address from
which to make the shared mapping.
This patch adds one to the shared heap management code.