Re: [PATCH v2 02/21] powerpc: use memblock functions returning virtual address

2019-01-29 Thread Michael Ellerman
Mike Rapoport  writes:

> From: Christophe Leroy 
>
> Since only the virtual address of allocated blocks is used,
> lets use functions returning directly virtual address.
>
> Those functions have the advantage of also zeroing the block.
>
> [ MR:
>  - updated error message in alloc_stack() to be more verbose
>  - convereted several additional call sites ]
>
> Signed-off-by: Christophe Leroy 
> Signed-off-by: Mike Rapoport 
> ---
>  arch/powerpc/kernel/dt_cpu_ftrs.c |  3 +--
>  arch/powerpc/kernel/irq.c |  5 -
>  arch/powerpc/kernel/paca.c|  6 +-
>  arch/powerpc/kernel/prom.c|  5 -
>  arch/powerpc/kernel/setup_32.c| 26 --
>  5 files changed, 26 insertions(+), 19 deletions(-)

LGTM.

Acked-by: Michael Ellerman 

cheers

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH v2 06/21] memblock: memblock_phys_alloc_try_nid(): don't panic

2019-01-29 Thread Michael Ellerman
Mike Rapoport  writes:

> diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
> index ae34e3a..2c61ea4 100644
> --- a/arch/arm64/mm/numa.c
> +++ b/arch/arm64/mm/numa.c
> @@ -237,6 +237,10 @@ static void __init setup_node_data(int nid, u64 
> start_pfn, u64 end_pfn)
>   pr_info("Initmem setup node %d []\n", nid);
>  
>   nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
> + if (!nd_pa)
> + panic("Cannot allocate %zu bytes for node %d data\n",
> +   nd_size, nid);
> +
>   nd = __va(nd_pa);

Acked-by: Michael Ellerman  (powerpc)

cheers

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH v2 06/21] memblock: memblock_phys_alloc_try_nid(): don't panic

2019-01-29 Thread Michael Ellerman
Michael Ellerman  writes:

> Mike Rapoport  writes:
>
>> diff --git a/arch/arm64/mm/numa.c b/arch/arm64/mm/numa.c
>> index ae34e3a..2c61ea4 100644
>> --- a/arch/arm64/mm/numa.c
>> +++ b/arch/arm64/mm/numa.c
>> @@ -237,6 +237,10 @@ static void __init setup_node_data(int nid, u64 
>> start_pfn, u64 end_pfn)
>>  pr_info("Initmem setup node %d []\n", nid);
>>  
>>  nd_pa = memblock_phys_alloc_try_nid(nd_size, SMP_CACHE_BYTES, nid);
>> +if (!nd_pa)
>> +panic("Cannot allocate %zu bytes for node %d data\n",
>> +  nd_size, nid);
>> +
>>  nd = __va(nd_pa);

Wrong hunk, O_o

> Acked-by: Michael Ellerman  (powerpc)

You know what I mean though :)

cheers

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH v2 09/21] memblock: drop memblock_alloc_base()

2019-01-29 Thread Michael Ellerman
Mike Rapoport  writes:

> The memblock_alloc_base() function tries to allocate a memory up to the
> limit specified by its max_addr parameter and panics if the allocation
> fails. Replace its usage with memblock_phys_alloc_range() and make the
> callers check the return value and panic in case of error.
>
> Signed-off-by: Mike Rapoport 
> ---
>  arch/powerpc/kernel/rtas.c  |  6 +-
>  arch/powerpc/mm/hash_utils_64.c |  8 ++--
>  arch/s390/kernel/smp.c  |  6 +-
>  drivers/macintosh/smu.c |  2 +-
>  include/linux/memblock.h|  2 --
>  mm/memblock.c   | 14 --
>  6 files changed, 17 insertions(+), 21 deletions(-)

Acked-by: Michael Ellerman  (powerpc)

cheers

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH 1/5] ARCv2: lib: memcpy: fix doing prefetchw outside of buffer

2019-01-29 Thread Eugeniy Paltsev
ARCv2 optimized memcpy uses PREFETCHW instruction for prefetching the
next cache line but doesn't ensure that the line is not past the end of
the buffer. PRETECHW changes the line ownership and marks it dirty,
which can cause data corruption if this area is used for DMA IO.

Fix the issue by avoiding the PREFETCHW. This leads to performance
degradation but it is OK as we'll introduce new memcpy implementation
optimized for unaligned memory access using.

We also cut off all PREFETCH instructions at they are quite useless
according to benchmark.

Signed-off-by: Eugeniy Paltsev 
---
 arch/arc/lib/memcpy-archs.S | 14 --
 1 file changed, 14 deletions(-)

diff --git a/arch/arc/lib/memcpy-archs.S b/arch/arc/lib/memcpy-archs.S
index d61044dd8b58..ea14b0bf3116 100644
--- a/arch/arc/lib/memcpy-archs.S
+++ b/arch/arc/lib/memcpy-archs.S
@@ -25,15 +25,11 @@
 #endif
 
 #ifdef CONFIG_ARC_HAS_LL64
-# define PREFETCH_READ(RX) prefetch[RX, 56]
-# define PREFETCH_WRITE(RX)prefetchw   [RX, 64]
 # define LOADX(DST,RX) ldd.ab  DST, [RX, 8]
 # define STOREX(SRC,RX)std.ab  SRC, [RX, 8]
 # define ZOLSHFT   5
 # define ZOLAND0x1F
 #else
-# define PREFETCH_READ(RX) prefetch[RX, 28]
-# define PREFETCH_WRITE(RX)prefetchw   [RX, 32]
 # define LOADX(DST,RX) ld.ab   DST, [RX, 4]
 # define STOREX(SRC,RX)st.ab   SRC, [RX, 4]
 # define ZOLSHFT   4
@@ -41,8 +37,6 @@
 #endif
 
 ENTRY_CFI(memcpy)
-   prefetch [r1]   ; Prefetch the read location
-   prefetchw [r0]  ; Prefetch the write location
mov.f   0, r2
 ;;; if size is zero
jz.d[blink]
@@ -72,8 +66,6 @@ ENTRY_CFI(memcpy)
lpnz@.Lcopy32_64bytes
;; LOOP START
LOADX (r6, r1)
-   PREFETCH_READ (r1)
-   PREFETCH_WRITE (r3)
LOADX (r8, r1)
LOADX (r10, r1)
LOADX (r4, r1)
@@ -117,9 +109,7 @@ ENTRY_CFI(memcpy)
lpnz@.Lcopy8bytes_1
;; LOOP START
ld.ab   r6, [r1, 4]
-   prefetch [r1, 28]   ;Prefetch the next read location
ld.ab   r8, [r1,4]
-   prefetchw [r3, 32]  ;Prefetch the next write location
 
SHIFT_1 (r7, r6, 24)
or  r7, r7, r5
@@ -162,9 +152,7 @@ ENTRY_CFI(memcpy)
lpnz@.Lcopy8bytes_2
;; LOOP START
ld.ab   r6, [r1, 4]
-   prefetch [r1, 28]   ;Prefetch the next read location
ld.ab   r8, [r1,4]
-   prefetchw [r3, 32]  ;Prefetch the next write location
 
SHIFT_1 (r7, r6, 16)
or  r7, r7, r5
@@ -204,9 +192,7 @@ ENTRY_CFI(memcpy)
lpnz@.Lcopy8bytes_3
;; LOOP START
ld.ab   r6, [r1, 4]
-   prefetch [r1, 28]   ;Prefetch the next read location
ld.ab   r8, [r1,4]
-   prefetchw [r3, 32]  ;Prefetch the next write location
 
SHIFT_1 (r7, r6, 8)
or  r7, r7, r5
-- 
2.14.5


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH 5/5] ARCv2: LIB: MEMCPY: fixed and optimised routine

2019-01-29 Thread Eugeniy Paltsev
Optimise code to use efficient unaligned memory access which is
available on ARCv2. This allows us to really simplify memcpy code
and speed up the code one and a half times (in case of unaligned
source or destination).

Signed-off-by: Eugeniy Paltsev 
---
 arch/arc/Kconfig  |  4 +++
 arch/arc/lib/Makefile |  5 +++-
 arch/arc/lib/memcpy-archs-unaligned.S | 46 +++
 3 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 arch/arc/lib/memcpy-archs-unaligned.S

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index a1d976c612a6..88f1a3205b8f 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -396,6 +396,10 @@ config ARC_USE_UNALIGNED_MEM_ACCESS
  which is disabled by default. Enable unaligned access in
  hardware and use it in software.
 
+#dummy symbol for using in makefile
+config ARC_NO_UNALIGNED_MEM_ACCESS
+   def_bool !ARC_USE_UNALIGNED_MEM_ACCESS
+
 config ARC_HAS_LL64
bool "Insn: 64bit LDD/STD"
help
diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile
index b1656d156097..59cc8b61342e 100644
--- a/arch/arc/lib/Makefile
+++ b/arch/arc/lib/Makefile
@@ -8,4 +8,7 @@
 lib-y  := strchr-700.o strcpy-700.o strlen.o memcmp.o
 
 lib-$(CONFIG_ISA_ARCOMPACT)+= memcpy-700.o memset.o strcmp.o
-lib-$(CONFIG_ISA_ARCV2)+= memcpy-archs.o memset-archs.o 
strcmp-archs.o
+lib-$(CONFIG_ISA_ARCV2)+= memset-archs.o strcmp-archs.o
+
+lib-$(CONFIG_ARC_NO_UNALIGNED_MEM_ACCESS)  += memcpy-archs.o
+lib-$(CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS) += memcpy-archs-unaligned.o
diff --git a/arch/arc/lib/memcpy-archs-unaligned.S 
b/arch/arc/lib/memcpy-archs-unaligned.S
new file mode 100644
index ..e09b51d4de70
--- /dev/null
+++ b/arch/arc/lib/memcpy-archs-unaligned.S
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
+//
+// ARCv2 memcpy implementation optimized for unaligned memory access using.
+//
+// Copyright (C) 2019 Synopsys
+// Author: Eugeniy Paltsev 
+
+#include 
+
+#ifdef CONFIG_ARC_HAS_LL64
+# define LOADX(DST,RX) ldd.ab  DST, [RX, 8]
+# define STOREX(SRC,RX)std.ab  SRC, [RX, 8]
+# define ZOLSHFT   5
+# define ZOLAND0x1F
+#else
+# define LOADX(DST,RX) ld.ab   DST, [RX, 4]
+# define STOREX(SRC,RX)st.ab   SRC, [RX, 4]
+# define ZOLSHFT   4
+# define ZOLAND0xF
+#endif
+
+ENTRY_CFI(memcpy)
+   mov r3, r0  ; don;t clobber ret val
+
+   lsr.f   lp_count, r2, ZOLSHFT
+   lpnz@.Lcopy32_64bytes
+   ;; LOOP START
+   LOADX   (r6, r1)
+   LOADX   (r8, r1)
+   LOADX   (r10, r1)
+   LOADX   (r4, r1)
+   STOREX  (r6, r3)
+   STOREX  (r8, r3)
+   STOREX  (r10, r3)
+   STOREX  (r4, r3)
+.Lcopy32_64bytes:
+
+   and.f   lp_count, r2, ZOLAND ;Last remaining 31 bytes
+   lpnz@.Lcopyremainingbytes
+   ;; LOOP START
+   ldb.ab  r5, [r1, 1]
+   stb.ab  r5, [r3, 1]
+.Lcopyremainingbytes:
+
+   j   [blink]
+END_CFI(memcpy)
-- 
2.14.5


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH 4/5] ARCv2: use unaligned access in SW

2019-01-29 Thread Eugeniy Paltsev
Select HAVE_EFFICIENT_UNALIGNED_ACCESS and allow GCC to generate
unaligned data if we enable enable unaligned access in HW.

Signed-off-by: Eugeniy Paltsev 
---
 arch/arc/Kconfig  | 1 +
 arch/arc/Makefile | 6 ++
 2 files changed, 7 insertions(+)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 37c8aeefa3a5..a1d976c612a6 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -390,6 +390,7 @@ if ISA_ARCV2
 config ARC_USE_UNALIGNED_MEM_ACCESS
bool "Handle unaligned access in HW and use it"
default y
+   select HAVE_EFFICIENT_UNALIGNED_ACCESS
help
  The ARC HS architecture supports unaligned memory access
  which is disabled by default. Enable unaligned access in
diff --git a/arch/arc/Makefile b/arch/arc/Makefile
index df00578c279d..e2b991f75bc5 100644
--- a/arch/arc/Makefile
+++ b/arch/arc/Makefile
@@ -28,6 +28,12 @@ cflags-$(CONFIG_ARC_HAS_SWAPE)   += -mswape
 
 ifdef CONFIG_ISA_ARCV2
 
+ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
+cflags-y   += -munaligned-access
+else
+cflags-y   += -mno-unaligned-access
+endif
+
 ifndef CONFIG_ARC_HAS_LL64
 cflags-y   += -mno-ll64
 endif
-- 
2.14.5


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH 3/5] ARCv2: Enable unaligned access in early ASM code

2019-01-29 Thread Eugeniy Paltsev
Even though we do enable AD bit in arc_init_IRQ() we need to do
it in early ASM code otherwise we may face unaligned data until
we reach arc_init_IRQ() because GCC starting from v8.1.0 actively
generates unaligned data as it assumes that:
 * ARCv2 always has support of unaliged data
 * This support is turned on in runtime

Signed-off-by: Eugeniy Paltsev 
---
 arch/arc/kernel/head.S   | 14 ++
 arch/arc/kernel/intc-arcv2.c |  2 --
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
index 8b90d25a15cc..ffe3d384fca5 100644
--- a/arch/arc/kernel/head.S
+++ b/arch/arc/kernel/head.S
@@ -17,6 +17,9 @@
 #include 
 #include 
 #include 
+#ifdef CONFIG_ISA_ARCV2
+#include 
+#endif
 
 .macro CPU_EARLY_SETUP
 
@@ -47,6 +50,17 @@
sr  r5, [ARC_REG_DC_CTRL]
 
 1:
+
+   ; Enable / disable HW handling of unaligned access in the CPU.
+#ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
+   kflag   STATUS_AD_MASK
+#else
+   ; Handling of unaligned access is disabled by default but we disable it
+   ; manually in case of any bootloader enabled it earlier.
+   lr  r5, [ARC_REG_STATUS32]
+   bclrr5, r5, STATUS_AD_BIT
+   kflag   r5
+#endif
 .endm
 
.section .init.text, "ax",@progbits
diff --git a/arch/arc/kernel/intc-arcv2.c b/arch/arc/kernel/intc-arcv2.c
index 84b1c7157d1b..6359896da1ea 100644
--- a/arch/arc/kernel/intc-arcv2.c
+++ b/arch/arc/kernel/intc-arcv2.c
@@ -93,8 +93,6 @@ void arc_init_IRQ(void)
 
/* setup status32, don't enable intr yet as kernel doesn't want */
tmp = read_aux_reg(ARC_REG_STATUS32);
-   if (IS_ENABLED(ARC_USE_UNALIGNED_MEM_ACCESS))
-   tmp |= STATUS_AD_MASK;
tmp |= ARCV2_IRQ_DEF_PRIO << 1;
tmp &= ~STATUS_IE_MASK;
asm volatile("kflag %0  \n"::"r"(tmp));
-- 
2.14.5


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH 2/5] ARCv2: introduce unaligned access under a Kconfig option

2019-01-29 Thread Eugeniy Paltsev
As of today we enable unaligned access unconditionally on ARCv2.
Lets move it under Kconfig option so we can disable it in case of
using HW configuration which lacks of it.

Signed-off-by: Eugeniy Paltsev 
---
 arch/arc/Kconfig  | 8 
 arch/arc/include/asm/irqflags-arcv2.h | 4 
 arch/arc/kernel/intc-arcv2.c  | 4 +++-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
index 376366a7db81..37c8aeefa3a5 100644
--- a/arch/arc/Kconfig
+++ b/arch/arc/Kconfig
@@ -387,6 +387,14 @@ config ARC_HAS_SWAPE
 
 if ISA_ARCV2
 
+config ARC_USE_UNALIGNED_MEM_ACCESS
+   bool "Handle unaligned access in HW and use it"
+   default y
+   help
+ The ARC HS architecture supports unaligned memory access
+ which is disabled by default. Enable unaligned access in
+ hardware and use it in software.
+
 config ARC_HAS_LL64
bool "Insn: 64bit LDD/STD"
help
diff --git a/arch/arc/include/asm/irqflags-arcv2.h 
b/arch/arc/include/asm/irqflags-arcv2.h
index 8a4f77ea3238..9b911e2c6b31 100644
--- a/arch/arc/include/asm/irqflags-arcv2.h
+++ b/arch/arc/include/asm/irqflags-arcv2.h
@@ -44,8 +44,12 @@
 #define ARCV2_IRQ_DEF_PRIO 1
 
 /* seed value for status register */
+#ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
 #define ISA_INIT_STATUS_BITS   (STATUS_IE_MASK | STATUS_AD_MASK | \
(ARCV2_IRQ_DEF_PRIO << 1))
+#else
+#define ISA_INIT_STATUS_BITS   (STATUS_IE_MASK | (ARCV2_IRQ_DEF_PRIO << 1))
+#endif /* CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS */
 
 #ifndef __ASSEMBLY__
 
diff --git a/arch/arc/kernel/intc-arcv2.c b/arch/arc/kernel/intc-arcv2.c
index 067ea362fb3e..84b1c7157d1b 100644
--- a/arch/arc/kernel/intc-arcv2.c
+++ b/arch/arc/kernel/intc-arcv2.c
@@ -93,7 +93,9 @@ void arc_init_IRQ(void)
 
/* setup status32, don't enable intr yet as kernel doesn't want */
tmp = read_aux_reg(ARC_REG_STATUS32);
-   tmp |= STATUS_AD_MASK | (ARCV2_IRQ_DEF_PRIO << 1);
+   if (IS_ENABLED(ARC_USE_UNALIGNED_MEM_ACCESS))
+   tmp |= STATUS_AD_MASK;
+   tmp |= ARCV2_IRQ_DEF_PRIO << 1;
tmp &= ~STATUS_IE_MASK;
asm volatile("kflag %0  \n"::"r"(tmp));
 }
-- 
2.14.5


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH 0/5] introduce unaligned access under a Kconfig option

2019-01-29 Thread Eugeniy Paltsev
As of today we enable unaligned access unconditionally on ARCv2.
Lets move it under Kconfig option and use it actively in SW if it is
enabled.

While I'm at it fix and optimise ARCv2 memcpy implementaion.

Eugeniy Paltsev (5):
  ARCv2: lib: memcpy: fix doing prefetchw outside of buffer
  ARCv2: introduce unaligned access under a Kconfig option
  ARCv2: Enable unaligned access in early ASM code
  ARCv2: use unaligned access in SW
  ARCv2: LIB: MEMCPY: fixed and optimised routine

 arch/arc/Kconfig  | 13 ++
 arch/arc/Makefile |  6 +
 arch/arc/include/asm/irqflags-arcv2.h |  4 +++
 arch/arc/kernel/head.S| 14 +++
 arch/arc/kernel/intc-arcv2.c  |  2 +-
 arch/arc/lib/Makefile |  5 +++-
 arch/arc/lib/memcpy-archs-unaligned.S | 46 +++
 arch/arc/lib/memcpy-archs.S   | 14 ---
 8 files changed, 88 insertions(+), 16 deletions(-)
 create mode 100644 arch/arc/lib/memcpy-archs-unaligned.S

-- 
2.14.5


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH] ARC: [plat-hsdk]: Add support of Vivante GPU

2019-01-29 Thread Eugeniy Paltsev
HSDK board has built-in Vivante GPU IP which works perfectly fine
with Etnaviv driver, so let's use it.

Signed-off-by: Eugeniy Paltsev 
---
NOTE:
 * this patch has prerequisite:
   https://patchwork.kernel.org/patch/10766265/

 arch/arc/boot/dts/hsdk.dts  | 6 ++
 arch/arc/configs/hsdk_defconfig | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts
index 43f17b51ee89..ef892994f024 100644
--- a/arch/arc/boot/dts/hsdk.dts
+++ b/arch/arc/boot/dts/hsdk.dts
@@ -237,6 +237,12 @@
reg = <0>;
};
};
+
+   gpu_3d: gpu@9 {
+   compatible = "vivante,gc";
+   reg = <0x9 0x4000>;
+   interrupts = <28>;
+   };
};
 
memory@8000 {
diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig
index 87b23b7fb781..915e1cca31f8 100644
--- a/arch/arc/configs/hsdk_defconfig
+++ b/arch/arc/configs/hsdk_defconfig
@@ -52,6 +52,7 @@ CONFIG_GPIO_DWAPB=y
 CONFIG_DRM=y
 # CONFIG_DRM_FBDEV_EMULATION is not set
 CONFIG_DRM_UDL=y
+CONFIG_DRM_ETNAVIV=y
 CONFIG_FB=y
 CONFIG_FRAMEBUFFER_CONSOLE=y
 CONFIG_USB_EHCI_HCD=y
@@ -63,7 +64,6 @@ CONFIG_MMC=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_PLTFM=y
 CONFIG_MMC_DW=y
-# CONFIG_IOMMU_SUPPORT is not set
 CONFIG_EXT3_FS=y
 CONFIG_VFAT_FS=y
 CONFIG_TMPFS=y
-- 
2.14.5


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH] ARC: [plat-hsdk]: Add support of Vivante GPU

2019-01-29 Thread Lucas Stach
Am Dienstag, den 29.01.2019, 15:41 +0300 schrieb Eugeniy Paltsev:
> HSDK board has built-in Vivante GPU IP which works perfectly fine
> with Etnaviv driver, so let's use it.
> 
> > Signed-off-by: Eugeniy Paltsev 
> ---
> NOTE:
>  * this patch has prerequisite:
>    https://patchwork.kernel.org/patch/10766265/
> 
>  arch/arc/boot/dts/hsdk.dts  | 6 ++
>  arch/arc/configs/hsdk_defconfig | 2 +-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arc/boot/dts/hsdk.dts b/arch/arc/boot/dts/hsdk.dts
> index 43f17b51ee89..ef892994f024 100644
> --- a/arch/arc/boot/dts/hsdk.dts
> +++ b/arch/arc/boot/dts/hsdk.dts
> @@ -237,6 +237,12 @@
> >     reg = <0>;
> >     };
> >     };
> +
> > > + gpu_3d: gpu@9 {
> > +   compatible = "vivante,gc";
> > +   reg = <0x9 0x4000>;
> + interrupts = <28>;

Really no clock inputs? While the driver does not enforce this due to
backward compatibility issues, the binding says that some of the clocks
are mandatory. So I would really like to see them hooked up here, even
if it's just fixed always-on clocks.

Regards,
Lucas

> + };
> >     };
>  
> >     memory@8000 {
> diff --git a/arch/arc/configs/hsdk_defconfig b/arch/arc/configs/hsdk_defconfig
> index 87b23b7fb781..915e1cca31f8 100644
> --- a/arch/arc/configs/hsdk_defconfig
> +++ b/arch/arc/configs/hsdk_defconfig
> @@ -52,6 +52,7 @@ CONFIG_GPIO_DWAPB=y
>  CONFIG_DRM=y
>  # CONFIG_DRM_FBDEV_EMULATION is not set
>  CONFIG_DRM_UDL=y
> +CONFIG_DRM_ETNAVIV=y
>  CONFIG_FB=y
>  CONFIG_FRAMEBUFFER_CONSOLE=y
>  CONFIG_USB_EHCI_HCD=y
> @@ -63,7 +64,6 @@ CONFIG_MMC=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_PLTFM=y
>  CONFIG_MMC_DW=y
> -# CONFIG_IOMMU_SUPPORT is not set
>  CONFIG_EXT3_FS=y
>  CONFIG_VFAT_FS=y
>  CONFIG_TMPFS=y

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

RE: [PATCH] [ARC]: Enable init_array support

2019-01-29 Thread Claudiu Zissulescu


2019-xx-xx  Vineet Gupta 

* gcc/config.gcc: Force .init_array for ARC

Signed-off-by: Vineet Gupta 
---

Hi,

Thank you for your contribution. I'll push it asap.

Cheers,
Claudiu
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 1/2] ARCv2: Enable unaligned access in early ASM code

2019-01-29 Thread Vineet Gupta
On 1/28/19 11:27 PM, Alexey Brodkin wrote:
> Hi Vineet,
>
>> -Original Message-
>> From: Eugeniy Paltsev 
>> Sent: Wednesday, January 16, 2019 2:30 PM
>> To: linux-snps-arc@lists.infradead.org; Vineet Gupta 
>> Cc: linux-ker...@vger.kernel.org; Alexey Brodkin ; 
>> Eugeniy Paltsev
>> 
>> Subject: [PATCH 1/2] ARCv2: Enable unaligned access in early ASM code
>>
>> Even though we do enable AD bit in arc_init_IRQ() we need to do
>> it in early ASM code otherwise we may face unaligned data until
>> we reach arc_init_IRQ() because GCC starting from v8.1.0 actively
>> generates unaligned data as it assumes that:
>>  * ARCv2 always has support of unaliged data
>>  * This support is turned on in runtime
>>
>> Signed-off-by: Eugeniy Paltsev 
> I remember you wanted to have a Kconfig toggle for unaligned access support
> but since this commit is more of a fix for existing (always enabling)
> implementation and so I propose to accept is as it is and moreover backport
> to stable kernels.
>
> And in the separate change introduce discussed Kconfig toggle so we may test
> RTL with unaligned support disabled.
>
> Sounds good?

Fair enough. And to avoid backport merge conflicts we need to keep the redundant
AD bit setting in intc-arcv2.c and rework in Eugeniy's series.

-Vineet

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 1/2] ARCv2: Enable unaligned access in early ASM code

2019-01-29 Thread Vineet Gupta
On 1/16/19 3:29 AM, Eugeniy Paltsev wrote:
> Even though we do enable AD bit in arc_init_IRQ() we need to do
> it in early ASM code otherwise we may face unaligned data until
> we reach arc_init_IRQ() because GCC starting from v8.1.0 actively
> generates unaligned data as it assumes that:
>  * ARCv2 always has support of unaliged data
>  * This support is turned on in runtime
> 
> Signed-off-by: Eugeniy Paltsev 
> ---
>  arch/arc/kernel/head.S | 10 ++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
> index 8b90d25a15cc..d5b7a572365a 100644
> --- a/arch/arc/kernel/head.S
> +++ b/arch/arc/kernel/head.S
> @@ -17,6 +17,9 @@
>  #include 
>  #include 
>  #include 
> +#ifdef CONFIG_ISA_ARCV2
> +#include 
> +#endif

I presume there is no specific reason to include this conditionally.
irqflags.h already includes the right version.

>  
>  .macro CPU_EARLY_SETUP
>  
> @@ -47,6 +50,13 @@
>   sr  r5, [ARC_REG_DC_CTRL]
>  
>  1:
> +
> +#ifdef CONFIG_ISA_ARCV2
> + ; Enable handling of unaligned access in the CPU as by default
> + ; this HW feature is disabled while GCC starting from 8.1.0
> + ; unconditionally uses it for ARC HS cores.
> + flag1 << STATUS_AD_BIT
> +#endif
>  .endm
>  
>   .section .init.text, "ax",@progbits
> 


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 1/2] ARCv2: Enable unaligned access in early ASM code

2019-01-29 Thread Eugeniy Paltsev
On Tue, 2019-01-29 at 09:21 -0800, Vineet Gupta wrote:
> On 1/16/19 3:29 AM, Eugeniy Paltsev wrote:
> > Even though we do enable AD bit in arc_init_IRQ() we need to do
> > it in early ASM code otherwise we may face unaligned data until
> > we reach arc_init_IRQ() because GCC starting from v8.1.0 actively
> > generates unaligned data as it assumes that:
> >  * ARCv2 always has support of unaliged data
> >  * This support is turned on in runtime
> > 
> > Signed-off-by: Eugeniy Paltsev 
> > ---
> >  arch/arc/kernel/head.S | 10 ++
> >  1 file changed, 10 insertions(+)
> > 
> > diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
> > index 8b90d25a15cc..d5b7a572365a 100644
> > --- a/arch/arc/kernel/head.S
> > +++ b/arch/arc/kernel/head.S
> > @@ -17,6 +17,9 @@
> >  #include 
> >  #include 
> >  #include 
> > +#ifdef CONFIG_ISA_ARCV2
> > +#include 
> > +#endif
> 
> I presume there is no specific reason to include this conditionally.
> irqflags.h already includes the right version.

Agree.
I've just forgotten about common irqflags.h

Will fix in V2.

> >  
> >  .macro CPU_EARLY_SETUP
> >  
> > @@ -47,6 +50,13 @@
> > sr  r5, [ARC_REG_DC_CTRL]
> >  
> >  1:
> > +
> > +#ifdef CONFIG_ISA_ARCV2
> > +   ; Enable handling of unaligned access in the CPU as by default
> > +   ; this HW feature is disabled while GCC starting from 8.1.0
> > +   ; unconditionally uses it for ARC HS cores.
> > +   flag1 << STATUS_AD_BIT
> > +#endif
> >  .endm
> >  
> > .section .init.text, "ax",@progbits
> > 
> 
> 
-- 
 Eugeniy Paltsev
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 1/2] ARCv2: Enable unaligned access in early ASM code

2019-01-29 Thread Vineet Gupta
On 1/29/19 9:26 AM, Eugeniy Paltsev wrote:
>> I presume there is no specific reason to include this conditionally.
>> irqflags.h already includes the right version.
> Agree.
> I've just forgotten about common irqflags.h

No need for this series. Given Alexey's request, I've pushed the minimal patch.
You do need to rebase the other unalinged access series on top, however wait for
me to comment on that.

-Vineet

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 1/2] ARCv2: Enable unaligned access in early ASM code

2019-01-29 Thread Eugeniy Paltsev
On Tue, 2019-01-29 at 09:28 -0800, Vineet Gupta wrote:
> On 1/29/19 9:26 AM, Eugeniy Paltsev wrote:
> > > I presume there is no specific reason to include this conditionally.
> > > irqflags.h already includes the right version.
> > 
> > Agree.
> > I've just forgotten about common irqflags.h
> 
> No need for this series. Given Alexey's request, I've pushed the minimal 
> patch.
> You do need to rebase the other unalinged access series on top, however wait 
> for
> me to comment on that.

Ok.

> -Vineet
> 
-- 
 Eugeniy Paltsev
___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 2/5] ARCv2: introduce unaligned access under a Kconfig option

2019-01-29 Thread Vineet Gupta
On 1/29/19 2:49 AM, Eugeniy Paltsev wrote:
> As of today we enable unaligned access unconditionally on ARCv2.
> Lets move it under Kconfig option so we can disable it in case of
> using HW configuration which lacks of it.
>
> Signed-off-by: Eugeniy Paltsev 
> ---
>  arch/arc/Kconfig  | 8 
>  arch/arc/include/asm/irqflags-arcv2.h | 4 
>  arch/arc/kernel/intc-arcv2.c  | 4 +++-
>  3 files changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
> index 376366a7db81..37c8aeefa3a5 100644
> --- a/arch/arc/Kconfig
> +++ b/arch/arc/Kconfig
> @@ -387,6 +387,14 @@ config ARC_HAS_SWAPE
>  
>  if ISA_ARCV2
>  
> +config ARC_USE_UNALIGNED_MEM_ACCESS
> + bool "Handle unaligned access in HW and use it"
> + default y
> + help
> +   The ARC HS architecture supports unaligned memory access
> +   which is disabled by default. Enable unaligned access in
> +   hardware and use it in software.
> +
>  config ARC_HAS_LL64
>   bool "Insn: 64bit LDD/STD"
>   help
> diff --git a/arch/arc/include/asm/irqflags-arcv2.h 
> b/arch/arc/include/asm/irqflags-arcv2.h
> index 8a4f77ea3238..9b911e2c6b31 100644
> --- a/arch/arc/include/asm/irqflags-arcv2.h
> +++ b/arch/arc/include/asm/irqflags-arcv2.h
> @@ -44,8 +44,12 @@
>  #define ARCV2_IRQ_DEF_PRIO   1
>  
>  /* seed value for status register */
> +#ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
>  #define ISA_INIT_STATUS_BITS (STATUS_IE_MASK | STATUS_AD_MASK | \
>   (ARCV2_IRQ_DEF_PRIO << 1))
> +#else
> +#define ISA_INIT_STATUS_BITS (STATUS_IE_MASK | (ARCV2_IRQ_DEF_PRIO << 1))
> +#endif /* CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS */

I'd prefer to change the define of STATUS_AD_MASK itself and keep all of this
unchanged !

>  
>  #ifndef __ASSEMBLY__
>  
> diff --git a/arch/arc/kernel/intc-arcv2.c b/arch/arc/kernel/intc-arcv2.c
> index 067ea362fb3e..84b1c7157d1b 100644
> --- a/arch/arc/kernel/intc-arcv2.c
> +++ b/arch/arc/kernel/intc-arcv2.c
> @@ -93,7 +93,9 @@ void arc_init_IRQ(void)
>  
>   /* setup status32, don't enable intr yet as kernel doesn't want */
>   tmp = read_aux_reg(ARC_REG_STATUS32);
> - tmp |= STATUS_AD_MASK | (ARCV2_IRQ_DEF_PRIO << 1);
> + if (IS_ENABLED(ARC_USE_UNALIGNED_MEM_ACCESS))
> + tmp |= STATUS_AD_MASK;
> + tmp |= ARCV2_IRQ_DEF_PRIO << 1;

This will change after rebase as we just need to delete the code here, done in 
head.S

>   tmp &= ~STATUS_IE_MASK;
>   asm volatile("kflag %0  \n"::"r"(tmp));
>  }


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 5/5] ARCv2: LIB: MEMCPY: fixed and optimised routine

2019-01-29 Thread Vineet Gupta
On 1/29/19 2:49 AM, Eugeniy Paltsev wrote:
> Optimise code to use efficient unaligned memory access which is
> available on ARCv2. This allows us to really simplify memcpy code
> and speed up the code one and a half times (in case of unaligned
> source or destination).
>
> Signed-off-by: Eugeniy Paltsev 
> ---
>  arch/arc/Kconfig  |  4 +++
>  arch/arc/lib/Makefile |  5 +++-
>  arch/arc/lib/memcpy-archs-unaligned.S | 46 
> +++
>  3 files changed, 54 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arc/lib/memcpy-archs-unaligned.S
>
> diff --git a/arch/arc/Kconfig b/arch/arc/Kconfig
> index a1d976c612a6..88f1a3205b8f 100644
> --- a/arch/arc/Kconfig
> +++ b/arch/arc/Kconfig
> @@ -396,6 +396,10 @@ config ARC_USE_UNALIGNED_MEM_ACCESS
> which is disabled by default. Enable unaligned access in
> hardware and use it in software.
>  
> +#dummy symbol for using in makefile
> +config ARC_NO_UNALIGNED_MEM_ACCESS
> + def_bool !ARC_USE_UNALIGNED_MEM_ACCESS
> +

Not needed - you can use the kconfig symbols in Makefile.
See arch/arc/kernel/Makefile

>  config ARC_HAS_LL64
>   bool "Insn: 64bit LDD/STD"
>   help
> diff --git a/arch/arc/lib/Makefile b/arch/arc/lib/Makefile
> index b1656d156097..59cc8b61342e 100644
> --- a/arch/arc/lib/Makefile
> +++ b/arch/arc/lib/Makefile
> @@ -8,4 +8,7 @@
>  lib-y:= strchr-700.o strcpy-700.o strlen.o memcmp.o
>  
>  lib-$(CONFIG_ISA_ARCOMPACT)  += memcpy-700.o memset.o strcmp.o
> -lib-$(CONFIG_ISA_ARCV2)  += memcpy-archs.o memset-archs.o 
> strcmp-archs.o
> +lib-$(CONFIG_ISA_ARCV2)  += memset-archs.o strcmp-archs.o
> +
> +lib-$(CONFIG_ARC_NO_UNALIGNED_MEM_ACCESS)+= memcpy-archs.o
> +lib-$(CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS)   += memcpy-archs-unaligned.o

ifdef CONFIG_ARC_USE_UNALIGNED_MEM_ACCESS
lib-$(CONFIG_ISA_ARCV2) +=memcpy-archs-unaligned.o
else
lib-$(CONFIG_ISA_ARCV2) +=memcpy-archs.o
endif

> diff --git a/arch/arc/lib/memcpy-archs-unaligned.S 
> b/arch/arc/lib/memcpy-archs-unaligned.S
> new file mode 100644
> index ..e09b51d4de70
> --- /dev/null
> +++ b/arch/arc/lib/memcpy-archs-unaligned.S
> @@ -0,0 +1,46 @@
> +/* SPDX-License-Identifier: GPL-2.0+ */
> +//
> +// ARCv2 memcpy implementation optimized for unaligned memory access using.
> +//
> +// Copyright (C) 2019 Synopsys
> +// Author: Eugeniy Paltsev 
> +
> +#include 
> +
> +#ifdef CONFIG_ARC_HAS_LL64
> +# define LOADX(DST,RX)   ldd.ab  DST, [RX, 8]
> +# define STOREX(SRC,RX)  std.ab  SRC, [RX, 8]
> +# define ZOLSHFT 5
> +# define ZOLAND  0x1F
> +#else
> +# define LOADX(DST,RX)   ld.ab   DST, [RX, 4]
> +# define STOREX(SRC,RX)  st.ab   SRC, [RX, 4]
> +# define ZOLSHFT 4
> +# define ZOLAND  0xF
> +#endif
> +
> +ENTRY_CFI(memcpy)
> + mov r3, r0  ; don;t clobber ret val
> +
> + lsr.f   lp_count, r2, ZOLSHFT
> + lpnz@.Lcopy32_64bytes
> + ;; LOOP START
> + LOADX   (r6, r1)
> + LOADX   (r8, r1)
> + LOADX   (r10, r1)
> + LOADX   (r4, r1)
> + STOREX  (r6, r3)
> + STOREX  (r8, r3)
> + STOREX  (r10, r3)
> + STOREX  (r4, r3)
> +.Lcopy32_64bytes:
> +
> + and.f   lp_count, r2, ZOLAND ;Last remaining 31 bytes
> + lpnz@.Lcopyremainingbytes
> + ;; LOOP START
> + ldb.ab  r5, [r1, 1]
> + stb.ab  r5, [r3, 1]



> +.Lcopyremainingbytes:
> +
> + j   [blink]
> +END_CFI(memcpy)


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH 13/21] ARC: Build Infrastructure

2019-01-29 Thread Vineet Gupta
On 12/20/18 3:24 PM, Joseph Myers wrote:
> On Thu, 20 Dec 2018, Vineet Gupta wrote:
> 
>> On 12/19/18 2:17 PM, Joseph Myers wrote:
>>> I should note a separate issue to consider: that of *static* PIE support.  
>>> That doesn't need to be working, but if it's not working,
>>
>> Aren't there directed test cases for that already ?
>>
>> PASS: elf/tst-tls1-static
>> PASS: elf/tst-tls1-static-non-pie
>> FAIL: gmon/tst-gmon-pie-gprof
> 
> The key point on the PortStatus page is "If linker can correctly generate 
> static PIE, glibc test results should be identical with and without 
> --enable-static-pie.".  You need to test a build configured with 
> --enable-static-pie to see if this is fully working.

Unfortunately this doesn't seem to work.

ld bails out when linking elf/sln. It can't seem to resolve the _DYNAMIC@pcl in
elf_machine_load_address(). We can look into this but presume it is not a deal
breaker.


~/BR/host/bin/arc-buildroot-linux-gnu-gcc
-nostdlib -nostartfiles
*-static*
-o ~/BR/build/glibc-2f9a78f208a7/build/elf/sln
*-static-pie*
~/BR/build/glibc-2f9a78f208a7/build/csu/rcrt1.o
~/BR/build/glibc-2f9a78f208a7/build/csu/crti.o
`~/BR/host/bin/arc-buildroot-linux-gnu-gcc  --print-file-name=crtbeginS.o`
~/BR/build/glibc-2f9a78f208a7/build/elf/sln.o
~/BR/build/glibc-2f9a78f208a7/build/elf/static-stubs.o
-Wl,--start-group
~/BR/build/glibc-2f9a78f208a7/build/libc.a -lgcc
-Wl,--end-group
`~/BR/host/bin/arc-buildroot-linux-gnu-gcc  --print-file-name=crtendS.o`
~/BR/build/glibc-2f9a78f208a7/build/csu/crtn.o

~/BR/host/lib/gcc/arc-buildroot-linux-gnu/8.2.1/../../../../arc-buildroot-linux-gnu/bin/ld:
~/BR/build/glibc-2f9a78f208a7/build/libc.a(dl-reloc-static-pie.o): in function
`elf_machine_load_address':
~/BR/build:/glibc-2f9a78f208a7/elf/../sysdeps/arc/dl-machine.h:115: undefined
reference to `_DYNAMIC'
~/BR/host/lib/gcc/arc-buildroot-linux-gnu/8.2.1/../../../../arc-buildroot-linux-gnu/bin/ld:
~/BR/build/glibc-2f9a78f208a7/elf/../sysdeps/arc/dl-machine.h:115: undefined
reference to `_DYNAMIC'
collect2: error: ld returned 1 exit status

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH v2 15/15] make-syscalls.sh: fix comment referencing syscall-template

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog | 2 ++
 sysdeps/unix/make-syscalls.sh | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 8c1fc3d2cdcb..3c73507df5f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -101,6 +101,8 @@
* sysdeps/unix/sysv/linux/arc/shlib-versions: New file.
* scripts/build-many-glibcs.py: Enable building for ARC.
* NEW: Mention ARC port.
+   * sysdeps/unix/make-syscalls.sh: Fix comment referencing
+   syscall-template file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
index e39b2d6d5214..6a5c10d54e87 100644
--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -7,7 +7,7 @@
 #
 # This script is used to process the syscall data encoded in the various
 # syscalls.list files to produce thin assembly syscall wrappers around the
-# appropriate OS syscall. See syscall-template.s for more details on the
+# appropriate OS syscall. See syscall-template.S for more details on the
 # actual wrapper.
 #
 # Syscall Signature Prefixes:
-- 
2.7.4


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH v2 07/15] ARC: Linux Syscall Interface

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog |  13 ++
 sysdeps/unix/sysv/linux/arc/clone.S   |  98 ++
 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h  |   6 +
 sysdeps/unix/sysv/linux/arc/kernel-features.h |  28 +++
 sysdeps/unix/sysv/linux/arc/mmap_internal.h   |  27 +++
 sysdeps/unix/sysv/linux/arc/profil-counter.h  |   2 +
 sysdeps/unix/sysv/linux/arc/pt-vfork.S|   1 +
 sysdeps/unix/sysv/linux/arc/sigaction.c   |  31 
 sysdeps/unix/sysv/linux/arc/sigrestorer.S |  29 +++
 sysdeps/unix/sysv/linux/arc/syscall.S |  38 
 sysdeps/unix/sysv/linux/arc/syscalls.list |   3 +
 sysdeps/unix/sysv/linux/arc/sysdep.c  |  33 
 sysdeps/unix/sysv/linux/arc/sysdep.h  | 251 ++
 sysdeps/unix/sysv/linux/arc/vfork.S   |  42 +
 14 files changed, 602 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/arc/clone.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/kernel-features.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/mmap_internal.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/profil-counter.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/pt-vfork.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigaction.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigrestorer.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscall.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/syscalls.list
 create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/sysdep.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/vfork.S

diff --git a/ChangeLog b/ChangeLog
index 1cf28bbbf96f..b5da8c28e64c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,19 @@
* sysdeps/arc/nofpu/math-tests-exceptions.h: New file.
* sysdeps/arc/nofpu/math-tests-rounding.h: New file.
* sysdeps/arc/sfp-machine.h: New file.
+   * sysdeps/unix/sysv/linux/arc/clone.S: New file.
+   * sysdeps/unix/sysv/linux/arc/jmp_buf-macros.h: New file.
+   * sysdeps/unix/sysv/linux/arc/kernel-features.h: New file.
+   * sysdeps/unix/sysv/linux/arc/mmap_internal.h: New file.
+   * sysdeps/unix/sysv/linux/arc/profil-counter.h: New file.
+   * sysdeps/unix/sysv/linux/arc/pt-vfork.S: New file.
+   * sysdeps/unix/sysv/linux/arc/sigaction.c: New file.
+   * sysdeps/unix/sysv/linux/arc/sigrestorer.S: New file.
+   * sysdeps/unix/sysv/linux/arc/syscall.S: New file.
+   * sysdeps/unix/sysv/linux/arc/syscalls.list: New file.
+   * sysdeps/unix/sysv/linux/arc/sysdep.c: New file.
+   * sysdeps/unix/sysv/linux/arc/sysdep.h: New file.
+   * sysdeps/unix/sysv/linux/arc/vfork.S: New file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/unix/sysv/linux/arc/clone.S 
b/sysdeps/unix/sysv/linux/arc/clone.S
new file mode 100644
index ..55c2a2b60ed8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arc/clone.S
@@ -0,0 +1,98 @@
+/* clone() implementation for ARC.
+   Copyright (C) 2008-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Andrew Jenner , 2008.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   .  */
+
+
+#include 
+#define _ERRNO_H   1
+#include 
+#include 
+
+#define CLONE_SETTLS   0x0008
+
+/* int clone(int (*fn)(void *), void *child_stack,
+   int flags, void *arg, ...
+   < pid_t *ptid, struct user_desc *tls, pid_t *ctid > );
+
+ NOTE: I'm assuming that the last 3 args are NOT var-args and in case all
+   3 are not relevant, caller will nevertheless pass those as NULL.
+
+ clone syscall in kernel (ABI: CONFIG_CLONE_BACKWARDS)
+
+  int sys_clone(unsigned long int clone_flags,
+   unsigned long int newsp,
+   int __user *parent_tidptr,
+   void *tls,
+   int __user *child_tidptr).  */
+
+ENTRY (__clone)
+   cmp r0, 0   ; @fn can't be NULL
+   cmp.ne  r1, 0   ; @child_stack can't be NULL
+   bz  .L__sys_err
+
+   ; save some of the orig args
+   ; r0 containg @fn will be clobbered AFTER syscall (with ret val)
+   ; rest are clobbered BEFORE syscall due to different arg ordering
+   mov r10, r0 ; @fn
+   mov r11

[PATCH v2 02/15] ARC: ABI Implementation

2019-01-29 Thread Vineet Gupta
This code deals with the ARC ABI.

Signed-off-by: Vineet Gupta 
---
 ChangeLog| 18 ++
 sysdeps/arc/__longjmp.S  | 50 +++
 sysdeps/arc/abort-instr.h|  2 ++
 sysdeps/arc/bits/endian.h| 12 +++
 sysdeps/arc/bits/setjmp.h| 26 ++
 sysdeps/arc/bsd-_setjmp.S|  1 +
 sysdeps/arc/bsd-setjmp.S |  1 +
 sysdeps/arc/dl-runtime.c | 39 +
 sysdeps/arc/dl-sysdep.h  | 25 ++
 sysdeps/arc/dl-trampoline.S  | 80 
 sysdeps/arc/gccframe.h   | 21 
 sysdeps/arc/gmp-mparam.h | 23 +
 sysdeps/arc/jmpbuf-offsets.h | 47 ++
 sysdeps/arc/jmpbuf-unwind.h  | 47 ++
 sysdeps/arc/machine-gmon.h   | 35 +++
 sysdeps/arc/memusage.h   | 23 +
 sysdeps/arc/setjmp.S | 66 
 sysdeps/arc/sysdep.h | 48 ++
 sysdeps/arc/tls-macros.h | 47 ++
 19 files changed, 611 insertions(+)
 create mode 100644 sysdeps/arc/__longjmp.S
 create mode 100644 sysdeps/arc/abort-instr.h
 create mode 100644 sysdeps/arc/bits/endian.h
 create mode 100644 sysdeps/arc/bits/setjmp.h
 create mode 100644 sysdeps/arc/bsd-_setjmp.S
 create mode 100644 sysdeps/arc/bsd-setjmp.S
 create mode 100644 sysdeps/arc/dl-runtime.c
 create mode 100644 sysdeps/arc/dl-sysdep.h
 create mode 100644 sysdeps/arc/dl-trampoline.S
 create mode 100644 sysdeps/arc/gccframe.h
 create mode 100644 sysdeps/arc/gmp-mparam.h
 create mode 100644 sysdeps/arc/jmpbuf-offsets.h
 create mode 100644 sysdeps/arc/jmpbuf-unwind.h
 create mode 100644 sysdeps/arc/machine-gmon.h
 create mode 100644 sysdeps/arc/memusage.h
 create mode 100644 sysdeps/arc/setjmp.S
 create mode 100644 sysdeps/arc/sysdep.h
 create mode 100644 sysdeps/arc/tls-macros.h

diff --git a/ChangeLog b/ChangeLog
index e2091865afb5..ec8f6a0a9238 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,24 @@
 2019-01-21  Vineet Gupta 
 
* elf/elf.h: add defines for ARC.
+   * sysdeps/arc/__longjmp.S: New file.
+   * sysdeps/arc/abort-instr.h: New file.
+   * sysdeps/arc/bits/endian.h: New file.
+   * sysdeps/arc/bits/setjmp.h: New file.
+   * sysdeps/arc/bsd-_setjmp.S: New file.
+   * sysdeps/arc/bsd-setjmp.S: New file.
+   * sysdeps/arc/dl-runtime.c: New file.
+   * sysdeps/arc/dl-sysdep.h: New file.
+   * sysdeps/arc/dl-trampoline.S: New file.
+   * sysdeps/arc/gccframe.h: New file.
+   * sysdeps/arc/gmp-mparam.h: New file.
+   * sysdeps/arc/jmpbuf-offsets.h: New file.
+   * sysdeps/arc/jmpbuf-unwind.h: New file.
+   * sysdeps/arc/machine-gmon.h: New file.
+   * sysdeps/arc/memusage.h: New file.
+   * sysdeps/arc/setjmp.S: New file.
+   * sysdeps/arc/sysdep.h: New file.
+   * sysdeps/arc/tls-macros.h: New file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/arc/__longjmp.S b/sysdeps/arc/__longjmp.S
new file mode 100644
index ..8296aa445f63
--- /dev/null
+++ b/sysdeps/arc/__longjmp.S
@@ -0,0 +1,50 @@
+/* longjmp for ARC.
+   Copyright (C) 2017-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public License as
+   published by the Free Software Foundation; either version 2.1 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   .  */
+
+#include 
+#include 
+
+;@ r0 = jump buffer from which regs will be restored
+;@ r1 = value that setjmp( ) will return due to this longjmp
+
+ENTRY (__longjmp)
+
+   ld_s r13,   [r0]
+   ld_s r14,   [r0,4]
+   ld   r15,   [r0,8]
+   ld   r16,   [r0,12]
+   ld   r17,   [r0,16]
+   ld   r18,   [r0,20]
+   ld   r19,   [r0,24]
+   ld   r20,   [r0,28]
+   ld   r21,   [r0,32]
+   ld   r22,   [r0,36]
+   ld   r23,   [r0,40]
+   ld   r24,   [r0,44]
+   ld   r25,   [r0,48]
+
+   ld   blink, [r0,60]
+   ld   fp,[r0,52]
+   ld   sp,[r0,56]
+
+   mov.f  r0, r1   ; get the setjmp return value(due to longjmp) in place
+
+   j.d[blink]  ; to caller of setjmp location, right after the call
+   mov.z  r0, 1; can't let setjmp return 0 when it is due to longjmp
+
+END (__longjmp)
diff --git a/sysdeps/arc/abort-instr.h b/sysdeps/arc/abort-instr.h
new file mode 100644
index ..49f33613c404
--- 

[PATCH v2 06/15] ARC: math soft float support

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog |  5 +++
 sysdeps/arc/bits/fenv.h   | 72 ++
 sysdeps/arc/nofpu/Implies |  1 +
 sysdeps/arc/nofpu/math-tests-exceptions.h | 27 
 sysdeps/arc/nofpu/math-tests-rounding.h   | 27 
 sysdeps/arc/sfp-machine.h | 73 +++
 6 files changed, 205 insertions(+)
 create mode 100644 sysdeps/arc/bits/fenv.h
 create mode 100644 sysdeps/arc/nofpu/Implies
 create mode 100644 sysdeps/arc/nofpu/math-tests-exceptions.h
 create mode 100644 sysdeps/arc/nofpu/math-tests-rounding.h
 create mode 100644 sysdeps/arc/sfp-machine.h

diff --git a/ChangeLog b/ChangeLog
index 5406e4c16fc2..1cf28bbbf96f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -34,6 +34,11 @@
* sysdeps/arc/atomic-machine.h: New file.
* sysdeps/arc/nptl/bits/pthreadtypes-arch.h: New file.
* sysdeps/arc/nptl/bits/semaphore.h: New file.
+   * sysdeps/arc/bits/fenv.h: New file.
+   * sysdeps/arc/nofpu/Implies: New file.
+   * sysdeps/arc/nofpu/math-tests-exceptions.h: New file.
+   * sysdeps/arc/nofpu/math-tests-rounding.h: New file.
+   * sysdeps/arc/sfp-machine.h: New file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/arc/bits/fenv.h b/sysdeps/arc/bits/fenv.h
new file mode 100644
index ..58388fb43a35
--- /dev/null
+++ b/sysdeps/arc/bits/fenv.h
@@ -0,0 +1,72 @@
+/* Copyright (C) 2012-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   .  */
+
+#ifndef _FENV_H
+# error "Never use  directly; include  instead."
+#endif
+
+enum
+  {
+FE_INVALID   =
+# define FE_INVALID(0x01)
+  FE_INVALID,
+FE_DIVBYZERO =
+# define FE_DIVBYZERO  (0x02)
+  FE_DIVBYZERO,
+FE_OVERFLOW  =
+# define FE_OVERFLOW   (0x04)
+  FE_OVERFLOW,
+FE_UNDERFLOW =
+# define FE_UNDERFLOW  (0x08)
+  FE_UNDERFLOW,
+FE_INEXACT   =
+# define FE_INEXACT(0x10)
+  FE_INEXACT
+  };
+
+# define FE_ALL_EXCEPT \
+   (FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
+
+enum
+  {
+FE_TOWARDZERO =
+# define FE_TOWARDZERO (0x0)
+  FE_TOWARDZERO,
+FE_TONEAREST  =
+# define FE_TONEAREST  (0x1)
+  FE_TONEAREST,
+FE_UPWARD =
+# define FE_UPWARD (0x2)
+  FE_UPWARD,
+FE_DOWNWARD   =
+# define FE_DOWNWARD   (0x3)
+  FE_DOWNWARD
+  };
+
+typedef unsigned int fexcept_t;
+typedef unsigned int fenv_t;
+
+/* If the default argument is used we use this value.  */
+#define FE_DFL_ENV ((const fenv_t *) -1)
+
+#if __GLIBC_USE (IEC_60559_BFP_EXT)
+/* Type representing floating-point control modes.  */
+typedef unsigned int femode_t;
+
+/* Default floating-point control modes.  */
+# define FE_DFL_MODE   ((const femode_t *) -1L)
+#endif
diff --git a/sysdeps/arc/nofpu/Implies b/sysdeps/arc/nofpu/Implies
new file mode 100644
index ..abcbadb25f22
--- /dev/null
+++ b/sysdeps/arc/nofpu/Implies
@@ -0,0 +1 @@
+ieee754/soft-fp
diff --git a/sysdeps/arc/nofpu/math-tests-exceptions.h 
b/sysdeps/arc/nofpu/math-tests-exceptions.h
new file mode 100644
index ..f5c0b73589ed
--- /dev/null
+++ b/sysdeps/arc/nofpu/math-tests-exceptions.h
@@ -0,0 +1,27 @@
+/* Configuration for math tests. exceptions support ARC version.
+   Copyright (C) 2017-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   .  */
+
+#ifndef ARC_NOFPU_MATH_TESTS_EXCEPTIONS_H
+#define ARC_NOFPU_MATH_TESTS_EXCEPTIONS_H 1
+
+/* Soft-float doesnot support exceptions.  */
+#defin

[PATCH v2 03/15] ARC: startup and dynamic linking code

2019-01-29 Thread Vineet Gupta
Code for C runtime startup and dynamic loading including PLT layout.

Signed-off-by: Vineet Gupta 
---
 ChangeLog |   7 +
 sysdeps/arc/bits/link.h   |  52 +++
 sysdeps/arc/dl-machine.h  | 340 ++
 sysdeps/arc/entry.h   |   5 +
 sysdeps/arc/ldsodefs.h|  43 ++
 sysdeps/arc/sotruss-lib.c |  51 +++
 sysdeps/arc/start.S   |  89 
 sysdeps/arc/tst-audit.h   |  23 
 8 files changed, 610 insertions(+)
 create mode 100644 sysdeps/arc/bits/link.h
 create mode 100644 sysdeps/arc/dl-machine.h
 create mode 100644 sysdeps/arc/entry.h
 create mode 100644 sysdeps/arc/ldsodefs.h
 create mode 100644 sysdeps/arc/sotruss-lib.c
 create mode 100644 sysdeps/arc/start.S
 create mode 100644 sysdeps/arc/tst-audit.h

diff --git a/ChangeLog b/ChangeLog
index ec8f6a0a9238..43d031a05141 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,13 @@
* sysdeps/arc/setjmp.S: New file.
* sysdeps/arc/sysdep.h: New file.
* sysdeps/arc/tls-macros.h: New file.
+   * sysdeps/arc/bits/link.h: New file.
+   * sysdeps/arc/dl-machine.h: New file.
+   * sysdeps/arc/entry.h: New file.
+   * sysdeps/arc/ldsodefs.h: New file.
+   * sysdeps/arc/sotruss-lib.c: New file.
+   * sysdeps/arc/start.S: New file.
+   * sysdeps/arc/tst-audit.h: New file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/arc/bits/link.h b/sysdeps/arc/bits/link.h
new file mode 100644
index ..c4508ab66649
--- /dev/null
+++ b/sysdeps/arc/bits/link.h
@@ -0,0 +1,52 @@
+/* Machine-specific declarations for dynamic linker interface, ARC version.
+   Copyright (C) 2009-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   .  */
+
+#ifndef_LINK_H
+# error "Never include  directly; use  instead."
+#endif
+
+/* Registers for entry into PLT on ARC.  */
+typedef struct La_arc_regs
+{
+  uint32_t lr_reg[8]; /* r0 through r7 (upto 8 args).  */
+} La_arc_regs;
+
+/* Return values for calls from PLT on ARC.  */
+typedef struct La_arc_retval
+{
+  /* For ARCv2, a 64-bit integer return value can use 2 regs.  */
+  uint32_t lrv_reg[2];
+} La_arc_retval;
+
+__BEGIN_DECLS
+
+extern ElfW(Addr) la_arc_gnu_pltenter (ElfW(Sym) *__sym, unsigned int __ndx,
+uintptr_t *__refcook,
+uintptr_t *__defcook,
+La_arc_regs *__regs,
+unsigned int *__flags,
+const char *__symname,
+long int *__framesizep);
+extern unsigned int la_arc_gnu_pltexit (ElfW(Sym) *__sym, unsigned int __ndx,
+ uintptr_t *__refcook,
+ uintptr_t *__defcook,
+ const La_arc_regs *__inregs,
+ La_arc_retval *__outregs,
+ const char *symname);
+
+__END_DECLS
diff --git a/sysdeps/arc/dl-machine.h b/sysdeps/arc/dl-machine.h
new file mode 100644
index ..c81acb9d4fd4
--- /dev/null
+++ b/sysdeps/arc/dl-machine.h
@@ -0,0 +1,340 @@
+/* Machine-dependent ELF dynamic relocation inline functions.  ARC version.
+   Copyright (C) 1995-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   .  */
+
+#ifndef dl_machine_h
+#define dl_machine_h
+
+#define ELF_MACHINE_NAME "arc"
+
+#include 
+
+#ifndef ENTRY_POINT
+# error ENTRY_POINT nee

[PATCH v2 10/15] ARC: ABI lists

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog  |   16 +
 sysdeps/arc/nofpu/libm-test-ulps   |  390 
 sysdeps/arc/nofpu/libm-test-ulps-name  |1 +
 sysdeps/unix/sysv/linux/arc/c++-types.data |   67 +
 sysdeps/unix/sysv/linux/arc/ld.abilist |9 +
 .../unix/sysv/linux/arc/libBrokenLocale.abilist|1 +
 sysdeps/unix/sysv/linux/arc/libanl.abilist |4 +
 sysdeps/unix/sysv/linux/arc/libc.abilist   | 2089 
 sysdeps/unix/sysv/linux/arc/libcrypt.abilist   |2 +
 sysdeps/unix/sysv/linux/arc/libdl.abilist  |9 +
 sysdeps/unix/sysv/linux/arc/libm.abilist   |  753 +++
 sysdeps/unix/sysv/linux/arc/libpthread.abilist |  235 +++
 sysdeps/unix/sysv/linux/arc/libresolv.abilist  |   79 +
 sysdeps/unix/sysv/linux/arc/librt.abilist  |   35 +
 sysdeps/unix/sysv/linux/arc/libthread_db.abilist   |   40 +
 sysdeps/unix/sysv/linux/arc/libutil.abilist|6 +
 sysdeps/unix/sysv/linux/arc/localplt.data  |   16 +
 17 files changed, 3752 insertions(+)
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps
 create mode 100644 sysdeps/arc/nofpu/libm-test-ulps-name
 create mode 100644 sysdeps/unix/sysv/linux/arc/c++-types.data
 create mode 100644 sysdeps/unix/sysv/linux/arc/ld.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libanl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libc.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libcrypt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libdl.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libm.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libpthread.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libresolv.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/librt.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libthread_db.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/libutil.abilist
 create mode 100644 sysdeps/unix/sysv/linux/arc/localplt.data

diff --git a/ChangeLog b/ChangeLog
index 017bced57129..55d185c2a189 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -69,6 +69,22 @@
* sysdeps/unix/sysv/linux/arc/ucontext_i.sym: New file.
* sysdeps/unix/sysv/linux/arc/dl-static.c: New file.
* sysdeps/unix/sysv/linux/arc/ldsodefs.h: New file.
+   * sysdeps/arc/nofpu/libm-test-ulps: New file.
+   * sysdeps/arc/nofpu/libm-test-ulps-name: New file.
+   * sysdeps/unix/sysv/linux/arc/c++-types.data: New file.
+   * sysdeps/unix/sysv/linux/arc/ld.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/libBrokenLocale.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/libanl.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/libc.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/libcrypt.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/libdl.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/libm.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/libpthread.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/libresolv.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/librt.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/libthread_db.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/libutil.abilist: New file.
+   * sysdeps/unix/sysv/linux/arc/localplt.data: New file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/arc/nofpu/libm-test-ulps b/sysdeps/arc/nofpu/libm-test-ulps
new file mode 100644
index ..0e8ef313fa94
--- /dev/null
+++ b/sysdeps/arc/nofpu/libm-test-ulps
@@ -0,0 +1,390 @@
+# Begin of automatic generation
+
+# Maximal error of functions:
+Function: "acos":
+float: 1
+ifloat: 1
+
+Function: "acosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "asin":
+float: 1
+ifloat: 1
+
+Function: "asinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: "atan":
+float: 1
+ifloat: 1
+
+Function: "atan2":
+float: 1
+ifloat: 1
+
+Function: "atanh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: "cabs":
+double: 1
+idouble: 1
+
+Function: Real part of "cacos":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: Imaginary part of "cacos":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "cacosh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "cacosh":
+double: 1
+float: 2
+idouble: 1
+ifloat: 2
+
+Function: "carg":
+float: 1
+ifloat: 1
+
+Function: Real part of "casin":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary part of "casin":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Real part of "casinh":
+double: 2
+float: 2
+idouble: 2
+ifloat: 2
+
+Function: Imaginary part of "casinh":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Real part of "catan":
+double: 1
+float: 1
+idouble: 1
+ifloat: 1
+
+Function: Imaginary 

[PATCH v2 11/15] ARC: Update syscall-names.list for ARC specific syscalls

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog  | 1 +
 sysdeps/unix/sysv/linux/syscall-names.list | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 55d185c2a189..3fb8c7c14cae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -85,6 +85,7 @@
* sysdeps/unix/sysv/linux/arc/libthread_db.abilist: New file.
* sysdeps/unix/sysv/linux/arc/libutil.abilist: New file.
* sysdeps/unix/sysv/linux/arc/localplt.data: New file.
+   * sysdeps/unix/sysv/linux/syscall-names.list: Update for ARC.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/unix/sysv/linux/syscall-names.list 
b/sysdeps/unix/sysv/linux/syscall-names.list
index b650dc07cc64..5a9f63ff511c 100644
--- a/sysdeps/unix/sysv/linux/syscall-names.list
+++ b/sysdeps/unix/sysv/linux/syscall-names.list
@@ -42,6 +42,9 @@ adjtimex
 afs_syscall
 alarm
 alloc_hugepages
+arc_gettls
+arc_settls
+arc_usr_cmpxchg
 arch_prctl
 arm_fadvise64_64
 arm_sync_file_range
-- 
2.7.4


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH v2 12/15] ARC: Build Infrastructure

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog  | 13 +
 sysdeps/arc/Implies|  4 
 sysdeps/arc/Makefile   | 25 +
 sysdeps/arc/Versions   |  6 ++
 sysdeps/arc/configure  | 14 ++
 sysdeps/arc/configure.ac   | 11 +++
 sysdeps/arc/nptl/Makefile  | 22 ++
 sysdeps/arc/preconfigure   | 14 ++
 sysdeps/unix/sysv/linux/arc/Implies|  3 +++
 sysdeps/unix/sysv/linux/arc/Makefile   | 20 
 sysdeps/unix/sysv/linux/arc/Versions   | 16 
 sysdeps/unix/sysv/linux/arc/configure  |  4 
 sysdeps/unix/sysv/linux/arc/configure.ac   |  4 
 sysdeps/unix/sysv/linux/arc/shlib-versions |  2 ++
 14 files changed, 158 insertions(+)
 create mode 100644 sysdeps/arc/Implies
 create mode 100644 sysdeps/arc/Makefile
 create mode 100644 sysdeps/arc/Versions
 create mode 100644 sysdeps/arc/configure
 create mode 100644 sysdeps/arc/configure.ac
 create mode 100644 sysdeps/arc/nptl/Makefile
 create mode 100644 sysdeps/arc/preconfigure
 create mode 100644 sysdeps/unix/sysv/linux/arc/Implies
 create mode 100644 sysdeps/unix/sysv/linux/arc/Makefile
 create mode 100644 sysdeps/unix/sysv/linux/arc/Versions
 create mode 100644 sysdeps/unix/sysv/linux/arc/configure
 create mode 100644 sysdeps/unix/sysv/linux/arc/configure.ac
 create mode 100644 sysdeps/unix/sysv/linux/arc/shlib-versions

diff --git a/ChangeLog b/ChangeLog
index 3fb8c7c14cae..d8ecb7d233c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -86,6 +86,19 @@
* sysdeps/unix/sysv/linux/arc/libutil.abilist: New file.
* sysdeps/unix/sysv/linux/arc/localplt.data: New file.
* sysdeps/unix/sysv/linux/syscall-names.list: Update for ARC.
+   * sysdeps/arc/Implies: New file.
+   * sysdeps/arc/Makefile: New file.
+   * sysdeps/arc/Versions: New file.
+   * sysdeps/arc/configure: New file.
+   * sysdeps/arc/configure.ac: New file.
+   * sysdeps/arc/nptl/Makefile: New file.
+   * sysdeps/arc/preconfigure: New file.
+   * sysdeps/unix/sysv/linux/arc/Implies: New file.
+   * sysdeps/unix/sysv/linux/arc/Makefile: New file.
+   * sysdeps/unix/sysv/linux/arc/Versions: New file.
+   * sysdeps/unix/sysv/linux/arc/configure: New file.
+   * sysdeps/unix/sysv/linux/arc/configure.ac: New file.
+   * sysdeps/unix/sysv/linux/arc/shlib-versions: New file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/arc/Implies b/sysdeps/arc/Implies
new file mode 100644
index ..a0f0b00cfac2
--- /dev/null
+++ b/sysdeps/arc/Implies
@@ -0,0 +1,4 @@
+init_array
+wordsize-32
+ieee754/flt-32
+ieee754/dbl-64
diff --git a/sysdeps/arc/Makefile b/sysdeps/arc/Makefile
new file mode 100644
index ..8d2fbe00c5e1
--- /dev/null
+++ b/sysdeps/arc/Makefile
@@ -0,0 +1,25 @@
+# ARC Makefile
+# Copyright (C) 1993-2019 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+
+# The GNU C Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library.  If not, see
+# .
+
+# We don't support long doubles as a distinct type.  We don't need to set
+# this variable; it's here mostly for documentational purposes.
+long-double-fcts = no
+
+ifeq ($(subdir),debug)
+CFLAGS-backtrace.c += -funwind-tables
+endif
diff --git a/sysdeps/arc/Versions b/sysdeps/arc/Versions
new file mode 100644
index ..a41ad34f953d
--- /dev/null
+++ b/sysdeps/arc/Versions
@@ -0,0 +1,6 @@
+libc {
+  GLIBC_2.29 {
+__syscall_error;
+__mcount;
+  }
+}
diff --git a/sysdeps/arc/configure b/sysdeps/arc/configure
new file mode 100644
index ..52e286da2ebb
--- /dev/null
+++ b/sysdeps/arc/configure
@@ -0,0 +1,14 @@
+# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/arc.
+
+$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
+
+libc_cv_have_sdata_section=no
+
+# For ARC, historically ; was used for comments and not newline
+# Later # also got added to comment list, but ; couldn't be switched to
+# canonical newline as there's lots of code out there which will break
+libc_cv_asm_line_sep='`'
+cat >>confdefs.h <<_ACEOF
+#define ASM_LINE_SEP $libc_cv_asm_line_sep
+_ACEOF
diff --git a/sysdeps/arc/

[PATCH v2 09/15] ARC: Linux Startup and Dynamic Loading

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog   |  2 +
 sysdeps/unix/sysv/linux/arc/dl-static.c | 84 +
 sysdeps/unix/sysv/linux/arc/ldsodefs.h  | 32 +
 3 files changed, 118 insertions(+)
 create mode 100644 sysdeps/unix/sysv/linux/arc/dl-static.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/ldsodefs.h

diff --git a/ChangeLog b/ChangeLog
index e0f2c3372e31..017bced57129 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -67,6 +67,8 @@
* sysdeps/unix/sysv/linux/arc/sys/user.h: New file.
* sysdeps/unix/sysv/linux/arc/ucontext-macros.h: New file.
* sysdeps/unix/sysv/linux/arc/ucontext_i.sym: New file.
+   * sysdeps/unix/sysv/linux/arc/dl-static.c: New file.
+   * sysdeps/unix/sysv/linux/arc/ldsodefs.h: New file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/unix/sysv/linux/arc/dl-static.c 
b/sysdeps/unix/sysv/linux/arc/dl-static.c
new file mode 100644
index ..1a8757c9840d
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arc/dl-static.c
@@ -0,0 +1,84 @@
+/* Variable initialization.  ARC version.
+   Copyright (C) 2001-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   .  */
+
+#include 
+
+#ifdef SHARED
+
+void
+_dl_var_init (void *array[])
+{
+  /* It has to match "variables" below. */
+  enum
+{
+  DL_PAGESIZE = 0
+};
+
+  GLRO(dl_pagesize) = *((size_t *) array[DL_PAGESIZE]);
+}
+
+#else
+
+static void *variables[] =
+{
+  &GLRO(dl_pagesize)
+};
+
+static void
+_dl_unprotect_relro (struct link_map *l)
+{
+  ElfW(Addr) start = ((l->l_addr + l->l_relro_addr)
+ & ~(GLRO(dl_pagesize) - 1));
+  ElfW(Addr) end = ((l->l_addr + l->l_relro_addr + l->l_relro_size)
+   & ~(GLRO(dl_pagesize) - 1));
+
+  if (start != end)
+__mprotect ((void *) start, end - start, PROT_READ | PROT_WRITE);
+}
+
+void
+_dl_static_init (struct link_map *l)
+{
+  struct link_map *rtld_map = l;
+  struct r_scope_elem **scope;
+  const ElfW(Sym) *ref = NULL;
+  lookup_t loadbase;
+  void (*f) (void *[]);
+  size_t i;
+
+  loadbase = _dl_lookup_symbol_x ("_dl_var_init", l, &ref, l->l_local_scope,
+ NULL, 0, 1, NULL);
+
+  for (scope = l->l_local_scope; *scope != NULL; scope++)
+for (i = 0; i < (*scope)->r_nlist; i++)
+  if ((*scope)->r_list[i] == loadbase)
+   {
+ rtld_map = (*scope)->r_list[i];
+ break;
+   }
+
+  if (ref != NULL)
+{
+  f = (void (*) (void *[])) DL_SYMBOL_ADDRESS (loadbase, ref);
+  _dl_unprotect_relro (rtld_map);
+  f (variables);
+  _dl_protect_relro (rtld_map);
+}
+}
+
+#endif
diff --git a/sysdeps/unix/sysv/linux/arc/ldsodefs.h 
b/sysdeps/unix/sysv/linux/arc/ldsodefs.h
new file mode 100644
index ..8c5c6800af13
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/arc/ldsodefs.h
@@ -0,0 +1,32 @@
+/* Run-time dynamic linker data structures for loaded ELF shared objects. ARC
+   Copyright (C) 2001-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   .  */
+
+#ifndef_LDSODEFS_H
+
+/* Get the real definitions.  */
+#include_next 
+
+/* Now define our stuff.  */
+
+/* We need special support to initialize DSO loaded for statically linked
+   binaries.  */
+extern void _dl_static_init (struct link_map *map);
+#undef DL_STATIC_INIT
+#define DL_STATIC_INIT(map) _dl_static_init (map)
+
+#endif /* ldsodefs.h */
-- 
2.7.4


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.or

[PATCH v2 00/15] glibc port to ARC processors

2019-01-29 Thread Vineet Gupta
Hi,

v2 of glibc port to ARC processors from Synopsys.

Thx for reviewing the v1 [1], I've hopefully addressed all the comments.
Any unlikely omissions are unintended.

Also apologies for the bad timing given the imminent release, but that ship
has likely already sailed, so we might as well continue our march independently.

The main changes since v1 are

  * sigaction updates
- drop sigaction.h, use generic version
- sigaction.c to use generic linux/sigaction.c
- arch specific __sigset_t.h to enable __sigset_t [2] vs. [128]

  * atomics: Enable USE_ATOMIC_COMPILER_BUILTINS
  * switch to init_array, removed crt{i,n}
  * Build: remove libc_cv_fpie=no
  * __startcontext: use cfi_undefined to terminate unwinder

  * dropped ldconfig.h, libnsl.abilist, cacheflush.c (use syscalls.list),
procfs-id.h, math_private.h

  * cosmetics
- Trying to follow the coding style and conventions
- Folded the testsuite fixes patches into main port patches
- Update copyright headers to 2019

Customary test results: Built against
   binutils-2_32-branch
   gcc-8-stable (commit 0d5ba57508c5 as of today with prerequisite backport)

(a) build-many-glibcs.py

| Summary of test results:
|   1173 PASS   # same as v1
| 15 XFAIL  # same as v1
|
| PASS: glibcs-arc-linux-gnu check

(b) Full testsuite ran in a cross compile setup using buildroot on HSDK 
development
platform. Full log at [2].

| Summary of test results:
| 22 FAIL   #  2 fewer than v1
|   5151 PASS   # 27 more than v1
| 23 UNSUPPORTED#  4 fewer
| 19 XFAIL  # no change
|
| FAIL: localedata/sort-test
| FAIL: stdio-common/bug22
| FAIL: sunrpc/bug20790
| FAIL: nptl/test-mutexattr-printers
| FAIL: nptl/test-mutex-printers
| FAIL: nptl/test-condattr-printers
| FAIL: nptl/test-cond-printers
| FAIL: nptl/test-rwlockattr-printers
| FAIL: nptl/test-rwlock-printers
| FAIL: iconv/test-iconvconfig
| FAIL: posix/bug-ga2
| FAIL: posix/tst-getaddrinfo5
| FAIL: posix/globtest
| FAIL: gmon/tst-sprofil
| FAIL: io/ftwtest
| FAIL: nptl/tst-cond17
| FAIL: nptl/tst-cond25
| FAIL: nptl/tst-umask1
| FAIL: nss/bug-erange
| FAIL: nss/tst-nss-files-hosts-getent
| FAIL: nss/tst-nss-files-hosts-multi
| FAIL: nss/tst-nss-test3

Kindly review.

Thx,
-Vineet

[1] https://sourceware.org/ml/libc-alpha/2018-12/msg00678.html
[2] 
https://github.com/foss-for-synopsys-dwc-arc-processors/glibc/files/2810200/glibc-testsuite-results-commit-2f9a78f208a7.log.gz

Vineet Gupta (15):
  ARC: add definitions to elf/elf.h
  ARC: ABI Implementation
  ARC: startup and dynamic linking code
  ARC: Thread Local Storage support
  ARC: Atomics and Locking primitives
  ARC: math soft float support
  ARC: Linux Syscall Interface
  ARC: Linux ABI
  ARC: Linux Startup and Dynamic Loading
  ARC: ABI lists
  ARC: Update syscall-names.list for ARC specific syscalls
  ARC: Build Infrastructure
  build-many-glibcs.py: Enable ARC builds
  NEWS: mention ARC port
  make-syscalls.sh: fix comment referencing syscall-template

 ChangeLog  |  106 +
 NEWS   |7 +
 elf/elf.h  |   70 +-
 scripts/build-many-glibcs.py   |4 +
 sysdeps/arc/Implies|4 +
 sysdeps/arc/Makefile   |   25 +
 sysdeps/arc/Versions   |6 +
 sysdeps/arc/__longjmp.S|   50 +
 sysdeps/arc/abort-instr.h  |2 +
 sysdeps/arc/atomic-machine.h   |   73 +
 sysdeps/arc/bits/endian.h  |   12 +
 sysdeps/arc/bits/fenv.h|   72 +
 sysdeps/arc/bits/link.h|   52 +
 sysdeps/arc/bits/setjmp.h  |   26 +
 sysdeps/arc/bsd-_setjmp.S  |1 +
 sysdeps/arc/bsd-setjmp.S   |1 +
 sysdeps/arc/configure  |   14 +
 sysdeps/arc/configure.ac   |   11 +
 sysdeps/arc/dl-machine.h   |  340 
 sysdeps/arc/dl-runtime.c   |   39 +
 sysdeps/arc/dl-sysdep.h|   25 +
 sysdeps/arc/dl-tls.h   |   30 +
 sysdeps/arc/dl-trampoline.S|   80 +
 sysdeps/arc/entry.h|5 +
 sysdeps/arc/gccframe.h |   21 +
 sysdeps/arc/gmp-mparam.h   |   23 +
 sysdeps/arc/jmpbuf-offsets.h   |   47 +
 sysdeps/arc/jmpbuf-unwind.h|   47 +
 sysdeps/arc/ldsodefs.h |   43 +
 sysdeps/arc/libc-tls.c |   27 +
 sysdeps/arc/machine-gmon.h |   35 +
 sysdeps/arc/memusage.h |   23 +
 sysdeps/a

[PATCH v2 01/15] ARC: add definitions to elf/elf.h

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog |  4 
 elf/elf.h | 70 ++-
 2 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 23c20066a4a6..e2091865afb5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2019-01-21  Vineet Gupta 
+
+   * elf/elf.h: add defines for ARC.
+
 2019-01-25  Siddhesh Poyarekar  
 
* po/be.po: Update translations.
diff --git a/elf/elf.h b/elf/elf.h
index 47a514a389f0..bc2184f643c7 100644
--- a/elf/elf.h
+++ b/elf/elf.h
@@ -330,7 +330,7 @@ typedef struct
 #define EM_CLOUDSHIELD 192 /* CloudShield */
 #define EM_COREA_1ST   193 /* KIPO-KAIST Core-A 1st gen. */
 #define EM_COREA_2ND   194 /* KIPO-KAIST Core-A 2nd gen. */
-#define EM_ARC_COMPACT2195 /* Synopsys ARCompact V2 */
+#define EM_ARCV2   195 /* Synopsys ARCv2 ISA.  */
 #define EM_OPEN8   196 /* Open8 RISC */
 #define EM_RL78197 /* Renesas RL78 */
 #define EM_VIDEOCORE5  198 /* Broadcom VideoCore V */
@@ -3996,6 +3996,74 @@ enum
 #define R_NDS32_TLS_TPOFF  102
 #define R_NDS32_TLS_DESC   119
 
+/* ARCompact/ARCv2 specific relocs.  */
+#define R_ARC_NONE 0x0
+#define R_ARC_80x1
+#define R_ARC_16   0x2
+#define R_ARC_24   0x3
+#define R_ARC_32   0x4
+#define R_ARC_B26  0x5
+#define R_ARC_B22_PCREL0x6
+#define R_ARC_H30  0x7
+#define R_ARC_N8   0x8
+#define R_ARC_N16  0x9
+#define R_ARC_N24  0xA
+#define R_ARC_N32  0xB
+#define R_ARC_SDA  0xC
+#define R_ARC_SECTOFF  0xD
+#define R_ARC_S21H_PCREL   0xE
+#define R_ARC_S21W_PCREL   0xF
+#define R_ARC_S25H_PCREL   0x10
+#define R_ARC_S25W_PCREL   0x11
+#define R_ARC_SDA320x12
+#define R_ARC_SDA_LDST 0x13
+#define R_ARC_SDA_LDST10x14
+#define R_ARC_SDA_LDST20x15
+#define R_ARC_SDA16_LD 0x16
+#define R_ARC_SDA16_LD10x17
+#define R_ARC_SDA16_LD20x18
+#define R_ARC_S13_PCREL0x19
+#define R_ARC_W0x1A
+#define R_ARC_32_ME0x1B
+#define R_ARC_N32_ME   0x1C
+#define R_ARC_SECTOFF_ME   0x1D
+#define R_ARC_SDA32_ME 0x1E
+#define R_ARC_W_ME 0x1F
+#define R_ARC_H30_ME   0x20
+#define R_ARC_SECTOFF_U8   0x21
+#define R_ARC_SECTOFF_S9   0x22
+#define R_AC_SECTOFF_U80x23
+#define R_AC_SECTOFF_U8_1  0x24
+#define R_AC_SECTOFF_U8_2  0x25
+#define R_AC_SECTOFF_S90x26
+#define R_AC_SECTOFF_S9_1  0x27
+#define R_AC_SECTOFF_S9_2  0x28
+#define R_ARC_SECTOFF_ME_1 0x29
+#define R_ARC_SECTOFF_ME_2 0x2A
+#define R_ARC_SECTOFF_10x2B
+#define R_ARC_SECTOFF_20x2C
+#define R_ARC_PC32 0x32
+#define R_ARC_GOTPC32  0x33
+#define R_ARC_PLT320x34
+#define R_ARC_COPY 0x35
+#define R_ARC_GLOB_DAT 0x36
+#define R_ARC_JUMP_SLOT0x37
+#define R_ARC_RELATIVE 0x38
+#define R_ARC_GOTOFF   0x39
+#define R_ARC_GOTPC0x3A
+#define R_ARC_GOT320x3B
+
+#define R_ARC_TLS_DTPMOD   0x42
+#define R_ARC_TLS_DTPOFF   0x43
+#define R_ARC_TLS_TPOFF0x44
+#define R_ARC_TLS_GD_GOT   0x45
+#define R_ARC_TLS_GD_LD0x46
+#define R_ARC_TLS_GD_CALL  0x47
+#define R_ARC_TLS_IE_GOT   0x48
+#define R_ARC_TLS_DTPOFF_S90x4a
+#define R_ARC_TLS_LE_S90x4a
+#define R_ARC_TLS_LE_320x4b
+
 __END_DECLS
 
 #endif /* elf.h */
-- 
2.7.4


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH v2 08/15] ARC: Linux ABI

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog  | 15 
 sysdeps/arc/nptl/pthread-offsets.h |  5 ++
 sysdeps/arc/nptl/pthreaddef.h  | 32 
 sysdeps/unix/sysv/linux/arc/bits/procfs.h  | 35 
 .../unix/sysv/linux/arc/bits/types/__sigset_t.h| 12 +++
 sysdeps/unix/sysv/linux/arc/getcontext.S   | 63 +++
 sysdeps/unix/sysv/linux/arc/ipc_priv.h | 21 +
 sysdeps/unix/sysv/linux/arc/makecontext.c  | 75 ++
 sysdeps/unix/sysv/linux/arc/setcontext.S   | 92 ++
 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h   | 23 ++
 sysdeps/unix/sysv/linux/arc/swapcontext.S  | 92 ++
 sysdeps/unix/sysv/linux/arc/sys/cachectl.h | 36 +
 sysdeps/unix/sysv/linux/arc/sys/ucontext.h | 63 +++
 sysdeps/unix/sysv/linux/arc/sys/user.h | 31 
 sysdeps/unix/sysv/linux/arc/ucontext-macros.h  | 29 +++
 sysdeps/unix/sysv/linux/arc/ucontext_i.sym | 20 +
 16 files changed, 644 insertions(+)
 create mode 100644 sysdeps/arc/nptl/pthread-offsets.h
 create mode 100644 sysdeps/arc/nptl/pthreaddef.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/procfs.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/getcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/ipc_priv.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/makecontext.c
 create mode 100644 sysdeps/unix/sysv/linux/arc/setcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/sigcontextinfo.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/swapcontext.S
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/cachectl.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/ucontext.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/sys/user.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/ucontext-macros.h
 create mode 100644 sysdeps/unix/sysv/linux/arc/ucontext_i.sym

diff --git a/ChangeLog b/ChangeLog
index b5da8c28e64c..e0f2c3372e31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -52,6 +52,21 @@
* sysdeps/unix/sysv/linux/arc/sysdep.c: New file.
* sysdeps/unix/sysv/linux/arc/sysdep.h: New file.
* sysdeps/unix/sysv/linux/arc/vfork.S: New file.
+   * sysdeps/arc/nptl/pthread-offsets.h: New file.
+   * sysdeps/arc/nptl/pthreaddef.h: New file.
+   * sysdeps/unix/sysv/linux/arc/bits/procfs.h: New file.
+   * sysdeps/unix/sysv/linux/arc/bits/types/__sigset_t.h: New file.
+   * sysdeps/unix/sysv/linux/arc/getcontext.S: New file.
+   * sysdeps/unix/sysv/linux/arc/ipc_priv.h: New file.
+   * sysdeps/unix/sysv/linux/arc/makecontext.c: New file.
+   * sysdeps/unix/sysv/linux/arc/setcontext.S: New file.
+   * sysdeps/unix/sysv/linux/arc/sigcontextinfo.h: New file.
+   * sysdeps/unix/sysv/linux/arc/swapcontext.S: New file.
+   * sysdeps/unix/sysv/linux/arc/sys/cachectl.h: New file.
+   * sysdeps/unix/sysv/linux/arc/sys/ucontext.h: New file.
+   * sysdeps/unix/sysv/linux/arc/sys/user.h: New file.
+   * sysdeps/unix/sysv/linux/arc/ucontext-macros.h: New file.
+   * sysdeps/unix/sysv/linux/arc/ucontext_i.sym: New file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/arc/nptl/pthread-offsets.h 
b/sysdeps/arc/nptl/pthread-offsets.h
new file mode 100644
index ..9617354dc7e3
--- /dev/null
+++ b/sysdeps/arc/nptl/pthread-offsets.h
@@ -0,0 +1,5 @@
+#define __PTHREAD_MUTEX_NUSERS_OFFSET   16
+#define __PTHREAD_MUTEX_KIND_OFFSET 12
+#define __PTHREAD_MUTEX_SPINS_OFFSET20
+#define __PTHREAD_MUTEX_ELISION_OFFSET  22
+#define __PTHREAD_MUTEX_LIST_OFFSET 20
diff --git a/sysdeps/arc/nptl/pthreaddef.h b/sysdeps/arc/nptl/pthreaddef.h
new file mode 100644
index ..80a109bbd52a
--- /dev/null
+++ b/sysdeps/arc/nptl/pthreaddef.h
@@ -0,0 +1,32 @@
+/* pthread machine parameter definitions, ARC version.
+   Copyright (C) 2002-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   .  */
+
+/* Default stack size.  */
+#define ARCH_STACK_DEFAULT_SIZE(2 * 1024 * 1024)
+
+/* Required stack pointer alignment at beginning.  */
+#define STA

[PATCH v2 05/15] ARC: Atomics and Locking primitives

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog |  3 ++
 sysdeps/arc/atomic-machine.h  | 73 +++
 sysdeps/arc/nptl/bits/pthreadtypes-arch.h | 72 ++
 sysdeps/arc/nptl/bits/semaphore.h | 32 ++
 4 files changed, 180 insertions(+)
 create mode 100644 sysdeps/arc/atomic-machine.h
 create mode 100644 sysdeps/arc/nptl/bits/pthreadtypes-arch.h
 create mode 100644 sysdeps/arc/nptl/bits/semaphore.h

diff --git a/ChangeLog b/ChangeLog
index 2a9cea8235f1..5406e4c16fc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,9 @@
* sysdeps/arc/nptl/tcb-offsets.sym: New file.
* sysdeps/arc/nptl/tls.h: New file.
* sysdeps/arc/stackinfo.h: New file.
+   * sysdeps/arc/atomic-machine.h: New file.
+   * sysdeps/arc/nptl/bits/pthreadtypes-arch.h: New file.
+   * sysdeps/arc/nptl/bits/semaphore.h: New file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/arc/atomic-machine.h b/sysdeps/arc/atomic-machine.h
new file mode 100644
index ..bdc91d0558f9
--- /dev/null
+++ b/sysdeps/arc/atomic-machine.h
@@ -0,0 +1,73 @@
+/* Low-level functions for atomic operations. ARC version.
+   Copyright (C) 2012-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   .  */
+
+#ifndef _ARC_BITS_ATOMIC_H
+#define _ARC_BITS_ATOMIC_H 1
+
+#include 
+
+typedef int32_t atomic32_t;
+typedef uint32_t uatomic32_t;
+typedef int_fast32_t atomic_fast32_t;
+typedef uint_fast32_t uatomic_fast32_t;
+
+typedef intptr_t atomicptr_t;
+typedef uintptr_t uatomicptr_t;
+typedef intmax_t atomic_max_t;
+typedef uintmax_t uatomic_max_t;
+
+#define __HAVE_64B_ATOMICS 0
+#define USE_ATOMIC_COMPILER_BUILTINS 1
+
+/* ARC does have legacy atomic EX reg, [mem] instruction but the micro-arch
+   is not as optimal as LLOCK/SCOND specially for SMP.  */
+#define ATOMIC_EXCHANGE_USES_CAS 1
+
+#define __arch_compare_and_exchange_bool_8_acq(mem, newval, oldval)\
+  (abort (), 0)
+#define __arch_compare_and_exchange_bool_16_acq(mem, newval, oldval)   \
+  (abort (), 0)
+#define __arch_compare_and_exchange_bool_64_acq(mem, newval, oldval)   \
+  (abort (), 0)
+
+#define __arch_compare_and_exchange_val_8_int(mem, newval, oldval, model)  
\
+  (abort (), (__typeof (*mem)) 0)
+#define __arch_compare_and_exchange_val_16_int(mem, newval, oldval, model) 
\
+  (abort (), (__typeof (*mem)) 0)
+#define __arch_compare_and_exchange_val_64_int(mem, newval, oldval, model) 
\
+  (abort (), (__typeof (*mem)) 0)
+
+#define __arch_compare_and_exchange_val_32_int(mem, newval, oldval, model) 
\
+  ({   
\
+typeof (*mem) __oldval = (oldval); 
\
+__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,   
\
+ model, __ATOMIC_RELAXED); 
\
+__oldval;  
\
+  })
+
+#define atomic_compare_and_exchange_val_acq(mem, new, old) \
+  __atomic_val_bysize (__arch_compare_and_exchange_val, int,   \
+  mem, new, old, __ATOMIC_ACQUIRE)
+
+#ifdef __ARC700__
+#define atomic_full_barrier()  ({ asm volatile ("sync":::"memory"); })
+#else
+#define atomic_full_barrier()  ({ asm volatile ("dmb 3":::"memory"); })
+#endif
+
+#endif /* _ARC_BITS_ATOMIC_H */
diff --git a/sysdeps/arc/nptl/bits/pthreadtypes-arch.h 
b/sysdeps/arc/nptl/bits/pthreadtypes-arch.h
new file mode 100644
index ..cd91785a331c
--- /dev/null
+++ b/sysdeps/arc/nptl/bits/pthreadtypes-arch.h
@@ -0,0 +1,72 @@
+/* Machine-specific pthread type layouts.  ARC version.
+   Copyright (C) 2012-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of

[PATCH v2 14/15] NEWS: mention ARC port

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog | 1 +
 NEWS  | 7 +++
 2 files changed, 8 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 63418806d331..8c1fc3d2cdcb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -100,6 +100,7 @@
* sysdeps/unix/sysv/linux/arc/configure.ac: New file.
* sysdeps/unix/sysv/linux/arc/shlib-versions: New file.
* scripts/build-many-glibcs.py: Enable building for ARC.
+   * NEW: Mention ARC port.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/NEWS b/NEWS
index 76679f33938d..73f422a93e85 100644
--- a/NEWS
+++ b/NEWS
@@ -64,6 +64,13 @@ Major new features:
   "%EY" to control how the year number is formatted; they have the
   same effect that they would on "%Ey".
 
+* Support for ARC HS cores running Linux has been contributed by Synopsys.
+  Port requires atleast
+- binutils-2.31 (binutils-2_31-branch: commit 6ce881c15fc4, 2018-10-04)
+- gcc 8.2 (gcc-8-stable: commit 0d5ba57508c5, 2019-01-29)
+- Linux kernel 3.9+
+  Soft-float ABI is currently supported.
+
 Deprecated and removed features, and other changes affecting compatibility:
 
 * The glibc.tune tunable namespace has been renamed to glibc.cpu and the
-- 
2.7.4


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


[PATCH v2 04/15] ARC: Thread Local Storage support

2019-01-29 Thread Vineet Gupta
This includes all 4 TLS addressing models

Signed-off-by: Vineet Gupta 
---
 ChangeLog|   5 ++
 sysdeps/arc/dl-tls.h |  30 
 sysdeps/arc/libc-tls.c   |  27 +++
 sysdeps/arc/nptl/tcb-offsets.sym |  11 +++
 sysdeps/arc/nptl/tls.h   | 150 +++
 sysdeps/arc/stackinfo.h  |  33 +
 6 files changed, 256 insertions(+)
 create mode 100644 sysdeps/arc/dl-tls.h
 create mode 100644 sysdeps/arc/libc-tls.c
 create mode 100644 sysdeps/arc/nptl/tcb-offsets.sym
 create mode 100644 sysdeps/arc/nptl/tls.h
 create mode 100644 sysdeps/arc/stackinfo.h

diff --git a/ChangeLog b/ChangeLog
index 43d031a05141..2a9cea8235f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,11 @@
* sysdeps/arc/sotruss-lib.c: New file.
* sysdeps/arc/start.S: New file.
* sysdeps/arc/tst-audit.h: New file.
+   * sysdeps/arc/dl-tls.h: New file.
+   * sysdeps/arc/libc-tls.c: New file.
+   * sysdeps/arc/nptl/tcb-offsets.sym: New file.
+   * sysdeps/arc/nptl/tls.h: New file.
+   * sysdeps/arc/stackinfo.h: New file.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/sysdeps/arc/dl-tls.h b/sysdeps/arc/dl-tls.h
new file mode 100644
index ..7f0cf91e4022
--- /dev/null
+++ b/sysdeps/arc/dl-tls.h
@@ -0,0 +1,30 @@
+/* Thread-local storage handling in the ELF dynamic linker.  ARC version.
+   Copyright (C) 2012-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   .  */
+
+
+/* Type used for the representation of TLS information in the GOT.  */
+typedef struct
+{
+  unsigned long int ti_module;
+  unsigned long int ti_offset;
+} tls_index;
+
+extern void *__tls_get_addr (tls_index *ti);
+
+/* Value used for dtv entries for which the allocation is delayed.  */
+#define TLS_DTV_UNALLOCATED((void *) -1l)
diff --git a/sysdeps/arc/libc-tls.c b/sysdeps/arc/libc-tls.c
new file mode 100644
index ..903a75a41b55
--- /dev/null
+++ b/sysdeps/arc/libc-tls.c
@@ -0,0 +1,27 @@
+/* Thread-local storage handling in the ELF dynamic linker.  ARC version.
+   Copyright (C) 2005-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   .  */
+
+#include 
+#include 
+
+void *
+__tls_get_addr (tls_index *ti)
+{
+  dtv_t *dtv = THREAD_DTV ();
+  return (char *) dtv[1].pointer.val + ti->ti_offset;
+}
diff --git a/sysdeps/arc/nptl/tcb-offsets.sym b/sysdeps/arc/nptl/tcb-offsets.sym
new file mode 100644
index ..56950e0676ed
--- /dev/null
+++ b/sysdeps/arc/nptl/tcb-offsets.sym
@@ -0,0 +1,11 @@
+#include 
+#include 
+
+-- Derive offsets relative to the thread register.
+#define thread_offsetof(mem)   (long)(offsetof(struct pthread, mem) - 
sizeof(struct pthread))
+
+MULTIPLE_THREADS_OFFSEToffsetof (struct pthread, 
header.multiple_threads)
+TLS_PRE_TCB_SIZE   sizeof (struct pthread)
+TLS_TCB_SIZE   sizeof(tcbhead_t)
+
+PTHREAD_TIDoffsetof(struct pthread, tid)
diff --git a/sysdeps/arc/nptl/tls.h b/sysdeps/arc/nptl/tls.h
new file mode 100644
index ..2c90109d5705
--- /dev/null
+++ b/sysdeps/arc/nptl/tls.h
@@ -0,0 +1,150 @@
+/* Definition for thread-local data handling.  NPTL/ARC version.
+   Copyright (C) 2012-2019 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License,

[PATCH v2 13/15] build-many-glibcs.py: Enable ARC builds

2019-01-29 Thread Vineet Gupta
Signed-off-by: Vineet Gupta 
---
 ChangeLog| 1 +
 scripts/build-many-glibcs.py | 4 
 2 files changed, 5 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index d8ecb7d233c5..63418806d331 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -99,6 +99,7 @@
* sysdeps/unix/sysv/linux/arc/configure: New file.
* sysdeps/unix/sysv/linux/arc/configure.ac: New file.
* sysdeps/unix/sysv/linux/arc/shlib-versions: New file.
+   * scripts/build-many-glibcs.py: Enable building for ARC.
 
 2019-01-25  Siddhesh Poyarekar  
 
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 025876486a35..40bf9398d48d 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -155,6 +155,9 @@ class Context(object):
'cfg': ['--disable-multi-arch']}])
 self.add_config(arch='aarch64_be',
 os_name='linux-gnu')
+self.add_config(arch='arc',
+os_name='linux-gnu',
+gcc_cfg=['--disable-multilib', '--with-cpu=archs'])
 self.add_config(arch='alpha',
 os_name='linux-gnu')
 self.add_config(arch='arm',
@@ -1265,6 +1268,7 @@ class Config(object):
 def install_linux_headers(self, cmdlist):
 """Install Linux kernel headers."""
 arch_map = {'aarch64': 'arm64',
+'arc': 'arc',
 'alpha': 'alpha',
 'arm': 'arm',
 'csky': 'csky',
-- 
2.7.4


___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH v2 15/15] make-syscalls.sh: fix comment referencing syscall-template

2019-01-29 Thread Joseph Myers
This particular patch is OK after 2.29 has been released and master has 
opened for 2.30 development, but such architecture-independent fixes ought 
not be considered part of the port submission (see 
).

-- 
Joseph S. Myers
jos...@codesourcery.com

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc


Re: [PATCH v2 00/15] glibc port to ARC processors

2019-01-29 Thread Joseph Myers
In the absence of clear consensus regarding consideration of new ports to 
undocumented architectures (which would need to result in consensus on 
suitable rules on the subject to go in 
), and in the absence of 
suitable public architecture and ABI documentation, I don't intend to 
attempt review of this or subsequent versions of the port submission.  (I 
am supposing that the documentation available at 
 - which in any case does not include 
an ABI reference - is for an architecture version too old to be sufficient 
for understanding and maintaining the port code as may be needed in the 
course of glibc maintenance.)

-- 
Joseph S. Myers
jos...@codesourcery.com

___
linux-snps-arc mailing list
linux-snps-arc@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-snps-arc