summaryrefslogtreecommitdiff
path: root/arch/powerpc/lib/inst.c
blob: 605220dbb6ba5caacbb738ea22bae7e95294fadb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;
}