-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af5c0ac
commit 4149eaf
Showing
46 changed files
with
3,560 additions
and
1,169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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~* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
Oops, something went wrong.