Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b618336a authored by Kevin D. Kissell's avatar Kevin D. Kissell Committed by Ralf Baechle
Browse files

[MIPS] Fixes necessary for non-SMP kernels and non-relocatable binaries

parent 8e07c2c6
Loading
Loading
Loading
Loading
+15 −8
Original line number Diff line number Diff line
@@ -781,10 +781,15 @@ static int vpe_run(struct vpe * v)
	/* take system out of configuration state */
	clear_c0_mvpcontrol(MVPCONTROL_VPC);

	/*
	 * SMTC/SMVP kernels manage VPE enable independently,
	 * but uniprocessor kernels need to turn it on, even
	 * if that wasn't the pre-dvpe() state.
	 */
#ifdef CONFIG_SMP
	evpe(EVPE_ENABLE);
#else
	evpe(vpeflags);
#else
	evpe(EVPE_ENABLE);
#endif
	emt(dmt_flag);
	local_irq_restore(flags);
@@ -947,11 +952,13 @@ static int vpe_elfload(struct vpe * v)
		struct elf_phdr *phdr = (struct elf_phdr *) ((char *)hdr + hdr->e_phoff);

		for (i = 0; i < hdr->e_phnum; i++) {
			if (phdr->p_type != PT_LOAD)
				continue;

			memcpy((void *)phdr->p_paddr, (char *)hdr + phdr->p_offset, phdr->p_filesz);
			memset((void *)phdr->p_paddr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz);
			if (phdr->p_type == PT_LOAD) {
				memcpy((void *)phdr->p_paddr,
				       (char *)hdr + phdr->p_offset,
				       phdr->p_filesz);
				memset((void *)phdr->p_paddr + phdr->p_filesz,
				       0, phdr->p_memsz - phdr->p_filesz);
		    }
		    phdr++;
		}