Looks there is some "problem" in compiler/riscv/insts.lisp or compiler/riscv/target-insts.lisp as package SB-RISCV-ASM is defined there ?
---------------------
Current mapping (c.f. riscv-lispreags.h)
os_context_register_addr(os_context_t *context, int regno)
{
switch (regno) { // c.f.: https://en.wikichip.org/wiki/risc-v/registers
case reg_RA: return (&context->sc_ra); // return address
case reg_NSP: return (&context->sc_sp); // stack pointer
case reg_GLOBAL: return (&context->sc_gp); // global pointer
case reg_TP: return (&context->sc_tp); // thread pointer
case reg_LIP:
case reg_CFP:
case reg_OCFP:
case reg_LEXENV:
case reg_NULL:
case reg_CODE:
case reg_NARGS:
return (&context->sc_t[regno]); // temporary register 0 - 6
case reg_NFP:
case reg_CSP:
case reg_A4:
case reg_NL4:
case reg_A5:
case reg_NL5:
case reg_L0:
case reg_NL6:
case reg_L1:
case reg_NL7:
#ifdef LISP_FEATURE_SB_THREAD
case reg_THREAD:
#else
case reg_L2:
#endif
case reg_CFUNC:
return (&context->sc_s[regno]); // saved register 0 - 11
case reg_A0:
case reg_NL0:
case reg_A1:
case reg_NL1:
case reg_A2:
case reg_NL2:
case reg_A3:
case reg_NL3:
return (&context->sc_a[regno]); // function argument register 0 - 7
default: return (&context->sc_sepc); // exception program counter
}
}
Tried to build --without-sb-thread but doesn't seem to have an effect. So I commented out in thread.c
----------- OS_THREAD_ STACK switching_ stack(void* , void *(*fun)(void *));
/*
#ifdef LISP_FEATURE_
extern void* funcall1_
void* new_thread_ trampoline_ switch_ stack(void* th) { switching_ stack(th, new_thread_ trampoline) ;
return funcall1_
}
#endif
*/
-----------
Maybe I don't need this right now as in linux there doesn't seem to be an assembler file that does that part, too.
Current "blocking" error is this (which seems to be independent from the mapping code below):
"obj/from- xc/src/ code/early- defmethod. lisp-obj" xc/src/ code/format. lisp-obj" xc/src/ code/target- format. lisp-obj" xc/src/ code/late- globaldb. lisp-obj" :INST-PRINTER SB-RISCV-ASM::C.J 1) :LOOKUP- LABEL SB-DISASSEM::|.T9|)
"obj/from-
"obj/from-
"obj/from-
; in: SB-INT:NAMED-LAMBDA (SB-DISASSEM:
; (SB-DISASSEM:
;
; note: deleting unreachable code
; (OR :DSTATE- LABEL-HASH SB-DISASSEM: :DSTATE) )
; (GETHASH SB-DISASSEM::LAB
; (SB-DISASSEM:
; SB-DISASSEM::LAB)
; --> IF
; ==>
; SB-DISASSEM::LAB
;
; note: deleting unreachable code
; (SB-DISASSEM: :INST-PRINT- NAME SB-DISASSEM::INST)
;
; note: deleting unreachable code
; (SB-DISASSEM: :DSTATE- ARGUMENT- COLUMN SB-DISASSEM: :DSTATE)
;
; note: deleting unreachable code
; (SB-DISASSEM: :LOCAL- PRINC16 SB-DISASSEM: :|.T10| )
;
; note: deleting unreachable code
; (SB-DISASSEM: PRINC16 SB-DISASSEM::THING STREAM)
;
; note: deleting unreachable code
; (SB-DISASSEM: OPERAND SB-DISASSEM::THING SB-DISASSEM: :DSTATE) :INST-PRINTER SB-RISCV- ASM::C. BEQZ 1) :DSTATE- LABEL-HASH SB-DISASSEM: :DSTATE) )
;
; note: deleting unreachable code
;
; compilation unit finished
; printed 7 notes
; in:
; SB-INT:NAMED-LAMBDA (SB-DISASSEM:
; (OR
; (GETHASH SB-DISASSEM::LAB
; (SB-DISASSEM:
; SB-DISASSEM::LAB)
; --> IF
; ==>
; SB-DISASSEM::LAB
;
; note: deleting unreachable code
; (PRINC ", " STREAM)
;
; note: deleting unreachable code
; (SB-DISASSEM: :INST-PRINT- NAME SB-DISASSEM::INST)
;
; note: deleting unreachable code
; (LET* ((SB-DISASSEM: :|.T6| :LOCAL- EXTRACT '#))) :LOCAL- EXTRACT '#))) :LOCAL- EXTRACT '#))) :LOCAL- EXTRACT '#))) :LOCAL- EXTRACT '#))) :ADJUST- LABEL ASM::USE- CB-LABEL> )) :LOOKUP- LABEL SB-DISASSEM: :|.T7|) ) :LOCAL- EXTRACT '#)))) :LOCAL- PRINT-NAME) :LOCAL- TAB-TO- ARG-COLUMN) :LOCAL- CALL-ARG- PRINTER SB-DISASSEM::|.T1| ASM::PRINT- RVC-REG> ) :LOCAL- PRINT-ARG- SEPARATOR) :LOCAL- PRINC16 SB-DISASSEM: :|.T8|) )
; (THE (UNSIGNED-BYTE 2) (SB-DISASSEM:
; (SB-DISASSEM::|.T5|
; (THE (UNSIGNED-BYTE 2) (SB-DISASSEM:
; (SB-DISASSEM::|.T4|
; (THE (UNSIGNED-BYTE 1) (SB-DISASSEM:
; (SB-DISASSEM::|.T3|
; (THE (UNSIGNED-BYTE 2) (SB-DISASSEM:
; (SB-DISASSEM::|.T2|
; (THE (UNSIGNED-BYTE 1) (SB-DISASSEM:
; (SB-DISASSEM::|.T7|
; (SB-DISASSEM:
; (LIST SB-DISASSEM::|.T2| SB-DISASSEM::|.T3| SB-DISASSEM::|.T4|
; SB-DISASSEM::|.T5| SB-DISASSEM::|.T6|)
; #<FUNCTION SB-RISCV-
; (SB-DISASSEM::|.T8| (SB-DISASSEM:
; (SB-DISASSEM::|.T1|
; (THE (UNSIGNED-BYTE 3) (SB-DISASSEM:
; (SB-DISASSEM:
; (SB-DISASSEM:
; (SB-DISASSEM:
; #<FUNCTION SB-RISCV-
; (SB-DISASSEM:
; (SB-DISASSEM:
;
; note: deleting unreachable code
; (SB-DISASSEM: :DSTATE- ARGUMENT- COLUMN SB-DISASSEM: :DSTATE)
;
; note: deleting unreachable code
; (SB-DISASSEM: PRINC16 SB-DISASSEM::THING STREAM)
;
; note: deleting unreachable code
; (SB-DISASSEM: OPERAND SB-DISASSEM::THING SB-DISASSEM: :DSTATE)
;
; note: deleting unreachable code
;
; compilation unit finished
; printed 7 notes
CORRUPTION WARNING
Looks there is some "problem" in compiler/ riscv/insts. lisp or compiler/ riscv/target- insts.lisp as package SB-RISCV-ASM is defined there ?
------- ------- -------
Current mapping (c.f. riscv-lispreags.h)
os_context_ register_ addr(os_ context_ t *context, int regno) /en.wikichip. org/wiki/ risc-v/ registers >sc_t[regno] ); // temporary register 0 - 6 SB_THREAD >sc_s[regno] ); // saved register 0 - 11 >sc_a[regno] ); // function argument register 0 - 7 >sc_sepc) ; // exception program counter
{
switch (regno) { // c.f.: https:/
case reg_RA: return (&context->sc_ra); // return address
case reg_NSP: return (&context->sc_sp); // stack pointer
case reg_GLOBAL: return (&context->sc_gp); // global pointer
case reg_TP: return (&context->sc_tp); // thread pointer
case reg_LIP:
case reg_CFP:
case reg_OCFP:
case reg_LEXENV:
case reg_NULL:
case reg_CODE:
case reg_NARGS:
return (&context-
case reg_NFP:
case reg_CSP:
case reg_A4:
case reg_NL4:
case reg_A5:
case reg_NL5:
case reg_L0:
case reg_NL6:
case reg_L1:
case reg_NL7:
#ifdef LISP_FEATURE_
case reg_THREAD:
#else
case reg_L2:
#endif
case reg_CFUNC:
return (&context-
case reg_A0:
case reg_NL0:
case reg_A1:
case reg_NL1:
case reg_A2:
case reg_NL2:
case reg_A3:
case reg_NL3:
return (&context-
default: return (&context-
}
}
os_context_ register_ t * float_register_ addr(os_ context_ t *context, int offset) >sc_f[offset] ); // floating-point registers
os_context_
{
return (&context-
}
void fp_control( os_context_ t *context) >sc_fcsr) ; // floating-point control register
os_restore_
{
// ToDo
// (&context-
}
os_context_ register_ t * lr_addr( os_context_ t *context) register_ addr(context, reg_LIP); ------- ------- ------- --
os_context_
{
return os_context_
}
-------