diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-07-31 16:23:59 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-09-26 15:44:49 +0200 |
commit | c10302efe569bfd646b4c22df29577a4595b4580 (patch) | |
tree | fbfba0e5a1cab17411f6d2084477abbdd9e9e547 /arch/s390/kernel/dis.c | |
parent | 6f0f9b6b3fcfe5e156f20d4f804f0d505c750b3c (diff) | |
download | op-kernel-dev-c10302efe569bfd646b4c22df29577a4595b4580.zip op-kernel-dev-c10302efe569bfd646b4c22df29577a4595b4580.tar.gz |
s390/bpf,jit: BPF Just In Time compiler for s390
The s390 implementation of the JIT compiler for packet filter speedup.
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/dis.c')
-rw-r--r-- | arch/s390/kernel/dis.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c index 619c5d3..84fd7e9 100644 --- a/arch/s390/kernel/dis.c +++ b/arch/s390/kernel/dis.c @@ -1601,3 +1601,26 @@ void show_code(struct pt_regs *regs) } printk("\n"); } + +void print_fn_code(unsigned char *code, unsigned long len) +{ + char buffer[64], *ptr; + int opsize, i; + + while (len) { + ptr = buffer; + opsize = insn_length(*code); + ptr += sprintf(ptr, "%p: ", code); + for (i = 0; i < opsize; i++) + ptr += sprintf(ptr, "%02x", code[i]); + *ptr++ = '\t'; + if (i < 4) + *ptr++ = '\t'; + ptr += print_insn(ptr, code, (unsigned long) code); + *ptr++ = '\n'; + *ptr++ = 0; + printk(buffer); + code += opsize; + len -= opsize; + } +} |