aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/process.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 01:11:30 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-23 01:11:30 -0400
commit45c091bb2d453ce4a8b06cf19872ec7a77fc4799 (patch)
tree06fb2e05518ebfba163f8424e028e7faf5672d66 /arch/powerpc/kernel/process.c
parentd588fcbe5a7ba8bba2cebf7799ab2d573717a806 (diff)
parent2191fe3e39159e3375f4b7ec1420df149f154101 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (139 commits) [POWERPC] re-enable OProfile for iSeries, using timer interrupt [POWERPC] support ibm,extended-*-frequency properties [POWERPC] Extra sanity check in EEH code [POWERPC] Dont look for class-code in pci children [POWERPC] Fix mdelay badness on shared processor partitions [POWERPC] disable floating point exceptions for init [POWERPC] Unify ppc syscall tables [POWERPC] mpic: add support for serial mode interrupts [POWERPC] pseries: Print PCI slot location code on failure [POWERPC] spufs: one more fix for 64k pages [POWERPC] spufs: fail spu_create with invalid flags [POWERPC] spufs: clear class2 interrupt status before wakeup [POWERPC] spufs: fix Makefile for "make clean" [POWERPC] spufs: remove stop_code from struct spu [POWERPC] spufs: fix spu irq affinity setting [POWERPC] spufs: further abstract priv1 register access [POWERPC] spufs: split the Cell BE support into generic and platform dependant parts [POWERPC] spufs: dont try to access SPE channel 1 count [POWERPC] spufs: use kzalloc in create_spu [POWERPC] spufs: fix initial state of wbox file ... Manually resolved conflicts in: drivers/net/phy/Makefile include/asm-powerpc/spu.h
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r--arch/powerpc/kernel/process.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 2dd47d2dd998..e4732459c485 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -708,6 +708,61 @@ int get_fpexc_mode(struct task_struct *tsk, unsigned long adr)
708 return put_user(val, (unsigned int __user *) adr); 708 return put_user(val, (unsigned int __user *) adr);
709} 709}
710 710
711int set_endian(struct task_struct *tsk, unsigned int val)
712{
713 struct pt_regs *regs = tsk->thread.regs;
714
715 if ((val == PR_ENDIAN_LITTLE && !cpu_has_feature(CPU_FTR_REAL_LE)) ||
716 (val == PR_ENDIAN_PPC_LITTLE && !cpu_has_feature(CPU_FTR_PPC_LE)))
717 return -EINVAL;
718
719 if (regs == NULL)
720 return -EINVAL;
721
722 if (val == PR_ENDIAN_BIG)
723 regs->msr &= ~MSR_LE;
724 else if (val == PR_ENDIAN_LITTLE || val == PR_ENDIAN_PPC_LITTLE)
725 regs->msr |= MSR_LE;
726 else
727 return -EINVAL;
728
729 return 0;
730}
731
732int get_endian(struct task_struct *tsk, unsigned long adr)
733{
734 struct pt_regs *regs = tsk->thread.regs;
735 unsigned int val;
736
737 if (!cpu_has_feature(CPU_FTR_PPC_LE) &&
738 !cpu_has_feature(CPU_FTR_REAL_LE))
739 return -EINVAL;
740
741 if (regs == NULL)
742 return -EINVAL;
743
744 if (regs->msr & MSR_LE) {
745 if (cpu_has_feature(CPU_FTR_REAL_LE))
746 val = PR_ENDIAN_LITTLE;
747 else
748 val = PR_ENDIAN_PPC_LITTLE;
749 } else
750 val = PR_ENDIAN_BIG;
751
752 return put_user(val, (unsigned int __user *)adr);
753}
754
755int set_unalign_ctl(struct task_struct *tsk, unsigned int val)
756{
757 tsk->thread.align_ctl = val;
758 return 0;
759}
760
761int get_unalign_ctl(struct task_struct *tsk, unsigned long adr)
762{
763 return put_user(tsk->thread.align_ctl, (unsigned int __user *)adr);
764}
765
711#define TRUNC_PTR(x) ((typeof(x))(((unsigned long)(x)) & 0xffffffff)) 766#define TRUNC_PTR(x) ((typeof(x))(((unsigned long)(x)) & 0xffffffff))
712 767
713int sys_clone(unsigned long clone_flags, unsigned long usp, 768int sys_clone(unsigned long clone_flags, unsigned long usp,