linux/drivers/net/ethernet/netronome/nfp/nfp_asm.h

/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/* Copyright (C) 2016-2018 Netronome Systems, Inc. */

#ifndef __NFP_ASM_H__
#define __NFP_ASM_H__

#include <linux/bitfield.h>
#include <linux/bug.h>
#include <linux/types.h>

#define REG_NONE
#define REG_WIDTH

#define RE_REG_NO_DST
#define RE_REG_IMM
#define RE_REG_IMM_encode(x)
#define RE_REG_IMM_MAX
#define RE_REG_LM
#define RE_REG_LM_IDX
#define RE_REG_LM_IDX_MAX
#define RE_REG_XFR

#define UR_REG_XFR
#define UR_REG_LM
#define UR_REG_LM_IDX
#define UR_REG_LM_POST_MOD
#define UR_REG_LM_POST_MOD_DEC
#define UR_REG_LM_IDX_MAX
#define UR_REG_NN
#define UR_REG_NO_DST
#define UR_REG_IMM
#define UR_REG_IMM_encode(x)
#define UR_REG_IMM_MAX

#define OP_BR_BASE
#define OP_BR_BASE_MASK
#define OP_BR_MASK
#define OP_BR_EV_PIP
#define OP_BR_CSS
#define OP_BR_DEFBR
#define OP_BR_ADDR_LO
#define OP_BR_ADDR_HI

#define OP_BR_BIT_BASE
#define OP_BR_BIT_BASE_MASK
#define OP_BR_BIT_A_SRC
#define OP_BR_BIT_B_SRC
#define OP_BR_BIT_BV
#define OP_BR_BIT_SRC_LMEXTN
#define OP_BR_BIT_DEFBR
#define OP_BR_BIT_ADDR_LO
#define OP_BR_BIT_ADDR_HI

#define OP_BR_ALU_BASE
#define OP_BR_ALU_BASE_MASK
#define OP_BR_ALU_A_SRC
#define OP_BR_ALU_B_SRC
#define OP_BR_ALU_DEFBR
#define OP_BR_ALU_IMM_HI
#define OP_BR_ALU_SRC_LMEXTN
#define OP_BR_ALU_DST_LMEXTN

static inline bool nfp_is_br(u64 insn)
{}

enum br_mask {};

enum br_ev_pip {};

enum br_ctx_signal_state {};

u16 br_get_offset(u64 instr);
void br_set_offset(u64 *instr, u16 offset);
void br_add_offset(u64 *instr, u16 offset);

#define OP_BBYTE_BASE
#define OP_BB_A_SRC
#define OP_BB_BYTE
#define OP_BB_B_SRC
#define OP_BB_I8
#define OP_BB_EQ
#define OP_BB_DEFBR
#define OP_BB_ADDR_LO
#define OP_BB_ADDR_HI
#define OP_BB_SRC_LMEXTN

#define OP_BALU_BASE
#define OP_BA_A_SRC
#define OP_BA_B_SRC
#define OP_BA_DEFBR
#define OP_BA_ADDR_HI

#define OP_IMMED_A_SRC
#define OP_IMMED_B_SRC
#define OP_IMMED_IMM
#define OP_IMMED_WIDTH
#define OP_IMMED_INV
#define OP_IMMED_SHIFT
#define OP_IMMED_BASE
#define OP_IMMED_WR_AB
#define OP_IMMED_SRC_LMEXTN
#define OP_IMMED_DST_LMEXTN

enum immed_width {};

enum immed_shift {};

u16 immed_get_value(u64 instr);
void immed_set_value(u64 *instr, u16 immed);
void immed_add_value(u64 *instr, u16 offset);

#define OP_SHF_BASE
#define OP_SHF_A_SRC
#define OP_SHF_SC
#define OP_SHF_B_SRC
#define OP_SHF_I8
#define OP_SHF_SW
#define OP_SHF_DST
#define OP_SHF_SHIFT
#define OP_SHF_OP
#define OP_SHF_DST_AB
#define OP_SHF_WR_AB
#define OP_SHF_SRC_LMEXTN
#define OP_SHF_DST_LMEXTN

enum shf_op {};

enum shf_sc {};

#define OP_ALU_A_SRC
#define OP_ALU_B_SRC
#define OP_ALU_DST
#define OP_ALU_SW
#define OP_ALU_OP
#define OP_ALU_DST_AB
#define OP_ALU_BASE
#define OP_ALU_WR_AB
#define OP_ALU_SRC_LMEXTN
#define OP_ALU_DST_LMEXTN

enum alu_op {};

enum alu_dst_ab {};

#define OP_LDF_BASE
#define OP_LDF_A_SRC
#define OP_LDF_SC
#define OP_LDF_B_SRC
#define OP_LDF_I8
#define OP_LDF_SW
#define OP_LDF_ZF
#define OP_LDF_BMASK
#define OP_LDF_SHF
#define OP_LDF_WR_AB
#define OP_LDF_SRC_LMEXTN
#define OP_LDF_DST_LMEXTN

#define OP_CMD_A_SRC
#define OP_CMD_CTX
#define OP_CMD_B_SRC
#define OP_CMD_TOKEN
#define OP_CMD_XFER
#define OP_CMD_CNT
#define OP_CMD_SIG
#define OP_CMD_TGT_CMD
#define OP_CMD_INDIR
#define OP_CMD_MODE

struct cmd_tgt_act {};

enum cmd_tgt_map {};

extern const struct cmd_tgt_act cmd_tgt_act[__CMD_TGT_MAP_SIZE];

enum cmd_mode {};

enum cmd_ctx_swap {};

#define CMD_OVE_DATA
#define CMD_OVE_LEN
#define CMD_OV_LEN

#define OP_LCSR_BASE
#define OP_LCSR_A_SRC
#define OP_LCSR_B_SRC
#define OP_LCSR_WRITE
#define OP_LCSR_ADDR
#define OP_LCSR_SRC_LMEXTN
#define OP_LCSR_DST_LMEXTN

enum lcsr_wr_src {};

#define OP_CARB_BASE
#define OP_CARB_OR

#define NFP_CSR_CTX_PTR
#define NFP_CSR_ACT_LM_ADDR0
#define NFP_CSR_ACT_LM_ADDR1
#define NFP_CSR_ACT_LM_ADDR2
#define NFP_CSR_ACT_LM_ADDR3
#define NFP_CSR_PSEUDO_RND_NUM

/* Software register representation, independent of operand type */
#define NN_REG_TYPE
#define NN_REG_LM_IDX
#define NN_REG_LM_IDX_HI
#define NN_REG_LM_IDX_LO
#define NN_REG_LM_MOD
#define NN_REG_VAL

enum nfp_bpf_reg_type {};

enum nfp_bpf_lm_mode {};

#define reg_both(x)
#define reg_a(x)
#define reg_b(x)
#define reg_nnr(x)
#define reg_xfer(x)
#define reg_imm(x)
#define reg_none()
#define reg_lm(x, off)
#define reg_lm_inc(x)
#define reg_lm_dec(x)
#define __reg_lm(x, mod, off)

swreg;

static inline swreg __enc_swreg(u16 id, u8 type)
{}

static inline swreg __enc_swreg_lm(u8 id, enum nfp_bpf_lm_mode mode, u8 off)
{}

static inline u32 swreg_raw(swreg reg)
{}

static inline enum nfp_bpf_reg_type swreg_type(swreg reg)
{}

static inline u16 swreg_value(swreg reg)
{}

static inline bool swreg_lm_idx(swreg reg)
{}

static inline bool swreg_lmextn(swreg reg)
{}

static inline enum nfp_bpf_lm_mode swreg_lm_mode(swreg reg)
{}

struct nfp_insn_ur_regs {};

struct nfp_insn_re_regs {};

int swreg_to_unrestricted(swreg dst, swreg lreg, swreg rreg,
			  struct nfp_insn_ur_regs *reg);
int swreg_to_restricted(swreg dst, swreg lreg, swreg rreg,
			struct nfp_insn_re_regs *reg, bool has_imm8);

#define NFP_USTORE_PREFETCH_WINDOW

int nfp_ustore_check_valid_no_ecc(u64 insn);
u64 nfp_ustore_calc_ecc_insn(u64 insn);

#define NFP_IND_ME_REFL_WR_SIG_INIT
#define NFP_IND_ME_CTX_PTR_BASE_MASK
#define NFP_IND_NUM_CONTEXTS

static inline u32 nfp_get_ind_csr_ctx_ptr_offs(u32 read_offset)
{}

enum mul_type {};

enum mul_step {};

#define OP_MUL_BASE
#define OP_MUL_A_SRC
#define OP_MUL_B_SRC
#define OP_MUL_STEP
#define OP_MUL_DST_AB
#define OP_MUL_SW
#define OP_MUL_TYPE
#define OP_MUL_WR_AB
#define OP_MUL_SRC_LMEXTN
#define OP_MUL_DST_LMEXTN

#endif