diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-10-12 23:40:54 -0400 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2005-10-12 23:40:54 -0400 |
commit | d4bf9a7858a0766cafb21dcb66ff9a5d92c1cd09 (patch) | |
tree | 7179d40fa2b016414fb2b7fcc9e9da960459bc8d /arch | |
parent | 0f17d0742f27b7a69b0e2dfb21190f06ea3a9087 (diff) |
ppc64: merge binfmt_elf32.c
and use start_thread for both 32 and 64 bit bineries.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/kernel/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/binfmt_elf32.c (renamed from arch/ppc64/kernel/binfmt_elf32.c) | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/process.c | 6 | ||||
-rw-r--r-- | arch/ppc64/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/ppc64/kernel/sys_ppc32.c | 46 |
5 files changed, 7 insertions, 51 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index f03f6d4ffaa6..adac749a1a8a 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -11,6 +11,7 @@ CFLAGS_btext.o += -fPIC | |||
11 | endif | 11 | endif |
12 | 12 | ||
13 | obj-y := semaphore.o cputable.o | 13 | obj-y := semaphore.o cputable.o |
14 | obj-$(CONFIG_PPC64) += binfmt_elf32.o | ||
14 | obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o | 15 | obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o |
15 | obj-$(CONFIG_POWER4) += idle_power4.o | 16 | obj-$(CONFIG_POWER4) += idle_power4.o |
16 | 17 | ||
diff --git a/arch/ppc64/kernel/binfmt_elf32.c b/arch/powerpc/kernel/binfmt_elf32.c index fadc699a0497..8ad6b0f33651 100644 --- a/arch/ppc64/kernel/binfmt_elf32.c +++ b/arch/powerpc/kernel/binfmt_elf32.c | |||
@@ -70,9 +70,6 @@ cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value) | |||
70 | value->tv_sec = jiffies / HZ; | 70 | value->tv_sec = jiffies / HZ; |
71 | } | 71 | } |
72 | 72 | ||
73 | extern void start_thread32(struct pt_regs *, unsigned long, unsigned long); | ||
74 | #undef start_thread | ||
75 | #define start_thread start_thread32 | ||
76 | #define init_elf_binfmt init_elf32_binfmt | 73 | #define init_elf_binfmt init_elf32_binfmt |
77 | 74 | ||
78 | #include "../../../fs/binfmt_elf.c" | 75 | #include "../../../fs/binfmt_elf.c" |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 92bc75f61ca6..193c8c1bf132 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -620,7 +620,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) | |||
620 | regs->nip = start; | 620 | regs->nip = start; |
621 | regs->msr = MSR_USER; | 621 | regs->msr = MSR_USER; |
622 | #else | 622 | #else |
623 | { | 623 | if (!test_thread_flag(TIF_32BIT)) { |
624 | unsigned long entry, toc, load_addr = regs->gpr[2]; | 624 | unsigned long entry, toc, load_addr = regs->gpr[2]; |
625 | 625 | ||
626 | /* start is a relocated pointer to the function descriptor for | 626 | /* start is a relocated pointer to the function descriptor for |
@@ -641,6 +641,10 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) | |||
641 | regs->nip = entry; | 641 | regs->nip = entry; |
642 | regs->gpr[2] = toc; | 642 | regs->gpr[2] = toc; |
643 | regs->msr = MSR_USER64; | 643 | regs->msr = MSR_USER64; |
644 | } else { | ||
645 | regs->nip = start; | ||
646 | regs->gpr[2] = 0; | ||
647 | regs->msr = MSR_USER32; | ||
644 | } | 648 | } |
645 | #endif | 649 | #endif |
646 | 650 | ||
diff --git a/arch/ppc64/kernel/Makefile b/arch/ppc64/kernel/Makefile index 834aef034b77..a724f6fc04da 100644 --- a/arch/ppc64/kernel/Makefile +++ b/arch/ppc64/kernel/Makefile | |||
@@ -14,7 +14,7 @@ endif | |||
14 | obj-y += irq.o idle.o dma.o \ | 14 | obj-y += irq.o idle.o dma.o \ |
15 | time.o signal.o syscalls.o ptrace.o \ | 15 | time.o signal.o syscalls.o ptrace.o \ |
16 | align.o bitops.o pacaData.o \ | 16 | align.o bitops.o pacaData.o \ |
17 | udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \ | 17 | udbg.o sys_ppc32.o ioctl32.o \ |
18 | ptrace32.o signal32.o rtc.o \ | 18 | ptrace32.o signal32.o rtc.o \ |
19 | cpu_setup_power4.o \ | 19 | cpu_setup_power4.o \ |
20 | iommu.o sysfs.o vdso.o pmc.o firmware.o | 20 | iommu.o sysfs.o vdso.o pmc.o firmware.o |
diff --git a/arch/ppc64/kernel/sys_ppc32.c b/arch/ppc64/kernel/sys_ppc32.c index 1cacf61f9c91..b53f565ee443 100644 --- a/arch/ppc64/kernel/sys_ppc32.c +++ b/arch/ppc64/kernel/sys_ppc32.c | |||
@@ -609,52 +609,6 @@ out: | |||
609 | return error; | 609 | return error; |
610 | } | 610 | } |
611 | 611 | ||
612 | /* Set up a thread for executing a new program. */ | ||
613 | void start_thread32(struct pt_regs* regs, unsigned long nip, unsigned long sp) | ||
614 | { | ||
615 | set_fs(USER_DS); | ||
616 | |||
617 | /* | ||
618 | * If we exec out of a kernel thread then thread.regs will not be | ||
619 | * set. Do it now. | ||
620 | */ | ||
621 | if (!current->thread.regs) { | ||
622 | unsigned long childregs = (unsigned long)current->thread_info + | ||
623 | THREAD_SIZE; | ||
624 | childregs -= sizeof(struct pt_regs); | ||
625 | current->thread.regs = (struct pt_regs *)childregs; | ||
626 | } | ||
627 | |||
628 | /* | ||
629 | * ELF_PLAT_INIT already clears all registers but it also sets r2. | ||
630 | * So just clear r2 here. | ||
631 | */ | ||
632 | regs->gpr[2] = 0; | ||
633 | |||
634 | regs->nip = nip; | ||
635 | regs->gpr[1] = sp; | ||
636 | regs->msr = MSR_USER32; | ||
637 | #ifndef CONFIG_SMP | ||
638 | if (last_task_used_math == current) | ||
639 | last_task_used_math = 0; | ||
640 | #endif /* CONFIG_SMP */ | ||
641 | current->thread.fpscr = 0; | ||
642 | memset(current->thread.fpr, 0, sizeof(current->thread.fpr)); | ||
643 | #ifdef CONFIG_ALTIVEC | ||
644 | #ifndef CONFIG_SMP | ||
645 | if (last_task_used_altivec == current) | ||
646 | last_task_used_altivec = 0; | ||
647 | #endif /* CONFIG_SMP */ | ||
648 | memset(current->thread.vr, 0, sizeof(current->thread.vr)); | ||
649 | current->thread.vscr.u[0] = 0; | ||
650 | current->thread.vscr.u[1] = 0; | ||
651 | current->thread.vscr.u[2] = 0; | ||
652 | current->thread.vscr.u[3] = 0x00010000; /* Java mode disabled */ | ||
653 | current->thread.vrsave = 0; | ||
654 | current->thread.used_vr = 0; | ||
655 | #endif /* CONFIG_ALTIVEC */ | ||
656 | } | ||
657 | |||
658 | /* Note: it is necessary to treat option as an unsigned int, | 612 | /* Note: it is necessary to treat option as an unsigned int, |
659 | * with the corresponding cast to a signed int to insure that the | 613 | * with the corresponding cast to a signed int to insure that the |
660 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) | 614 | * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode) |