瀏覽代碼

MIPS: start{, 64}.S: fill branch delay slots with NOP instructions

The romReserved and romExcHandle handlers are
accessed by a branch instruction however the
delay slots of those instructions are not filled.

Because the start.S uses the 'noreorder' directive,
the assembler will not fill the delay slots either,
and leads to the following assembly code:

  0000056c <romReserved>:
   56c:   1000ffff        b       56c <romReserved>

  00000570 <romExcHandle>:
   570:   1000ffff        b       570 <romExcHandle>

In the resulting code, the second branch instruction
is placed into the delay slot of the first branch
instruction, which is not allowed on the MIPS
architecture.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Cc: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
Gabor Juhos 12 年之前
父節點
當前提交
14fdd1a8bf
共有 2 個文件被更改,包括 3 次插入0 次删除
  1. 2 0
      arch/mips/cpu/mips32/start.S
  2. 1 0
      arch/mips/cpu/mips64/start.S

+ 2 - 0
arch/mips/cpu/mips32/start.S

@@ -380,6 +380,8 @@ in_ram:
 	/* Exception handlers */
 	/* Exception handlers */
 romReserved:
 romReserved:
 	b	romReserved
 	b	romReserved
+	 nop
 
 
 romExcHandle:
 romExcHandle:
 	b	romExcHandle
 	b	romExcHandle
+	 nop

+ 1 - 0
arch/mips/cpu/mips64/start.S

@@ -259,3 +259,4 @@ in_ram:
 	/* Exception handlers */
 	/* Exception handlers */
 romReserved:
 romReserved:
 	b	romReserved
 	b	romReserved
+	 nop