diff mbox series

[v10,62/65] linux-user: Add nanoMIPS support in scripts/qemu-binfmt-conf.sh

Message ID 1534514633-13725-63-git-send-email-aleksandar.markovic@rt-rk.com
State New
Headers show
Series [v10,01/65] target/mips: Add preprocessor constants for nanoMIPS | expand

Commit Message

Aleksandar Markovic Aug. 17, 2018, 2:03 p.m. UTC
From: Aleksandar Rikalo <arikalo@wavecomp.com>

Add support for nanomips[eb] variant in scripts/qemu-binfmt-conf.sh.

Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
---
 scripts/qemu-binfmt-conf.sh | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

Comments

Laurent Vivier Aug. 22, 2018, 6:02 p.m. UTC | #1
Le 17/08/2018 à 16:03, Aleksandar Markovic a écrit :
> From: Aleksandar Rikalo <arikalo@wavecomp.com>
> 
> Add support for nanomips[eb] variant in scripts/qemu-binfmt-conf.sh.
> 
> Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
> Signed-off-by: Stefan Markovic <smarkovic@wavecomp.com>
> ---
>  scripts/qemu-binfmt-conf.sh | 16 +++++++++++++++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
> 
....
> @@ -137,6 +145,12 @@ qemu_get_family() {
>      mips*)
>          echo "mips"
>          ;;
> +    nanomips)
> +        echo "nanomips"
> +        ;;
> +    nanomipseb)
> +        echo "nanomipseb"
> +        ;;

You don't need to add these lines, it's only needed if $cpu != $family.
The default case manages it:

    case "$cpu" in
...
    *)
        echo $cpu
        ;;

Thanks,
Laurent
diff mbox series

Patch

diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index b0dc8a7..adb96ac 100755
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -2,7 +2,7 @@ 
 # Enable automatic program execution by the kernel.
 
 qemu_target_list="i386 i486 alpha arm armeb sparc32plus ppc ppc64 ppc64le m68k \
-mips mipsel mipsn32 mipsn32el mips64 mips64el \
+mips mipsel mipsn32 mipsn32el mips64 mips64el nanomips nanomipseb \
 sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb \
 microblaze microblazeel or1k"
 
@@ -76,6 +76,14 @@  mips64el_magic='\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\
 mips64el_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
 mips64el_family=mips
 
+nanomips_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf9\x00'
+nanomips_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
+nanomips_family=nanomips
+
+nanomipseb_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xf9'
+nanomipseb_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
+nanomipseb_family=nanomipseb
+
 sh4_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00'
 sh4_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
 sh4_family=sh4
@@ -137,6 +145,12 @@  qemu_get_family() {
     mips*)
         echo "mips"
         ;;
+    nanomips)
+        echo "nanomips"
+        ;;
+    nanomipseb)
+        echo "nanomipseb"
+        ;;
     "Power Macintosh"|ppc64|powerpc|ppc)
         echo "ppc"
         ;;