diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/Makedefs ./config/unix/netbsdelf1.5/Makedefs --- ../icon-9.4.0/config/unix/netbsdelf1.5/Makedefs Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/Makedefs Wed May 8 21:20:07 2002 @@ -0,0 +1,17 @@ +# Makefile definitions from config/unix/netbsdelf1.5 + +# CC C compiler +# CFLAGS flags for building C files +# CFDYN additional flags for dynamic functions +# RLINK flags for linking run-time system +# RLIBS libraries to link with run-time system +# XLIBS libraries to link for graphics +# XPMDEFS definitions for building XPM library + +CC = gcc +CFLAGS = -O2 +CFDYN = -fPIC +RLINK = -Wl,-E +RLIBS = -lm +XLIBS = -L/usr/X11R6/lib -lX11 +XPMDEFS = -DZPIPE diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/custom.sh ./config/unix/netbsdelf1.5/custom.sh --- ../icon-9.4.0/config/unix/netbsdelf1.5/custom.sh Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/custom.sh Wed May 8 21:20:30 2002 @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Custom setup script for Debian + +SRC=../../../src +ARCH=`dpkg --print-architecture||uname -m` + +if [ -f rswitch.$ARCH.s ]; then + cp -f rswitch.$ARCH.s $SRC/common/rswitch.s +elif [ -f rswitch.$ARCH.c ]; then + cp -f rswitch.$ARCH.c $SRC/common/rswitch.c +else + echo "#define NoCoexpr" >>$SRC/h/define.h +fi + +if [ -f define.$ARCH ]; then + cat define.$ARCH >>$SRC/h/define.h +fi diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/define.alpha ./config/unix/netbsdelf1.5/define.alpha --- ../icon-9.4.0/config/unix/netbsdelf1.5/define.alpha Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/define.alpha Wed May 8 20:40:58 2002 @@ -0,0 +1,5 @@ +/* CPU architecture */ +#define IntBits 32 +#define WordBits 64 +#define Double +#define StackAlign 8 diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/define.h ./config/unix/netbsdelf1.5/define.h --- ../icon-9.4.0/config/unix/netbsdelf1.5/define.h Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/define.h Wed May 8 21:19:34 2002 @@ -0,0 +1,15 @@ +/* + * Icon configuration file for NetBSD + */ + +#define UNIX 1 +#define GenericBSD +#define BSD_4_4_LITE 1 /* This is new, for 4.4Lite specific stuff */ +#define NetBSD /* This is for NetBSD stuff (save) */ + +#define LoadFunc +#define SysOpt +#define ExecImages + +#define CComp "gcc" +#define COpts "-O2 -fomit-frame-pointer" diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/define.netbsd-sparc ./config/unix/netbsdelf1.5/define.netbsd-sparc --- ../icon-9.4.0/config/unix/netbsdelf1.5/define.netbsd-sparc Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/define.netbsd-sparc Wed May 8 20:40:58 2002 @@ -0,0 +1,5 @@ + +/* sparc-specific configuration parameters */ + +#define Double +#define StackAlign 8 diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/rswitch.c ./config/unix/netbsdelf1.5/rswitch.c --- ../icon-9.4.0/config/unix/netbsdelf1.5/rswitch.c Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/rswitch.c Wed May 8 20:40:58 2002 @@ -0,0 +1,11 @@ +/* + * This is a dummy co-expression context switch that can be used in + * the absence of a working one. + */ + +int coswitch(old_cs, new_cs, fnc) +int *old_cs, *new_cs; +int fnc; + { + err_msg(401, (void*)0); + } diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/rswitch.netbsd-alpha.s ./config/unix/netbsdelf1.5/rswitch.netbsd-alpha.s --- ../icon-9.4.0/config/unix/netbsdelf1.5/rswitch.netbsd-alpha.s Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/rswitch.netbsd-alpha.s Wed May 8 20:40:58 2002 @@ -0,0 +1,46 @@ +/* + * coswitch(old_cs, new_cs, first) for Dec Alpha architecture + * $16 $17 $18 + */ + .data +errmsg: .ascii "new_context() returned in coswitch\X00" + + .text + .globl coswitch + .ent coswitch +coswitch: + lda $sp, -72($sp) /* make room on stack */ + stq $sp, 0($16) /* save stack pointer */ + stq $9, 0($sp) /* save registers on stack */ + stq $10, 8($sp) + stq $11, 16($sp) + stq $12, 24($sp) + stq $13, 32($sp) + stq $14, 40($sp) + stq $15, 48($sp) + stq $27, 56($sp) + stq $26, 64($sp) /* return address */ + beq $18, first /* if first time */ + + ldq $sp, 0($17) /* load new stack pointer */ + ldq $9, 0($sp) /* load registers from stack */ + ldq $10, 8($sp) + ldq $11, 16($sp) + ldq $12, 24($sp) + ldq $13, 32($sp) + ldq $14, 40($sp) + ldq $15, 48($sp) + ldq $27, 56($sp) + ldq $26, 64($sp) /* return address */ + lda $sp, 72($sp) /* reset sp */ + jsr_coroutine $31, ($26), 0 /* jump into new_context */ + +first: + ldq $sp, 0($17) /* load stack pointer only */ + bis $31, $31, $16 /* r16 = 0 */ + bis $31, $31, $17 /* r17 = 0 */ + jsr $26, new_context /* new_context(0,0) */ + lda $16, errmsg + jsr $26, syserr /* shouldn't get here */ + + .end coswitch diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/rswitch.netbsd-i386.c ./config/unix/netbsdelf1.5/rswitch.netbsd-i386.c --- ../icon-9.4.0/config/unix/netbsdelf1.5/rswitch.netbsd-i386.c Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/rswitch.netbsd-i386.c Wed May 8 20:40:58 2002 @@ -0,0 +1,23 @@ +/* + * coswitch for i386 architecture + */ + +coswitch(old_cs, new_cs, first) +int *old_cs, *new_cs; +int first; + { + asm(" movl 8(%ebp),%eax"); + asm(" movl %esp,0(%eax)"); + asm(" movl %ebp,4(%eax)"); + asm(" movl 12(%ebp),%eax"); + if (first == 0) { /* this is the first activation */ + asm(" movl 0(%eax),%esp"); + asm(" movl $0,%ebp"); + new_context(0, 0); + syserr("interp() returned in coswitch"); + } + else { + asm(" movl 0(%eax),%esp"); + asm(" movl 4(%eax),%ebp"); + } + } diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/rswitch.netbsd-parisc.s ./config/unix/netbsdelf1.5/rswitch.netbsd-parisc.s --- ../icon-9.4.0/config/unix/netbsdelf1.5/rswitch.netbsd-parisc.s Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/rswitch.netbsd-parisc.s Wed May 8 20:40:58 2002 @@ -0,0 +1,68 @@ +; coexpression code for HP PA-RISC architecture for Icon 8.10 +; +; n.b. two of the three coexpression tests work, but coexpression +; *transmission*, a rarely used feature, does not + + .CODE + .IMPORT syserr + .EXPORT coswitch +coswitch + .PROC + .CALLINFO + .ENTRY + ; store old registers + STW %sp,0(%arg0) + ; not used: 4(%arg0) + STW %rp,8(%arg0) + STW %r3,12(%arg0) + STW %r4,16(%arg0) + STW %r5,20(%arg0) + STW %r6,24(%arg0) + STW %r7,28(%arg0) + STW %r8,32(%arg0) + STW %r9,36(%arg0) + STW %r10,40(%arg0) + STW %r11,44(%arg0) + STW %r12,48(%arg0) + STW %r13,52(%arg0) + STW %r14,56(%arg0) + STW %r15,60(%arg0) + STW %r16,64(%arg0) + STW %r17,68(%arg0) + STW %r18,72(%arg0) + + COMIB,=,N 0,%arg2,L$isfirst + + ; this is not a first-time call; reload old context + LDW 0(%arg1),%sp + LDW 8(%arg1),%rp + LDW 12(%arg1),%r3 + LDW 16(%arg1),%r4 + LDW 20(%arg1),%r5 + LDW 24(%arg1),%r6 + LDW 28(%arg1),%r7 + LDW 32(%arg1),%r8 + LDW 36(%arg1),%r9 + LDW 40(%arg1),%r10 + LDW 44(%arg1),%r11 + LDW 48(%arg1),%r12 + LDW 52(%arg1),%r13 + LDW 56(%arg1),%r14 + LDW 60(%arg1),%r15 + LDW 64(%arg1),%r16 + LDW 68(%arg1),%r17 + LDW 72(%arg1),%r18 + BV,N (%rp) ; return + +L$isfirst + LDW 0(%arg1),%sp + LDI 0,%arg0 + LDI 0,%arg1 + .CALL ARGW0=GR,ARGW1=GR + BL,N new_context,%rp ; call new_context(0,0) + SUBI 1,%r0,%rp + BV,N (%rp) ; abort w/ illegal jump + .EXIT + .PROCEND + .IMPORT new_context,CODE + .END diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/rswitch.netbsd-sparc.c ./config/unix/netbsdelf1.5/rswitch.netbsd-sparc.c --- ../icon-9.4.0/config/unix/netbsdelf1.5/rswitch.netbsd-sparc.c Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/rswitch.netbsd-sparc.c Wed May 8 20:40:58 2002 @@ -0,0 +1,36 @@ +/* + * coswitch for Sun-4 Sparc. + * + * Compile this with 'gcc -c rswitch.c'. Do not use gcc -O. + */ + +int coswitch(old_cs, new_cs, first) +int *old_cs, *new_cs; +int first; +{ + asm("ta 0x03"); /* ST_FLUSH_WINDOWS in trap.h */ + asm("ld [%fp+0x44], %o0"); /* load old_cs into %o0 */ + asm("st %sp,[%o0]"); /* Save user stack pointer */ + asm("st %fp,[%o0+0x4]"); /* Save frame pointer */ + asm("st %i7,[%o0+0x8]"); /* Save return address */ + + if (first == 0) { /* this is the first activation */ + asm("ld [%fp+0x48], %o0"); /* load new_cs into %o0 */ + asm("ld [%o0], %o1"); /* load %o1 from cstate[0] */ + + /* Decrement new stack pointer value before loading it into sp. */ + /* The top 64 bytes of the stack are reserved for the kernel, to */ + /* save the 8 local and 8 in registers into, on context switches, */ + /* interrupts, traps, etc. */ + + asm("save %o1,-96, %sp"); /* load %sp from %o1 */ + new_context(0,0); + syserr("new_context() returned in coswitch"); + + } else { + asm("ld [%fp+0x48], %o0"); /* load new_cs into %o0 */ + asm("ld [%o0+0x4],%fp"); /* Load frame pointer */ + asm("ld [%o0+0x8],%i7"); /* Load return address */ + asm("ld [%o0],%sp"); /* Load user stack pointer */ + } +} diff -urN ../icon-9.4.0/config/unix/netbsdelf1.5/status ./config/unix/netbsdelf1.5/status --- ../icon-9.4.0/config/unix/netbsdelf1.5/status Thu Jan 1 00:00:00 1970 +++ ./config/unix/netbsdelf1.5/status Wed May 8 21:22:09 2002 @@ -0,0 +1,29 @@ +System configuration: + + Debian GNU/NetBSD + +Latest Icon version: + + Version 9.4.0 + +Installer: + + Christian Hudon + The Debian project + +Missing features: + + Coexpressions implemented only for the i386, sparc, parisc and + alpha architectures. + +Known bugs: + + None + +Comments: + + Tested under Debian woody on the i386 architecture. + +Date: + + August 7, 2001 diff -urN ../icon-9.4.0/ipl/cfuncs/mklib.sh ./ipl/cfuncs/mklib.sh --- ../icon-9.4.0/ipl/cfuncs/mklib.sh Wed May 8 21:09:40 2002 +++ ./ipl/cfuncs/mklib.sh Wed May 8 21:05:25 2002 @@ -21,7 +21,7 @@ ld -shared -o $LIBNAME "$@";; OSF*) ld -shared -expect_unresolved '*' -o $LIBNAME "$@" -lc;; - Linux*|BSD/OS*|OpenBSD*|GNU*) + Linux*|BSD/OS*|OpenBSD*|GNU*|NetBSD*) gcc -shared -o $LIBNAME -fPIC "$@";; FreeBSD*) ld -Bshareable -o $LIBNAME "$@" -lc;;