20000317 sourceware import
This commit is contained in:
155
libgloss/pa/Makefile.in
Normal file
155
libgloss/pa/Makefile.in
Normal file
@ -0,0 +1,155 @@
|
||||
# Copyright (c) 1995, 1996 Cygnus Support
|
||||
#
|
||||
# The authors hereby grant permission to use, copy, modify, distribute,
|
||||
# and license this software and its documentation for any purpose, provided
|
||||
# that existing copyright notices are retained in all copies and that this
|
||||
# notice is included verbatim in any distributions. No written agreement,
|
||||
# license, or royalty fee is required for any of the authorized uses.
|
||||
# Modifications to this software may be copyrighted by their authors
|
||||
# and need not follow the licensing terms described here, provided that
|
||||
# the new terms are clearly indicated on the first page of each file where
|
||||
# they apply.
|
||||
#
|
||||
VPATH = @srcdir@
|
||||
srcdir = @srcdir@
|
||||
objdir = .
|
||||
srcroot = $(srcdir)/../..
|
||||
objroot = $(objdir)/../..
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
host_alias = @host_alias@
|
||||
target_alias = @target_alias@
|
||||
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
tooldir = $(exec_prefix)/$(target_alias)
|
||||
|
||||
# Multilib support variables.
|
||||
# TOP is used instead of MULTI{BUILD,SRC}TOP.
|
||||
MULTIDIRS =
|
||||
MULTISUBDIR =
|
||||
MULTIDO = true
|
||||
MULTICLEAN = true
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
CC = @CC@
|
||||
|
||||
AS = @AS@
|
||||
AR = @AR@
|
||||
LD = @LD@
|
||||
RANLIB = @RANLIB@
|
||||
|
||||
OBJDUMP = `if [ -f ${objroot}/../binutils/objdump ] ; \
|
||||
then echo ${objroot}/../binutils/objdump ; \
|
||||
else t='$(program_transform_name)'; echo objdump | sed -e $$t ; fi`
|
||||
OBJCOPY = `if [ -f ${objroot}/../binutils/objcopy ] ; \
|
||||
then echo ${objroot}/../binutils/objcopy ; \
|
||||
else t='$(program_transform_name)'; echo objcopy | sed -e $$t ; fi`
|
||||
|
||||
SCRIPTS = w89k op50n
|
||||
CRT0 = crt0.o
|
||||
OBJS = close.o fstat.o getpid.o isatty.o kill.o \
|
||||
lseek.o open.o print.o putnum.o read.o sbrk.o stat.o \
|
||||
unlink.o write.o hp-milli.o
|
||||
|
||||
CFLAGS = -g
|
||||
# ARFLAGS = rv
|
||||
|
||||
#
|
||||
# here's all the Oki OP50N target stuff
|
||||
#
|
||||
OKI_LDFLAGS= -L${srcdir} -Top50n.ld $(LDFLAGS_FOR_TARGET) -Ttext 40000 -Map oki.map
|
||||
OKI_BSP= libop50n.a
|
||||
OKI_OBJS= op50nled.o op50n-io.o
|
||||
|
||||
#
|
||||
# here's all the WinBind W89k target stuff
|
||||
#
|
||||
WEC_LDFLAGS= -L${srcdir} -Tw89k.ld $(LDFLAGS_FOR_TARGET) -Ttext 100000 -Map wec.map
|
||||
WEC_BSP= libw89k.a
|
||||
WEC_OBJS= w89k-io.o
|
||||
|
||||
# Host specific makefile fragment comes in here.
|
||||
@host_makefile_frag@
|
||||
|
||||
#
|
||||
# build a test program for each target board. Just trying to get
|
||||
# it to link is a good test, so we ignore all the errors for now.
|
||||
#
|
||||
|
||||
all: ${CRT0} ${OKI_BSP} ${WEC_BSP}
|
||||
|
||||
test: ${CRT0} test.o ${OKI_BSP} ${WEC_BSP}
|
||||
@for script in ${SCRIPTS}; do \
|
||||
echo Building $@ for $${script}... ; \
|
||||
${CC} $(CFLAGS_FOR_TARGET) $(INCLUDES) -L${objdir} \
|
||||
-m$${script} test.o -L. \
|
||||
-o $${script}-test.x $(LIBS_FOR_TARGET) ; \
|
||||
if [ -s $${script}-test.x ] ; then \
|
||||
echo "Making an srecord for $${script}-test.x..." ; \
|
||||
${OBJCOPY} -O srec $${script}-test.x $${script}-test.srec ; \
|
||||
echo "Making an disassembly file for $${script}-test.x..." ; \
|
||||
rm -f $${script}-test.dis ; \
|
||||
${OBJDUMP} -d $${script}-test.x > $${script}-test.dis ; \
|
||||
else \
|
||||
rm $${script}-test.x ; \
|
||||
echo "WARNING: $${script}-test didn't build." ; \
|
||||
fi ; \
|
||||
done
|
||||
|
||||
#
|
||||
# here's where we build the board support packages for each target
|
||||
#
|
||||
${OKI_BSP}: $(OBJS) ${OKI_OBJS}
|
||||
${AR} ${ARFLAGS} $@ $(OBJS) ${OKI_OBJS}
|
||||
${RANLIB} $@
|
||||
|
||||
${WEC_BSP}: $(OBJS) ${WEC_OBJS}
|
||||
${AR} ${ARFLAGS} $@ $(OBJS) ${WEC_OBJS}
|
||||
${RANLIB} $@
|
||||
|
||||
op50n-test.x: test.o ${srcdir}/test.c ${OKI_BSP} ${WEC_BSP}
|
||||
w89k-test.x: test.o ${srcdir}/test.c ${OKI_BSP} ${WEC_BSP}
|
||||
|
||||
doc:
|
||||
|
||||
clean mostlyclean:
|
||||
rm -f a.out core *.i *~ *.o *-test *.srec *.dis *.map *.x
|
||||
|
||||
distclean maintainer-clean realclean: clean
|
||||
rm -f Makefile config.cache config.log config.status
|
||||
|
||||
.PHONY: install info install-info clean-info
|
||||
install:
|
||||
$(INSTALL_PROGRAM) $(CRT0) $(tooldir)/lib${MULTISUBDIR}/$(CRT0)
|
||||
# install Oki stuff
|
||||
$(INSTALL_PROGRAM) $(OKI_BSP) $(tooldir)/lib${MULTISUBDIR}/$(OKI_BSP)
|
||||
$(INSTALL_DATA) ${srcdir}/op50n.ld $(tooldir)/lib${MULTISUBDIR}/op50n.ld
|
||||
# install WinBond stuff
|
||||
$(INSTALL_PROGRAM) $(WEC_BSP) $(tooldir)/lib${MULTISUBDIR}/$(WEC_BSP)
|
||||
$(INSTALL_DATA) ${srcdir}/w89k.ld $(tooldir)/lib${MULTISUBDIR}/w89k.ld
|
||||
|
||||
info:
|
||||
install-info:
|
||||
clean-info:
|
||||
|
||||
test.o: ${srcdir}/test.c
|
||||
${CRT0}:${srcdir}/crt0.S
|
||||
op50n-io.o: ${srcdir}/op50n-io.S
|
||||
op50nled.o: ${srcdir}/op50nled.c
|
||||
|
||||
# target specific makefile fragment comes in here.
|
||||
@target_makefile_frag@
|
||||
|
||||
Makefile: Makefile.in config.status @host_makefile_frag_path@ @target_makefile_frag_path@
|
||||
$(SHELL) config.status
|
||||
|
||||
config.status: configure
|
||||
$(SHELL) config.status --recheck
|
82
libgloss/pa/README
Normal file
82
libgloss/pa/README
Normal file
@ -0,0 +1,82 @@
|
||||
Misc
|
||||
....
|
||||
|
||||
Naming Conventions
|
||||
------------------
|
||||
The basic naming convention for Unix machines is that
|
||||
hppa1.1-hp-proelf- is prepended to the front of each tool
|
||||
name. For DOS machines, the names are truncated to just the base
|
||||
tool name, like GCC.
|
||||
|
||||
Installation
|
||||
------------
|
||||
For this beta release, there are three tar files on the tape. A
|
||||
simple "tar xvf [device name]" will work. One of the tarfiles is
|
||||
all the sources, the others are binaries. One set is for a HP-UX
|
||||
host, and the other set is for a sun4 host.
|
||||
|
||||
First, make a directory called /usr/cygnus/beta-941019. Cd into
|
||||
this directory and type the tar command to extract the three tar
|
||||
files. Once the tar files are off the tape, you can uncompress
|
||||
and extract them. Typically, once they are installed, it's common
|
||||
practice to make a symbolic link so the path
|
||||
/usr/cygnus/beta-941019 works regardless which host. The actual
|
||||
binaries are in /usr/cygnus/beta-941019/$host/bin, where host is
|
||||
the configuration string for this machine.
|
||||
|
||||
|
||||
WinBond W89k board
|
||||
..................
|
||||
Downloading
|
||||
-----------
|
||||
To download type the "U" command to the ROM monitor. This will
|
||||
load to the address as specified in the srecord. This address is
|
||||
0x100000.
|
||||
|
||||
To compile
|
||||
----------
|
||||
Use these arguments on the command line for either the linker or
|
||||
the compiler:
|
||||
|
||||
-Tw89k.ld -Ttext 100000
|
||||
|
||||
To execute
|
||||
----------
|
||||
Type a "g = 100000" at thr ROM monitor after downloading to the
|
||||
target. After downloading, PC will be set to the correct address,
|
||||
but this command will *always* restart the execution from the
|
||||
beginning.
|
||||
|
||||
To debug
|
||||
--------
|
||||
To connect GDB to the target, use the "target w89k [devicename]".
|
||||
|
||||
Oki OP50N board
|
||||
...............
|
||||
|
||||
Downloading
|
||||
-----------
|
||||
To download, type "r 0" to the ROM monitor. The 0 is cause the
|
||||
monitor wants to offset the address in the srecord to 0x40000. The
|
||||
problem is that it doesn't relocate data right. So, we set the
|
||||
address for .text and .data to 0x40000, and we don't want any
|
||||
offset.
|
||||
|
||||
To compile
|
||||
----------
|
||||
Use these arguments on the command line for either the linker or
|
||||
the compiler:
|
||||
|
||||
-Top50n.ld -Ttext 40000
|
||||
|
||||
To execute
|
||||
----------
|
||||
Type a "g 40000" at thr ROM monitor after downloading to the
|
||||
target. After downloading, PC will be set to the correct address,
|
||||
but this command will *always* restart the execution from the
|
||||
beginning
|
||||
|
||||
To debug
|
||||
--------
|
||||
To connect GDB to the target, use the "target op50n [devicename]".
|
||||
|
1117
libgloss/pa/configure
vendored
Executable file
1117
libgloss/pa/configure
vendored
Executable file
File diff suppressed because it is too large
Load Diff
68
libgloss/pa/configure.in
Normal file
68
libgloss/pa/configure.in
Normal file
@ -0,0 +1,68 @@
|
||||
/* Copyright (c) 1995, 1996 Cygnus Support
|
||||
*
|
||||
* The authors hereby grant permission to use, copy, modify, distribute,
|
||||
* and license this software and its documentation for any purpose, provided
|
||||
* that existing copyright notices are retained in all copies and that this
|
||||
* notice is included verbatim in any distributions. No written agreement,
|
||||
* license, or royalty fee is required for any of the authorized uses.
|
||||
* Modifications to this software may be copyrighted by their authors
|
||||
* and need not follow the licensing terms described here, provided that
|
||||
* the new terms are clearly indicated on the first page of each file where
|
||||
* they apply.
|
||||
*
|
||||
* Process this file with autoconf to produce a configure script.
|
||||
*/
|
||||
AC_PREREQ(2.5)dnl
|
||||
AC_INIT(crt0.S)
|
||||
|
||||
if test "${enable_shared}" = "yes" ; then
|
||||
echo "Shared libraries not supported for cross compiling, ignored"
|
||||
fi
|
||||
|
||||
if test "$srcdir" = "." ; then
|
||||
if test "${with_target_subdir}" != "." ; then
|
||||
libgloss_topdir="${srcdir}/${with_multisrctop}../../.."
|
||||
else
|
||||
libgloss_topdir="${srcdir}/${with_multisrctop}../.."
|
||||
fi
|
||||
else
|
||||
libgloss_topdir="${srcdir}/../.."
|
||||
fi
|
||||
AC_CONFIG_AUX_DIR($libgloss_topdir)
|
||||
|
||||
AC_CANONICAL_SYSTEM
|
||||
AC_ARG_PROGRAM
|
||||
|
||||
AC_PROG_INSTALL
|
||||
|
||||
AC_PROG_CC
|
||||
AS=${AS-as}
|
||||
AC_SUBST(AS)
|
||||
AR=${AR-ar}
|
||||
AC_SUBST(AR)
|
||||
LD=${LD-ld}
|
||||
AC_SUBST(LD)
|
||||
AC_PROG_RANLIB
|
||||
|
||||
host_makefile_frag=${srcdir}/../config/default.mh
|
||||
target_makefile_frag=${srcdir}/../config/default.mt
|
||||
|
||||
dnl We have to assign the same value to other variables because autoconf
|
||||
dnl doesn't provide a mechanism to substitute a replacement keyword with
|
||||
dnl arbitrary data or pathnames.
|
||||
dnl
|
||||
host_makefile_frag_path=$host_makefile_frag
|
||||
AC_SUBST(host_makefile_frag_path)
|
||||
AC_SUBST_FILE(host_makefile_frag)
|
||||
target_makefile_frag_path=$target_makefile_frag
|
||||
AC_SUBST(target_makefile_frag_path)
|
||||
AC_SUBST_FILE(target_makefile_frag)
|
||||
|
||||
AC_OUTPUT(Makefile,
|
||||
. ${libgloss_topdir}/config-ml.in,
|
||||
srcdir=${srcdir}
|
||||
target=${target}
|
||||
ac_configure_args="${ac_configure_args} --enable-multilib"
|
||||
CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
libgloss_topdir=${libgloss_topdir}
|
||||
)
|
128
libgloss/pa/crt0.S
Normal file
128
libgloss/pa/crt0.S
Normal file
@ -0,0 +1,128 @@
|
||||
/* crt0.S -- startup file for hppa.
|
||||
*
|
||||
* Copyright (c) 1995 Cygnus Support
|
||||
*
|
||||
* The authors hereby grant permission to use, copy, modify, distribute,
|
||||
* and license this software and its documentation for any purpose, provided
|
||||
* that existing copyright notices are retained in all copies and that this
|
||||
* notice is included verbatim in any distributions. No written agreement,
|
||||
* license, or royalty fee is required for any of the authorized uses.
|
||||
* Modifications to this software may be copyrighted by their authors
|
||||
* and need not follow the licensing terms described here, provided that
|
||||
* the new terms are clearly indicated on the first page of each file where
|
||||
* they apply.
|
||||
*/
|
||||
.VERSION "1.0"
|
||||
.COPYRIGHT "crt0.o for the PA"
|
||||
|
||||
.DATA
|
||||
|
||||
/*
|
||||
* Set up the standard spaces (sections) These definitions come
|
||||
* from /lib/pcc_prefix.s.
|
||||
*/
|
||||
.TEXT
|
||||
|
||||
/*
|
||||
* stuff we need that's defined elsewhere.
|
||||
*/
|
||||
.IMPORT main, CODE
|
||||
.IMPORT exit, CODE
|
||||
.IMPORT _bss_start, DATA
|
||||
.IMPORT _end, DATA
|
||||
.IMPORT environ, DATA
|
||||
|
||||
/*
|
||||
* start -- set things up so the application will run.
|
||||
*
|
||||
*/
|
||||
.PROC
|
||||
.CALLINFO SAVE_SP, FRAME=48
|
||||
.EXPORT $START$,ENTRY
|
||||
$START$
|
||||
|
||||
/* FIXME: this writes to page zero */
|
||||
;; setup the %30 (stack pointer) with some memory
|
||||
ldil L%_stack,%r30
|
||||
ldo R%_stack(%r30),%r30
|
||||
|
||||
;; we need to set %r27 (global data pointer) here too
|
||||
ldil L%$global$,%r27
|
||||
ldo R%$global$(%r27),%r27 ; same problem as above
|
||||
|
||||
/*
|
||||
* zerobss -- zero out the bss section
|
||||
*/
|
||||
; load the start of bss
|
||||
ldil L%_bss_start,%r4
|
||||
ldo R%_bss_start(%r4),%r4
|
||||
|
||||
; load the end of bss
|
||||
ldil L%_end,%r5
|
||||
ldo R%_end(%r5),%r5
|
||||
|
||||
|
||||
L$bssloop
|
||||
addi -1,%r5,%r5 ; decrement _bss_end
|
||||
stb %r0,0(0,%r5) ; we do this by bytes for now even
|
||||
; though it's slower, it's safer
|
||||
combf,= %r4,%r5, L$bssloop
|
||||
nop
|
||||
|
||||
ldi 1,%ret0
|
||||
|
||||
/*
|
||||
* Call the main routine from the application to get it going.
|
||||
* main (argc, argv, environ)
|
||||
* We pass argv as a pointer to NULL.
|
||||
*/
|
||||
|
||||
ldil L%main,%r22
|
||||
ble R%main(%sr4,%r22)
|
||||
copy %r31,%r2
|
||||
/*
|
||||
* Call exit() from the C library with the return value from main()
|
||||
*/
|
||||
copy %r28,%r26
|
||||
ldil L%exit,%r22
|
||||
ble R%exit(%sr4,%r22)
|
||||
copy %r31,%r2
|
||||
|
||||
.PROCEND
|
||||
/*
|
||||
* _exit -- Exit from the application. Normally we cause a user trap
|
||||
* to return to the ROM monitor for another run.
|
||||
*/
|
||||
.EXPORT _exit, ENTRY
|
||||
_exit
|
||||
.PROC
|
||||
.CALLINFO
|
||||
.ENTRY
|
||||
|
||||
;; This just causes a breakpoint exception
|
||||
break 0x0,0x0
|
||||
bv,n (%rp)
|
||||
nop
|
||||
.EXIT
|
||||
.PROCEND
|
||||
|
||||
/*
|
||||
* _sr4export -- support for called functions. (mostly for GDB)
|
||||
*/
|
||||
.EXPORT _sr4export, ENTRY
|
||||
_sr4export:
|
||||
.PROC
|
||||
.CALLINFO
|
||||
.ENTRY
|
||||
|
||||
ble 0(%sr4,%r22)
|
||||
copy %r31,%rp
|
||||
ldw -24(%sr0,%sp),%rp
|
||||
ldsid (%sr0,%rp),%r1
|
||||
mtsp %r1,%sr0
|
||||
be,n 0(%sr0,%rp)
|
||||
nop
|
||||
.EXIT
|
||||
.PROCEND
|
||||
|
||||
|
1998
libgloss/pa/hp-milli.s
Normal file
1998
libgloss/pa/hp-milli.s
Normal file
File diff suppressed because it is too large
Load Diff
120
libgloss/pa/op50n-io.S
Normal file
120
libgloss/pa/op50n-io.S
Normal file
@ -0,0 +1,120 @@
|
||||
/* op50n-io.S -- low-level I/O routines for the Oki OP50N eval board.
|
||||
*
|
||||
* Copyright (c) 1995 Cygnus Support
|
||||
*
|
||||
* The authors hereby grant permission to use, copy, modify, distribute,
|
||||
* and license this software and its documentation for any purpose, provided
|
||||
* that existing copyright notices are retained in all copies and that this
|
||||
* notice is included verbatim in any distributions. No written agreement,
|
||||
* license, or royalty fee is required for any of the authorized uses.
|
||||
* Modifications to this software may be copyrighted by their authors
|
||||
* and need not follow the licensing terms described here, provided that
|
||||
* the new terms are clearly indicated on the first page of each file where
|
||||
* they apply.
|
||||
*/
|
||||
|
||||
mon_start .EQU 0xd0000000
|
||||
where_dp .EQU mon_start+4*4
|
||||
where_ci .EQU mon_start+14*4
|
||||
where_co .EQU mon_start+15*4
|
||||
where_read .EQU mon_start+22*4
|
||||
where_write .EQU mon_start+23*4
|
||||
|
||||
/*
|
||||
*int c = inbyte(wait);
|
||||
*/
|
||||
.space $TEXT$
|
||||
.align 4
|
||||
.EXPORT inbyte,CODE,ARGW0=GR,RTNVAL=GR
|
||||
inbyte
|
||||
.PROC
|
||||
.CALLINFO CALLER,FRAME=64,SAVE_RP
|
||||
.ENTRY
|
||||
stw %r2,-20(0,%r30)
|
||||
ldo 64(%r30),%r30
|
||||
stw %r27,-56(0,%r30) ; save my dp
|
||||
ldil l%where_dp,%r27 ; load monitors dp
|
||||
ldw r%where_dp(0,%r27),%r27
|
||||
ldil l%where_ci,%r1
|
||||
ldw r%where_ci(0,%r1),%r1
|
||||
ble 0(0,%r1)
|
||||
copy %r31,%r2
|
||||
ldw -56(0,%r30),%r27 ; load my dp
|
||||
ldw -84(0,%r30),%r2
|
||||
ldo -64(%r30),%r30
|
||||
bv %r0(%r2)
|
||||
nop
|
||||
.EXIT
|
||||
.PROCEND
|
||||
|
||||
/* int c = outbyte(c);
|
||||
*/
|
||||
.EXPORT outbyte,CODE,ARGW0=GR,RTNVAL=GR
|
||||
outbyte
|
||||
.PROC
|
||||
.CALLINFO CALLER,FRAME=64,SAVE_RP
|
||||
.ENTRY
|
||||
stw %r2,-20(0,%r30)
|
||||
ldo 64(%r30),%r30
|
||||
stw %r27,-56(0,%r30) ; save my dp
|
||||
ldil l%where_dp,%r27 ; load monitors dp
|
||||
ldw r%where_dp(0,%r27),%r27
|
||||
ldil l%where_co,%r1
|
||||
ldw r%where_co(0,%r1),%r1
|
||||
ble 0(0,%r1)
|
||||
copy %r31,%r2
|
||||
ldw -56(0,%r30),%r27 ; load my dp
|
||||
ldw -84(0,%r30),%r2
|
||||
ldo -64(%r30),%r30
|
||||
bv %r0(%r2)
|
||||
nop
|
||||
.EXIT
|
||||
.PROCEND
|
||||
|
||||
#if 0
|
||||
/* cnt = read(fd, bufp, cnt);
|
||||
*/
|
||||
.EXPORT read,CODE,ARGW0=NO,ARGW1=NO,ARGW2=NO,ARGW3=NO,RTNVAL=NO
|
||||
read
|
||||
.PROC
|
||||
.CALLINFO FRAME=64,CALLS,SAVE_RP
|
||||
.ENTRY
|
||||
stw %r2,-20(0,%r30)
|
||||
ldo 64(%r30),%r30
|
||||
stw %dp,-56(0,%r30) ; save my dp
|
||||
ldil l%where_dp,%dp ; load monitors dp
|
||||
ldw r%where_dp(0,%dp), %dp
|
||||
ldil l%where_read,%r1
|
||||
ldw r%where_read(0,%r1), %r1
|
||||
ble 0(0,%r1)
|
||||
copy %r31,%r2
|
||||
ldw -56(0,%r30),%dp ; load my dp
|
||||
ldw -84(0,%r30),%r2
|
||||
bv %r0(%r2)
|
||||
ldo -64(%r30),%r30
|
||||
.EXIT
|
||||
.PROCEND
|
||||
|
||||
/* cnt = write(fd, bufp, cnt);
|
||||
*/
|
||||
.EXPORT write,CODE,ARGW0=NO,ARGW1=NO,ARGW2=NO,ARGW3=NO,RTNVAL=NO
|
||||
write
|
||||
.PROC
|
||||
.CALLINFO FRAME=64,CALLS,SAVE_RP
|
||||
.ENTRY
|
||||
stw %r2,-20(0,%r30)
|
||||
ldo 64(%r30),%r30
|
||||
stw %dp,-56(0,%r30) ; save my dp
|
||||
ldil l%where_dp,%dp ; load monitors dp
|
||||
ldw r%where_dp(0,%dp), %dp
|
||||
ldil l%where_write,%r1
|
||||
ldw r%where_write(0,%r1), %r1
|
||||
ble 0(0,%r1)
|
||||
copy %r31,%r2
|
||||
ldw -56(0,%r30),%dp ; load my dp
|
||||
ldw -84(0,%r30),%r2
|
||||
bv %r0(%r2)
|
||||
ldo -64(%r30),%r30
|
||||
.EXIT
|
||||
.PROCEND
|
||||
#endif
|
31
libgloss/pa/op50n.h
Normal file
31
libgloss/pa/op50n.h
Normal file
@ -0,0 +1,31 @@
|
||||
/* op50n.h -- Support definitions for the Oki OP50N target board
|
||||
*
|
||||
* Copyright (c) 1995 Cygnus Support
|
||||
* The authors hereby grant permission to use, copy, modify, distribute,
|
||||
* and license this software and its documentation for any purpose, provided
|
||||
* that existing copyright notices are retained in all copies and that this
|
||||
* notice is included verbatim in any distributions. No written agreement,
|
||||
* license, or royalty fee is required for any of the authorized uses.
|
||||
* Modifications to this software may be copyrighted by their authors
|
||||
* and need not follow the licensing terms described here, provided that
|
||||
* the new terms are clearly indicated on the first page of each file where
|
||||
* they apply.
|
||||
*/
|
||||
|
||||
#ifndef __OP50N_H__
|
||||
#define __OP50N_H__
|
||||
|
||||
#define LED_ADDR 0xfc000059
|
||||
#define LED_0 0x1
|
||||
#define LED_1 0x2
|
||||
#define LED_2 0x4
|
||||
#define LED_3 0x8
|
||||
#define LED_4 0x10
|
||||
|
||||
extern void led_putnum( char );
|
||||
#define FUDGE(x) ((x >= 0xa && x <= 0xf) ? (x + 'a') & 0x7f : (x + '0') & 0x7f)
|
||||
|
||||
#endif /* __OP50N_H__ */
|
||||
|
||||
|
||||
|
54
libgloss/pa/op50n.ld
Normal file
54
libgloss/pa/op50n.ld
Normal file
@ -0,0 +1,54 @@
|
||||
OUTPUT_ARCH(hppa)
|
||||
ENTRY("$START$")
|
||||
STARTUP(crt0.o)
|
||||
GROUP(-lc -lop50n -lgcc)
|
||||
SEARCH_DIR(.)
|
||||
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x40000, LENGTH = 0x100000
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
CREATE_OBJECT_SYMBOLS
|
||||
*(.PARISC.stubs)
|
||||
*(.text)
|
||||
etext = . ;
|
||||
_etext = . ;
|
||||
__CTOR_LIST__ = . ;
|
||||
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
|
||||
*(.ctors)
|
||||
LONG(0)
|
||||
__CTOR_END__ = . ;
|
||||
__DTOR_LIST__ = . ;
|
||||
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
|
||||
*(.dtors)
|
||||
LONG(0)
|
||||
__DTOR_END__ = . ;
|
||||
*(.lit)
|
||||
*(.shdata)
|
||||
$global$ = ALIGN(4) ;
|
||||
. += 4;
|
||||
} > ram
|
||||
|
||||
.data : {
|
||||
*(.data)
|
||||
CONSTRUCTORS
|
||||
edata = . ;
|
||||
_edata = . ;
|
||||
} > ram
|
||||
|
||||
.bss : {
|
||||
_bss_start = ALIGN(4) ;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
_stack = ALIGN(64) ; /* Stack grows up on the PA!!! */
|
||||
. += 0x2000 ;
|
||||
end = . ;
|
||||
_end = . ;
|
||||
} > ram
|
||||
|
||||
}
|
81
libgloss/pa/op50nled.c
Normal file
81
libgloss/pa/op50nled.c
Normal file
@ -0,0 +1,81 @@
|
||||
/* op50nled.c -- fucntions that manipulate the LEDs.
|
||||
*
|
||||
* Copyright (c) 1995 Cygnus Support
|
||||
*
|
||||
* The authors hereby grant permission to use, copy, modify, distribute,
|
||||
* and license this software and its documentation for any purpose, provided
|
||||
* that existing copyright notices are retained in all copies and that this
|
||||
* notice is included verbatim in any distributions. No written agreement,
|
||||
* license, or royalty fee is required for any of the authorized uses.
|
||||
* Modifications to this software may be copyrighted by their authors
|
||||
* and need not follow the licensing terms described here, provided that
|
||||
* the new terms are clearly indicated on the first page of each file where
|
||||
* they apply.
|
||||
*/
|
||||
#include "op50n.h"
|
||||
|
||||
void zylons();
|
||||
void strobe();
|
||||
void led_putnum();
|
||||
void delay();
|
||||
|
||||
/*
|
||||
* led_putnum -- print a hex number on the LED. the value of num must be a byte.
|
||||
* The max number 15, since the front panel only has 4 LEDs.
|
||||
*/
|
||||
void
|
||||
led_putnum ( num )
|
||||
char num;
|
||||
{
|
||||
static unsigned char *leds = (unsigned char *)LED_ADDR;
|
||||
|
||||
/** *leds = (num << 4); **/
|
||||
*leds = num;
|
||||
}
|
||||
|
||||
/*
|
||||
* strobe -- do a zylons thing, toggling each led in sequence forever...
|
||||
*/
|
||||
void
|
||||
zylons()
|
||||
{
|
||||
while (1) {
|
||||
strobe();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* strobe -- toggle each led in sequence up and back once.
|
||||
*/
|
||||
void
|
||||
strobe()
|
||||
{
|
||||
static unsigned char curled;
|
||||
static unsigned char dir;
|
||||
|
||||
curled = 1;
|
||||
dir = 0;
|
||||
while (curled != 0) {
|
||||
led_putnum (curled);
|
||||
delay (70000);
|
||||
if (dir)
|
||||
curled >>= 1;
|
||||
else
|
||||
curled <<= 1;
|
||||
|
||||
if (curled == 0x100) {
|
||||
dir = ~dir;
|
||||
}
|
||||
}
|
||||
curled = 1;
|
||||
dir = 0;
|
||||
}
|
||||
|
||||
void
|
||||
delay (x)
|
||||
int x;
|
||||
{
|
||||
int y = 17;
|
||||
while (x-- !=0)
|
||||
y = y^2;
|
||||
}
|
140
libgloss/pa/setjmp.S
Normal file
140
libgloss/pa/setjmp.S
Normal file
@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (c) 1990,1994 The University of Utah and
|
||||
* the Computer Systems Laboratory (CSL). All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify and distribute this software is hereby
|
||||
* granted provided that (1) source code retains these copyright, permission,
|
||||
* and disclaimer notices, and (2) redistributions including binaries
|
||||
* reproduce the notices in supporting documentation, and (3) all advertising
|
||||
* materials mentioning features or use of this software display the following
|
||||
* acknowledgement: ``This product includes software developed by the
|
||||
* Computer Systems Laboratory at the University of Utah.''
|
||||
*
|
||||
* THE UNIVERSITY OF UTAH AND CSL ALLOW FREE USE OF THIS SOFTWARE IN ITS "AS
|
||||
* IS" CONDITION. THE UNIVERSITY OF UTAH AND CSL DISCLAIM ANY LIABILITY OF
|
||||
* ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
|
||||
*
|
||||
* CSL requests users of this software to return to csl-dist@cs.utah.edu any
|
||||
* improvements that they make and grant CSL redistribution rights.
|
||||
*
|
||||
* Utah $Hdr: _setjmp.s 1.9 94/12/16$
|
||||
*/
|
||||
|
||||
.space $TEXT$
|
||||
.subspa $CODE$
|
||||
|
||||
/*
|
||||
* The PA jmp_buf is 48 words arranged as follows:
|
||||
*
|
||||
* 0- 9: sigcontext
|
||||
* 10-26: callee save GRs (r3-r18) and DP (r27)
|
||||
* 27: callee save SRs (sr3)
|
||||
* 28-47: callee save FRs (fr12-fr21)
|
||||
*/
|
||||
|
||||
/*
|
||||
* int
|
||||
* setjmp(env)
|
||||
* jmp_buf env;
|
||||
*
|
||||
* This routine does not restore signal state.
|
||||
*/
|
||||
|
||||
.export setjmp,entry
|
||||
.export _setjmp,entry
|
||||
.proc
|
||||
.callinfo
|
||||
setjmp
|
||||
_setjmp
|
||||
.entry
|
||||
|
||||
/*
|
||||
* save sp and rp in sigcontext, skip the rest
|
||||
*/
|
||||
stw %r30,8(%r26)
|
||||
stw %r2,24(%r26)
|
||||
ldo 40(%r26),%r26
|
||||
|
||||
/*
|
||||
* save dp and the callee saves registers
|
||||
*/
|
||||
stwm %r3,4(%r26)
|
||||
stwm %r4,4(%r26)
|
||||
stwm %r5,4(%r26)
|
||||
stwm %r6,4(%r26)
|
||||
stwm %r7,4(%r26)
|
||||
stwm %r8,4(%r26)
|
||||
stwm %r9,4(%r26)
|
||||
stwm %r10,4(%r26)
|
||||
stwm %r11,4(%r26)
|
||||
stwm %r12,4(%r26)
|
||||
stwm %r13,4(%r26)
|
||||
stwm %r14,4(%r26)
|
||||
stwm %r15,4(%r26)
|
||||
stwm %r16,4(%r26)
|
||||
stwm %r17,4(%r26)
|
||||
stwm %r18,4(%r26)
|
||||
stwm %r27,4(%r26)
|
||||
|
||||
mfsp %sr3,%r9
|
||||
stwm %r9,4(%r26)
|
||||
|
||||
bv 0(%r2)
|
||||
copy %r0,%r28
|
||||
.exit
|
||||
.procend
|
||||
|
||||
/*
|
||||
* void
|
||||
* longjmp(env, val)
|
||||
* jmp_buf env;
|
||||
* int val;
|
||||
*
|
||||
* This routine does not retore signal state.
|
||||
* This routine does not override a zero val.
|
||||
*/
|
||||
|
||||
.export longjmp,entry
|
||||
.export _longjmp,entry
|
||||
.proc
|
||||
.callinfo
|
||||
longjmp
|
||||
_longjmp
|
||||
|
||||
.entry
|
||||
|
||||
/*
|
||||
* restore sp and rp
|
||||
*/
|
||||
ldw 8(%r26),%r30
|
||||
ldw 24(%r26),%r2
|
||||
ldo 40(%r26),%r26
|
||||
|
||||
/*
|
||||
* restore callee saves registers
|
||||
*/
|
||||
ldwm 4(%r26),%r3
|
||||
ldwm 4(%r26),%r4
|
||||
ldwm 4(%r26),%r5
|
||||
ldwm 4(%r26),%r6
|
||||
ldwm 4(%r26),%r7
|
||||
ldwm 4(%r26),%r8
|
||||
ldwm 4(%r26),%r9
|
||||
ldwm 4(%r26),%r10
|
||||
ldwm 4(%r26),%r11
|
||||
ldwm 4(%r26),%r12
|
||||
ldwm 4(%r26),%r13
|
||||
ldwm 4(%r26),%r14
|
||||
ldwm 4(%r26),%r15
|
||||
ldwm 4(%r26),%r16
|
||||
ldwm 4(%r26),%r17
|
||||
ldwm 4(%r26),%r18
|
||||
ldwm 4(%r26),%r27
|
||||
|
||||
ldwm 4(%r26),%r9
|
||||
mtsp %r9,%sr3
|
||||
|
||||
bv 0(%r2)
|
||||
copy %r25,%r28
|
||||
.exit
|
||||
.procend
|
41
libgloss/pa/test.c
Normal file
41
libgloss/pa/test.c
Normal file
@ -0,0 +1,41 @@
|
||||
/* Copyright (c) 1995 Cygnus Support
|
||||
*
|
||||
* The authors hereby grant permission to use, copy, modify, distribute,
|
||||
* and license this software and its documentation for any purpose, provided
|
||||
* that existing copyright notices are retained in all copies and that this
|
||||
* notice is included verbatim in any distributions. No written agreement,
|
||||
* license, or royalty fee is required for any of the authorized uses.
|
||||
* Modifications to this software may be copyrighted by their authors
|
||||
* and need not follow the licensing terms described here, provided that
|
||||
* the new terms are clearly indicated on the first page of each file where
|
||||
* they apply.
|
||||
*/
|
||||
extern int led_putnum();
|
||||
extern char putDebugChar(),print(),putnum();
|
||||
#include <stdio.h>
|
||||
|
||||
main()
|
||||
{
|
||||
float a1,b1,c1;
|
||||
int a2, b2, c2;
|
||||
|
||||
a1 = 0.41;
|
||||
b1 = 3.12;
|
||||
c1 = a1+b1;
|
||||
|
||||
a2 = 1;
|
||||
b2 = 2;
|
||||
c2 = a2 + b2;
|
||||
|
||||
iprintf ("Print integer, result = %d\n", c2);
|
||||
fflush (stdout);
|
||||
putnum (c1);
|
||||
outbyte ('\n');
|
||||
printf ("Print float, result with 'f' = %f\n", c1);
|
||||
printf ("Print float, result with 'e' = %e\n", c1);
|
||||
printf ("Print float, result with 'E' = %E\n", c1);
|
||||
printf ("Print float, result with 'g' = %g\n", c1);
|
||||
printf ("Print float, result with 'G' = %G\n", c1);
|
||||
fflush (stdout);
|
||||
print ("Done...\n");
|
||||
}
|
74
libgloss/pa/w89k-io.c
Normal file
74
libgloss/pa/w89k-io.c
Normal file
@ -0,0 +1,74 @@
|
||||
/* w89k-io.c -- I/O code for the Winbond Cougar board.
|
||||
*
|
||||
* Copyright (c) 1995 Cygnus Support
|
||||
*
|
||||
* The authors hereby grant permission to use, copy, modify, distribute,
|
||||
* and license this software and its documentation for any purpose, provided
|
||||
* that existing copyright notices are retained in all copies and that this
|
||||
* notice is included verbatim in any distributions. No written agreement,
|
||||
* license, or royalty fee is required for any of the authorized uses.
|
||||
* Modifications to this software may be copyrighted by their authors
|
||||
* and need not follow the licensing terms described here, provided that
|
||||
* the new terms are clearly indicated on the first page of each file where
|
||||
* they apply.
|
||||
*/
|
||||
#include "w89k.h"
|
||||
|
||||
void zylons();
|
||||
void led_putnum();
|
||||
void delay();
|
||||
|
||||
/*
|
||||
* outbyte -- shove a byte out the serial port. We wait till the byte
|
||||
*/
|
||||
void
|
||||
outbyte (byte)
|
||||
unsigned char byte;
|
||||
{
|
||||
while ((inp(COM1_LSR) & TRANSMIT) == 0x0) ;
|
||||
|
||||
outp (COM1_DATA, byte);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* inbyte -- get a byte from the serial port
|
||||
*/
|
||||
unsigned char
|
||||
inbyte ()
|
||||
{
|
||||
while ((inp(COM1_LSR) & RECEIVE) == 0x0) ;
|
||||
|
||||
return (inp(COM1_DATA));
|
||||
}
|
||||
|
||||
/*
|
||||
* led_putnum -- print a hex number on the LED. the value of num must be a byte.
|
||||
* The max number 15, since the front panel only has 4 LEDs.
|
||||
*/
|
||||
void
|
||||
led_putnum ( num )
|
||||
char num;
|
||||
{
|
||||
print ("Sorry, no LED's on the WinBond W89k board, using putnum instead\r\n");
|
||||
putnum (num);
|
||||
}
|
||||
|
||||
/*
|
||||
* zylons -- draw a rotating pattern. NOTE: this function never returns.
|
||||
*/
|
||||
void
|
||||
zylons()
|
||||
{
|
||||
print ("Sorry, no LED's on the WinBond W89k board\r\n");
|
||||
}
|
||||
|
||||
void
|
||||
delay (x)
|
||||
int x;
|
||||
{
|
||||
int y = 17;
|
||||
while (x-- !=0)
|
||||
y = y^2;
|
||||
}
|
25
libgloss/pa/w89k.h
Normal file
25
libgloss/pa/w89k.h
Normal file
@ -0,0 +1,25 @@
|
||||
/* Copyright (c) 1995 Cygnus Support
|
||||
*
|
||||
* The authors hereby grant permission to use, copy, modify, distribute,
|
||||
* and license this software and its documentation for any purpose, provided
|
||||
* that existing copyright notices are retained in all copies and that this
|
||||
* notice is included verbatim in any distributions. No written agreement,
|
||||
* license, or royalty fee is required for any of the authorized uses.
|
||||
* Modifications to this software may be copyrighted by their authors
|
||||
* and need not follow the licensing terms described here, provided that
|
||||
* the new terms are clearly indicated on the first page of each file where
|
||||
* they apply.
|
||||
*
|
||||
* The w89k uses a memory mapped I/O scheme as well as a PC style ISA bus.
|
||||
* All I/O accesses are via a port.
|
||||
*/
|
||||
#define IOSPACE 0xf0000000
|
||||
#define outp(port,val) *((volatile unsigned char*)(IOSPACE+port))=val
|
||||
#define inp(port) *((volatile unsigned char*)(IOSPACE+port))
|
||||
#define RS232PORT 0x3f8
|
||||
#define COM1_LSR (0x3f8 + 5)
|
||||
#define COM1_DATA (0x3f8 + 0)
|
||||
|
||||
#define RS232REG 0x3fd
|
||||
#define TRANSMIT 0x20
|
||||
#define RECEIVE 0x01
|
54
libgloss/pa/w89k.ld
Normal file
54
libgloss/pa/w89k.ld
Normal file
@ -0,0 +1,54 @@
|
||||
OUTPUT_ARCH(hppa)
|
||||
ENTRY("$START$")
|
||||
STARTUP(crt0.o)
|
||||
GROUP(-lc -lw89k -lgcc)
|
||||
SEARCH_DIR(.)
|
||||
|
||||
MEMORY
|
||||
{
|
||||
ram (rwx) : ORIGIN = 0x100000, LENGTH = 0x100000
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
{
|
||||
CREATE_OBJECT_SYMBOLS
|
||||
*(.PARISC.stubs)
|
||||
*(.text)
|
||||
etext = . ;
|
||||
_etext = . ;
|
||||
__CTOR_LIST__ = . ;
|
||||
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
|
||||
*(.ctors)
|
||||
LONG(0)
|
||||
__CTOR_END__ = . ;
|
||||
__DTOR_LIST__ = . ;
|
||||
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
|
||||
*(.dtors)
|
||||
LONG(0)
|
||||
__DTOR_END__ = . ;
|
||||
*(.lit)
|
||||
*(.shdata)
|
||||
$global$ = ALIGN(4) ;
|
||||
. += 4;
|
||||
} > ram
|
||||
|
||||
.data : {
|
||||
*(.data)
|
||||
CONSTRUCTORS
|
||||
edata = . ;
|
||||
_edata = . ;
|
||||
} > ram
|
||||
|
||||
.bss : {
|
||||
_bss_start = ALIGN(4) ;
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
_stack = ALIGN(64) ; /* Stack grows up on the PA!!! */
|
||||
. += 0x2000 ;
|
||||
end = . ;
|
||||
_end = . ;
|
||||
} > ram
|
||||
|
||||
}
|
Reference in New Issue
Block a user