diff options
Diffstat (limited to 'arch/mips/kernel/vpe.c')
-rw-r--r-- | arch/mips/kernel/vpe.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 39804c584edd..f73a89850a25 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c | |||
@@ -781,10 +781,15 @@ static int vpe_run(struct vpe * v) | |||
781 | /* take system out of configuration state */ | 781 | /* take system out of configuration state */ |
782 | clear_c0_mvpcontrol(MVPCONTROL_VPC); | 782 | clear_c0_mvpcontrol(MVPCONTROL_VPC); |
783 | 783 | ||
784 | /* | ||
785 | * SMTC/SMVP kernels manage VPE enable independently, | ||
786 | * but uniprocessor kernels need to turn it on, even | ||
787 | * if that wasn't the pre-dvpe() state. | ||
788 | */ | ||
784 | #ifdef CONFIG_SMP | 789 | #ifdef CONFIG_SMP |
785 | evpe(EVPE_ENABLE); | ||
786 | #else | ||
787 | evpe(vpeflags); | 790 | evpe(vpeflags); |
791 | #else | ||
792 | evpe(EVPE_ENABLE); | ||
788 | #endif | 793 | #endif |
789 | emt(dmt_flag); | 794 | emt(dmt_flag); |
790 | local_irq_restore(flags); | 795 | local_irq_restore(flags); |
@@ -947,12 +952,14 @@ static int vpe_elfload(struct vpe * v) | |||
947 | struct elf_phdr *phdr = (struct elf_phdr *) ((char *)hdr + hdr->e_phoff); | 952 | struct elf_phdr *phdr = (struct elf_phdr *) ((char *)hdr + hdr->e_phoff); |
948 | 953 | ||
949 | for (i = 0; i < hdr->e_phnum; i++) { | 954 | for (i = 0; i < hdr->e_phnum; i++) { |
950 | if (phdr->p_type != PT_LOAD) | 955 | if (phdr->p_type == PT_LOAD) { |
951 | continue; | 956 | memcpy((void *)phdr->p_paddr, |
952 | 957 | (char *)hdr + phdr->p_offset, | |
953 | memcpy((void *)phdr->p_paddr, (char *)hdr + phdr->p_offset, phdr->p_filesz); | 958 | phdr->p_filesz); |
954 | memset((void *)phdr->p_paddr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz); | 959 | memset((void *)phdr->p_paddr + phdr->p_filesz, |
955 | phdr++; | 960 | 0, phdr->p_memsz - phdr->p_filesz); |
961 | } | ||
962 | phdr++; | ||
956 | } | 963 | } |
957 | 964 | ||
958 | for (i = 0; i < hdr->e_shnum; i++) { | 965 | for (i = 0; i < hdr->e_shnum; i++) { |