Skip to content

Commit

Permalink
Added 2.2.0-85
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 12, 2020
1 parent af5c0ac commit 4149eaf
Show file tree
Hide file tree
Showing 46 changed files with 3,560 additions and 1,169 deletions.
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>libspe2</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
81 changes: 54 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,25 @@ libspe2_OBJS := libspe2.o
CFLAGS += -I$(TOP)/spebase
CFLAGS += -I$(TOP)/speevent

PACKAGE := libspe2
VERSION := $(MAJOR_VERSION).$(MINOR_VERSION)
RELEASE := $(shell svnversion)
FULLNAME := $(PACKAGE)-$(VERSION)
PACKAGE_VER := $(FULLNAME)-$(RELEASE)
TARBALL := $(SOURCES)$(PACKAGE_VER).tar.gz
SOURCEFILES := $(TARBALL)

edit = @sed \
-e 's,@prefix@,$(prefix),g' \
-e 's,@exec_prefix@,$(exec_prefix),g' \
-e 's,@libdir@,$(libdir),g' \
-e 's,@name@,$(PACKAGE),g' \
-e 's,@includedir@,$(includedir),g' \
-e 's,@version@,$(VERSION),g'

all: $(libspe2_SO) $(libspe2_A) libspe12-all

dist: pushall all
dist: $(TARBALL)

pushall:
quilt push -a ; true
Expand All @@ -52,9 +67,11 @@ libspe12-all:

install: libspe12-install
$(INSTALL_DIR) $(ROOT)$(libdir)
$(INSTALL_DIR) $(ROOT)$(libdir)/pkgconfig
$(INSTALL_DATA) $(libspe2_A) $(ROOT)$(libdir)/$(libspe2_A)
$(INSTALL_PROGRAM) $(libspe2_SO) $(ROOT)$(libdir)/$(libspe2_SO)
$(INSTALL_LINK) $(libspe2_SO) $(ROOT)$(libdir)/$(libspe2_SONAME)
$(INSTALL_DATA) libspe2.pc $(ROOT)$(libdir)/pkgconfig
$(INSTALL_LINK) $(libspe2_SONAME) $(ROOT)$(libdir)/libspe2.so
$(INSTALL_DIR) $(ROOT)$(includedir)
$(INSTALL_DATA) libspe2.h $(ROOT)$(includedir)/libspe2.h
Expand All @@ -63,6 +80,11 @@ install: libspe12-install
$(INSTALL_DATA) spebase/cbea_map.h $(ROOT)$(includedir)/cbea_map.h
$(INSTALL_DIR) $(ROOT)$(speinclude)
$(INSTALL_DATA) spebase/cbea_map.h $(ROOT)$(speinclude)/cbea_map.h
$(INSTALL_DIR) $(ROOT)$(adabindingdir)
$(INSTALL_DATA) ada/README $(ROOT)$(adabindingdir)/README-libspe2
$(INSTALL_DATA) ada/cbea_map.ads $(ROOT)$(adabindingdir)/cbea_map.ads
$(INSTALL_DATA) ada/libspe2.ads $(ROOT)$(adabindingdir)/libspe2.ads
$(INSTALL_DATA) ada/libspe2_types.ads $(ROOT)$(adabindingdir)/libspe2_types.ads

elfspe-install:
$(MAKE) -C elfspe install
Expand All @@ -73,20 +95,24 @@ libspe12-install:
tests: tests/Makefile
make -C tests

ada : ada/Makefile
make -C ada

tags:
$(CTAGS) -R .

$(libspe2_SO): $(libspe2_OBJS) base-all event-all
libspe2.pc: Makefile $(TOP)/libspe2.pc.in
@rm -f $@ $@.tmp
$(edit) $(TOP)/$@.in >$@.tmp
@mv $@.tmp $@

$(libspe2_SO): $(libspe2_OBJS) base-all event-all libspe2.pc
$(CC) $(CFLAGS) -shared -o $@ $(libspe2_OBJS) spebase/*.o speevent/*.o -lrt -lpthread -Wl,--soname=${libspe2_SONAME}

$(libspe2_A): $(libspe2_OBJS) base-all event-all
$(CROSS)ar -r $(libspe2_A) $(libspe2_OBJS) spebase/*.o speevent/*.o $(libspe2_OBJS)


PACKAGE = libspe2
FULLNAME = $(PACKAGE)-$(MAJOR_VERSION).$(MINOR_VERSION)
TARBALL = $(SOURCES)$(FULLNAME).tar.gz
SOURCEFILES = $(TARBALL)
PATCHES := `cat series | grep -v ^\#`
#RPMBUILD = ppc32 rpmbuild --target=ppc
RPMBUILD = rpmbuild
Expand All @@ -103,22 +129,22 @@ SPEC ?= $(PACKAGE).spec
RPMBUILD ?= rpmbuild

checkenv:
@if [ ""x == "$(PACKAGE)"x \
-o ""x == "$(SOURCEFILES)"x \
-o ""x == "$(SPEC)"x ] ; then \
echo "inconsistant make file" false; fi
@if [ ""x = "$(PACKAGE)"x \
-o ""x = "$(SOURCEFILES)"x \
-o ""x = "$(SPEC)"x ] ; then \
echo "inconsistant make file" false; fi

$(PWD)/.rpmmacros:
mkdir -p $(SOURCES) $(RPMS) $(SRPMS) $(BUILD)
echo -e \%_topdir $(RPM)\\n\%_sourcedir $(PWD)\\n\%_tmppath %_topdir/tmp > $@
echo -e \%_topdir $(RPM)\\n\%_sourcedir $(PWD)\\n\%_tmppath %_topdir/tmp\\n\%_version $(RELEASE) > $@

rpm: checkenv $(RPM)/$(PACKAGE)-stamp
rpm: dist checkenv $(RPM)/$(PACKAGE)-stamp

$(RPM)/$(PACKAGE)-stamp: $(PWD)/.rpmmacros $(SOURCEFILES) $(SPEC)
HOME=$(PWD) $(RPMBUILD) -ba $(SPEC) $(RPMFLAGS)
touch $@

crossrpm: checkenv $(RPM)/$(PACKAGE)-cross-stamp
crossrpm: dist checkenv $(RPM)/$(PACKAGE)-cross-stamp

$(RPM)/$(PACKAGE)-cross-stamp: $(PWD)/.rpmmacros $(SOURCEFILES) $(SPEC)
HOME=$(PWD) $(RPMBUILD) -ba $(SPEC) --target=noarch $(RPMFLAGS)
Expand All @@ -134,21 +160,18 @@ rpm32:
rpm64:
HOME=$(PWD) $(RPMBUILD) --target=ppc64 -ba $(SPEC) $(RPMFLAGS)



tarball: $(TARBALL)

$(TARBALL): $(SOURCES)
# cd patches; cp $(PATCHES) ..
rm -f $(FULLNAME)
$(TARBALL): clean
ln -s . $(FULLNAME)
tar czf $@ --exclude=$(FULLNAME).tar.gz \
--exclude=$(FULLNAME)/$(FULLNAME) \
--exclude=$(FULLNAME)/spegang \
--exclude=$(FULLNAME)/spethread \
--exclude=$(FULLNAME)/tests_hidden \
--exclude=$(FULLNAME)/patches \
--exclude=CVS $(FULLNAME)/*
tar -czhf $@ --exclude=$(PACKAGE_VER).tar.gz \
--exclude=$(FULLNAME)/$(FULLNAME) \
--exclude=CVS --exclude .pc --exclude '.*.swp' --exclude '*~' --exclude '.#*' \
--exclude=$(FULLNAME)/spegang \
--exclude=$(FULLNAME)/spethread \
--exclude=$(FULLNAME)/tests_hidden \
--exclude=$(FULLNAME)/patches \
--exclude=.svn \
$(FULLNAME)
rm $(FULLNAME)

doc: text pdf

Expand Down Expand Up @@ -177,12 +200,16 @@ clean: base-clean event-clean elfspe-clean libspe12-clean
rm *.diff ; true
rm -rf $(libspe2_A) $(libspe2_SO) $(libspe2_OBJS)
rm -f $(TARBALL)
rm -f $(FULLNAME)
rm -f doc/*.pdf
rm -f doc/functions.txt
rm -rf xml
rm -rf html
rm -rf latex
rm -f libspe2.pc
make -C tests clean
make -C ada clean


base-clean:
$(MAKE) -C spebase clean
Expand Down
50 changes: 50 additions & 0 deletions ada/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#*
#* libspe2 - A wrapper library to adapt the JSRE SPU usage model to SPUFS
#* Copyright (C) 2005 IBM Corp.
#*
#* This library is free software; you can redistribute it and/or modify it
#* under the terms of the GNU Lesser General Public License as published by
#* the Free Software Foundation; either version 2.1 of the License,
#* or (at your option) any later version.
#*
#* This library is distributed in the hope that it will be useful, but
#* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
#* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
#* License for more details.
#*
#* You should have received a copy of the GNU Lesser General Public License
#* along with this library; if not, write to the Free Software Foundation,
#* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#*

TOP=..

include $(TOP)/make.defines

adabindings := libspe2 libspe2_types cbea_map\
testsingle
spu_images := hello

all: adabinding tests spu_programs

adabinding : libspe2.ads libspe2_types.ads cbea_map.ads
$(CC) -c cbea_map.ads
$(CC) -c libspe2.ads
$(CC) -c libspe2_types.ads

tests : testsingle.adb
$(CROSS)gnatmake -g $^

spu_programs: hello

hello: helloworld.c
$(SPU_CC) $(SPU_CFLAGS) $^ -o $@


install: $(adabinding)

clean:
rm -f $(adabindings)
rm -f $(spu_images)
rm -f *.o *.ali b~*

26 changes: 26 additions & 0 deletions ada/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Usage of Ada binding package files

There are three Ada binding package files under this directory:
cbea_map.ads, libspe2_types.ads and libspe2.ads. The cbea_map.ads and libspe2_types.ads declare data types, data structures and constants used in libspe2 API. The libspe.ads defines all interfaces of libspe functions using Ada pragmas.

To include the package files in Ada source file:
with cbea_map.ads;
with libspe_types.ads;
with libspe.ads;
Further more to have full visibility of the data and interfaces:
use cbea_map.ads;
use libspe_types.ads;
use libspe.ads

The Ada binding package files are installed under /usr/adainclude in SDK 3.0.
You need to set this directory in your source path so that the compiler could find the packages.
For instance in your GNAT project file hello.gpr:
Project hello is
for Source_Dirs use("/usr/adainclude/", ".");
end hello;

When compiling the Ada source program, add a GNAT option -Phello.gpr.
e.g.
ppu-gnatmake helloworld.adb -Phello.gpr

The libspe2.ads file is linked with libspe dynamic library automatically through Linker_Options pragma.
70 changes: 70 additions & 0 deletions ada/cbea_map.ads
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
--
-- Data structure declarations for SPE problem state areas
-- (part of public API)
--
with System;
with Interfaces.C;

package cbea_map is
use System;
use Interfaces.C;

type spe_mssync_area_t is
record
MFC_MSSync : unsigned;
end record;
type spe_mssync_area_ptr is access spe_mssync_area_t;

type spe_mfc_command_area_t is
record
reserved_0_3 : char_array (0 .. 3);
MFC_LSA : unsigned;
MFC_EAH : unsigned;
MFC_EAL : unsigned;
MFC_Size_Tag : unsigned;
MFC_ClassID_CMD : unsigned;
-- MFC_CMDStatus : unsigned;
reserved_18_103 : char_array (0 .. 235);
MFC_QStatus : unsigned;
reserved_108_203 : char_array (0 .. 251);
Prxy_QueryType : unsigned;
reserved_208_21B : char_array (0 .. 19);
Prxy_QueryMask : unsigned;
reserved_220_22B : char_array (0 .. 11);
Prxy_TagStatus : unsigned;
end record;
type spe_mfc_command_area_ptr is access spe_mfc_command_area_t;

type spe_spu_control_area_t is
record
reserved_0_3 : char_array (0 .. 3);
SPU_Out_Mbox : unsigned;
reserved_8_B : char_array (0 .. 3);
SPU_In_Mbox : unsigned;
reserved_10_13 : char_array (0 .. 3);
SPU_Mbox_Stat : unsigned;
reserved_18_1B : char_array (0 .. 3);
SPU_RunCntl : unsigned;
reserved_20_23 : char_array (0 .. 3);
SPU_Status : unsigned;
reserved_28_33 : char_array (0 .. 11);
SPU_NPC : unsigned;
end record;
type spe_spu_control_area_ptr is access spe_spu_control_area_t;

type spe_sig_notify_1_area_t is
record
reserved_0_B : char_array (0 .. 11);
SPU_Sig_Notify_1 : unsigned;
end record;
type spe_sig_notify_1_area_ptr is access spe_sig_notify_1_area_t;

type spe_sig_notify_2_area_t is
record
reserved_0_B : char_array (0 .. 11);
SPU_Sig_Notify_2 : unsigned;
end record;
type spe_sig_notify_2_area_ptr is access spe_sig_notify_2_area_t;

end cbea_map;

7 changes: 7 additions & 0 deletions ada/helloworld.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdio.h>

main()
{
printf("Spu says hello!\n");
return 42;
}
Loading

0 comments on commit 4149eaf

Please sign in to comment.