openrisc / or1ksim

The OpenRISC 1000 architectural simulator
GNU General Public License v3.0
69 stars 43 forks source link

Add NOP_EXIT_SILENT support #2

Closed fjullien closed 11 years ago

fjullien commented 11 years ago

This patch adds support for NOP_EXIT_SILENT (0x000c) opcode. This opcode acts like NOP_EXIT but doesn't print anything while exiting.

NOP_EXIT_SILENT was introduce in the new or1k toolchain.

See: http://www.mail-archive.com/openrisc@lists.openrisc.net/msg00637.html

Signed-off-by: Franck Jullien franck.jullien@gmail.com

fjullien commented 11 years ago

Hi there,

I don't know if it's the right thing to do. However, this change is mandatory to run the gdb testsuite against or1ksim.

Franck.

jeremybennett commented 11 years ago

Hi Franck. This is a good change. I'm not sure why it never caused a problem before. I would hope DejaGnu's pattern matching would just ignore it.

You will have to change newlib and uClibc implementation of _exit() to actually use the new NOP.

juliusbaxter commented 11 years ago

On Wed, Jan 30, 2013 at 5:08 PM, Jeremy Bennett notifications@github.comwrote:

Hi Franck. This is a good change. I'm not sure why it never caused a problem before. I would hope DejaGnu's pattern matching would just ignore it.

I agree, this is good to add.

You will have to change newlib and uClibc implementation of _exit() to actually use the new NOP.

I believe newlib may already use this?

However, this is good if all simulation models are updated to recognise this new nop. I know that when I started using code with this new l.nop that my simulator wasn't exiting and I wasn't sure why. But to be honest, that's a good thing because it made me add support for it. So I'd back this change, too.

Cheers

Julius

fjullien commented 11 years ago

It is used in newlib:

[franck@centos or1k-src]$ grep -r NOP_EXIT_SILENT *

libgloss/or1k/or1ksim-uart.S: l.nop NOP_EXIT_SILENT libgloss/or1k/or1ksim.S: l.nop NOP_EXIT_SILENT libgloss/ChangeLog.or1k: * or1k/_exit.c: replace use of NOP_EXIT_SILENT with jump to _board_exit libgloss/ChangeLog.or1k: * or1k/_exit.c: use NOP_EXIT_SILENT as l.nop code instead of newlib/ChangeLog.or1k: * libc/machine/or1k/include/or1k-support.h: add NOP_EXIT_SILENT; newlib/libc/machine/or1k/include/or1k-support-defs.h:#define NOP_EXIT_SILENT 0x000c
sim/or1k/or1k.h:#define NOP_EXIT_SILENT 0xc sim/or1k/or1k.c: case NOP_EXIT_SILENT: sim/or1k/ChangeLog: simulator output; add NOP_EXIT_SILENT which silently exits. This sim/or1k/ChangeLog: Newlib's exit will use NOP_EXIT_SILENT.

Franck.