sparc: Simplify build junk

* Don't bother with FUNCDEF.  I've seen make-config pick the wrong definition.
  Not sure how or why. Apart from call_into_lisp, most of the assembly code
  could be written as lisp asm routines anyway.

* Remove dead code in sparc-arch.c

* Don't offer a choice of cheneygc
This commit is contained in:
Douglas Katzman 2022-03-08 10:04:52 -05:00
parent 794177fed3
commit 6cf18c77e2
8 changed files with 4 additions and 114 deletions

1
.gitignore vendored
View file

@ -33,7 +33,6 @@ src/runtime/target-arch.h
src/runtime/target-lispregs.h
src/runtime/target-os.h
src/runtime/ppc-linux-mcontext.h
src/runtime/sparc-funcdef.h
tests/test-status.lisp-expr
tests/test.log
tests/*.so

View file

@ -680,22 +680,7 @@ case "$sbcl_arch" in
fi
;;
sparc)
# Test the compiler in order to see if we are building on Sun
# toolchain as opposed to GNU binutils, and write the appropriate
# FUNCDEF macro for assembler. No harm in running this on sparc-linux
# as well.
sh tools-for-build/sparc-funcdef.sh > src/runtime/sparc-funcdef.h
if [ "$sbcl_os" = "netbsd" ] || [ "$sbcl_os" = "sunos" ] || [ "$sbcl_os" = "linux" ]; then
printf ' :gencgc' >> $ltf
else
echo '***'
echo '*** You are running SPARC on other than SunOS, NetBSD, or Linux. Since'
echo '*** GENCGC is untested on this combination, make-config.sh'
echo '*** is falling back to CHENEYGC. Please consider adjusting'
echo '*** parms.lisp to build with GENCGC instead.'
echo '***'
printf ' :cheneygc' >> $ltf
fi
printf ' :gencgc' >> $ltf
;;
esac

View file

@ -22,11 +22,7 @@ ifdef LISP_FEATURE_SB_CORE_COMPRESSION
OS_LIBS += -lz
endif
ifdef LISP_FEATURE_GENCGC
GC_SRC = fullcgc.c gencgc.c traceroot.c
else
GC_SRC = cheneygc.c
endif
GC_SRC = fullcgc.c gencgc.c traceroot.c
# Nothing to do for after-grovel-headers.
.PHONY: after-grovel-headers

View file

@ -23,11 +23,7 @@ ifdef LISP_FEATURE_SB_CORE_COMPRESSION
OS_LIBS += -lz
endif
ifdef LISP_FEATURE_GENCGC
GC_SRC = fullcgc.c gencgc.c traceroot.c
else
GC_SRC = cheneygc.c
endif
GC_SRC = fullcgc.c gencgc.c traceroot.c
# Nothing to do for after-grovel-headers.
.PHONY: after-grovel-headers

View file

@ -28,11 +28,7 @@ ifdef LISP_FEATURE_SB_CORE_COMPRESSION
OS_LIBS += -lz
endif
ifdef LISP_FEATURE_GENCGC
GC_SRC = fullcgc.c gencgc.c traceroot.c
else
GC_SRC = cheneygc.c
endif
GC_SRC = fullcgc.c gencgc.c traceroot.c
# Nothing to do for after-grovel-headers.
.PHONY: after-grovel-headers

View file

@ -27,57 +27,7 @@
os_vm_address_t arch_get_bad_addr(int sig, siginfo_t *code, os_context_t *context)
{
#if 1 /* New way. */
return (os_vm_address_t)code->si_addr;
#else /* Old way, almost certainly predates sigaction(2)-style handlers */
unsigned int badinst;
unsigned int *pc;
int rs1;
pc = (unsigned int *)OS_CONTEXT_PC(context);
/* On the sparc, we have to decode the instruction. */
/* Make sure it's not the pc thats bogus, and that it was lisp code */
/* that caused the fault. */
if ((unsigned long) pc & 3) {
/* Unaligned */
return NULL;
}
if ((pc < READ_ONLY_SPACE_START ||
pc >= READ_ONLY_SPACE_START+READ_ONLY_SPACE_SIZE) &&
(pc < current_dynamic_space ||
pc >= current_dynamic_space + dynamic_space_size)) {
return NULL;
}
badinst = *pc;
if ((badinst >> 30) != 3)
/* All load/store instructions have op = 11 (binary) */
return 0;
rs1 = (badinst>>14)&0x1f;
if (badinst & (1<<13)) {
/* r[rs1] + simm(13) */
int simm13 = badinst & 0x1fff;
if (simm13 & (1<<12))
simm13 |= -1<<13;
return (os_vm_address_t)
(*os_context_register_addr(context, rs1)+simm13);
}
else {
/* r[rs1] + r[rs2] */
int rs2 = badinst & 0x1f;
return (os_vm_address_t)
(*os_context_register_addr(context, rs1) +
*os_context_register_addr(context, rs2));
}
#endif
}
void arch_skip_instruction(os_context_t *context)

View file

@ -5,8 +5,6 @@
#define _ASM
#include "sparc-funcdef.h"
#include "lispregs.h"
#include "globals.h"
#include "sbcl.h"
@ -35,7 +33,6 @@
#define ST_FLUSH_WINDOWS 0x03
.seg "text"
.global call_into_lisp
FUNCDEF(call_into_lisp)
call_into_lisp:
save %sp, -FRAMESIZE, %sp
@ -126,7 +123,6 @@ lra:
restore %sp, FRAMESIZE, %sp
.global call_into_c
FUNCDEF(call_into_c)
call_into_c:
/* Build a lisp stack frame */
mov reg_CFP, reg_OCFP
@ -233,7 +229,6 @@ fun_end_breakpoint_trap:
fun_end_breakpoint_end:
.global sparc_flush_icache
FUNCDEF(sparc_flush_icache)
sparc_flush_icache:
add %o0,%o1,%o2
1: iflush %o0 ! flush instruction cache
@ -245,14 +240,12 @@ sparc_flush_icache:
nop
.global do_pending_interrupt
FUNCDEF(do_pending_interrupt)
do_pending_interrupt:
unimp trap_PendingInterrupt
retl
nop
.global save_context
FUNCDEF(save_context)
save_context:
ta ST_FLUSH_WINDOWS ! flush register windows
retl ! return from leaf routine

View file

@ -1,25 +0,0 @@
cd ./tools-for-build
TMP=sparc-funcdef.S
SUN_FUNCDEF="#define FUNCDEF(x) .type x, #function"
GNU_FUNCDEF="#define FUNCDEF(x) .type x,@function"
echo $SUN_FUNCDEF > $TMP
# cribbed from ldso_stubs, just "some code"
echo "
.globl foo_stub__printf ;
FUNCDEF(foo_stub__printf) ;
foo_stub__printf: ;
sethi %hi(printf),%g1 ;
jmpl %g1+%lo(printf),%g0 ;
nop /* delay slot*/ ;
.Lprintfe1: ;
.size foo_stub__printf,.Lprintfe1-foo_stub__printf ;" >> $TMP
if $GNUMAKE sparc-funcdef.o > /dev/null 2>&1 ; then
echo $SUN_FUNCDEF
else
echo $GNU_FUNCDEF
fi
rm -f $TMP