Path: blob/main/sys/dev/aic7xxx/aicasm/aicasm_insformat.h
39566 views
/*-1* Instruction formats for the sequencer program downloaded to2* Aic7xxx SCSI host adapters3*4* SPDX-License-Identifier: BSD-3-Clause5*6* Copyright (c) 1997, 1998, 2000 Justin T. Gibbs.7* All rights reserved.8*9* Redistribution and use in source and binary forms, with or without10* modification, are permitted provided that the following conditions11* are met:12* 1. Redistributions of source code must retain the above copyright13* notice, this list of conditions, and the following disclaimer,14* without modification.15* 2. Redistributions in binary form must reproduce at minimum a disclaimer16* substantially similar to the "NO WARRANTY" disclaimer below17* ("Disclaimer") and any redistribution must be conditioned upon18* including a substantially similar Disclaimer requirement for further19* binary redistribution.20* 3. Neither the names of the above-listed copyright holders nor the names21* of any contributors may be used to endorse or promote products derived22* from this software without specific prior written permission.23*24* Alternatively, this software may be distributed under the terms of the25* GNU General Public License ("GPL") version 2 as published by the Free26* Software Foundation.27*28* NO WARRANTY29* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS30* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT31* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR32* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT33* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL34* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS35* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)36* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,37* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING38* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE39* POSSIBILITY OF SUCH DAMAGES.40*41* $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_insformat.h#11 $42*/4344struct ins_format1 {45#if BYTE_ORDER == LITTLE_ENDIAN46uint32_t immediate : 8,47source : 9,48destination : 9,49ret : 1,50opcode : 4,51parity : 1;52#else53uint32_t parity : 1,54opcode : 4,55ret : 1,56destination : 9,57source : 9,58immediate : 8;59#endif60};6162struct ins_format2 {63#if BYTE_ORDER == LITTLE_ENDIAN64uint32_t shift_control : 8,65source : 9,66destination : 9,67ret : 1,68opcode : 4,69parity : 1;70#else71uint32_t parity : 1,72opcode : 4,73ret : 1,74destination : 9,75source : 9,76shift_control : 8;77#endif78};7980struct ins_format3 {81#if BYTE_ORDER == LITTLE_ENDIAN82uint32_t immediate : 8,83source : 9,84address : 10,85opcode : 4,86parity : 1;87#else88uint32_t parity : 1,89opcode : 4,90address : 10,91source : 9,92immediate : 8;93#endif94};9596union ins_formats {97struct ins_format1 format1;98struct ins_format2 format2;99struct ins_format3 format3;100uint8_t bytes[4];101uint32_t integer;102};103struct instruction {104union ins_formats format;105u_int srcline;106struct symbol *patch_label;107STAILQ_ENTRY(instruction) links;108};109110#define AIC_OP_OR 0x0111#define AIC_OP_AND 0x1112#define AIC_OP_XOR 0x2113#define AIC_OP_ADD 0x3114#define AIC_OP_ADC 0x4115#define AIC_OP_ROL 0x5116#define AIC_OP_BMOV 0x6117118#define AIC_OP_JMP 0x8119#define AIC_OP_JC 0x9120#define AIC_OP_JNC 0xa121#define AIC_OP_CALL 0xb122#define AIC_OP_JNE 0xc123#define AIC_OP_JNZ 0xd124#define AIC_OP_JE 0xe125#define AIC_OP_JZ 0xf126127/* Pseudo Ops */128#define AIC_OP_SHL 0x10129#define AIC_OP_SHR 0x20130#define AIC_OP_ROR 0x30131132133