aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-ppc/miscthings.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /arch/um/sys-ppc/miscthings.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'arch/um/sys-ppc/miscthings.c')
-rw-r--r--arch/um/sys-ppc/miscthings.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/um/sys-ppc/miscthings.c b/arch/um/sys-ppc/miscthings.c
new file mode 100644
index 000000000000..373061c50129
--- /dev/null
+++ b/arch/um/sys-ppc/miscthings.c
@@ -0,0 +1,53 @@
1#include "linux/threads.h"
2#include "linux/stddef.h" // for NULL
3#include "linux/elf.h" // for AT_NULL
4
5/* The following function nicked from arch/ppc/kernel/process.c and
6 * adapted slightly */
7/*
8 * XXX ld.so expects the auxiliary table to start on
9 * a 16-byte boundary, so we have to find it and
10 * move it up. :-(
11 */
12void shove_aux_table(unsigned long sp)
13{
14 int argc;
15 char *p;
16 unsigned long e;
17 unsigned long aux_start, offset;
18
19 argc = *(int *)sp;
20 sp += sizeof(int) + (argc + 1) * sizeof(char *);
21 /* skip over the environment pointers */
22 do {
23 p = *(char **)sp;
24 sp += sizeof(char *);
25 } while (p != NULL);
26 aux_start = sp;
27 /* skip to the end of the auxiliary table */
28 do {
29 e = *(unsigned long *)sp;
30 sp += 2 * sizeof(unsigned long);
31 } while (e != AT_NULL);
32 offset = ((aux_start + 15) & ~15) - aux_start;
33 if (offset != 0) {
34 do {
35 sp -= sizeof(unsigned long);
36 e = *(unsigned long *)sp;
37 *(unsigned long *)(sp + offset) = e;
38 } while (sp > aux_start);
39 }
40}
41/* END stuff taken from arch/ppc/kernel/process.c */
42
43
44/*
45 * Overrides for Emacs so that we follow Linus's tabbing style.
46 * Emacs will notice this stuff at the end of the file and automatically
47 * adjust the settings for this buffer only. This must remain at the end
48 * of the file.
49 * ---------------------------------------------------------------------------
50 * Local variables:
51 * c-file-style: "linux"
52 * End:
53 */