inst.h (c7d6891a770aa97dd36c2df3545031e64c6a0ef3) | inst.h (64a17a0ff19a938e1246474666635219f2c3bc15) |
---|---|
1/* 2 * Format of an instruction in memory. 3 * 4 * This file is subject to the terms and conditions of the GNU General Public 5 * License. See the file "COPYING" in the main directory of this archive 6 * for more details. 7 * 8 * Copyright (C) 1996, 2000 by Ralf Baechle 9 * Copyright (C) 2006 by Thiemo Seufer 10 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. 11 * Copyright (C) 2014 Imagination Technologies Ltd. 12 */ 13#ifndef _UAPI_ASM_INST_H 14#define _UAPI_ASM_INST_H 15 | 1/* 2 * Format of an instruction in memory. 3 * 4 * This file is subject to the terms and conditions of the GNU General Public 5 * License. See the file "COPYING" in the main directory of this archive 6 * for more details. 7 * 8 * Copyright (C) 1996, 2000 by Ralf Baechle 9 * Copyright (C) 2006 by Thiemo Seufer 10 * Copyright (C) 2012 MIPS Technologies, Inc. All rights reserved. 11 * Copyright (C) 2014 Imagination Technologies Ltd. 12 */ 13#ifndef _UAPI_ASM_INST_H 14#define _UAPI_ASM_INST_H 15 |
16#include <asm/bitfield.h> 17 |
|
16/* 17 * Major opcodes; before MIPS IV cop1x was called cop3. 18 */ 19enum major_op { 20 spec_op, bcond_op, j_op, jal_op, 21 beq_op, bne_op, blez_op, bgtz_op, 22 addi_op, addiu_op, slti_op, sltiu_op, 23 andi_op, ori_op, xori_op, lui_op, --- 451 unchanged lines hidden (view full) --- 475 MIPS16e_swrasp_func = 02, 476}; 477 478/* 479 * (microMIPS & MIPS16e) NOP instruction. 480 */ 481#define MM_NOP16 0x0c00 482 | 18/* 19 * Major opcodes; before MIPS IV cop1x was called cop3. 20 */ 21enum major_op { 22 spec_op, bcond_op, j_op, jal_op, 23 beq_op, bne_op, blez_op, bgtz_op, 24 addi_op, addiu_op, slti_op, sltiu_op, 25 andi_op, ori_op, xori_op, lui_op, --- 451 unchanged lines hidden (view full) --- 477 MIPS16e_swrasp_func = 02, 478}; 479 480/* 481 * (microMIPS & MIPS16e) NOP instruction. 482 */ 483#define MM_NOP16 0x0c00 484 |
483/* 484 * Damn ... bitfields depend from byteorder :-( 485 */ 486#ifdef __MIPSEB__ 487#define __BITFIELD_FIELD(field, more) \ 488 field; \ 489 more 490 491#elif defined(__MIPSEL__) 492 493#define __BITFIELD_FIELD(field, more) \ 494 more \ 495 field; 496 497#else /* !defined (__MIPSEB__) && !defined (__MIPSEL__) */ 498#error "MIPS but neither __MIPSEL__ nor __MIPSEB__?" 499#endif 500 | |
501struct j_format { 502 __BITFIELD_FIELD(unsigned int opcode : 6, /* Jump format */ 503 __BITFIELD_FIELD(unsigned int target : 26, 504 ;)) 505}; 506 507struct i_format { /* signed immediate format */ 508 __BITFIELD_FIELD(unsigned int opcode : 6, --- 408 unchanged lines hidden --- | 485struct j_format { 486 __BITFIELD_FIELD(unsigned int opcode : 6, /* Jump format */ 487 __BITFIELD_FIELD(unsigned int target : 26, 488 ;)) 489}; 490 491struct i_format { /* signed immediate format */ 492 __BITFIELD_FIELD(unsigned int opcode : 6, --- 408 unchanged lines hidden --- |