diff options
Diffstat (limited to 'arch/powerpc/lib/inst.c')
-rw-r--r-- | arch/powerpc/lib/inst.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/powerpc/lib/inst.c b/arch/powerpc/lib/inst.c new file mode 100644 index 000000000000..605220dbb6ba --- /dev/null +++ b/arch/powerpc/lib/inst.c @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright 2020, IBM Corporation. + */ + +#include <linux/uaccess.h> +#include <asm/inst.h> + +int probe_user_read_inst(struct ppc_inst *inst, + struct ppc_inst __user *nip) +{ + unsigned int val; + int err; + + err = probe_user_read(&val, nip, sizeof(val)); + if (!err) + *inst = ppc_inst(val); + + return err; +} |