blob: bfdc962f4aa9cd9568e9399d37dc36c8af5d3dac (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
/*
* SPDX-License-Identifier: CDDL 1.0
*
* Copyright 2023 Christos Margiolis <christos@FreeBSD.org>
*/
#include <sys/types.h>
#include <sys/dtrace.h>
#include <machine/riscvreg.h>
#define RVC_MASK 0x03
int
dtrace_instr_size(uint8_t *instr)
{
/* Detect compressed instructions. */
if ((~(*instr) & RVC_MASK) == 0)
return (INSN_SIZE);
else
return (INSN_C_SIZE);
}
|