Path: blob/master/arch/powerpc/include/asm/disassemble.h
15117 views
/*1* This program is free software; you can redistribute it and/or modify2* it under the terms of the GNU General Public License, version 2, as3* published by the Free Software Foundation.4*5* This program is distributed in the hope that it will be useful,6* but WITHOUT ANY WARRANTY; without even the implied warranty of7* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the8* GNU General Public License for more details.9*10* You should have received a copy of the GNU General Public License11* along with this program; if not, write to the Free Software12* Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.13*14* Copyright IBM Corp. 200815*16* Authors: Hollis Blanchard <[email protected]>17*/1819#ifndef __ASM_PPC_DISASSEMBLE_H__20#define __ASM_PPC_DISASSEMBLE_H__2122#include <linux/types.h>2324static inline unsigned int get_op(u32 inst)25{26return inst >> 26;27}2829static inline unsigned int get_xop(u32 inst)30{31return (inst >> 1) & 0x3ff;32}3334static inline unsigned int get_sprn(u32 inst)35{36return ((inst >> 16) & 0x1f) | ((inst >> 6) & 0x3e0);37}3839static inline unsigned int get_dcrn(u32 inst)40{41return ((inst >> 16) & 0x1f) | ((inst >> 6) & 0x3e0);42}4344static inline unsigned int get_rt(u32 inst)45{46return (inst >> 21) & 0x1f;47}4849static inline unsigned int get_rs(u32 inst)50{51return (inst >> 21) & 0x1f;52}5354static inline unsigned int get_ra(u32 inst)55{56return (inst >> 16) & 0x1f;57}5859static inline unsigned int get_rb(u32 inst)60{61return (inst >> 11) & 0x1f;62}6364static inline unsigned int get_rc(u32 inst)65{66return inst & 0x1;67}6869static inline unsigned int get_ws(u32 inst)70{71return (inst >> 11) & 0x1f;72}7374static inline unsigned int get_d(u32 inst)75{76return inst & 0xffff;77}7879#endif /* __ASM_PPC_DISASSEMBLE_H__ */808182