aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/nohash/8xx.c
diff options
context:
space:
mode:
authorJordan Niethe <jniethe5@gmail.com>2020-05-06 13:40:26 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2020-05-19 00:10:36 +1000
commit753462512868674a788ecc77bb96752efb818785 (patch)
tree02e2f30549082335849621bfdcce413e4166b252 /arch/powerpc/mm/nohash/8xx.c
parentpowerpc: Change calling convention for create_branch() et. al. (diff)
downloadlinux-dev-753462512868674a788ecc77bb96752efb818785.tar.xz
linux-dev-753462512868674a788ecc77bb96752efb818785.zip
powerpc: Use a macro for creating instructions from u32s
In preparation for instructions having a more complex data type start using a macro, ppc_inst(), for making an instruction out of a u32. A macro is used so that instructions can be used as initializer elements. Currently this does nothing, but it will allow for creating a data type that can represent prefixed instructions. Signed-off-by: Jordan Niethe <jniethe5@gmail.com> [mpe: Change include guard to _ASM_POWERPC_INST_H] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Alistair Popple <alistair@popple.id.au> Link: https://lore.kernel.org/r/20200506034050.24806-7-jniethe5@gmail.com
Diffstat (limited to 'arch/powerpc/mm/nohash/8xx.c')
-rw-r--r--arch/powerpc/mm/nohash/8xx.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/mm/nohash/8xx.c b/arch/powerpc/mm/nohash/8xx.c
index 3189308dece4..b27017109a36 100644
--- a/arch/powerpc/mm/nohash/8xx.c
+++ b/arch/powerpc/mm/nohash/8xx.c
@@ -11,6 +11,7 @@
#include <linux/mmu_context.h>
#include <asm/fixmap.h>
#include <asm/code-patching.h>
+#include <asm/inst.h>
#include <mm/mmu_decl.h>
@@ -101,7 +102,7 @@ static void mmu_patch_addis(s32 *site, long simm)
instr &= 0xffff0000;
instr |= ((unsigned long)simm) >> 16;
- patch_instruction_site(site, instr);
+ patch_instruction_site(site, ppc_inst(instr));
}
static void mmu_mapin_ram_chunk(unsigned long offset, unsigned long top, pgprot_t prot)
@@ -125,7 +126,7 @@ unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top)
mapped = 0;
mmu_mapin_immr();
if (!IS_ENABLED(CONFIG_PIN_TLB_IMMR))
- patch_instruction_site(&patch__dtlbmiss_immr_jmp, PPC_INST_NOP);
+ patch_instruction_site(&patch__dtlbmiss_immr_jmp, ppc_inst(PPC_INST_NOP));
if (!IS_ENABLED(CONFIG_PIN_TLB_TEXT))
mmu_patch_cmp_limit(&patch__itlbmiss_linmem_top, 0);
} else {