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

Commit 0fd42612 authored by Neil Leeder's avatar Neil Leeder
Browse files

cpaccess: use mmu function to write to memory



Kernel memory can be write protected, so use the
provided mmu function which will temporarily remove
the write protection to replace a word in kernel memory.

Change-Id: I22abfd9f7b61fd9494d6b39825ca465b3338533a
Signed-off-by: default avatarNeil Leeder <nleeder@codeaurora.org>
parent f522312c
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@
#include <linux/types.h>
#include <asm/cacheflush.h>
#include <asm/smp_plat.h>
#include <asm/mmu.h>

#define TYPE_MAX_CHARACTERS 20

@@ -113,9 +114,7 @@ static u64 do_cpregister_rw(int write)
	 * instruction, ensuring cache coherency.
	 */
	p_opcode = (u32 *)&cpaccess_dummy_inst;
	*p_opcode = opcode;
	flush_icache_range((unsigned long) p_opcode,
		(unsigned long)(p_opcode+sizeof(unsigned long)));
	mem_text_write_kernel_word(p_opcode, opcode);

	/*
	 * Use smp_call_function_single to do CPU core specific