From 5c3f3f1b1b50d1e2a1a141943b94f08f19f59b6d Mon Sep 17 00:00:00 2001
From: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
Date: Sun, 11 Apr 2021 20:04:06 -0700
Subject: [PATCH] Add systemd support for microblaze architecture

Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>

Applied to current version of systemd
Reworked to split microblaze and microblazeel

Signed-off-by: Mark Hatle <mark.hatle@amd.com>
---
 src/basic/architecture.c | 3 +++
 src/basic/architecture.h | 4 ++++
 2 files changed, 7 insertions(+)

Index: git/src/basic/architecture.c
===================================================================
--- git.orig/src/basic/architecture.c
+++ git/src/basic/architecture.c
@@ -49,6 +49,10 @@ Architecture uname_architecture(void) {
 #elif defined(__alpha__)
                 { "alpha" ,     ARCHITECTURE_ALPHA    },
 
+#elif defined(__microblaze__)
+                { "microblaze", ARCHITECTURE_MICROBLAZE },
+                { "microblazeel", ARCHITECTURE_MICROBLAZE_LE },
+
 #elif defined(__arc__)
                 { "arc",        ARCHITECTURE_ARC      },
                 { "arceb",      ARCHITECTURE_ARC_BE   },
@@ -147,6 +151,8 @@ static const char *const architecture_ta
         [ARCHITECTURE_ALPHA]       = "alpha",
         [ARCHITECTURE_ARC]         = "arc",
         [ARCHITECTURE_ARC_BE]      = "arc-be",
+        [ARCHITECTURE_MICROBLAZE]  = "microblaze",
+        [ARCHITECTURE_MICROBLAZE_LE] = "microblazeel",
         [ARCHITECTURE_CRIS]        = "cris",
         [ARCHITECTURE_X86_64]      = "x86-64",
         [ARCHITECTURE_X86]         = "x86",
Index: git/src/basic/architecture.h
===================================================================
--- git.orig/src/basic/architecture.h
+++ git/src/basic/architecture.h
@@ -22,6 +22,8 @@ typedef enum {
         ARCHITECTURE_IA64,
         ARCHITECTURE_LOONGARCH64,
         ARCHITECTURE_M68K,
+        ARCHITECTURE_MICROBLAZE,
+        ARCHITECTURE_MICROBLAZE_LE,
         ARCHITECTURE_MIPS,
         ARCHITECTURE_MIPS64,
         ARCHITECTURE_MIPS64_LE,
@@ -239,6 +241,14 @@ Architecture uname_architecture(void);
 #    define native_architecture() ARCHITECTURE_ARC
 #    define LIB_ARCH_TUPLE "arc-linux"
 #  endif
+#elif defined(__microblaze__)
+#  if __BYTE_ORDER == __BIG_ENDIAN
+#    define native_architecture() ARCHITECTURE_MICROBLAZE
+#    define LIB_ARCH_TUPLE "microblaze-linux"
+#  else
+#    define native_architecture() ARCHITECTURE_MICROBLAZE_LE
+#    define LIB_ARCH_TUPLE "microblazeel-linux"
+#  endif
 #else
 #  error "Please register your architecture here!"
 #endif
