Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11571
b: refs/heads/master
c: d4bf9a7
h: refs/heads/master
i:
  11569: 927af21
  11567: 20832d8
v: v3
  • Loading branch information
Stephen Rothwell committed Oct 13, 2005
1 parent 28328c5 commit f2d7cc1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 52 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0f17d0742f27b7a69b0e2dfb21190f06ea3a9087
refs/heads/master: d4bf9a7858a0766cafb21dcb66ff9a5d92c1cd09
1 change: 1 addition & 0 deletions trunk/arch/powerpc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CFLAGS_btext.o += -fPIC
endif

obj-y := semaphore.o cputable.o
obj-$(CONFIG_PPC64) += binfmt_elf32.o
obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
obj-$(CONFIG_POWER4) += idle_power4.o

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ cputime_to_compat_timeval(const cputime_t cputime, struct compat_timeval *value)
value->tv_sec = jiffies / HZ;
}

extern void start_thread32(struct pt_regs *, unsigned long, unsigned long);
#undef start_thread
#define start_thread start_thread32
#define init_elf_binfmt init_elf32_binfmt

#include "../../../fs/binfmt_elf.c"
6 changes: 5 additions & 1 deletion trunk/arch/powerpc/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
regs->nip = start;
regs->msr = MSR_USER;
#else
{
if (!test_thread_flag(TIF_32BIT)) {
unsigned long entry, toc, load_addr = regs->gpr[2];

/* start is a relocated pointer to the function descriptor for
Expand All @@ -641,6 +641,10 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
regs->nip = entry;
regs->gpr[2] = toc;
regs->msr = MSR_USER64;
} else {
regs->nip = start;
regs->gpr[2] = 0;
regs->msr = MSR_USER32;
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ppc64/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endif
obj-y += irq.o idle.o dma.o \
time.o signal.o syscalls.o ptrace.o \
align.o bitops.o pacaData.o \
udbg.o binfmt_elf32.o sys_ppc32.o ioctl32.o \
udbg.o sys_ppc32.o ioctl32.o \
ptrace32.o signal32.o rtc.o \
cpu_setup_power4.o \
iommu.o sysfs.o vdso.o pmc.o firmware.o
Expand Down
46 changes: 0 additions & 46 deletions trunk/arch/ppc64/kernel/sys_ppc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -609,52 +609,6 @@ long sys32_execve(unsigned long a0, unsigned long a1, unsigned long a2,
return error;
}

/* Set up a thread for executing a new program. */
void start_thread32(struct pt_regs* regs, unsigned long nip, unsigned long sp)
{
set_fs(USER_DS);

/*
* If we exec out of a kernel thread then thread.regs will not be
* set. Do it now.
*/
if (!current->thread.regs) {
unsigned long childregs = (unsigned long)current->thread_info +
THREAD_SIZE;
childregs -= sizeof(struct pt_regs);
current->thread.regs = (struct pt_regs *)childregs;
}

/*
* ELF_PLAT_INIT already clears all registers but it also sets r2.
* So just clear r2 here.
*/
regs->gpr[2] = 0;

regs->nip = nip;
regs->gpr[1] = sp;
regs->msr = MSR_USER32;
#ifndef CONFIG_SMP
if (last_task_used_math == current)
last_task_used_math = 0;
#endif /* CONFIG_SMP */
current->thread.fpscr = 0;
memset(current->thread.fpr, 0, sizeof(current->thread.fpr));
#ifdef CONFIG_ALTIVEC
#ifndef CONFIG_SMP
if (last_task_used_altivec == current)
last_task_used_altivec = 0;
#endif /* CONFIG_SMP */
memset(current->thread.vr, 0, sizeof(current->thread.vr));
current->thread.vscr.u[0] = 0;
current->thread.vscr.u[1] = 0;
current->thread.vscr.u[2] = 0;
current->thread.vscr.u[3] = 0x00010000; /* Java mode disabled */
current->thread.vrsave = 0;
current->thread.used_vr = 0;
#endif /* CONFIG_ALTIVEC */
}

/* Note: it is necessary to treat option as an unsigned int,
* with the corresponding cast to a signed int to insure that the
* proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
Expand Down

0 comments on commit f2d7cc1

Please sign in to comment.