[repost] Add a dummy interrupt handler to nios2 crt0.s.

Message ID 1554307176-32415-1-git-send-email-sandra@codesourcery.com
State Accepted
Commit c4c614046308a55e4b478c3609f05101c1b8e6b6
Headers show
Series
  • [repost] Add a dummy interrupt handler to nios2 crt0.s.
Related show

Commit Message

Sandra Loosemore April 3, 2019, 3:59 p.m.
The location of the handler at offset 0x20 from the start of memory,
immediately after the 32-byte reset vector, matches the expectations
of real hardware (e.g., a 3c120 board).
---
 libgloss/nios2/crt0.S | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

-- 
2.8.1

Comments

Corinna Vinschen April 3, 2019, 4:03 p.m. | #1
On Apr  3 09:59, Sandra Loosemore wrote:
> The location of the handler at offset 0x20 from the start of memory,

> immediately after the 32-byte reset vector, matches the expectations

> of real hardware (e.g., a 3c120 board).

> ---

>  libgloss/nios2/crt0.S | 14 +++++++++++++-

>  1 file changed, 13 insertions(+), 1 deletion(-)

> 

> diff --git a/libgloss/nios2/crt0.S b/libgloss/nios2/crt0.S

> index 77eacb3..c4dd4c6 100644

> --- a/libgloss/nios2/crt0.S

> +++ b/libgloss/nios2/crt0.S

> @@ -1,6 +1,6 @@

>  /* crt0.S -- startup code for Nios II QEMU generic-nommu board emulation.

>  

> -   Copyright (c) 2018 Mentor Graphics

> +   Copyright (c) 2018-2019 Mentor Graphics

>  

>     The authors hereby grant permission to use, copy, modify, distribute,

>     and license this software and its documentation for any purpose, provided

> @@ -81,6 +81,18 @@ __reset:

>  

>  	.size __reset, . - __reset

>  

> +/* Provide a stub interrupt handler that waits in a busy loop.

> +   The alignment puts it at offset 0x20 from the base of RAM.  */

> +

> +	.align 5

> +

> +        .globl  __interrupt_handler

> +        .type   __interrupt_handler, @function

> +__interrupt_handler:

> +0:

> +	br 0b

> +

> +	.size __interrupt_handler, . - __interrupt_handler

>  

>  /* __start is the ELF entry point.  */

>  

> -- 

> 2.8.1


Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Patch

diff --git a/libgloss/nios2/crt0.S b/libgloss/nios2/crt0.S
index 77eacb3..c4dd4c6 100644
--- a/libgloss/nios2/crt0.S
+++ b/libgloss/nios2/crt0.S
@@ -1,6 +1,6 @@ 
 /* crt0.S -- startup code for Nios II QEMU generic-nommu board emulation.
 
-   Copyright (c) 2018 Mentor Graphics
+   Copyright (c) 2018-2019 Mentor Graphics
 
    The authors hereby grant permission to use, copy, modify, distribute,
    and license this software and its documentation for any purpose, provided
@@ -81,6 +81,18 @@  __reset:
 
 	.size __reset, . - __reset
 
+/* Provide a stub interrupt handler that waits in a busy loop.
+   The alignment puts it at offset 0x20 from the base of RAM.  */
+
+	.align 5
+
+        .globl  __interrupt_handler
+        .type   __interrupt_handler, @function
+__interrupt_handler:
+0:
+	br 0b
+
+	.size __interrupt_handler, . - __interrupt_handler
 
 /* __start is the ELF entry point.  */