Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329821
b: refs/heads/master
c: 9b7fb99
h: refs/heads/master
i:
  329819: 28541f3
v: v3
  • Loading branch information
Cornelia Huck authored and Avi Kivity committed Jul 26, 2012
1 parent b86cd2f commit 39a9c96
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 23d43cf998275bc97437931c0cdee1df2c1aa3ca
refs/heads/master: 9b7fb990e080f3a7c5dff9a829d11247e629b98f
1 change: 1 addition & 0 deletions trunk/arch/s390/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ extern int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags);
extern unsigned long thread_saved_pc(struct task_struct *t);

extern void show_code(struct pt_regs *regs);
extern int insn_to_mnemonic(unsigned char *instruction, char buf[8]);

unsigned long get_wchan(struct task_struct *p);
#define task_pt_regs(tsk) ((struct pt_regs *) \
Expand Down
27 changes: 27 additions & 0 deletions trunk/arch/s390/kernel/dis.c
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,33 @@ static struct insn *find_insn(unsigned char *code)
return NULL;
}

/**
* insn_to_mnemonic - decode an s390 instruction
* @instruction: instruction to decode
* @buf: buffer to fill with mnemonic
*
* Decode the instruction at @instruction and store the corresponding
* mnemonic into @buf.
* @buf is left unchanged if the instruction could not be decoded.
* Returns:
* %0 on success, %-ENOENT if the instruction was not found.
*/
int insn_to_mnemonic(unsigned char *instruction, char buf[8])
{
struct insn *insn;

insn = find_insn(instruction);
if (!insn)
return -ENOENT;
if (insn->name[0] == '\0')
snprintf(buf, sizeof(buf), "%s",
long_insn_name[(int) insn->name[1]]);
else
snprintf(buf, sizeof(buf), "%.5s", insn->name);
return 0;
}
EXPORT_SYMBOL_GPL(insn_to_mnemonic);

static int print_insn(char *buffer, unsigned char *code, unsigned long addr)
{
struct insn *insn;
Expand Down

0 comments on commit 39a9c96

Please sign in to comment.