Path: blob/master/arch/powerpc/platforms/powernv/copy-paste.h
26481 views
/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2* Copyright 2016-17 IBM Corp.3*/4#include <asm/ppc-opcode.h>5#include <asm/reg.h>67/*8* Copy/paste instructions:9*10* copy RA,RB11* Copy contents of address (RA) + effective_address(RB)12* to internal copy-buffer.13*14* paste RA,RB15* Paste contents of internal copy-buffer to the address16* (RA) + effective_address(RB)17*/18static inline int vas_copy(void *crb, int offset)19{20asm volatile(PPC_COPY(%0, %1)";"21:22: "b" (offset), "b" (crb)23: "memory");2425return 0;26}2728static inline int vas_paste(void *paste_address, int offset)29{30u32 cr;3132cr = 0;33asm volatile(PPC_PASTE(%1, %2)";"34"mfocrf %0, 0x80;"35: "=r" (cr)36: "b" (offset), "b" (paste_address)37: "memory", "cr0");3839/* We mask with 0xE to ignore SO */40return (cr >> CR0_SHIFT) & 0xE;41}424344