]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c
Use <> for include of kernel-features.h.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / powerpc / dl-sysdep.c
CommitLineData
e61abf83 1/* Operating system support for run-time dynamic linker. Linux/PPC version.
c7693af7
UD
2 Copyright (C) 1997, 1998, 2001, 2003, 2006, 2007
3 Free Software Foundation, Inc.
e61abf83
UD
4 This file is part of the GNU C Library.
5
6 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
e61abf83
UD
10
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
41bdb6e2 14 Lesser General Public License for more details.
e61abf83 15
41bdb6e2
AJ
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA. */
e61abf83 20
6ddd37a4
RM
21#include <config.h>
22#include <kernel-features.h>
b8a5737a
GK
23#include <ldsodefs.h>
24
c7693af7 25int __cache_line_size attribute_hidden;
b8a5737a 26
b8a5737a
GK
27/* Scan the Aux Vector for the "Data Cache Block Size" entry. If found
28 verify that the static extern __cache_line_size is defined by checking
124dcac8 29 for not NULL. If it is defined then assign the cache block size
b8a5737a 30 value to __cache_line_size. */
124dcac8
RM
31#define DL_PLATFORM_AUXV \
32 case AT_DCACHEBSIZE: \
c7693af7
UD
33 __cache_line_size = av->a_un.a_val; \
34 break;
390911be
UD
35
36#ifndef __ASSUME_STD_AUXV
37
39e16978
UD
38/* The PowerPC's auxiliary argument block gets aligned to a 16-byte
39 boundary. This is history and impossible to change compatibly. */
40
390911be
UD
41#define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
42 do { \
43 char **_tmp; \
44 size_t _test; \
45 (argc) = *(long int *) cookie; \
46 (argv) = (char **) cookie + 1; \
47 (envp) = (argv) + (argc) + 1; \
48 for (_tmp = (envp); *_tmp; ++_tmp) \
49 continue; \
50 /* The following '++' is important! */ \
51 ++_tmp; \
52 \
53 _test = (size_t)_tmp; \
54 _test = (_test + 0xf) & ~0xf; \
55 /* Under some circumstances, MkLinux (up to at least DR3a5) \
56 omits the padding. To work around this, we make a \
57 basic sanity check of the argument vector. Of \
58 course, this means that in future, the argument \
59 vector will have to be laid out to allow for this \
60 test :-(. */ \
61 if (((ElfW(auxv_t) *)_test)->a_type <= 0x10) \
62 _tmp = (char **)_test; \
63 (auxp) = (ElfW(auxv_t) *) _tmp; \
39e16978 64 } while (0)
390911be 65#endif
39e16978 66
638bb1f3 67#include <sysdeps/unix/sysv/linux/dl-sysdep.c>