[klibc] [klibc:master] arch: Remove cris port

klibc-bot for Ben Hutchings ben at decadent.org.uk
Thu Apr 30 06:12:03 PDT 2020


Commit-ID:  a7a754c66437d4ab26503cdc183fd9e54a9e84d0
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=a7a754c66437d4ab26503cdc183fd9e54a9e84d0
Author:     Ben Hutchings <ben at decadent.org.uk>
AuthorDate: Thu, 30 Apr 2020 14:06:32 +0100
Committer:  Ben Hutchings <ben at decadent.org.uk>
CommitDate: Thu, 30 Apr 2020 14:08:28 +0100

[klibc] arch: Remove cris port

klibc targets the latest kernel version, and the cris kernel port
was removed in Linux 4.17.  Remove our support for it.

Signed-off-by: Ben Hutchings <ben at decadent.org.uk>

---
 usr/include/arch/cris/klibc/archconfig.h | 15 -----
 usr/include/arch/cris/klibc/archsetjmp.h | 24 --------
 usr/include/arch/cris/klibc/archsignal.h | 14 -----
 usr/include/arch/cris/klibc/archstat.h   | 39 -------------
 usr/klibc/README.klibc                   |  1 -
 usr/klibc/SYSCALLS.def                   |  2 +-
 usr/klibc/arch/cris/Kbuild               | 28 ---------
 usr/klibc/arch/cris/MCONFIG              | 26 ---------
 usr/klibc/arch/cris/__negdi2.S           | 25 --------
 usr/klibc/arch/cris/crt0.S               | 27 ---------
 usr/klibc/arch/cris/divide.c             | 99 --------------------------------
 usr/klibc/arch/cris/setjmp.S             | 37 ------------
 usr/klibc/arch/cris/syscall.S            | 30 ----------
 usr/klibc/arch/cris/sysstub.ph           | 29 ----------
 usr/klibc/arch/cris/vfork.S              | 29 ----------
 15 files changed, 1 insertion(+), 424 deletions(-)

diff --git a/usr/include/arch/cris/klibc/archconfig.h b/usr/include/arch/cris/klibc/archconfig.h
deleted file mode 100644
index 0206078f..00000000
--- a/usr/include/arch/cris/klibc/archconfig.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * include/arch/cris/klibc/archconfig.h
- *
- * See include/klibc/sysconfig.h for the options that can be set in
- * this file.
- *
- */
-
-#ifndef _KLIBC_ARCHCONFIG_H
-#define _KLIBC_ARCHCONFIG_H
-
-/* cris uses 13 as the page shift factor for sys_mmap2 */
-#define _KLIBC_MMAP2_SHIFT	13
-
-#endif				/* _KLIBC_ARCHCONFIG_H */
diff --git a/usr/include/arch/cris/klibc/archsetjmp.h b/usr/include/arch/cris/klibc/archsetjmp.h
deleted file mode 100644
index d345ccbf..00000000
--- a/usr/include/arch/cris/klibc/archsetjmp.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * arch/cris/include/klibc/archsetjmp.h
- */
-
-#ifndef _KLIBC_ARCHSETJMP_H
-#define _KLIBC_ARCHSETJMP_H
-
-struct __jmp_buf {
-	unsigned long __r0;
-	unsigned long __r1;
-	unsigned long __r2;
-	unsigned long __r3;
-	unsigned long __r4;
-	unsigned long __r5;
-	unsigned long __r6;
-	unsigned long __r7;
-	unsigned long __r8;
-	unsigned long __sp;
-	unsigned long __srp;
-};
-
-typedef struct __jmp_buf jmp_buf[1];
-
-#endif				/* _KLIBC_ARCHSETJMP_H */
diff --git a/usr/include/arch/cris/klibc/archsignal.h b/usr/include/arch/cris/klibc/archsignal.h
deleted file mode 100644
index 7fa7454a..00000000
--- a/usr/include/arch/cris/klibc/archsignal.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/*
- * arch/cris/include/klibc/archsignal.h
- *
- * Architecture-specific signal definitions
- *
- */
-
-#ifndef _KLIBC_ARCHSIGNAL_H
-#define _KLIBC_ARCHSIGNAL_H
-
-#include <asm/signal.h>
-/* No special stuff for this architecture */
-
-#endif
diff --git a/usr/include/arch/cris/klibc/archstat.h b/usr/include/arch/cris/klibc/archstat.h
deleted file mode 100644
index 09d3adec..00000000
--- a/usr/include/arch/cris/klibc/archstat.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#ifndef _KLIBC_ARCHSTAT_H
-#define _KLIBC_ARCHSTAT_H
-
-#include <klibc/stathelp.h>
-
-#define _STATBUF_ST_NSEC
-
-/* This matches struct stat64 in glibc2.1, hence the absolutely
- * insane amounts of padding around dev_t's.
- */
-struct stat {
-	__stdev64	(st_dev);
-	unsigned char	__pad0[4];
-
-	unsigned long	__st_ino;
-
-	unsigned int	st_mode;
-	unsigned int	st_nlink;
-
-	unsigned long	st_uid;
-	unsigned long	st_gid;
-
-	__stdev64	(st_rdev);
-	unsigned char	__pad3[4];
-
-	long long	st_size;
-	unsigned long	st_blksize;
-
-	unsigned long	st_blocks;	/* Number 512-byte blocks allocated. */
-	unsigned long	__pad4;		/* future possible st_blocks high bits */
-
-	struct timespec st_atim;
-	struct timespec st_mtim;
-	struct timespec st_ctim;
-
-	unsigned long long	st_ino;
-};
-
-#endif
diff --git a/usr/klibc/README.klibc b/usr/klibc/README.klibc
index dfb0895c..47183bb3 100644
--- a/usr/klibc/README.klibc
+++ b/usr/klibc/README.klibc
@@ -109,7 +109,6 @@ The following is the last known status of various architectures:
    arm:		 Working
    arm64:	 Working
    avr32:	 Not yet ported
-   cris:	 Working
    h8300:	 Not yet ported
    i386:	 Working
    ia64:	 Mostly working
diff --git a/usr/klibc/SYSCALLS.def b/usr/klibc/SYSCALLS.def
index 94b9af26..461d9bf6 100644
--- a/usr/klibc/SYSCALLS.def
+++ b/usr/klibc/SYSCALLS.def
@@ -226,7 +226,7 @@ int sigprocmask(int, const sigset_t *, sigset_t *);
  *
  * The arguments other than the sigset_t are assumed ignored.
  */
-<cris,sh,sparc,alpha,ppc,sparc64> int sigsuspend::__sigsuspend_s(sigset_t);
+<sh,sparc,alpha,ppc,sparc64> int sigsuspend::__sigsuspend_s(sigset_t);
 <arm,frv,i386,m68k,mn10300,s390,s390x> int sigsuspend::__sigsuspend_xxs(int, int, sigset_t);
 #endif
 int kill(pid_t, int);
diff --git a/usr/klibc/arch/cris/Kbuild b/usr/klibc/arch/cris/Kbuild
deleted file mode 100644
index 13ceeecd..00000000
--- a/usr/klibc/arch/cris/Kbuild
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-# klibc files fora cris
-#
-
-always  := crt0.o
-targets := crt0.o
-
-klib-y += __negdi2.o setjmp.o syscall.o vfork.o
-
-klib-y += ../../libgcc/__divdi3.o     ../../libgcc/__moddi3.o
-klib-y += ../../libgcc/__udivdi3.o    ../../libgcc/__umoddi3.o
-klib-y += ../../libgcc/__udivmoddi4.o
-
-# Divide support
-klib-y := __Umod.o __Udiv.o __Mod.o __Div.o
-
-quiet_cmd_cc-div = DIV-CC  $@
-      cmd_cc-div = $(KLIBCC) $(klibccflags) -c -o $@ $<
-
-
-$(obj)/__Umod.o: $(src)/divide.c
-KLIBCCFLAGS___Umod.o := -DSIGNED=0 -DREM=1 -DBITS=32 -DNAME=__Umod
-$(obj)/__Udiv.o: $(src)/divide.c
-KLIBCCFLAGS___Udiv.o := -DSIGNED=0 -DREM=0 -DBITS=32 -DNAME=__Udiv
-$(obj)/__Mod.o: $(src)/divide.c
-KLIBCCFLAGS___Mod.o  := -DSIGNED=1 -DREM=1 -DBITS=32 -DNAME=__Mod
-$(obj)/__Div.o: $(src)/divide.c
-KLIBCCFLAGS___Div.o  := -DSIGNED=1 -DREM=0 -DBITS=32 -DNAME=__Div
diff --git a/usr/klibc/arch/cris/MCONFIG b/usr/klibc/arch/cris/MCONFIG
deleted file mode 100644
index 20bfe731..00000000
--- a/usr/klibc/arch/cris/MCONFIG
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- makefile -*-
-#
-# arch/cris/MCONFIG
-#
-# Special rules for this architecture.  Note that this is actually
-# included from the main Makefile, and that pathnames should be
-# accordingly.
-#
-
-KLIBCOPTFLAGS += -Os -fomit-frame-pointer
-KLIBCBITSIZE  = 32
-
-# Extra linkflags when building the shared version of the library
-# This address needs to be reachable using normal inter-module
-# calls, and work on the memory models for this architecture
-# 224 MB - normal binaries start at 0
-# (lib?)gcc on cris seems to insist on producing .init and .fini sections
-KLIBCSHAREDFLAGS     = --section-start .init=0x0e000100
-
-# The CRIS compiler needs an -iprefix to find libgcc includes when
-# nostdinc is used. It also needs -mlinux to compile linux applications.
-INCLUDE_PREFIX  = $(shell $(CC) -print-libgcc-file-name | sed -e s/libgcc.a//)
-KLIBCARCHREQFLAGS = -iprefix $(INCLUDE_PREFIX) -mlinux
-
-# Special flags needed for linking
-KLIBCLDFLAGS 	+= -mcrislinux
diff --git a/usr/klibc/arch/cris/__negdi2.S b/usr/klibc/arch/cris/__negdi2.S
deleted file mode 100644
index 3cca9edf..00000000
--- a/usr/klibc/arch/cris/__negdi2.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * arch/cris/__negdi2.c
- */
-
-/*
- * In 2's complement arithmetric, -x == (~x + 1), so
- * -{h,l} = (~{h,l} + {0,1)
- * -{h,l} = {~h,~l} + {0,1}
- * -{h,l} = {~h + cy, ~l + 1}
- * ... where cy = (l == 0)
- * -{h,l} = {~h + cy, -l}
- */
-
-	.text
-	.balign 4
-	.type	__negdi2, at function
-	.globl	__negdi2
-__negdi2:
-	neg.d	$r10,$r10
-	seq	$r12
-	not	$r11
-	ret
-	  add.d	$r12,$r11
-
-	.size __negdi2, .-__negdi2
diff --git a/usr/klibc/arch/cris/crt0.S b/usr/klibc/arch/cris/crt0.S
deleted file mode 100644
index 22cb9b4e..00000000
--- a/usr/klibc/arch/cris/crt0.S
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-# arch/cris/crt0.S
-#
-# Does arch-specific initialization and invokes __libc_init
-# with the appropriate arguments.
-#
-# See __static_init.c or __shared_init.c for the expected
-# arguments.
-#
-
-	.text
-	.balign 4
-	.type	_start, at function
-	.globl	_start
-_start:
-	/* Save the address of the ELF argument array */
-	move.d	$sp,$r10	/* Address of ELF arguments */
-
-	/* atexit() function (assume null) */
-	moveq	0,$r11
-
-	/* Set up a dummy stack frame to keep gcc from getting confused */
-	push	$r11
-	push	$r11
-	jump	__libc_init
-
-	.size _start, .-_start
diff --git a/usr/klibc/arch/cris/divide.c b/usr/klibc/arch/cris/divide.c
deleted file mode 100644
index 1d4ab236..00000000
--- a/usr/klibc/arch/cris/divide.c
+++ /dev/null
@@ -1,99 +0,0 @@
-#include <stdint.h>
-#include <signal.h>
-
-#if BITS == 64
-typedef uint64_t unum;
-typedef int64_t snum;
-#else
-typedef uint32_t unum;
-typedef int32_t snum;
-#endif
-
-#ifdef SIGNED
-typedef snum xnum;
-#else
-typedef unum xnum;
-#endif
-
-#ifdef __cris__
-static inline unum __attribute__ ((const))dstep(unum rs, unum rd)
-{
-	asm("dstep %1,%0": "+r"(rd):"r"(rs));
-	return rd;
-}
-
-static inline unum __attribute__ ((const))lz(unum rs)
-{
-	unum rd;
-	asm("lz %1,%0": "=r"(rd):"r"(rs));
-	return rd;
-}
-
-#else
-/* For testing */
-static inline unum __attribute__ ((const))dstep(unum rs, unum rd)
-{
-	rd <<= 1;
-	if (rd >= rs)
-		rd -= rs;
-
-	return rd;
-}
-
-static inline unum __attribute__ ((const))lz(unum rs)
-{
-	unum rd = 0;
-	while (rs >= 0x7fffffff) {
-		rd++;
-		rs <<= 1;
-	}
-	return rd;
-}
-
-#endif
-
-xnum NAME(unum num, unum den)
-{
-	unum quot = 0, qbit = 1;
-	int minus = 0;
-	xnum v;
-
-	if (den == 0) {
-		raise(SIGFPE);
-		return 0;	/* If signal ignored... */
-	}
-
-	if (den == 1)
-		return (xnum) (REM ? 0 : num);
-
-#if SIGNED
-	if ((snum) (num ^ den) < 0)
-		minus = 1;
-	if ((snum) num < 0)
-		num = -num;
-	if ((snum) den < 0)
-		den = -den;
-#endif
-
-	den--;
-
-	/* Left-justify denominator and count shift */
-	while ((snum) den >= 0) {
-		den <<= 1;
-		qbit <<= 1;
-	}
-
-	while (qbit) {
-		if (den <= num) {
-			num -= den;
-			quot += qbit;
-		}
-		den >>= 1;
-		qbit >>= 1;
-	}
-
-	v = (xnum) (REM ? num : quot);
-	if (minus)
-		v = -v;
-	return v;
-}
diff --git a/usr/klibc/arch/cris/setjmp.S b/usr/klibc/arch/cris/setjmp.S
deleted file mode 100644
index 2041b82d..00000000
--- a/usr/klibc/arch/cris/setjmp.S
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# arch/cris/setjmp.S
-#
-# setjmp/longjmp for the cris architecture
-#
-
-#
-# The jmp_buf is assumed to contain the following, in order:
-#	$r8..$r0	(in that order)
-#	$sp	($r14)
-#	return address
-#
-
-	.text
-	.balign 4
-	.globl	setjmp
-	.type	setjmp, @function
-setjmp:
-	movem	$r8,[$r10+]		/* Save $r8..$r0 at $r10... */
-	move.d	$sp,[$r10+]
-	move	$srp,[$r10]
-	ret
-	  moveq	0,$r10
-
-	.size setjmp,.-setjmp
-
-	.text
-	.balign 4
-	.globl	longjmp
-	.type	longjmp, @function
-longjmp:
-	movem	[$r10+],$r8		/* Load $r8..$r0 from $r10... */
-	move.d	[$r10+],$sp
-	jump	[$r10]
-	move.d $r11,$r10
-
-	.size longjmp,.-longjmp
diff --git a/usr/klibc/arch/cris/syscall.S b/usr/klibc/arch/cris/syscall.S
deleted file mode 100644
index d71495ab..00000000
--- a/usr/klibc/arch/cris/syscall.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * arch/cris/syscall.S
- *
- * On cris, r9 contains the syscall number (set by generated stub);
- * r10..r13 contain arguments 0-3 per the standard calling convention,
- * and arguments 4-5 are passed in $mof and $srp; however, we have
- * to save $srp around the system call.
- */
-
-	.section ".text","ax"
-	.balign	4
-	.globl	__syscall_common
-	.type	__syscall_common, at function
-__syscall_common:
-	push	$srp
-	move	[$sp+4],$mof
-	move	[$sp+8],$srp
-	break	13
-
-	cmps.w	-4096,$r10
-	blo	1f
-	neg.d	$r10,$r11
-	move.d	$r11,[errno]
-	moveq	-1,$r10
-1:
-	pop	$srp
-	ret
-	nop
-
-	.size	__syscall_common,.-__syscall_common
diff --git a/usr/klibc/arch/cris/sysstub.ph b/usr/klibc/arch/cris/sysstub.ph
deleted file mode 100644
index 182ad73f..00000000
--- a/usr/klibc/arch/cris/sysstub.ph
+++ /dev/null
@@ -1,29 +0,0 @@
-# -*- perl -*-
-#
-# arch/cris/sysstub.ph
-#
-# Script to generate system call stubs
-#
-
-sub make_sysstub($$$$$@) {
-    my($outputdir, $fname, $type, $sname, $stype, @args) = @_;
-
-    open(OUT, '>', "${outputdir}/${fname}.S");
-    print OUT "#include <asm/unistd.h>\n";
-    print OUT "\n";
-    print OUT "\t.text\n";
-    print OUT "\t.type\t${fname},\@function\n";
-    print OUT "\t.globl\t${fname}\n";
-    print OUT "\t.balign\t4\n";
-    print OUT "${fname}:\n";
-    print OUT "#if __NR_${sname} <= 31\n";
-    print OUT "\t  moveq\t__NR_${sname}, \$r9\n";
-    print OUT "#else\n";
-    print OUT "\t  move.d\t__NR_${sname}, \$r9\n";
-    print OUT "#endif\n";
-    print OUT "\tjump\t__syscall_common\n";
-    print OUT "\t.size ${fname},.-${fname}\n";
-    close(OUT);
-}
-
-1;
diff --git a/usr/klibc/arch/cris/vfork.S b/usr/klibc/arch/cris/vfork.S
deleted file mode 100644
index ccdb36ce..00000000
--- a/usr/klibc/arch/cris/vfork.S
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * arch/cris/vfork.S
- *
- * On cris, r9 contains the syscall number (set by generated stub);
- * r10..r13 contain arguments 0-3 per the standard calling convention.
- * The return address is in $srp; so we just need to avoid the stack
- * usage of the normal syscall stubs.
- */
-
-#include <asm/unistd.h>
-
-	.section ".text","ax"
-	.balign	4
-	.globl	vfork
-	.type	vfork, at function
-vfork:
-	move.d	__NR_vfork, $r9
-	break	13
-
-	cmps.w	-4096,$r10
-	blo	1f
-	neg.d	$r10,$r11
-	move.d	$r11,[errno]
-	moveq	-1,$r10
-1:
-	ret
-	nop
-
-	.size	vfork,.-vfork


More information about the klibc mailing list