This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
[libgloss patch] fix mips cfe support to be mips16-compatible.
- From: cgd at broadcom dot com
- To: newlib at sources dot redhat dot com
- Date: 08 Jan 2003 11:11:32 -0800
- Subject: [libgloss patch] fix mips cfe support to be mips16-compatible.
So, i recently tripped over the fact that the mips libgloss CFE
support code isn't mips16 compatible.
(I ran into it building for mips64vr-elf, before the patch went in to
add special configuration bits for mips64vr-elf.)
tested by building for mips64vr-elf w/ the old configuration bits and
by builting for mipsisa32-elf, and by testing the latter on real hw
using CFE firmware.
thanks,
chris
--
2003-01-08 Chris Demetriou <cgd@broadcom.com>
* mips/cfe.c (hardware_hazard_hook): Move...
* mips/cfe_prestart.S (hardware_hazard_hook): To here,
and translate into assembly.
diff -rup ../combined.cleanish/libgloss/mips/cfe.c libgloss/mips/cfe.c
--- ../combined.cleanish/libgloss/mips/cfe.c Wed Jan 8 10:08:01 2003
+++ libgloss/mips/cfe.c Wed Jan 8 09:56:54 2003
@@ -96,23 +96,6 @@ hardware_init_hook(void)
cfe_conshandle = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE);
}
-/* Avoid worst-case execution hazards. This is targetted at the SB-1
- pipe, and is much worse than it needs to be (not even counting
- the subroutine call and return). */
-void
-hardware_hazard_hook(void)
-{
- __asm__ __volatile__ (" .set push \n"
- " .set mips32 \n"
- " .set noreorder \n"
- " ssnop \n"
- " ssnop \n"
- " ssnop \n"
- " bnel $0, $0, .+4 \n"
- " ssnop \n"
- " .set pop \n");
-}
-
/* Exit back to monitor, with the given status code. */
void
hardware_exit_hook (int status)
diff -rup ../combined.cleanish/libgloss/mips/cfe_prestart.S libgloss/mips/cfe_prestart.S
--- ../combined.cleanish/libgloss/mips/cfe_prestart.S Fri Jul 12 10:55:04 2002
+++ libgloss/mips/cfe_prestart.S Wed Jan 8 09:56:49 2003
@@ -64,3 +64,23 @@ _prestart:
jr v0
nop
.end _prestart
+
+
+/* Avoid worst-case execution hazards. This is targetted at the SB-1
+ pipe, and is much worse than it needs to be (not even counting
+ the subroutine call and return). */
+ .globl hardware_hazard_hook
+ .ent hardware_hazard_hook
+hardware_hazard_hook:
+ .set push
+ .set mips32
+ .set noreorder
+ ssnop
+ ssnop
+ ssnop
+ bnel $0, $0, .+4
+ ssnop
+ j ra
+ nop
+ .set pop
+ .end hardware_hazard_hook