commit
38956611b8
699 changed files with 138556 additions and 0 deletions
-
39Basic_test/Basic_test.c
-
6Basic_test/Basic_test.h
-
485Basic_test/Basic_test.vpj
-
BINBasic_test/Debug/Basic_test.elf
-
BINBasic_test/Debug/Basic_test.o
-
BINBasic_test/Debug/bios.o
-
BINBasic_test/Debug/crc16.o
-
BINBasic_test/Debug/crc32.o
-
BINBasic_test/Debug/crc7.o
-
BINBasic_test/Debug/crc8.o
-
BINBasic_test/Debug/dma.o
-
BINBasic_test/Debug/dma_packets.o
-
BINBasic_test/Debug/ee_sbus.o
-
BINBasic_test/Debug/gif.o
-
BINBasic_test/Debug/md5.o
-
BINBasic_test/Debug/ps2_sbus.o
-
BINBasic_test/Debug/sha1.o
-
BINBasic_test/Debug/sha256.o
-
11Basic_test/build
-
356Basic_test/makefile
-
1Basic_test/out.txt
-
0README.md
-
6SonyPS2.vpw
-
528SonyPS2.vpwhist
-
BINSonyPS2.vtg
-
48sps2_basement/core/alg/crc.h
-
75sps2_basement/core/alg/crc16.c
-
254sps2_basement/core/alg/crc32.c
-
60sps2_basement/core/alg/crc7.c
-
22sps2_basement/core/alg/crc8.c
-
295sps2_basement/core/alg/md5.c
-
34sps2_basement/core/alg/md5.h
-
455sps2_basement/core/alg/sha1.c
-
118sps2_basement/core/alg/sha1.h
-
283sps2_basement/core/alg/sha256.c
-
24sps2_basement/core/alg/sha256.h
-
29sps2_basement/core/base/assert.h
-
78sps2_basement/core/base/basicConfig.h
-
364sps2_basement/core/base/basicTypes.h
-
573sps2_basement/core/base/elf.h
-
140sps2_basement/core/base/errno.h
-
34sps2_basement/hardware/Makefile
-
457sps2_basement/hardware/common/alloc.c
-
45sps2_basement/hardware/common/alloc.h
-
12sps2_basement/hardware/debug/Makefile
-
29sps2_basement/hardware/debug/assert.h
-
16sps2_basement/hardware/debug/iop_sbusdbg/Makefile
-
38sps2_basement/hardware/debug/iop_sbusdbg/include/iop_sbusdbg.h
-
62sps2_basement/hardware/debug/iop_sbusdbg/src/imports.lst
-
30sps2_basement/hardware/debug/iop_sbusdbg/src/irx_imports.h
-
107sps2_basement/hardware/debug/iop_sbusdbg/src/main.c
-
80sps2_basement/hardware/debug/iop_sbusdbg/src/sbus_dbg.c
-
15sps2_basement/hardware/debug/iop_sbusdbg/src/sbus_dbg_low.S
-
176sps2_basement/hardware/debug/iop_sbusdbg/src/sbus_tty.c
-
9sps2_basement/hardware/debug/iop_sbusdbg/src/sbus_tty.h
-
14sps2_basement/hardware/debug/iopdebug/Makefile
-
79sps2_basement/hardware/debug/iopdebug/include/iopdebug.h
-
39sps2_basement/hardware/debug/iopdebug/src/exports.tab
-
31sps2_basement/hardware/debug/iopdebug/src/imports.lst
-
172sps2_basement/hardware/debug/iopdebug/src/iop_dbg_low.S
-
198sps2_basement/hardware/debug/iopdebug/src/iop_debug.c
-
288sps2_basement/hardware/debug/iopdebug/src/iop_exceptions.S
-
27sps2_basement/hardware/debug/iopdebug/src/iopdebug_defs.h
-
37sps2_basement/hardware/debug/iopdebug/src/iopdebug_priv.h
-
29sps2_basement/hardware/debug/iopdebug/src/irx_imports.h
-
54sps2_basement/hardware/debug/iopdebug/src/main.c
-
16sps2_basement/hardware/debug/ioptrap/Makefile
-
96sps2_basement/hardware/debug/ioptrap/include/ioptrap.h
-
43sps2_basement/hardware/debug/ioptrap/src/breakpoint.c
-
20sps2_basement/hardware/debug/ioptrap/src/exports.tab
-
291sps2_basement/hardware/debug/ioptrap/src/handler.S
-
31sps2_basement/hardware/debug/ioptrap/src/imports.lst
-
230sps2_basement/hardware/debug/ioptrap/src/ioptrap.c
-
29sps2_basement/hardware/debug/ioptrap/src/irx_imports.h
-
14sps2_basement/hardware/debug/sior/Makefile
-
22sps2_basement/hardware/debug/sior/src/exports.tab
-
24sps2_basement/hardware/debug/sior/src/imports.lst
-
25sps2_basement/hardware/debug/sior/src/irx_imports.h
-
141sps2_basement/hardware/debug/sior/src/sior.c
-
1119sps2_basement/hardware/debug/sior/src/xprintf.c
-
40sps2_basement/hardware/debug/sior/src/xprintf.h
-
12sps2_basement/hardware/dev9/Makefile
-
45sps2_basement/hardware/dev9/atad/Makefile
-
96sps2_basement/hardware/dev9/atad/include/atad.h
-
26sps2_basement/hardware/dev9/atad/src/exports.tab
-
37sps2_basement/hardware/dev9/atad/src/imports.lst
-
26sps2_basement/hardware/dev9/atad/src/irx_imports.h
-
1241sps2_basement/hardware/dev9/atad/src/ps2atad.c
-
38sps2_basement/hardware/dev9/dev9/Makefile
-
64sps2_basement/hardware/dev9/dev9/include/dev9.h
-
22sps2_basement/hardware/dev9/dev9/src/exports.tab
-
41sps2_basement/hardware/dev9/dev9/src/imports.lst
-
28sps2_basement/hardware/dev9/dev9/src/irx_imports.h
-
1282sps2_basement/hardware/dev9/dev9/src/ps2dev9.c
-
18sps2_basement/hardware/dev9/extflash/Makefile
-
29sps2_basement/hardware/dev9/extflash/README
-
45sps2_basement/hardware/dev9/extflash/include/fls.h
-
19sps2_basement/hardware/dev9/extflash/src/exports.tab
-
362sps2_basement/hardware/dev9/extflash/src/extflash.c
-
17sps2_basement/hardware/dev9/extflash/src/imports.lst
@ -0,0 +1,39 @@ |
|||
#include "Basic_test.h" |
|||
|
|||
/* |
|||
void init_drawing_environment(framebuffer_t *frame, zbuffer_t *z){ |
|||
|
|||
packet_t *packet = packet_init(16,PACKET_NORMAL); |
|||
|
|||
// This is our generic qword pointer. |
|||
qword_t *q = packet->data; |
|||
|
|||
// This will setup a default drawing environment. |
|||
q = draw_setup_environment(q,0,frame,z); |
|||
|
|||
// Now reset the primitive origin to 2048-width/2,2048-height/2. |
|||
q = draw_primitive_xyoffset(q,0,(2048-320),(2048-256)); |
|||
|
|||
// Finish setting up the environment. |
|||
q = draw_finish(q); |
|||
|
|||
// Now send the packet, no need to wait since it's the first. |
|||
dma_channel_send_normal( DMA_CHANNEL_GIF, packet->data,q - packet->data, 0, 0); |
|||
dma_wait_fast(); |
|||
|
|||
packet_free(packet); |
|||
|
|||
} |
|||
*/ |
|||
|
|||
|
|||
|
|||
|
|||
int main( int argc, char *argv[] ){ |
|||
uint8_t cnt = 0; |
|||
for ( ; cnt < 100; cnt++ ) { |
|||
//printf("hello world\n"); |
|||
}; |
|||
return(0); |
|||
}; |
|||
|
|||
@ -0,0 +1,6 @@ |
|||
#ifndef __BASIC_TEST__ |
|||
#define __BASIC_TEST__ |
|||
|
|||
#include "../sps2_basement/core/base/basicTypes.h" |
|||
|
|||
#endif |
|||
@ -0,0 +1,485 @@ |
|||
<!DOCTYPE Project SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpj.dtd"> |
|||
<Project |
|||
Version="10.0" |
|||
VendorName="SlickEdit" |
|||
TemplateName="GNU C/C++" |
|||
WorkingDir="." |
|||
BuildSystem="automakefile" |
|||
BuildMakeFile="makefile"> |
|||
<Config |
|||
Name="Debug" |
|||
Type="gnuc" |
|||
DebugCallbackName="gdb" |
|||
Version="1" |
|||
OutputFile="%bdBasic_test.elf" |
|||
CompilerConfigName="Latest Version" |
|||
Defines='"/D_EE"'> |
|||
<Menu> |
|||
<Target |
|||
Name="Compile" |
|||
MenuCaption="&Compile" |
|||
Dialog="_gnuc_options_form Compile" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
OutputExts="*.o" |
|||
SaveOption="SaveCurrent" |
|||
RunFromDir="%rw"> |
|||
<Exec |
|||
CmdLine='ee-gcc -c %xup %defd -g -fshort-double -ffast-math -mhard-float -mips3 -mfp32 -mno-abicalls %~other -o "%bd%n%oe" %i %f' |
|||
OtherOptions="-G0"/> |
|||
</Target> |
|||
<Target |
|||
Name="Link" |
|||
MenuCaption="&Link" |
|||
ShowOnMenu="Never" |
|||
Dialog="_gnuc_options_form Link" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveCurrent" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='ee-gcc %xup -g -o "%o" %objs'/> |
|||
</Target> |
|||
<Target |
|||
Name="Strip" |
|||
MenuCaption="&Strip" |
|||
ShowOnMenu="Never" |
|||
Dialog="_gnuc_options_form Link" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveCurrent" |
|||
RunFromDir="%rw"> |
|||
<Exec |
|||
CmdLine="ee-strip %o" |
|||
OtherOptions=""/> |
|||
</Target> |
|||
<Target |
|||
Name="Build" |
|||
MenuCaption="&Build" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='make -f "makefile" CFG=%b'/> |
|||
</Target> |
|||
<Target |
|||
Name="Rebuild" |
|||
MenuCaption="&Rebuild" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='make -f "makefile" rebuild CFG=%b'/> |
|||
</Target> |
|||
<Target |
|||
Name="Debug" |
|||
MenuCaption="&Debug" |
|||
Dialog="_gnuc_options_form Run/Debug" |
|||
BuildFirst="1" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveNone" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='vsdebugio -prog "%o"'/> |
|||
</Target> |
|||
<Target |
|||
Name="Execute" |
|||
MenuCaption="E&xecute" |
|||
Dialog="_gnuc_options_form Run/Debug" |
|||
BuildFirst="1" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='"%o"'/> |
|||
</Target> |
|||
<Target |
|||
Name="dash" |
|||
MenuCaption="-" |
|||
Deletable="0"> |
|||
<Exec/> |
|||
</Target> |
|||
<Target |
|||
Name="GNU C Options" |
|||
MenuCaption="GNU C &Options..." |
|||
ShowOnMenu="HideIfNoCmdLine" |
|||
Deletable="0" |
|||
SaveOption="SaveNone"> |
|||
<Exec |
|||
CmdLine="gnucoptions" |
|||
Type="Slick-C"/> |
|||
</Target> |
|||
</Menu> |
|||
<Rules Name="Compile"> |
|||
<Rule |
|||
InputExts="*.ada" |
|||
OutputExts="*.o" |
|||
LinkObject="1"> |
|||
<Exec CmdLine='gnat -g -c -o "%bd%n.o" "%f"'/> |
|||
</Rule> |
|||
<Rule |
|||
InputExts="*.adb" |
|||
OutputExts="*.o" |
|||
LinkObject="1"> |
|||
<Exec CmdLine='gnat -g -c -o "%bd%n.o" "%f"'/> |
|||
</Rule> |
|||
<Rule |
|||
InputExts="*.f" |
|||
OutputExts="*.o" |
|||
LinkObject="1"> |
|||
<Exec CmdLine='gfortran -c -g -o "%bd%n.o" "%f"'/> |
|||
</Rule> |
|||
<Rule |
|||
InputExts="*.f90" |
|||
OutputExts="*.o" |
|||
LinkObject="1"> |
|||
<Exec CmdLine='gfortran -c -g -o "%bd%n.o" "%f"'/> |
|||
</Rule> |
|||
<Rule |
|||
InputExts="*.d" |
|||
OutputExts="*.o" |
|||
LinkObject="1"> |
|||
<Exec CmdLine='gdc -c -g -o "%bd%n.o" "%f"'/> |
|||
</Rule> |
|||
</Rules> |
|||
<List Name="GNUC Options"> |
|||
<Item |
|||
Name="LinkerOutputType" |
|||
Value="Executable"/> |
|||
</List> |
|||
<Includes></Includes> |
|||
<Libs PreObjects="0"> |
|||
</Libs> |
|||
</Config> |
|||
<Config |
|||
Name="Release" |
|||
Type="gnuc" |
|||
DebugCallbackName="gdb" |
|||
Version="1" |
|||
OutputFile="%bdBasic_test.elf" |
|||
CompilerConfigName="Latest Version" |
|||
Defines='"/D_EE"'> |
|||
<Menu> |
|||
<Target |
|||
Name="Compile" |
|||
MenuCaption="&Compile" |
|||
Dialog="_gnuc_options_form Compile" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
OutputExts="*.o" |
|||
SaveOption="SaveCurrent" |
|||
RunFromDir="%rw"> |
|||
<Exec |
|||
CmdLine='ee-gcc -c %xup -v %defd -O2 %~other -o "%bd%n%oe" %i %f' |
|||
OtherOptions="-G0 -s"/> |
|||
</Target> |
|||
<Target |
|||
Name="Link" |
|||
MenuCaption="&Link" |
|||
ShowOnMenu="Never" |
|||
Dialog="_gnuc_options_form Link" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveCurrent" |
|||
RunFromDir="%rw"> |
|||
<Exec |
|||
CmdLine='ee-gcc %xup -v -O2 %~other -o "%o" %objs' |
|||
OtherOptions="-lc -lkernel -ldraw -lgraph -lmath3d -lmf -lpacket -ldma"/> |
|||
</Target> |
|||
<Target |
|||
Name="Build" |
|||
MenuCaption="&Build" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='make -f "makefile" CFG=%b'/> |
|||
</Target> |
|||
<Target |
|||
Name="Rebuild" |
|||
MenuCaption="&Rebuild" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='make -f "makefile" rebuild CFG=%b'/> |
|||
</Target> |
|||
<Target |
|||
Name="Debug" |
|||
MenuCaption="&Debug" |
|||
Dialog="_gnuc_options_form Run/Debug" |
|||
BuildFirst="1" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveNone" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='vsdebugio -prog "%o"'/> |
|||
</Target> |
|||
<Target |
|||
Name="Execute" |
|||
MenuCaption="E&xecute" |
|||
Dialog="_gnuc_options_form Run/Debug" |
|||
BuildFirst="1" |
|||
CaptureOutputWith="ProcessBuffer" |
|||
Deletable="0" |
|||
SaveOption="SaveWorkspaceFiles" |
|||
RunFromDir="%rw"> |
|||
<Exec CmdLine='"%o"'/> |
|||
</Target> |
|||
<Target |
|||
Name="dash" |
|||
MenuCaption="-" |
|||
Deletable="0"> |
|||
<Exec/> |
|||
</Target> |
|||
<Target |
|||
Name="GNU C Options" |
|||
MenuCaption="GNU C &Options..." |
|||
ShowOnMenu="HideIfNoCmdLine" |
|||
Deletable="0" |
|||
SaveOption="SaveNone"> |
|||
<Exec |
|||
CmdLine="gnucoptions" |
|||
Type="Slick-C"/> |
|||
</Target> |
|||
</Menu> |
|||
<Rules Name="Compile"> |
|||
<Rule |
|||
InputExts="*.ada" |
|||
OutputExts="*.o" |
|||
LinkObject="1"> |
|||
<Exec CmdLine='gnat -O -c -o "%bd%n.o" "%f"'/> |
|||
</Rule> |
|||
<Rule |
|||
InputExts="*.adb" |
|||
OutputExts="*.o" |
|||
LinkObject="1"> |
|||
<Exec CmdLine='gnat -O -c -o "%bd%n.o" "%f"'/> |
|||
</Rule> |
|||
<Rule |
|||
InputExts="*.f" |
|||
OutputExts="*.o" |
|||
LinkObject="1"> |
|||
<Exec CmdLine='gfortran -O -g -o "%bd%n.o" "%f"'/> |
|||
</Rule> |
|||
<Rule |
|||
InputExts="*.f90" |
|||
OutputExts="*.o" |
|||
LinkObject="1"> |
|||
<Exec CmdLine='gfortran -O -g -o "%bd%n.o" "%f"'/> |
|||
</Rule> |
|||
<Rule |
|||
InputExts="*.d" |
|||
OutputExts="*.o" |
|||
LinkObject="1"> |
|||
<Exec CmdLine='gdc -c -g -o "%bd%n.o" "%f"'/> |
|||
</Rule> |
|||
</Rules> |
|||
<List Name="GNUC Options"> |
|||
<Item |
|||
Name="LinkerOutputType" |
|||
Value="Executable"/> |
|||
</List> |
|||
<Includes> |
|||
<Include Dir="/usr/local/ps2dev/ps2sdk/ee/include"/> |
|||
<Include Dir="/usr/local/ps2dev/ps2sdk/common/include"/> |
|||
</Includes> |
|||
<Libs PreObjects="0"> |
|||
<Lib File="-L/usr/local/ps2dev/ee/ee/lib"/> |
|||
<Lib File="-L"/> |
|||
<Lib File="/usr/local/ps2dev/ps2sdk/ee/lib"/> |
|||
</Libs> |
|||
</Config> |
|||
<Files> |
|||
<Folder |
|||
Name="Source Files" |
|||
Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.c++;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.scala;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl;*.d;*.m;*.mm;*.go;*.groovy;*.gsh" |
|||
GUID="{E45967D3-6A5E-4714-A9F1-7451735C1391}"> |
|||
<Folder |
|||
Name="Hardware" |
|||
Filters="" |
|||
GUID="{2A100EC1-6CA0-4E4A-9969-A0A154FB8EE6}"> |
|||
<Folder |
|||
Name="sbus" |
|||
Filters="" |
|||
GUID="{44AE0915-66EC-483E-8AE3-5C4E40C34195}"> |
|||
<Folder |
|||
Name="iop" |
|||
Filters="" |
|||
GUID="{CF221482-DE03-4076-AB64-9EAB9BC514FC}"/> |
|||
<Folder |
|||
Name="sif" |
|||
Filters="" |
|||
GUID="{B5B7614C-2EF5-4C3B-95FE-0437EB6B1BCD}"/> |
|||
<F N="../sps2_basement/hardware/sbus/ee_low.S"/> |
|||
<F N="../sps2_basement/hardware/sbus/ee_sbus.c"/> |
|||
<F N="../sps2_basement/hardware/sbus/ps2_sbus.c"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="sbios" |
|||
Filters="" |
|||
GUID="{80B4BE72-8D4C-4F92-ACBE-E5435FDF0B9A}"> |
|||
<F N="../sps2_basement/hardware/sbios/bios.c"/> |
|||
<F N="../sps2_basement/hardware/sbios/bios.S"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="gs" |
|||
Filters="" |
|||
GUID="{8DF78FED-D8BE-4A01-B150-EE134BFDA49B}"> |
|||
<Folder |
|||
Name="gif" |
|||
Filters="" |
|||
GUID="{CAA3FD19-8110-4AA0-B7A2-1B7B171078D4}"> |
|||
<F N="../sps2_basement/hardware/gs/gif/gif.c"/> |
|||
</Folder> |
|||
</Folder> |
|||
<Folder |
|||
Name="ee" |
|||
Filters="" |
|||
GUID="{1EEEF439-9A74-4546-960C-554B6608339F}"> |
|||
<Folder |
|||
Name="dmac" |
|||
Filters="" |
|||
GUID="{F448A870-1B3E-4DB3-8A98-C0284ED5352C}"> |
|||
<F N="../sps2_basement/hardware/ee/dmac/dma.c"/> |
|||
<F N="../sps2_basement/hardware/ee/dmac/dma_packets.c"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="vu" |
|||
Filters="" |
|||
GUID="{720C0516-5BEB-422B-9099-DB47D173BA3E}"/> |
|||
<Folder |
|||
Name="ipu" |
|||
Filters="" |
|||
GUID="{EF70F2E8-3346-44D1-8B0B-A97893A427B3}"/> |
|||
<Folder |
|||
Name="fpu" |
|||
Filters="" |
|||
GUID="{C8B546A3-EA42-4C03-873A-527C00730125}"/> |
|||
</Folder> |
|||
</Folder> |
|||
<Folder |
|||
Name="core" |
|||
Filters="" |
|||
GUID="{DBB6B31E-573D-40DD-9672-D08DA29F611A}"> |
|||
<Folder |
|||
Name="kernel" |
|||
Filters="" |
|||
GUID="{49FDD1D2-1BB4-41CB-B623-32136519C0A8}"/> |
|||
<Folder |
|||
Name="alg" |
|||
Filters="" |
|||
GUID="{2569B300-024E-4EF9-9586-F6714F51A2E9}"> |
|||
<F N="../sps2_basement/core/alg/crc16.c"/> |
|||
<F N="../sps2_basement/core/alg/crc32.c"/> |
|||
<F N="../sps2_basement/core/alg/crc7.c"/> |
|||
<F N="../sps2_basement/core/alg/crc8.c"/> |
|||
<F N="../sps2_basement/core/alg/md5.c"/> |
|||
<F N="../sps2_basement/core/alg/sha1.c"/> |
|||
<F N="../sps2_basement/core/alg/sha256.c"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="base" |
|||
Filters="" |
|||
GUID="{972A346C-66AC-41FD-94F2-76257C14D679}"/> |
|||
</Folder> |
|||
<F N="Basic_test.c"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="Header Files" |
|||
Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.h++;*.inc;*.sh;*.cpy;*.if" |
|||
GUID="{3605FF1A-5C59-4DFC-BD9C-D6DF49C16EAF}"> |
|||
<Folder |
|||
Name="Hardware" |
|||
Filters="" |
|||
GUID="{FE674F6B-BA0B-46EF-AE54-31D530F3321A}"> |
|||
<Folder |
|||
Name="ee" |
|||
Filters="" |
|||
GUID="{6FD3FE46-17D8-49F7-A0DC-0C41AF31F384}"></Folder> |
|||
<Folder |
|||
Name="sbios" |
|||
Filters="" |
|||
GUID="{B5E2BBA3-36B6-4B12-898D-A30EEEC9F275}"> |
|||
<F N="../sps2_basement/hardware/sbios/bios.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/fileio.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/iopcontrol.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/iopheap.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/loadfile.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/osd_config.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/rom0_info.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/sbios.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/sifcmd.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/sifdma.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/sifrpc.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/sio.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/syscallnr.h"/> |
|||
<F N="../sps2_basement/hardware/sbios/timer.h"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="sbus" |
|||
Filters="" |
|||
GUID="{D546F32D-2709-4434-BBF6-2D66AEFD9A52}"> |
|||
<Folder |
|||
Name="sif" |
|||
Filters="" |
|||
GUID="{9F33CACC-E9E5-4A30-9443-EE03BF0AC449}"/> |
|||
<Folder |
|||
Name="iop" |
|||
Filters="" |
|||
GUID="{A6245A00-E174-4A35-96C2-6E43BD72F612}"/> |
|||
<F N="../sps2_basement/hardware/sbus/sbus.h"/> |
|||
<F N="../sps2_basement/hardware/sbus/sbus_priv.h"/> |
|||
<F N="../sps2_basement/hardware/sbus/sbus_regs.h"/> |
|||
</Folder> |
|||
</Folder> |
|||
<Folder |
|||
Name="include" |
|||
Filters="" |
|||
GUID="{5029EB8A-9C78-47AA-8DA2-363FFFF4C9B0}"> |
|||
<F N="../sps2_basement/include/tamtypes.h"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="core" |
|||
Filters="" |
|||
GUID="{9864B1DF-7FC5-4D12-928E-F38DF6F877B1}"> |
|||
<Folder |
|||
Name="base" |
|||
Filters="" |
|||
GUID="{422C698D-82FE-4F58-A110-516D7A12D3BB}"> |
|||
<F N="../sps2_basement/core/base/assert.h"/> |
|||
<F N="../sps2_basement/core/base/basicConfig.h"/> |
|||
<F N="../sps2_basement/core/base/basicTypes.h"/> |
|||
<F N="../sps2_basement/core/base/errno.h"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="alg" |
|||
Filters="" |
|||
GUID="{5BF40680-B1E3-4CB2-AA32-17C8E97D6CE4}"> |
|||
<F N="../sps2_basement/core/alg/crc.h"/> |
|||
<F N="../sps2_basement/core/alg/md5.h"/> |
|||
<F N="../sps2_basement/core/alg/sha1.h"/> |
|||
<F N="../sps2_basement/core/alg/sha256.h"/> |
|||
</Folder> |
|||
</Folder> |
|||
<F N="Basic_test.h"/> |
|||
</Folder> |
|||
<Folder |
|||
Name="Resource Files" |
|||
Filters="*.ico;*.cur;*.dlg" |
|||
GUID="{4EF109EF-92C9-42F6-9F9E-91F3CA6979DB}"/> |
|||
<Folder |
|||
Name="Bitmaps" |
|||
Filters="*.bmp" |
|||
GUID="{FF49C681-C1AF-46B9-B62F-BF36AF61289B}"/> |
|||
<Folder |
|||
Name="Other Files" |
|||
Filters="" |
|||
GUID="{1A7B5462-D713-45B7-AB19-D961F46A9889}"> |
|||
<F |
|||
N="makefile" |
|||
Type="Makefile"/> |
|||
</Folder> |
|||
</Files> |
|||
<List Name="RTE"> |
|||
</List> |
|||
</Project> |
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,11 @@ |
|||
#! /bin/sh |
|||
|
|||
|
|||
make clean -e "CFG=Debug" |
|||
make -e "CFG=Debug" |
|||
|
|||
|
|||
make clean -e "CFG=Release" |
|||
make -e "CFG=Release" |
|||
/usr/local/ps2dev/ee/bin/ee-strip ./Release/*.elf |
|||
|
|||
@ -0,0 +1,356 @@ |
|||
# SlickEdit generated file. Do not edit this file except in designated areas.
|
|||
|
|||
# Make command to use for dependencies
|
|||
MAKE=make |
|||
RM=rm |
|||
MKDIR=mkdir |
|||
|
|||
# -----Begin user-editable area-----
|
|||
|
|||
# -----End user-editable area-----
|
|||
|
|||
# If no configuration is specified, "Debug" will be used
|
|||
ifndef CFG |
|||
CFG=Debug |
|||
endif |
|||
|
|||
#
|
|||
# Configuration: Debug
|
|||
#
|
|||
ifeq "$(CFG)" "Debug" |
|||
OUTDIR=Debug |
|||
OUTFILE=$(OUTDIR)/Basic_test.elf |
|||
CFG_INC= |
|||
CFG_LIB= |
|||
CFG_OBJ= |
|||
COMMON_OBJ=$(OUTDIR)/ee_sbus.o $(OUTDIR)/ps2_sbus.o $(OUTDIR)/bios.o \
|
|||
$(OUTDIR)/gif.o $(OUTDIR)/dma.o $(OUTDIR)/dma_packets.o \
|
|||
$(OUTDIR)/crc16.o $(OUTDIR)/crc32.o $(OUTDIR)/crc7.o \
|
|||
$(OUTDIR)/crc8.o $(OUTDIR)/md5.o $(OUTDIR)/sha1.o $(OUTDIR)/sha256.o \
|
|||
$(OUTDIR)/Basic_test.o |
|||
OBJ=$(COMMON_OBJ) $(CFG_OBJ) |
|||
ALL_OBJ=$(OUTDIR)/ee_sbus.o $(OUTDIR)/ps2_sbus.o $(OUTDIR)/bios.o \
|
|||
$(OUTDIR)/gif.o $(OUTDIR)/dma.o $(OUTDIR)/dma_packets.o \
|
|||
$(OUTDIR)/crc16.o $(OUTDIR)/crc32.o $(OUTDIR)/crc7.o \
|
|||
$(OUTDIR)/crc8.o $(OUTDIR)/md5.o $(OUTDIR)/sha1.o $(OUTDIR)/sha256.o \
|
|||
$(OUTDIR)/Basic_test.o |
|||
|
|||
COMPILE=ee-gcc -c "-D_EE" -g -fshort-double -ffast-math -mhard-float -mips3 -mfp32 -mno-abicalls -G0 -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $< |
|||
LINK=ee-gcc -g -o "$(OUTFILE)" $(ALL_OBJ) |
|||
COMPILE_ADA=gnat -g -c -o "$(OUTDIR)/$(*F).o" "$<" |
|||
COMPILE_ADB=gnat -g -c -o "$(OUTDIR)/$(*F).o" "$<" |
|||
COMPILE_F=gfortran -c -g -o "$(OUTDIR)/$(*F).o" "$<" |
|||
COMPILE_F90=gfortran -c -g -o "$(OUTDIR)/$(*F).o" "$<" |
|||
COMPILE_D=gdc -c -g -o "$(OUTDIR)/$(*F).o" "$<" |
|||
|
|||
# Pattern rules
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : %.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : %.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : %.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : %.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : %.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
$(OUTDIR)/%.o : %.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
# Build rules
|
|||
all: $(OUTFILE) |
|||
|
|||
$(OUTFILE): $(OUTDIR) $(OBJ) |
|||
$(LINK) |
|||
|
|||
$(OUTDIR): |
|||
$(MKDIR) -p "$(OUTDIR)" |
|||
|
|||
# Rebuild this project
|
|||
rebuild: cleanall |
|||
@$(MAKE) -f "$(strip $(MAKEFILE_LIST))" $(MAKEFLAGS) all |
|||
|
|||
# Clean this project
|
|||
clean: |
|||
$(RM) -f $(OUTFILE) |
|||
$(RM) -f $(OBJ) |
|||
|
|||
# Clean this project and all dependencies
|
|||
cleanall: clean |
|||
endif |
|||
|
|||
#
|
|||
# Configuration: Release
|
|||
#
|
|||
ifeq "$(CFG)" "Release" |
|||
OUTDIR=Release |
|||
OUTFILE=$(OUTDIR)/Basic_test.elf |
|||
CFG_INC=-I/usr/local/ps2dev/ps2sdk/ee/include \
|
|||
-I/usr/local/ps2dev/ps2sdk/common/include |
|||
CFG_LIB=-L/usr/local/ps2dev/ee/ee/lib -L \
|
|||
/usr/local/ps2dev/ps2sdk/ee/lib |
|||
CFG_OBJ= |
|||
COMMON_OBJ=$(OUTDIR)/ee_sbus.o $(OUTDIR)/ps2_sbus.o $(OUTDIR)/bios.o \
|
|||
$(OUTDIR)/gif.o $(OUTDIR)/dma.o $(OUTDIR)/dma_packets.o \
|
|||
$(OUTDIR)/crc16.o $(OUTDIR)/crc32.o $(OUTDIR)/crc7.o \
|
|||
$(OUTDIR)/crc8.o $(OUTDIR)/md5.o $(OUTDIR)/sha1.o $(OUTDIR)/sha256.o \
|
|||
$(OUTDIR)/Basic_test.o |
|||
OBJ=$(COMMON_OBJ) $(CFG_OBJ) |
|||
ALL_OBJ=$(OUTDIR)/ee_sbus.o $(OUTDIR)/ps2_sbus.o $(OUTDIR)/bios.o \
|
|||
$(OUTDIR)/gif.o $(OUTDIR)/dma.o $(OUTDIR)/dma_packets.o \
|
|||
$(OUTDIR)/crc16.o $(OUTDIR)/crc32.o $(OUTDIR)/crc7.o \
|
|||
$(OUTDIR)/crc8.o $(OUTDIR)/md5.o $(OUTDIR)/sha1.o $(OUTDIR)/sha256.o \
|
|||
$(OUTDIR)/Basic_test.o -L/usr/local/ps2dev/ee/ee/lib -L \
|
|||
/usr/local/ps2dev/ps2sdk/ee/lib |
|||
|
|||
COMPILE=ee-gcc -c -v "-D_EE" -O2 -G0 -s -o "$(OUTDIR)/$(*F).o" $(CFG_INC) $< |
|||
LINK=ee-gcc -v -O2 -lc -lkernel -ldraw -lgraph -lmath3d -lmf -lpacket -ldma -o "$(OUTFILE)" $(ALL_OBJ) |
|||
COMPILE_ADA=gnat -O -c -o "$(OUTDIR)/$(*F).o" "$<" |
|||
COMPILE_ADB=gnat -O -c -o "$(OUTDIR)/$(*F).o" "$<" |
|||
COMPILE_F=gfortran -O -g -o "$(OUTDIR)/$(*F).o" "$<" |
|||
COMPILE_F90=gfortran -O -g -o "$(OUTDIR)/$(*F).o" "$<" |
|||
COMPILE_D=gdc -c -g -o "$(OUTDIR)/$(*F).o" "$<" |
|||
|
|||
# Pattern rules
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : %.d |
|||
$(COMPILE_D) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : %.f90 |
|||
$(COMPILE_F90) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : %.f |
|||
$(COMPILE_F) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : %.ada |
|||
$(COMPILE_ADA) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : %.c |
|||
$(COMPILE) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/gs/gif/%.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/core/alg/%.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/ee/dmac/%.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbios/%.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
$(OUTDIR)/%.o : ../sps2_basement/hardware/sbus/%.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
$(OUTDIR)/%.o : %.adb |
|||
$(COMPILE_ADB) |
|||
|
|||
# Build rules
|
|||
all: $(OUTFILE) |
|||
|
|||
$(OUTFILE): $(OUTDIR) $(OBJ) |
|||
$(LINK) |
|||
|
|||
$(OUTDIR): |
|||
$(MKDIR) -p "$(OUTDIR)" |
|||
|
|||
# Rebuild this project
|
|||
rebuild: cleanall |
|||
@$(MAKE) -f "$(strip $(MAKEFILE_LIST))" $(MAKEFLAGS) all |
|||
|
|||
# Clean this project
|
|||
clean: |
|||
$(RM) -f $(OUTFILE) |
|||
$(RM) -f $(OBJ) |
|||
|
|||
# Clean this project and all dependencies
|
|||
cleanall: clean |
|||
endif |
|||
|
|||
#
|
|||
# include dependencies:
|
|||
#
|
|||
$(OUTDIR)/ee_sbus.o: ../sps2_basement/hardware/sbus/ee_sbus.c ../sps2_basement/hardware/sbus/sbus.h ../sps2_basement/hardware/sbus/sbus_regs.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h ../sps2_basement/hardware/ee/ee_regs.h ../sps2_basement/hardware/sbus/iop/iop_regs.h ../sps2_basement/hardware/sbus/sbus_priv.h ../sps2_basement/hardware/sbios/bios.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h ../sps2_basement/hardware/sbios/sifdma.h |
|||
$(OUTDIR)/ps2_sbus.o: ../sps2_basement/hardware/sbus/ps2_sbus.c ../sps2_basement/hardware/sbus/sbus.h ../sps2_basement/hardware/sbus/sbus_regs.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h ../sps2_basement/hardware/ee/ee_regs.h ../sps2_basement/hardware/sbus/iop/iop_regs.h ../sps2_basement/hardware/sbus/sbus_priv.h ../sps2_basement/hardware/sbus/sbus_priv.h ../sps2_basement/hardware/sbios/bios.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h ../sps2_basement/hardware/sbios/sifdma.h |
|||
$(OUTDIR)/bios.o: ../sps2_basement/hardware/sbios/bios.c ../sps2_basement/hardware/sbios/bios.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h ../sps2_basement/hardware/sbios/sifdma.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h |
|||
$(OUTDIR)/gif.o: ../sps2_basement/hardware/gs/gif/gif.c ../sps2_basement/hardware/gs/gif/gif.h ../sps2_basement/hardware/ee/dmac/dma.h |
|||
$(OUTDIR)/dma.o: ../sps2_basement/hardware/ee/dmac/dma.c ../sps2_basement/hardware/ee/dmac/dma.h |
|||
$(OUTDIR)/dma_packets.o: ../sps2_basement/hardware/ee/dmac/dma_packets.c ../sps2_basement/hardware/ee/dmac/dma_packets.h |
|||
$(OUTDIR)/crc16.o: ../sps2_basement/core/alg/crc16.c ../sps2_basement/core/alg/crc.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h |
|||
$(OUTDIR)/crc32.o: ../sps2_basement/core/alg/crc32.c ../sps2_basement/core/alg/crc.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h |
|||
$(OUTDIR)/crc7.o: ../sps2_basement/core/alg/crc7.c ../sps2_basement/core/alg/crc.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h |
|||
$(OUTDIR)/crc8.o: ../sps2_basement/core/alg/crc8.c ../sps2_basement/core/alg/crc.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h |
|||
$(OUTDIR)/md5.o: ../sps2_basement/core/alg/md5.c ../sps2_basement/core/alg/md5.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h |
|||
$(OUTDIR)/sha1.o: ../sps2_basement/core/alg/sha1.c ../sps2_basement/core/alg/sha1.h |
|||
$(OUTDIR)/sha256.o: ../sps2_basement/core/alg/sha256.c ../sps2_basement/core/alg/sha256.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h |
|||
$(OUTDIR)/Basic_test.o: Basic_test.c Basic_test.h ../sps2_basement/core/base/basicTypes.h ../sps2_basement/core/base/basicConfig.h ../sps2_basement/core/base/errno.h ../sps2_basement/core/base/assert.h |
|||
@ -0,0 +1 @@ |
|||
ee-gcc -c "-D_EE" -g -fshort-double -ffast-math -mhard-float -mips3 -mfp32 -mno-abicalls -G0 -o "Debug/crc32.o" ../sps2_basement/core/alg/crc32.c |
|||
@ -0,0 +1,6 @@ |
|||
<!DOCTYPE Workspace SYSTEM "http://www.slickedit.com/dtd/vse/10.0/vpw.dtd"> |
|||
<Workspace Version="10.0" VendorName="SlickEdit"> |
|||
<Projects> |
|||
<Project File="Basic_test/Basic_test.vpj"/> |
|||
</Projects> |
|||
</Workspace> |
|||
@ -0,0 +1,528 @@ |
|||
[Global] |
|||
CurrentProject=Basic_test\Basic_test.vpj |
|||
[ProjectDates] |
|||
Basic_test\Basic_test.vpj=20220520154915477 |
|||
[ActiveConfig] |
|||
Basic_test.vpj=,Debug |
|||
Basic_test\Basic_test.vpj=,Debug |
|||
[TreeExpansion2] |
|||
-@ Basic_test\Basic_test.vpj |
|||
- Source Files |
|||
+ Hardware |
|||
- sbus |
|||
+ iop |
|||
- sif |
|||
- sbios |
|||
- gs |
|||
- gif |
|||
+ ee |
|||
- dmac |
|||
- vu |
|||
- ipu |
|||
- fpu |
|||
- core |
|||
- kernel |
|||
- alg |
|||
- base |
|||
- Header Files |
|||
- Hardware |
|||
- ee |
|||
- sbios |
|||
- sbus |
|||
- sif |
|||
- iop |
|||
- include |
|||
- core |
|||
- base |
|||
- alg |
|||
+ Resource Files |
|||
+ Bitmaps |
|||
+ Other Files |
|||
scroll:0 |
|||
[State] |
|||
MONITOR_CONFIGS: 345 |
|||
MONITOR_CONFIG: 113 0 0 1920 1080,-1920 0 1920 1080 |
|||
SCREEN: 1920 1080 130 130 1484 803 0 0 M 0 0 0 0 1476 943 0 |
|||
MDISTATE: 1 |
|||
AAAAAwAAAAIAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAuoAAAaKAAAAAvsAAAAJAAAACQAAAAcAAAAAAAAAAwAAAAgAAAAGAAAABQAAAAQAAAACAAAAAfsAAAAJAAAACQAAAAAAAAAGAAAABQAAAAgAAAAEAAAAAwAAAAcAAAACAAAAAfwAAAClAAAAAJgAMQAwADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABjAG8AcgBlAFwAYgBhAHMAZQBcAGEAcwBzAGUAcgB0AC4AaAAA/////wAA/AAAAK0AAAAAoAAzADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABjAG8AcgBlAFwAYgBhAHMAZQBcAGIAYQBzAGkAYwBDAG8AbgBmAGkAZwAuAGgAAP////8AAPwAAACrAAAAAJ4ANAA6ADoAOgBDADoAXABNAGkAbgBHAFcAXABtAHMAeQBzAFwAMQAuADAAXABoAG8AbQBlAFwAYgB1AGkAbABkAFwAVwBvAHIAawBTAHAAYQBjAGUAXABzAHAAcwAyAF8AYgBhAHMAZQBtAGUAbgB0AFwAYwBvAHIAZQBcAGIAYQBzAGUAXABiAGEAcwBpAGMAVAB5AHAAZQBzAC4AaAAA/////wAA/AAAAKkAAAAAnAA3ADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABoAGEAcgBkAHcAYQByAGUAXABzAGIAaQBvAHMAXABiAGkAbwBzAC4AYwAA/////wAA/AAAAKkAAAAAnAA4ADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABoAGEAcgBkAHcAYQByAGUAXABzAGIAaQBvAHMAXABiAGkAbwBzAC4AaAAA/////wAA/AAAAKkAAAAAnAAyADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABoAGEAcgBkAHcAYQByAGUAXABnAHMAXABnAGkAZgBcAGcAaQBmAC4AYwAA/////wAA/AAAAKkAAAAAnAA1ADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABoAGEAcgBkAHcAYQByAGUAXABnAHMAXABnAGkAZgBcAGcAaQBmAC4AaAAA/////wAA/AAAAKsAAAAAngA2ADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABoAGEAcgBkAHcAYQByAGUAXABzAGIAaQBvAHMAXABzAGIAaQBvAHMALgBoAQD/////AAH8AAAAswAAAACmADkAOgA6ADoAQwA6AFwATQBpAG4ARwBXAFwAbQBzAHkAcwBcADEALgAwAFwAaABvAG0AZQBcAGIAdQBpAGwAZABcAFcAbwByAGsAUwBwAGEAYwBlAFwAcwBwAHMAMgBfAGIAYQBzAGUAbQBlAG4AdABcAGgAYQByAGQAdwBhAHIAZQBcAHMAYgBpAG8AcwBcAHMAeQBzAGMAYQBsAGwAbgByAC4AaAAA/////wAAAAAAAA== |
|||
STANDARD_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbclass_form T=0 |
|||
_tbproctree_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
_tbopen_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAbcAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAFxAABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAABiAAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAIiAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAXuAAACDQAAAYCg5oZ4AAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAxADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAXMAAABTwAAAYBjGM+NAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAAB4AAAAOvAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
APP_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbclass_form T=0 |
|||
_tbproctree_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
_tbopen_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAbcAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAFxAABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAABiAAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAIiAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAXuAAACDQAAAYCg5oZ4AAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAxADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAXMAAABTwAAAYBjGM+NAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAAB4AAAAOvAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
MONITOR_CONFIG: 114 0 0 1920 1080,-1680 30 1680 1050 |
|||
SCREEN: 1920 1080 130 130 1453 772 0 0 M 0 0 0 0 1498 943 0 |
|||
MDISTATE: 1 |
|||
AAAAAwAAAAIAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAuoAAAMyAAAAAvsAAAAGAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABfsAAAAGAAAABgAAAAEAAAAFAAAABAAAAAMAAAAAAAAAAvwAAABlAAAAAFgAMwA6ADoAOgBaADoAXABkAHIAXwBmAHIAdQBjAGgAdABcAGwAaQBiAFwAcgBnAG8AbwBzAGUAXAByAGcAbwBvAHMAZQBDAGEAbQBlAHIAYQAuAGMAcABwAQD/////AAH8AAAAlQAAAACIADcAOgA6ADoAWgA6AFwAZAByAF8AZgByAHUAYwBoAHQAXABsAGkAYgBcAHIAZwBvAG8AcwBlAFwAcgBnAG8AbwBzAGUASABhAHIAZAB3AGEAcgBlAFIAZQBzAG8AdQByAGMAZQBTAGUAcgBpAGEAbABQAHIAbwB2AGkAZABlAHIALgBjAHAAcAAA/////wAA/AAAAHkAAAAAbAAyADoAOgA6AFoAOgBcAGQAcgBfAGYAcgB1AGMAaAB0AFwAbABpAGIAXAByAGcAbwBvAHMAZQBcAHIAZwBvAG8AcwBlAE0AbwBkAHUAbABlAEUAbQBiAGUAZABWAGkAZABlAG8ALgBjAHAAcAAA/////wAA/AAAAHsAAAAAbgA0ADoAOgA6AFoAOgBcAGQAcgBfAGYAcgB1AGMAaAB0AFwAbABpAGIAXAByAGcAbwBvAHMAZQBcAHIAZwBvAG8AcwBlAE4AbwBkAGUAUABUAFoAQwBhAG0AQwBvAG4AdAByAG8AbAAuAGMAcABwAAD/////AAD8AAAAgQAAAAB0ADUAOgA6ADoAWgA6AFwAZAByAF8AZgByAHUAYwBoAHQAXABsAGkAYgBcAHIAZwBvAG8AcwBlAFwAcgBnAG8AbwBzAGUATgBvAGQAZQBTAHQAYQB0AGkAYwBDAGEAbQBDAG8AbgB0AHIAbwBsAC4AYwBwAHAAAP////8AAPwAAABfAAAAAFIANgA6ADoAOgBaADoAXABkAHIAXwBmAHIAdQBjAGgAdABcAGwAaQBiAFwAcgBnAG8AbwBzAGUAXAByAGcAbwBvAHMAZQBUAHkAcABlAHMALgBoAAD/////AAAAAAAA |
|||
APP_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbproctree_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
_tbopen_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbclass_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAaEAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAF2gABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAACRgAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAFkAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAXaAAABTwAAAX+VhBd7AAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAwADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAX/AAAA0QAAAX8s1c3cAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAAB4AAAAOvAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
|
|||
STANDARD_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbproctree_form T=0 |
|||
_tbcbrowser_form T=0 |
|||
_tbopen_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbclass_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAAaEAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAF2gABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAACRgAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAFkAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAXaAAABTwAAAX+VhBd7AAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAwADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAX/AAAA0QAAAX8s1c3cAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAAB4AAAAOvAAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
MONITOR_CONFIG: 114 0 0 1280 1024 |
|||
SCREEN: 1280 1024 91 70 1133 879 0 0 M 0 0 0 0 987 887 0 |
|||
MDISTATE: 1 |
|||
AAAAAwAAAAIAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAuoAAAXYAAAAAvsAAAAIAAAACAAAAAIAAAAHAAAABQAAAAYAAAAEAAAAAwAAAAEAAAAA+wAAAAgAAAAIAAAABQAAAAQAAAAHAAAAAwAAAAIAAAAGAAAAAQAAAAD8AAAArQAAAACgADMAOgA6ADoAQwA6AFwATQBpAG4ARwBXAFwAbQBzAHkAcwBcADEALgAwAFwAaABvAG0AZQBcAGIAdQBpAGwAZABcAFcAbwByAGsAUwBwAGEAYwBlAFwAcwBwAHMAMgBfAGIAYQBzAGUAbQBlAG4AdABcAGMAbwByAGUAXABiAGEAcwBlAFwAYgBhAHMAaQBjAEMAbwBuAGYAaQBnAC4AaAAA/////wAA/AAAAKsAAAAAngA0ADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABjAG8AcgBlAFwAYgBhAHMAZQBcAGIAYQBzAGkAYwBUAHkAcABlAHMALgBoAAD/////AAD8AAAAqQAAAACcADcAOgA6ADoAQwA6AFwATQBpAG4ARwBXAFwAbQBzAHkAcwBcADEALgAwAFwAaABvAG0AZQBcAGIAdQBpAGwAZABcAFcAbwByAGsAUwBwAGEAYwBlAFwAcwBwAHMAMgBfAGIAYQBzAGUAbQBlAG4AdABcAGgAYQByAGQAdwBhAHIAZQBcAHMAYgBpAG8AcwBcAGIAaQBvAHMALgBjAQD/////AAH8AAAAqQAAAACcADgAOgA6ADoAQwA6AFwATQBpAG4ARwBXAFwAbQBzAHkAcwBcADEALgAwAFwAaABvAG0AZQBcAGIAdQBpAGwAZABcAFcAbwByAGsAUwBwAGEAYwBlAFwAcwBwAHMAMgBfAGIAYQBzAGUAbQBlAG4AdABcAGgAYQByAGQAdwBhAHIAZQBcAHMAYgBpAG8AcwBcAGIAaQBvAHMALgBoAAD/////AAD8AAAAqQAAAACcADIAOgA6ADoAQwA6AFwATQBpAG4ARwBXAFwAbQBzAHkAcwBcADEALgAwAFwAaABvAG0AZQBcAGIAdQBpAGwAZABcAFcAbwByAGsAUwBwAGEAYwBlAFwAcwBwAHMAMgBfAGIAYQBzAGUAbQBlAG4AdABcAGgAYQByAGQAdwBhAHIAZQBcAGcAcwBcAGcAaQBmAFwAZwBpAGYALgBjAAD/////AAD8AAAAqQAAAACcADUAOgA6ADoAQwA6AFwATQBpAG4ARwBXAFwAbQBzAHkAcwBcADEALgAwAFwAaABvAG0AZQBcAGIAdQBpAGwAZABcAFcAbwByAGsAUwBwAGEAYwBlAFwAcwBwAHMAMgBfAGIAYQBzAGUAbQBlAG4AdABcAGgAYQByAGQAdwBhAHIAZQBcAGcAcwBcAGcAaQBmAFwAZwBpAGYALgBoAAD/////AAD8AAAAqwAAAACeADYAOgA6ADoAQwA6AFwATQBpAG4ARwBXAFwAbQBzAHkAcwBcADEALgAwAFwAaABvAG0AZQBcAGIAdQBpAGwAZABcAFcAbwByAGsAUwBwAGEAYwBlAFwAcwBwAHMAMgBfAGIAYQBzAGUAbQBlAG4AdABcAGgAYQByAGQAdwBhAHIAZQBcAHMAYgBpAG8AcwBcAHMAYgBpAG8AcwAuAGgAAP////8AAPwAAACzAAAAAKYAOQA6ADoAOgBDADoAXABNAGkAbgBHAFcAXABtAHMAeQBzAFwAMQAuADAAXABoAG8AbQBlAFwAYgB1AGkAbABkAFwAVwBvAHIAawBTAHAAYQBjAGUAXABzAHAAcwAyAF8AYgBhAHMAZQBtAGUAbgB0AFwAaABhAHIAZAB3AGEAcgBlAFwAcwBiAGkAbwBzAFwAcwB5AHMAYwBhAGwAbABuAHIALgBoAAD/////AAAAAAAA |
|||
APP_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbcbrowser_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbclass_form T=0 |
|||
_tbproctree_form T=0 |
|||
_tbopen_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAE/wAAA6sAAAAAAAAAAAAABP8AAAPXAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAASAAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAD2wABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAABcAAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAICAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAPbAAAB7QAAAYC45jwMAAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAwADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAX/AAAA0QAAAX8s1c3cAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAABQAAAAN3AAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
|
|||
STANDARD_LAYOUT: 54 1 44 5 4 M 0 |
|||
_tbbufftabs_form F=11 |
|||
_tbprojects_form F=8 |
|||
_tbdebug_watches_form F=64 |
|||
_tbbaseclasses_form F=40 |
|||
_tbdeltasave_form F=0 |
|||
_tbdebug_regs_form F=64 |
|||
_tbFTPOpen_form F=0 |
|||
_tbdebug_threads_form F=64 |
|||
_tbclipboard_form F=44 |
|||
_tbopen_form F=40 |
|||
_tbterminal_form F=8 |
|||
_tbdebug_exceptions_form F=384 |
|||
_tbdebug_classes_form F=64 |
|||
_tbtagwin_form F=8 |
|||
_tbdebug_autovars_form F=64 |
|||
_tbsymbolcallers_form F=40 |
|||
_tbFTPClient_form F=0 |
|||
_tbtagrefs_form F=8 |
|||
_tbfind_symbol_form F=32 |
|||
_tbdebug_locals_form F=64 |
|||
_tbdebug_members_form F=64 |
|||
_tbdebug_memory_form F=64 |
|||
_tbsymbol_args_form F=8 |
|||
_tbdebug_stack_form F=64 |
|||
_tbsymbolcalls_form F=40 |
|||
_tbsymbol_props_form F=8 |
|||
_tbfilelist_form F=44 |
|||
_tboutputwin_form F=8 |
|||
_tbclass_form F=8 |
|||
_tbunittest_form F=0 |
|||
_tbfind_form F=36 |
|||
_tbmessages_browser_form F=8 |
|||
_tbannotations_browser_form F=0 |
|||
_tbdebug_breakpoints_form F=384 |
|||
_tbnotification_form F=36 |
|||
_tbinteractive_form F=8 |
|||
_tbproctree_form F=8 |
|||
_tbbookmarks_form F=8 |
|||
_tbregex_form F=40 |
|||
_tbslickc_stack_form F=8 |
|||
_tbderivedclasses_form F=40 |
|||
_tbshell_form F=8 |
|||
_tbcbrowser_form F=8 |
|||
_tbsearch_form F=8 |
|||
_tbcbrowser_form T=0 |
|||
_tbprojects_form T=0 |
|||
_tbclass_form T=0 |
|||
_tbproctree_form T=0 |
|||
_tbopen_form T=0 |
|||
AAAAAwAAAAEAAAAB2gAAAAIAMAAAAAAAAAA1AAAE/wAAA6sAAAAAAAAAAAAABP8AAAPXAAAAAesAAAUOAAAAAPsAAAACAAAAAgAAAAEAAAAA+wAAAAIAAAACAAAAAAAAAAH9AAABoQAAAAAaADoAOgA6AC8AdgBEAG8AYwBrAEEAcgBlAGEBAAAAASAAAAAAAAL7AAAABQAAAAUAAAAAAAAABAAAAAMAAAACAAAAAfsAAAAFAAAABQAAAAAAAAABAAAAAgAAAAMAAAAE/AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGoAZQBjAHQAcwBfAGYAbwByAG0BAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAHAAcgBvAGMAdAByAGUAZQBfAGYAbwByAG0AAP////8AAP///////////AAAADcAAAAAIgAwADoAOgA6AF8AdABiAGMAbABhAHMAcwBfAGYAbwByAG0AAP////8AAP///////////AAAAD0AAAAAKAAwADoAOgA6AF8AdABiAGMAYgByAG8AdwBzAGUAcgBfAGYAbwByAG0AAP////8AAP///////////AAAADUAAAAAIAAwADoAOgA6AF8AdABiAG8AcABlAG4AXwBmAG8AcgBtAAD/////AAD///////////0AAAMZAAAAABoAOgA6ADoALwB2AEQAbwBjAGsAQQByAGUAYQEAAAAD2wABAAAAAfsAAAACAAAAAgAAAAAAAAAB+wAAAAIAAAACAAAAAQAAAAD8AAAAKQAAAAAcADoAOgA6AE0ARABJAEEAUgBFAEEAVABJAEwARQEAAAABcAAB/QAAApkAAAAAGgA6ADoAOgAvAHYARABvAGMAawBBAHIAZQBhAAAAAAICAAAAAAAC+wAAAAcAAAAHAAAAAAAAAAIAAAABAAAABgAAAAUAAAAEAAAAA/sAAAAHAAAABwAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAb8AAAARQEAAAAkADEAOgA6ADoAXwB0AGIAcwBlAGEAcgBjAGgAXwBmAG8AcgBtAAD/////AAAAAAPbAAAB7QAAAYC45jwMAAAAAPwAAABFAQAAACQAMAA6ADoAOgBfAHQAYgB0AGEAZwB3AGkAbgBfAGYAbwByAG0AAP////8AAAAABf0AAACzAAABfyzVyuYAAAAA/AAAAEcBAAAAJgAwADoAOgA6AF8AdABiAHQAYQBnAHIAZQBmAHMAXwBmAG8AcgBtAAD/////AAAAAAX/AAAA0QAAAX8s1c3cAAAAAPwAAABDAQAAACIAMAA6ADoAOgBfAHQAYgBzAGgAZQBsAGwAXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1b7yAAAAAPwAAABZAQAAADgAMAA6ADoAOgBfAHQAYgBtAGUAcwBzAGEAZwBlAHMAXwBiAHIAbwB3AHMAZQByAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXCJAAAAAD8AAAASQEAAAAoADAAOgA6ADoAXwB0AGIAdABlAHIAbQBpAG4AYQBsAF8AZgBvAHIAbQAA/////wAAAAAF/QAAALMAAAF/LNXEsgAAAAD8AAAASwEAAAAqADAAOgA6ADoAXwB0AGIAbwB1AHQAcAB1AHQAdwBpAG4AXwBmAG8AcgBtAAD/////AAAAAAX9AAAAswAAAX8s1caQAAAAAAAAAADbAAAAAAAAAALbAAAAAAAAAAHbAAAAAAAAAAPbAAAAAAAAAAA= |
|||
QTOOLBAR 2 0 |
|||
AAAA/wAAAAD9AAAAAAAABQAAAAN3AAAABAAAAAQAAAAIAAAACPwAAAABAAAAAgAAAAIAAAAQAFMAdABhAG4AZABhAHIAZAEAAAAA/////wAAAAAAAAAAAAAAHgBDAHUAcgByAGUAbgB0ACAAQwBvAG4AdABlAHgAdAEAAAJx/////wAAAAAAAAAA |
|||
_tbstandard_form 1 |
|||
_tbcontext_form 1 |
|||
END_MONITOR_CONFIGS: |
|||
CWD: Basic_test |
|||
BUFFER: BN="sps2_basement\core\base\basicConfig.h""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.4949 CL=1 LE=0 CX=2 CY=56 WI=5 BI=7 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="sps2_basement\core\base\basicTypes.h""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.7496 CL=26 LE=0 CX=27 CY=43 WI=5 BI=8 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="sps2_basement\hardware\sbios\bios.h""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.17925 CL=34 LE=0 CX=35 CY=48 WI=5 BI=6 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="sps2_basement\hardware\gs\gif\gif.c""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.0 CL=14 LE=0 CX=15 CY=0 WI=5 BI=3 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="sps2_basement\hardware\sbios\sbios.h""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=119603808 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.13431 CL=32 LE=0 CX=33 CY=13 WI=5 BI=1 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="sps2_basement\hardware\gs\gif\gif.h""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.457 CL=1 LE=0 CX=2 CY=12 WI=5 BI=4 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="sps2_basement\hardware\sbios\syscallnr.h""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=33554432 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.626 CL=27 LE=0 CX=28 CY=18 WI=5 BI=5 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="sps2_basement\hardware\sbios\bios.c""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=119603808 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.2266 CL=46 LE=0 CX=47 CY=32 WI=5 BI=2 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
BUFFER: BN="sps2_basement\core\base\assert.h""""" |
|||
BI: MA=1 74 1 TABS= WWS=9 IWT= ST=8 IN=2 BW=0 US=32000 RO=0 SE=1 SN=0 BIN=0 MN= HM=0 MF=119603744 TL=0 MLL=0 ASE=0 LNL=1 LCF=6 CAPS=0 E=0 ESBU2=-1 CL="Chalkboard" SC="" SCE= SCU= ALM=0 FWRM=0 HMRE=0 HMRBW=0 SPCWT= SWF=2 SM= STAT= |
|||
VIEW: LN=.17 CL=19 LE=0 CX=20 CY=4 WI=5 BI=9 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 1563 920 0 0 N WF=0 WT=3 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="sps2_basement\core\base\basicConfig.h""""" |
|||
VIEW: LN=.4949 CL=1 LE=0 CX=5 CY=56 WI=128 BI=7 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 1563 920 0 0 N WF=0 WT=4 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="sps2_basement\core\base\basicTypes.h""""" |
|||
VIEW: LN=.7496 CL=26 LE=0 CX=31 CY=43 WI=127 BI=8 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 1563 920 0 0 N WF=0 WT=8 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="sps2_basement\hardware\sbios\bios.h""""" |
|||
VIEW: LN=.17925 CL=34 LE=0 CX=39 CY=48 WI=15 BI=6 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 1563 920 0 0 N WF=0 WT=2 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="sps2_basement\hardware\gs\gif\gif.c""""" |
|||
VIEW: LN=.0 CL=14 LE=0 CX=18 CY=0 WI=13 BI=3 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 1563 920 0 0 N WF=0 WT=5 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="sps2_basement\hardware\gs\gif\gif.h""""" |
|||
VIEW: LN=.457 CL=1 LE=0 CX=5 CY=12 WI=134 BI=4 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 1563 920 0 0 N WF=0 WT=9 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="sps2_basement\hardware\sbios\syscallnr.h""""" |
|||
VIEW: LN=.626 CL=27 LE=0 CX=32 CY=18 WI=137 BI=5 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 1474 920 0 0 N WF=0 WT=7 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="sps2_basement\hardware\sbios\bios.c""""" |
|||
VIEW: LN=.2266 CL=46 LE=0 CX=51 CY=32 WI=140 BI=2 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 1474 920 0 0 N WF=0 WT=10 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="sps2_basement\core\base\assert.h""""" |
|||
VIEW: LN=.17 CL=19 LE=0 CX=23 CY=4 WI=179 BI=9 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
WINDOW: 1 22 1474 920 0 0 N WF=0 WT=6 ",,," DID=0 MI="*,,," |
|||
BUFFER: BN="sps2_basement\hardware\sbios\sbios.h""""" |
|||
VIEW: LN=.13693 CL=32 LE=0 CX=37 CY=27 WI=131 BI=1 HT=0 HN=0 HF=0 HC=4 HB=4 |
|||
MDISTATE: 1 |
|||
AAAAAwAAAAIAAAAB2gAAAAIAMAAAAAAAAAA1AAAHfwAAA+MAAAAAAAAAAAAAB38AAAQPAAAAAuoAAAaKAAAAAvsAAAAJAAAACQAAAAcAAAAAAAAAAwAAAAgAAAAGAAAABQAAAAQAAAACAAAAAfsAAAAJAAAACQAAAAAAAAAGAAAABQAAAAgAAAAEAAAAAwAAAAcAAAACAAAAAfwAAAClAAAAAJgAMQAwADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABjAG8AcgBlAFwAYgBhAHMAZQBcAGEAcwBzAGUAcgB0AC4AaAAA/////wAA/AAAAK0AAAAAoAAzADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABjAG8AcgBlAFwAYgBhAHMAZQBcAGIAYQBzAGkAYwBDAG8AbgBmAGkAZwAuAGgAAP////8AAPwAAACrAAAAAJ4ANAA6ADoAOgBDADoAXABNAGkAbgBHAFcAXABtAHMAeQBzAFwAMQAuADAAXABoAG8AbQBlAFwAYgB1AGkAbABkAFwAVwBvAHIAawBTAHAAYQBjAGUAXABzAHAAcwAyAF8AYgBhAHMAZQBtAGUAbgB0AFwAYwBvAHIAZQBcAGIAYQBzAGUAXABiAGEAcwBpAGMAVAB5AHAAZQBzAC4AaAAA/////wAA/AAAAKkAAAAAnAA3ADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABoAGEAcgBkAHcAYQByAGUAXABzAGIAaQBvAHMAXABiAGkAbwBzAC4AYwAA/////wAA/AAAAKkAAAAAnAA4ADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABoAGEAcgBkAHcAYQByAGUAXABzAGIAaQBvAHMAXABiAGkAbwBzAC4AaAAA/////wAA/AAAAKkAAAAAnAAyADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABoAGEAcgBkAHcAYQByAGUAXABnAHMAXABnAGkAZgBcAGcAaQBmAC4AYwAA/////wAA/AAAAKkAAAAAnAA1ADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABoAGEAcgBkAHcAYQByAGUAXABnAHMAXABnAGkAZgBcAGcAaQBmAC4AaAAA/////wAA/AAAAKsAAAAAngA2ADoAOgA6AEMAOgBcAE0AaQBuAEcAVwBcAG0AcwB5AHMAXAAxAC4AMABcAGgAbwBtAGUAXABiAHUAaQBsAGQAXABXAG8AcgBrAFMAcABhAGMAZQBcAHMAcABzADIAXwBiAGEAcwBlAG0AZQBuAHQAXABoAGEAcgBkAHcAYQByAGUAXABzAGIAaQBvAHMAXABzAGIAaQBvAHMALgBoAQD/////AAH8AAAAswAAAACmADkAOgA6ADoAQwA6AFwATQBpAG4ARwBXAFwAbQBzAHkAcwBcADEALgAwAFwAaABvAG0AZQBcAGIAdQBpAGwAZABcAFcAbwByAGsAUwBwAGEAYwBlAFwAcwBwAHMAMgBfAGIAYQBzAGUAbQBlAG4AdABcAGgAYQByAGQAdwBhAHIAZQBcAHMAYgBpAG8AcwBcAHMAeQBzAGMAYQBsAGwAbgByAC4AaAAA/////wAAAAAAAA== |
|||
FILEHIST: 9 |
|||
sps2_basement\core\alg\crc.h |
|||
sps2_basement\core\base\basicTypes.h |
|||
sps2_basement\hardware\sbios\syscallnr.h |
|||
sps2_basement\hardware\sbios\bios.h |
|||
sps2_basement\hardware\gs\gif\gif.c |
|||
sps2_basement\hardware\gs\gif\gif.h |
|||
sps2_basement\hardware\sbios\bios.c |
|||
sps2_basement\core\base\assert.h |
|||
sps2_basement\hardware\sbios\sbios.h |
|||
ALLFILEHIST: 64 |
|||
sps2_basement\hardware\sbios\syscallnr.h |
|||
sps2_basement\hardware\sbios\sifdma.h |
|||
sps2_basement\core\alg\sha256.h |
|||
sps2_basement\core\alg\sha256.c |
|||
sps2_basement\core\alg\sha1.h |
|||
sps2_basement\core\alg\sha1.c |
|||
sps2_basement\hardware\sbus\sbus_regs.h |
|||
sps2_basement\hardware\sbus\sbus_priv.h |
|||
sps2_basement\hardware\sbus\sbus.h |
|||
sps2_basement\hardware\sbios\sbios.h |
|||
sps2_basement\hardware\sbus\ps2_sbus.c |
|||
Basic_test\packet2_types.h |
|||
Basic_test\packet2.h |
|||
Basic_test\packet.c |
|||
sps2_basement\core\alg\md5.h |
|||
sps2_basement\core\alg\md5.c |
|||
sps2_basement\hardware\sbus\iop\iop_regs.h |
|||
sps2_basement\hardware\gs\gif\gif.h |
|||
sps2_basement\hardware\graphic_synthesizer\gif.h |
|||
Basic_test\gif.h |
|||
sps2_basement\hardware\gs\gif\gif.c |
|||
sps2_basement\hardware\graphic_synthesizer\gif.c |
|||
Basic_test\gif.c |
|||
sps2_basement\core\base\errno.h |
|||
sps2_basement\hardware\sbus\ee_sbus.c |
|||
sps2_basement\hardware\emotion_engine\ee_regs.h |
|||
sps2_basement\hardware\ee\ee_regs.h |
|||
sps2_basement\hardware\sbus\ee_low.S |
|||
sps2_basement\hardware\ee\dmac\dma_packets.h |
|||
sps2_basement\hardware\dmac\dma_packets.h |
|||
sps2_basement\hardware\dma\dma_packets.h |
|||
Basic_test\dma_packets.h |
|||
sps2_basement\hardware\ee\dmac\dma_packets.c |
|||
sps2_basement\hardware\dmac\dma_packets.c |
|||
sps2_basement\hardware\dma\dma_packets.c |
|||
sps2_basement\hardware\ee\dmac\dma.h |
|||
sps2_basement\hardware\dmac\dma.h |
|||
sps2_basement\hardware\dma\dma.h |
|||
Basic_test\dma.h |
|||
sps2_basement\hardware\ee\dmac\dma.c |
|||
sps2_basement\hardware\dmac\dma.c |
|||
sps2_basement\hardware\dma\dma.c |
|||
Basic_test\dma.c |
|||
sps2_basement\core\alg\crc8.c |
|||
sps2_basement\core\alg\crc7.c |
|||
sps2_basement\core\alg\crc32.c |
|||
sps2_basement\core\alg\crc16.c |
|||
sps2_basement\core\alg\crc.h |
|||
sps2_basement\hardware\sbios\bios.S |
|||
sps2_basement\hardware\sbios\bios.h |
|||
sps2_basement\hardware\sbios\bios.c |
|||
sps2_basement\core\base\basicTypes.h |
|||
Z:\dr_frucht\lib\components\base\basicEventHeap.cpp |
|||
Z:\dr_frucht\lib\components\base\basicEvent.h |
|||
Z:\dr_frucht\lib\components\base\basicEvent.cpp |
|||
Z:\dr_frucht\lib\components\base\basicEngine.h |
|||
Z:\dr_frucht\lib\components\base\basicEngine.cpp |
|||
sps2_basement\core\base\basicConfig.h |
|||
Basic_test\Basic_test.h |
|||
Basic_test\Basic_test.c |
|||
Basic_test.c |
|||
sps2_basement\core\base\assert.h |
|||
Z:\dr_frucht\lib\App\argus\ArgusBackend.cpp |
|||
Z:\dr_frucht\lib\hardware\soc\general\3DLRF.h |
|||
DEBUG: 0 0 0 0 5 0 gdb |
|||
printf |
|||
strcpy |
|||
strcmp |
|||
std::* |
|||
boost::* |
|||
DEBUG2: 0 |
|||
TBCLASS: 0 0 |
|||
Binary file not shown.
@ -0,0 +1,48 @@ |
|||
/* |
|||
*========================================================================== |
|||
* |
|||
* crc.h |
|||
* |
|||
* Interface for the CRC algorithms. |
|||
* |
|||
*========================================================================== |
|||
* SPDX-License-Identifier: eCos-2.0 |
|||
*========================================================================== |
|||
*#####DESCRIPTIONBEGIN#### |
|||
* |
|||
* Author(s): Andrew Lunn |
|||
* Contributors: Andrew Lunn |
|||
* Date: 2002-08-06 |
|||
* Purpose: |
|||
* Description: |
|||
* |
|||
* This code is part of eCos (tm). |
|||
* |
|||
*####DESCRIPTIONEND#### |
|||
* |
|||
*========================================================================== |
|||
*/ |
|||
|
|||
#ifndef _SERVICES_CRC_CRC_H_ |
|||
#define _SERVICES_CRC_CRC_H_ |
|||
|
|||
#include "../base/basicTypes.h" |
|||
|
|||
#define DYNAMIC_CRC_TABLE |
|||
|
|||
__externC const uint8_t crc7_syndrome_table[256]; |
|||
static inline uint8_t crc7_byte( uint8_t crc, uint8_t data ){ return crc7_syndrome_table[(crc << 1) ^ data]; } |
|||
__externC uint8_t crc7( uint8_t crc, uint8_t const *buffer, size_t len); |
|||
|
|||
#if __BYTE_ORDER == __LITTLE_ENDIAN |
|||
//__externC uint32_t crc32_le( uint32_t crc, uint8_t const *buffer, size_t len ); |
|||
//#define crc32( seed, data, length ) crc32_le( seed, (uint8_t const *) data, length ) |
|||
#else |
|||
//__externC uint32_t crc32_be( uint32_t crc, uint8_t const *buffer, size_t len ); |
|||
//#define crc32( seed, data, length ) crc32_be( seed, (uint8_t const *) data, length ) |
|||
#endif |
|||
|
|||
__externC uint32_t crc32( uint32_t crc, const uint8_t *p, uint32_t len ); |
|||
|
|||
|
|||
#endif /* _SERVICES_CRC_CRC_H_ */ |
|||
@ -0,0 +1,75 @@ |
|||
/* |
|||
*========================================================================== |
|||
* |
|||
* crc16.c |
|||
* |
|||
* 16 bit CRC with polynomial x^16+x^12+x^5+1 |
|||
* |
|||
*========================================================================== |
|||
* SPDX-License-Identifier: eCos-2.0 |
|||
*========================================================================== |
|||
*#####DESCRIPTIONBEGIN#### |
|||
* |
|||
* Author(s): gthomas |
|||
* Contributors: gthomas,asl |
|||
* Date: 2001-01-31 |
|||
* Purpose: |
|||
* Description: |
|||
* |
|||
* This code is part of eCos (tm). |
|||
* |
|||
*####DESCRIPTIONEND#### |
|||
* |
|||
*========================================================================== |
|||
*/ |
|||
|
|||
#include "crc.h" |
|||
|
|||
/* Table of CRC constants - implements x^16+x^12+x^5+1 */ |
|||
static const uint16_t crc16_tab[] = { |
|||
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, |
|||
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, |
|||
0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, |
|||
0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, |
|||
0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, |
|||
0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, |
|||
0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, |
|||
0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, |
|||
0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, |
|||
0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, |
|||
0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, |
|||
0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, |
|||
0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, |
|||
0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, |
|||
0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, |
|||
0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, |
|||
0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, |
|||
0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, |
|||
0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, |
|||
0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, |
|||
0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, |
|||
0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, |
|||
0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, |
|||
0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, |
|||
0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, |
|||
0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, |
|||
0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, |
|||
0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, |
|||
0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, |
|||
0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, |
|||
0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, |
|||
0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0, |
|||
}; |
|||
|
|||
uint16_t |
|||
cyg_crc16(unsigned char *buf, int len) |
|||
{ |
|||
int i; |
|||
uint16_t cksum; |
|||
|
|||
cksum = 0; |
|||
for (i = 0; i < len; i++) { |
|||
cksum = crc16_tab[((cksum>>8) ^ *buf++) & 0xFF] ^ (cksum << 8); |
|||
} |
|||
return cksum; |
|||
} |
|||
@ -0,0 +1,254 @@ |
|||
/* |
|||
* This file is derived from crc32.c from the zlib-1.1.3 distribution |
|||
* by Jean-loup Gailly and Mark Adler. |
|||
*/ |
|||
|
|||
/* crc32.c -- compute the CRC-32 of a data stream |
|||
* Copyright (C) 1995-1998 Mark Adler |
|||
* For conditions of distribution and use, see copyright notice in zlib.h |
|||
*/ |
|||
|
|||
#include "crc.h" |
|||
|
|||
#ifdef USE_HOSTCC |
|||
//#include <arpa/inet.h> |
|||
#else |
|||
//#include <common.h> |
|||
#endif |
|||
|
|||
//#include <compiler.h> |
|||
//#include <u-boot/crc.h> |
|||
|
|||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) |
|||
//#include <watchdog.h> |
|||
#endif |
|||
|
|||
//#include "u-boot/zlib.h" |
|||
|
|||
#define local static |
|||
#define ZEXPORT /* empty */ |
|||
|
|||
#define tole(x) cpu_to_le32(x) |
|||
|
|||
#ifdef DYNAMIC_CRC_TABLE |
|||
|
|||
local int crc_table_empty = 1; |
|||
local uint32_t crc_table[256]; |
|||
//local void make_crc_table OF((void)); |
|||
|
|||
/* |
|||
Generate a table for a byte-wise 32-bit CRC calculation on the polynomial: |
|||
x^32+x^26+x^23+x^22+x^16+x^12+x^11+x^10+x^8+x^7+x^5+x^4+x^2+x+1. |
|||
|
|||
Polynomials over GF(2) are represented in binary, one bit per coefficient, |
|||
with the lowest powers in the most significant bit. Then adding polynomials |
|||
is just exclusive-or, and multiplying a polynomial by x is a right shift by |
|||
one. If we call the above polynomial p, and represent a byte as the |
|||
polynomial q, also with the lowest power in the most significant bit (so the |
|||
byte 0xb1 is the polynomial x^7+x^3+x+1), then the CRC is (q*x^32) mod p, |
|||
where a mod b means the remainder after dividing a by b. |
|||
|
|||
This calculation is done using the shift-register method of multiplying and |
|||
taking the remainder. The register is initialized to zero, and for each |
|||
incoming bit, x^32 is added mod p to the register if the bit is a one (where |
|||
x^32 mod p is p+x^32 = x^26+...+1), and the register is multiplied mod p by |
|||
x (which is shifting right by one and adding x^32 mod p if the bit shifted |
|||
out is a one). We start with the highest power (least significant bit) of |
|||
q and repeat for all eight bits of q. |
|||
|
|||
The table is simply the CRC of all possible eight bit values. This is all |
|||
the information needed to generate CRC's on data a byte at a time for all |
|||
combinations of CRC register values and incoming bytes. |
|||
*/ |
|||
local void make_crc_table( ){ |
|||
uint32_t c; |
|||
uint32_t n, k; |
|||
uint64_t poly = 0; /* polynomial exclusive-or pattern */ |
|||
/* terms of polynomial defining this crc (except x^32): */ |
|||
static const uint8_t p[] = {0,1,2,4,5,7,8,10,11,12,16,22,23,26}; |
|||
|
|||
/* make exclusive-or pattern from polynomial (0xedb88320L) */ |
|||
for (n = 0; n < sizeof(p)/sizeof(uint8_t); n++) poly |= 1L << (31 - p[n]); |
|||
for (n = 0; n < 256; n++) { |
|||
c = n; |
|||
for (k = 0; k < 8; k++) c = c & 1 ? poly ^ (c >> 1) : c >> 1; |
|||
crc_table[n] = tole(c); |
|||
}; |
|||
crc_table_empty = 0; |
|||
}; |
|||
|
|||
#else |
|||
/* ======================================================================== |
|||
* Table of CRC-32's of all single-byte values (made by make_crc_table) |
|||
*/ |
|||
|
|||
local const uint32_t crc_table[256] = { |
|||
tole(0x00000000L), tole(0x77073096L), tole(0xee0e612cL), tole(0x990951baL), |
|||
tole(0x076dc419L), tole(0x706af48fL), tole(0xe963a535L), tole(0x9e6495a3L), |
|||
tole(0x0edb8832L), tole(0x79dcb8a4L), tole(0xe0d5e91eL), tole(0x97d2d988L), |
|||
tole(0x09b64c2bL), tole(0x7eb17cbdL), tole(0xe7b82d07L), tole(0x90bf1d91L), |
|||
tole(0x1db71064L), tole(0x6ab020f2L), tole(0xf3b97148L), tole(0x84be41deL), |
|||
tole(0x1adad47dL), tole(0x6ddde4ebL), tole(0xf4d4b551L), tole(0x83d385c7L), |
|||
tole(0x136c9856L), tole(0x646ba8c0L), tole(0xfd62f97aL), tole(0x8a65c9ecL), |
|||
tole(0x14015c4fL), tole(0x63066cd9L), tole(0xfa0f3d63L), tole(0x8d080df5L), |
|||
tole(0x3b6e20c8L), tole(0x4c69105eL), tole(0xd56041e4L), tole(0xa2677172L), |
|||
tole(0x3c03e4d1L), tole(0x4b04d447L), tole(0xd20d85fdL), tole(0xa50ab56bL), |
|||
tole(0x35b5a8faL), tole(0x42b2986cL), tole(0xdbbbc9d6L), tole(0xacbcf940L), |
|||
tole(0x32d86ce3L), tole(0x45df5c75L), tole(0xdcd60dcfL), tole(0xabd13d59L), |
|||
tole(0x26d930acL), tole(0x51de003aL), tole(0xc8d75180L), tole(0xbfd06116L), |
|||
tole(0x21b4f4b5L), tole(0x56b3c423L), tole(0xcfba9599L), tole(0xb8bda50fL), |
|||
tole(0x2802b89eL), tole(0x5f058808L), tole(0xc60cd9b2L), tole(0xb10be924L), |
|||
tole(0x2f6f7c87L), tole(0x58684c11L), tole(0xc1611dabL), tole(0xb6662d3dL), |
|||
tole(0x76dc4190L), tole(0x01db7106L), tole(0x98d220bcL), tole(0xefd5102aL), |
|||
tole(0x71b18589L), tole(0x06b6b51fL), tole(0x9fbfe4a5L), tole(0xe8b8d433L), |
|||
tole(0x7807c9a2L), tole(0x0f00f934L), tole(0x9609a88eL), tole(0xe10e9818L), |
|||
tole(0x7f6a0dbbL), tole(0x086d3d2dL), tole(0x91646c97L), tole(0xe6635c01L), |
|||
tole(0x6b6b51f4L), tole(0x1c6c6162L), tole(0x856530d8L), tole(0xf262004eL), |
|||
tole(0x6c0695edL), tole(0x1b01a57bL), tole(0x8208f4c1L), tole(0xf50fc457L), |
|||
tole(0x65b0d9c6L), tole(0x12b7e950L), tole(0x8bbeb8eaL), tole(0xfcb9887cL), |
|||
tole(0x62dd1ddfL), tole(0x15da2d49L), tole(0x8cd37cf3L), tole(0xfbd44c65L), |
|||
tole(0x4db26158L), tole(0x3ab551ceL), tole(0xa3bc0074L), tole(0xd4bb30e2L), |
|||
tole(0x4adfa541L), tole(0x3dd895d7L), tole(0xa4d1c46dL), tole(0xd3d6f4fbL), |
|||
tole(0x4369e96aL), tole(0x346ed9fcL), tole(0xad678846L), tole(0xda60b8d0L), |
|||
tole(0x44042d73L), tole(0x33031de5L), tole(0xaa0a4c5fL), tole(0xdd0d7cc9L), |
|||
tole(0x5005713cL), tole(0x270241aaL), tole(0xbe0b1010L), tole(0xc90c2086L), |
|||
tole(0x5768b525L), tole(0x206f85b3L), tole(0xb966d409L), tole(0xce61e49fL), |
|||
tole(0x5edef90eL), tole(0x29d9c998L), tole(0xb0d09822L), tole(0xc7d7a8b4L), |
|||
tole(0x59b33d17L), tole(0x2eb40d81L), tole(0xb7bd5c3bL), tole(0xc0ba6cadL), |
|||
tole(0xedb88320L), tole(0x9abfb3b6L), tole(0x03b6e20cL), tole(0x74b1d29aL), |
|||
tole(0xead54739L), tole(0x9dd277afL), tole(0x04db2615L), tole(0x73dc1683L), |
|||
tole(0xe3630b12L), tole(0x94643b84L), tole(0x0d6d6a3eL), tole(0x7a6a5aa8L), |
|||
tole(0xe40ecf0bL), tole(0x9309ff9dL), tole(0x0a00ae27L), tole(0x7d079eb1L), |
|||
tole(0xf00f9344L), tole(0x8708a3d2L), tole(0x1e01f268L), tole(0x6906c2feL), |
|||
tole(0xf762575dL), tole(0x806567cbL), tole(0x196c3671L), tole(0x6e6b06e7L), |
|||
tole(0xfed41b76L), tole(0x89d32be0L), tole(0x10da7a5aL), tole(0x67dd4accL), |
|||
tole(0xf9b9df6fL), tole(0x8ebeeff9L), tole(0x17b7be43L), tole(0x60b08ed5L), |
|||
tole(0xd6d6a3e8L), tole(0xa1d1937eL), tole(0x38d8c2c4L), tole(0x4fdff252L), |
|||
tole(0xd1bb67f1L), tole(0xa6bc5767L), tole(0x3fb506ddL), tole(0x48b2364bL), |
|||
tole(0xd80d2bdaL), tole(0xaf0a1b4cL), tole(0x36034af6L), tole(0x41047a60L), |
|||
tole(0xdf60efc3L), tole(0xa867df55L), tole(0x316e8eefL), tole(0x4669be79L), |
|||
tole(0xcb61b38cL), tole(0xbc66831aL), tole(0x256fd2a0L), tole(0x5268e236L), |
|||
tole(0xcc0c7795L), tole(0xbb0b4703L), tole(0x220216b9L), tole(0x5505262fL), |
|||
tole(0xc5ba3bbeL), tole(0xb2bd0b28L), tole(0x2bb45a92L), tole(0x5cb36a04L), |
|||
tole(0xc2d7ffa7L), tole(0xb5d0cf31L), tole(0x2cd99e8bL), tole(0x5bdeae1dL), |
|||
tole(0x9b64c2b0L), tole(0xec63f226L), tole(0x756aa39cL), tole(0x026d930aL), |
|||
tole(0x9c0906a9L), tole(0xeb0e363fL), tole(0x72076785L), tole(0x05005713L), |
|||
tole(0x95bf4a82L), tole(0xe2b87a14L), tole(0x7bb12baeL), tole(0x0cb61b38L), |
|||
tole(0x92d28e9bL), tole(0xe5d5be0dL), tole(0x7cdcefb7L), tole(0x0bdbdf21L), |
|||
tole(0x86d3d2d4L), tole(0xf1d4e242L), tole(0x68ddb3f8L), tole(0x1fda836eL), |
|||
tole(0x81be16cdL), tole(0xf6b9265bL), tole(0x6fb077e1L), tole(0x18b74777L), |
|||
tole(0x88085ae6L), tole(0xff0f6a70L), tole(0x66063bcaL), tole(0x11010b5cL), |
|||
tole(0x8f659effL), tole(0xf862ae69L), tole(0x616bffd3L), tole(0x166ccf45L), |
|||
tole(0xa00ae278L), tole(0xd70dd2eeL), tole(0x4e048354L), tole(0x3903b3c2L), |
|||
tole(0xa7672661L), tole(0xd06016f7L), tole(0x4969474dL), tole(0x3e6e77dbL), |
|||
tole(0xaed16a4aL), tole(0xd9d65adcL), tole(0x40df0b66L), tole(0x37d83bf0L), |
|||
tole(0xa9bcae53L), tole(0xdebb9ec5L), tole(0x47b2cf7fL), tole(0x30b5ffe9L), |
|||
tole(0xbdbdf21cL), tole(0xcabac28aL), tole(0x53b39330L), tole(0x24b4a3a6L), |
|||
tole(0xbad03605L), tole(0xcdd70693L), tole(0x54de5729L), tole(0x23d967bfL), |
|||
tole(0xb3667a2eL), tole(0xc4614ab8L), tole(0x5d681b02L), tole(0x2a6f2b94L), |
|||
tole(0xb40bbe37L), tole(0xc30c8ea1L), tole(0x5a05df1bL), tole(0x2d02ef8dL) |
|||
}; |
|||
#endif |
|||
|
|||
#if 0 |
|||
/* ========================================================================= |
|||
* This function can be used by asm versions of crc32() |
|||
*/ |
|||
const uint32_t * ZEXPORT get_crc_table() |
|||
{ |
|||
#ifdef DYNAMIC_CRC_TABLE |
|||
if (crc_table_empty) make_crc_table(); |
|||
#endif |
|||
return (const uint32_t *)crc_table; |
|||
} |
|||
#endif |
|||
|
|||
/* ========================================================================= */ |
|||
# if __BYTE_ORDER == __LITTLE_ENDIAN |
|||
# define DO_CRC(x) crc = tab[(crc ^ (x)) & 255] ^ (crc >> 8) |
|||
# else |
|||
# define DO_CRC(x) crc = tab[((crc >> 24) ^ (x)) & 255] ^ (crc << 8) |
|||
# endif |
|||
|
|||
/* ========================================================================= */ |
|||
|
|||
/* No ones complement version. JFFS2 (and other things ?) |
|||
* don't use ones compliment in their CRC calculations. |
|||
*/ |
|||
uint32_t ZEXPORT crc32_no_comp(uint32_t crc, const uint8_t *buf, uint32_t len){ |
|||
|
|||
const uint32_t *tab = crc_table; |
|||
const uint32_t *b =(const uint32_t *)buf; |
|||
size_t rem_len; |
|||
#ifdef DYNAMIC_CRC_TABLE |
|||
if( crc_table_empty ) make_crc_table(); |
|||
#endif |
|||
crc = cpu_to_le32(crc); |
|||
/* Align it */ |
|||
if(((uint32_t)b) & 3 && len) { |
|||
uint8_t *p = (uint8_t *)b; |
|||
do{ |
|||
DO_CRC(*p++); |
|||
} while ((--len) && ((uint32_t)p)&3); |
|||
b = (uint32_t *)p; |
|||
}; |
|||
|
|||
rem_len = len & 3; |
|||
len = len >> 2; |
|||
for (--b; len; --len) { |
|||
/* load data 32 bits wide, xor data 32 bits wide. */ |
|||
crc ^= *++b; /* use pre increment for speed */ |
|||
DO_CRC(0); |
|||
DO_CRC(0); |
|||
DO_CRC(0); |
|||
DO_CRC(0); |
|||
} |
|||
len = rem_len; |
|||
/* And the last few bytes */ |
|||
if (len) { |
|||
uint8_t *p = (uint8_t *)(b + 1) - 1; |
|||
do { |
|||
DO_CRC(*++p); /* use pre increment for speed */ |
|||
} while (--len); |
|||
} |
|||
|
|||
return le32_to_cpu(crc); |
|||
} |
|||
#undef DO_CRC |
|||
|
|||
uint32_t ZEXPORT crc32 (uint32_t crc, const uint8_t *p, uint32_t len){ |
|||
return crc32_no_comp(crc ^ 0xffffffffL, p, len) ^ 0xffffffffL; |
|||
} |
|||
|
|||
/* |
|||
* Calculate the crc32 checksum triggering the watchdog every 'chunk_sz' bytes |
|||
* of input. |
|||
*/ |
|||
uint32_t ZEXPORT crc32_wd (uint32_t crc, const uint8_t *buf, uint32_t len, uint32_t chunk_sz){ |
|||
|
|||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) |
|||
const unsigned char *end, *curr; |
|||
int chunk; |
|||
|
|||
curr = buf; |
|||
end = buf + len; |
|||
while (curr < end) { |
|||
chunk = end - curr; |
|||
if (chunk > chunk_sz) |
|||
chunk = chunk_sz; |
|||
crc = crc32 (crc, curr, chunk); |
|||
curr += chunk; |
|||
WATCHDOG_RESET (); |
|||
} |
|||
#else |
|||
crc = crc32 (crc, buf, len); |
|||
#endif |
|||
return crc; |
|||
}; |
|||
|
|||
void crc32_wd_buf(const uint8_t *input, uint32_t ilen, uint8_t *output, uint32_t chunk_sz ){ |
|||
uint32_t crc; |
|||
crc = crc32_wd( 0, input, ilen, chunk_sz ); |
|||
crc = cpu_to_be32( crc ); //htonl -> Net Byte Order is BE! |
|||
memcpy( output, &crc, sizeof(crc)); |
|||
}; |
|||
@ -0,0 +1,60 @@ |
|||
/* |
|||
* crc7.c |
|||
* |
|||
* This source code is licensed under the GNU General Public License, |
|||
* Version 2. See the file COPYING for more details. |
|||
*/ |
|||
|
|||
//#include <linux/types.h> |
|||
//#include <linux/crc7.h> |
|||
#include "crc.h" |
|||
|
|||
/* Table for CRC-7 (polynomial x^7 + x^3 + 1) */ |
|||
const uint8_t crc7_syndrome_table[256] = { |
|||
0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f, |
|||
0x48, 0x41, 0x5a, 0x53, 0x6c, 0x65, 0x7e, 0x77, |
|||
0x19, 0x10, 0x0b, 0x02, 0x3d, 0x34, 0x2f, 0x26, |
|||
0x51, 0x58, 0x43, 0x4a, 0x75, 0x7c, 0x67, 0x6e, |
|||
0x32, 0x3b, 0x20, 0x29, 0x16, 0x1f, 0x04, 0x0d, |
|||
0x7a, 0x73, 0x68, 0x61, 0x5e, 0x57, 0x4c, 0x45, |
|||
0x2b, 0x22, 0x39, 0x30, 0x0f, 0x06, 0x1d, 0x14, |
|||
0x63, 0x6a, 0x71, 0x78, 0x47, 0x4e, 0x55, 0x5c, |
|||
0x64, 0x6d, 0x76, 0x7f, 0x40, 0x49, 0x52, 0x5b, |
|||
0x2c, 0x25, 0x3e, 0x37, 0x08, 0x01, 0x1a, 0x13, |
|||
0x7d, 0x74, 0x6f, 0x66, 0x59, 0x50, 0x4b, 0x42, |
|||
0x35, 0x3c, 0x27, 0x2e, 0x11, 0x18, 0x03, 0x0a, |
|||
0x56, 0x5f, 0x44, 0x4d, 0x72, 0x7b, 0x60, 0x69, |
|||
0x1e, 0x17, 0x0c, 0x05, 0x3a, 0x33, 0x28, 0x21, |
|||
0x4f, 0x46, 0x5d, 0x54, 0x6b, 0x62, 0x79, 0x70, |
|||
0x07, 0x0e, 0x15, 0x1c, 0x23, 0x2a, 0x31, 0x38, |
|||
0x41, 0x48, 0x53, 0x5a, 0x65, 0x6c, 0x77, 0x7e, |
|||
0x09, 0x00, 0x1b, 0x12, 0x2d, 0x24, 0x3f, 0x36, |
|||
0x58, 0x51, 0x4a, 0x43, 0x7c, 0x75, 0x6e, 0x67, |
|||
0x10, 0x19, 0x02, 0x0b, 0x34, 0x3d, 0x26, 0x2f, |
|||
0x73, 0x7a, 0x61, 0x68, 0x57, 0x5e, 0x45, 0x4c, |
|||
0x3b, 0x32, 0x29, 0x20, 0x1f, 0x16, 0x0d, 0x04, |
|||
0x6a, 0x63, 0x78, 0x71, 0x4e, 0x47, 0x5c, 0x55, |
|||
0x22, 0x2b, 0x30, 0x39, 0x06, 0x0f, 0x14, 0x1d, |
|||
0x25, 0x2c, 0x37, 0x3e, 0x01, 0x08, 0x13, 0x1a, |
|||
0x6d, 0x64, 0x7f, 0x76, 0x49, 0x40, 0x5b, 0x52, |
|||
0x3c, 0x35, 0x2e, 0x27, 0x18, 0x11, 0x0a, 0x03, |
|||
0x74, 0x7d, 0x66, 0x6f, 0x50, 0x59, 0x42, 0x4b, |
|||
0x17, 0x1e, 0x05, 0x0c, 0x33, 0x3a, 0x21, 0x28, |
|||
0x5f, 0x56, 0x4d, 0x44, 0x7b, 0x72, 0x69, 0x60, |
|||
0x0e, 0x07, 0x1c, 0x15, 0x2a, 0x23, 0x38, 0x31, |
|||
0x46, 0x4f, 0x54, 0x5d, 0x62, 0x6b, 0x70, 0x79 |
|||
}; |
|||
|
|||
/** |
|||
* crc7 - update the CRC7 for the data buffer |
|||
* @crc: previous CRC7 value |
|||
* @buffer: data pointer |
|||
* @len: number of bytes in the buffer |
|||
* Context: any |
|||
* |
|||
* Returns the updated CRC7 value. |
|||
*/ |
|||
uint8_t crc7( uint8_t crc, const uint8_t *buffer, size_t len ){ |
|||
while (len--) crc = crc7_byte( crc, *buffer++ ); |
|||
return crc; |
|||
}; |
|||
@ -0,0 +1,22 @@ |
|||
/* |
|||
* Copyright (c) 2013 Google, Inc |
|||
* |
|||
* SPDX-License-Identifier: GPL-2.0+ |
|||
*/ |
|||
|
|||
#include "crc.h" |
|||
|
|||
uint32_t crc8(const uint8_t *vptr, size_t len ){ |
|||
const uint8_t * data = vptr; |
|||
uint32_t crc = 0; |
|||
uint32_t i, j; |
|||
for( j = len; j; j--, data++ ){ |
|||
crc ^= (*data << 8); |
|||
for (i = 8; i; i--) { |
|||
if (crc & 0x8000) crc ^= (0x1070 << 3); |
|||
crc <<= 1; |
|||
}; |
|||
}; |
|||
return (crc >> 8) & 0xff; |
|||
}; |
|||
|
|||
@ -0,0 +1,295 @@ |
|||
/* |
|||
* This file was transplanted with slight modifications from Linux sources |
|||
* (fs/cifs/md5.c) into U-Boot by Bartlomiej Sieka <tur@semihalf.com>. |
|||
*/ |
|||
|
|||
/* |
|||
* This code implements the MD5 message-digest algorithm. |
|||
* The algorithm is due to Ron Rivest. This code was |
|||
* written by Colin Plumb in 1993, no copyright is claimed. |
|||
* This code is in the public domain; do with it what you wish. |
|||
* |
|||
* Equivalent code is available from RSA Data Security, Inc. |
|||
* This code has been tested against that, and is equivalent, |
|||
* except that you don't need to include two pages of legalese |
|||
* with every copy. |
|||
* |
|||
* To compute the message digest of a chunk of bytes, declare an |
|||
* MD5Context structure, pass it to MD5Init, call MD5Update as |
|||
* needed on buffers full of bytes, and then call MD5Final, which |
|||
* will fill a supplied 16-byte array with the digest. |
|||
*/ |
|||
|
|||
/* This code slightly modified to fit into Samba by |
|||
abartlet@samba.org Jun 2001 |
|||
and to fit the cifs vfs by |
|||
Steve French sfrench@us.ibm.com */ |
|||
|
|||
#include "md5.h" |
|||
|
|||
static void MD5Transform( uint32_t buf[4], uint32_t const in[16] ); |
|||
|
|||
/* |
|||
* Note: this code is harmless on little-endian machines. |
|||
*/ |
|||
static void byteReverse( uint8_t *buf, unsigned longs){ |
|||
uint32_t t; |
|||
do { |
|||
t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 | |
|||
((unsigned) buf[1] << 8 | buf[0]); |
|||
*(uint32_t *) buf = t; |
|||
buf += 4; |
|||
} while (--longs); |
|||
}; |
|||
|
|||
/* |
|||
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious |
|||
* initialization constants. |
|||
*/ |
|||
static void MD5Init( struct MD5Context *ctx ){ |
|||
|
|||
ctx->buf[0] = 0x67452301; |
|||
ctx->buf[1] = 0xefcdab89; |
|||
ctx->buf[2] = 0x98badcfe; |
|||
ctx->buf[3] = 0x10325476; |
|||
|
|||
ctx->bits[0] = 0; |
|||
ctx->bits[1] = 0; |
|||
}; |
|||
|
|||
/* |
|||
* Update context to reflect the concatenation of another buffer full |
|||
* of bytes. |
|||
*/ |
|||
static void MD5Update( struct MD5Context *ctx, uint8_t const *buf, unsigned len ){ |
|||
register uint32_t t; |
|||
|
|||
/* Update bitcount */ |
|||
|
|||
t = ctx->bits[0]; |
|||
if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t) |
|||
ctx->bits[1]++; /* Carry from low to high */ |
|||
ctx->bits[1] += len >> 29; |
|||
|
|||
t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ |
|||
|
|||
/* Handle any leading odd-sized chunks */ |
|||
|
|||
if (t) { |
|||
unsigned char *p = (unsigned char *) ctx->in + t; |
|||
|
|||
t = 64 - t; |
|||
if (len < t) { |
|||
memmove(p, buf, len); |
|||
return; |
|||
} |
|||
memmove(p, buf, t); |
|||
byteReverse(ctx->in, 16); |
|||
MD5Transform(ctx->buf, (uint32_t *) ctx->in); |
|||
buf += t; |
|||
len -= t; |
|||
} |
|||
/* Process data in 64-byte chunks */ |
|||
|
|||
while (len >= 64) { |
|||
memmove(ctx->in, buf, 64); |
|||
byteReverse(ctx->in, 16); |
|||
MD5Transform(ctx->buf, (uint32_t *) ctx->in); |
|||
buf += 64; |
|||
len -= 64; |
|||
} |
|||
|
|||
/* Handle any remaining bytes of data. */ |
|||
|
|||
memmove(ctx->in, buf, len); |
|||
} |
|||
|
|||
/* |
|||
* Final wrapup - pad to 64-byte boundary with the bit pattern |
|||
* 1 0* (64-bit count of bits processed, MSB-first) |
|||
*/ |
|||
static void MD5Final( uint8_t digest[16], struct MD5Context *ctx ){ |
|||
uint32_t count; |
|||
uint8_t * p; |
|||
|
|||
/* Compute number of bytes mod 64 */ |
|||
count = (ctx->bits[0] >> 3) & 0x3F; |
|||
|
|||
/* Set the first char of padding to 0x80. This is safe since there is |
|||
always at least one byte free */ |
|||
p = ctx->in + count; |
|||
*p++ = 0x80; |
|||
|
|||
/* Bytes of padding needed to make 64 bytes */ |
|||
count = 64 - 1 - count; |
|||
|
|||
/* Pad out to 56 mod 64 */ |
|||
if (count < 8) { |
|||
/* Two lots of padding: Pad the first block to 64 bytes */ |
|||
memset(p, 0, count); |
|||
byteReverse(ctx->in, 16); |
|||
MD5Transform(ctx->buf, (uint32_t *) ctx->in); |
|||
|
|||
/* Now fill the next block with 56 bytes */ |
|||
memset(ctx->in, 0, 56); |
|||
} else { |
|||
/* Pad block to 56 bytes */ |
|||
memset(p, 0, count - 8); |
|||
} |
|||
byteReverse(ctx->in, 14); |
|||
|
|||
/* Append length in bits and transform */ |
|||
ctx->in32[14] = ctx->bits[0]; |
|||
ctx->in32[15] = ctx->bits[1]; |
|||
|
|||
MD5Transform(ctx->buf, (uint32_t *) ctx->in); |
|||
byteReverse((unsigned char *) ctx->buf, 4); |
|||
memmove(digest, ctx->buf, 16); |
|||
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ |
|||
}; |
|||
|
|||
/* The four core functions - F1 is optimized somewhat */ |
|||
|
|||
/* #define F1(x, y, z) (x & y | ~x & z) */ |
|||
#define F1(x, y, z) (z ^ (x & (y ^ z))) |
|||
#define F2(x, y, z) F1(z, x, y) |
|||
#define F3(x, y, z) (x ^ y ^ z) |
|||
#define F4(x, y, z) (y ^ (x | ~z)) |
|||
|
|||
/* This is the central step in the MD5 algorithm. */ |
|||
#define MD5STEP(f, w, x, y, z, data, s) \ |
|||
( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x ) |
|||
|
|||
/* |
|||
* The core of the MD5 algorithm, this alters an existing MD5 hash to |
|||
* reflect the addition of 16 longwords of new data. MD5Update blocks |
|||
* the data and converts bytes into longwords for this routine. |
|||
*/ |
|||
static void MD5Transform( uint32_t buf[4], uint32_t const in[16] ){ |
|||
register uint32_t a, b, c, d; |
|||
|
|||
a = buf[0]; |
|||
b = buf[1]; |
|||
c = buf[2]; |
|||
d = buf[3]; |
|||
|
|||
MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); |
|||
MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); |
|||
MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); |
|||
MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); |
|||
MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); |
|||
MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); |
|||
MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); |
|||
MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); |
|||
MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); |
|||
MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); |
|||
MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); |
|||
MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); |
|||
MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); |
|||
MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); |
|||
MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); |
|||
MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); |
|||
|
|||
MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); |
|||
MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); |
|||
MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); |
|||
MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); |
|||
MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); |
|||
MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); |
|||
MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); |
|||
MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); |
|||
MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); |
|||
MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); |
|||
MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); |
|||
MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); |
|||
MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); |
|||
MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); |
|||
MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); |
|||
MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); |
|||
|
|||
MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); |
|||
MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); |
|||
MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); |
|||
MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); |
|||
MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); |
|||
MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); |
|||
MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); |
|||
MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); |
|||
MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); |
|||
MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); |
|||
MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); |
|||
MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); |
|||
MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); |
|||
MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); |
|||
MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); |
|||
MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); |
|||
|
|||
MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); |
|||
MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); |
|||
MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); |
|||
MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); |
|||
MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); |
|||
MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); |
|||
MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); |
|||
MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); |
|||
MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); |
|||
MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); |
|||
MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); |
|||
MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); |
|||
MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); |
|||
MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); |
|||
MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); |
|||
MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); |
|||
|
|||
buf[0] += a; |
|||
buf[1] += b; |
|||
buf[2] += c; |
|||
buf[3] += d; |
|||
}; |
|||
|
|||
/* |
|||
* Calculate and store in 'output' the MD5 digest of 'len' bytes at |
|||
* 'input'. 'output' must have enough space to hold 16 bytes. |
|||
*/ |
|||
void md5( uint8_t *input, int len, uint8_t output[16] ){ |
|||
struct MD5Context context; |
|||
MD5Init(&context); |
|||
MD5Update(&context, input, len); |
|||
MD5Final(output, &context); |
|||
} |
|||
|
|||
|
|||
/* |
|||
* Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'. |
|||
* 'output' must have enough space to hold 16 bytes. If 'chunk' Trigger the |
|||
* watchdog every 'chunk_sz' bytes of input processed. |
|||
*/ |
|||
void |
|||
md5_wd (unsigned char *input, int len, unsigned char output[16], |
|||
unsigned int chunk_sz) |
|||
{ |
|||
struct MD5Context context; |
|||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) |
|||
unsigned char *end, *curr; |
|||
int chunk; |
|||
#endif |
|||
|
|||
MD5Init(&context); |
|||
|
|||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) |
|||
curr = input; |
|||
end = input + len; |
|||
while (curr < end) { |
|||
chunk = end - curr; |
|||
if (chunk > chunk_sz) |
|||
chunk = chunk_sz; |
|||
MD5Update(&context, curr, chunk); |
|||
curr += chunk; |
|||
WATCHDOG_RESET (); |
|||
} |
|||
#else |
|||
MD5Update(&context, input, len); |
|||
#endif |
|||
|
|||
MD5Final(output, &context); |
|||
} |
|||
@ -0,0 +1,34 @@ |
|||
/* |
|||
* This file was transplanted with slight modifications from Linux sources |
|||
* (fs/cifs/md5.h) into U-Boot by Bartlomiej Sieka <tur@semihalf.com>. |
|||
*/ |
|||
|
|||
#ifndef _MD5_H |
|||
#define _MD5_H |
|||
|
|||
#include "../base/basicTypes.h" |
|||
|
|||
struct MD5Context { |
|||
uint32_t buf[4]; |
|||
uint32_t bits[2]; |
|||
union { |
|||
uint8_t in[64]; |
|||
uint32_t in32[16]; |
|||
}; |
|||
}; |
|||
|
|||
/* |
|||
* Calculate and store in 'output' the MD5 digest of 'len' bytes at |
|||
* 'input'. 'output' must have enough space to hold 16 bytes. |
|||
*/ |
|||
void md5 (unsigned char *input, int len, unsigned char output[16]); |
|||
|
|||
/* |
|||
* Calculate and store in 'output' the MD5 digest of 'len' bytes at 'input'. |
|||
* 'output' must have enough space to hold 16 bytes. If 'chunk' Trigger the |
|||
* watchdog every 'chunk_sz' bytes of input processed. |
|||
*/ |
|||
void md5_wd (unsigned char *input, int len, unsigned char output[16], |
|||
unsigned int chunk_sz); |
|||
|
|||
#endif /* _MD5_H */ |
|||
@ -0,0 +1,455 @@ |
|||
/* |
|||
* Heiko Schocher, DENX Software Engineering, hs@denx.de. |
|||
* based on: |
|||
* FIPS-180-1 compliant SHA-1 implementation |
|||
* |
|||
* Copyright (C) 2003-2006 Christophe Devine |
|||
* |
|||
* This library is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU Lesser General Public |
|||
* License, version 2.1 as published by the Free Software Foundation. |
|||
* |
|||
* 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., 51 Franklin Street, Fifth Floor, Boston, |
|||
* MA 02110-1301 USA |
|||
*/ |
|||
/* |
|||
* The SHA-1 standard was published by NIST in 1993. |
|||
* |
|||
* http://www.itl.nist.gov/fipspubs/fip180-1.htm |
|||
*/ |
|||
|
|||
#ifndef _CRT_SECURE_NO_DEPRECATE |
|||
#define _CRT_SECURE_NO_DEPRECATE 1 |
|||
#endif |
|||
|
|||
//#ifndef USE_HOSTCC |
|||
//#include <common.h> |
|||
//#include <linux/string.h> |
|||
//#else |
|||
//#include <string.h> |
|||
//#endif /* USE_HOSTCC */ |
|||
//#include <watchdog.h> |
|||
#include "sha1.h" |
|||
|
|||
/* |
|||
* 32-bit integer manipulation macros (big endian) |
|||
*/ |
|||
#ifndef GET_UINT32_BE |
|||
#define GET_UINT32_BE(n,b,i) { \ |
|||
(n) = ( (unsigned long) (b)[(i) ] << 24 ) \ |
|||
| ( (unsigned long) (b)[(i) + 1] << 16 ) \ |
|||
| ( (unsigned long) (b)[(i) + 2] << 8 ) \ |
|||
| ( (unsigned long) (b)[(i) + 3] ); \ |
|||
} |
|||
#endif |
|||
#ifndef PUT_UINT32_BE |
|||
#define PUT_UINT32_BE(n,b,i) { \ |
|||
(b)[(i) ] = (unsigned char) ( (n) >> 24 ); \ |
|||
(b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \ |
|||
(b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \ |
|||
(b)[(i) + 3] = (unsigned char) ( (n) ); \ |
|||
} |
|||
#endif |
|||
|
|||
/* |
|||
* SHA-1 context setup |
|||
*/ |
|||
void sha1_starts (sha1_context * ctx) |
|||
{ |
|||
ctx->total[0] = 0; |
|||
ctx->total[1] = 0; |
|||
|
|||
ctx->state[0] = 0x67452301; |
|||
ctx->state[1] = 0xEFCDAB89; |
|||
ctx->state[2] = 0x98BADCFE; |
|||
ctx->state[3] = 0x10325476; |
|||
ctx->state[4] = 0xC3D2E1F0; |
|||
} |
|||
|
|||
static void sha1_process(sha1_context *ctx, const unsigned char data[64]) |
|||
{ |
|||
unsigned long temp, W[16], A, B, C, D, E; |
|||
|
|||
GET_UINT32_BE (W[0], data, 0); |
|||
GET_UINT32_BE (W[1], data, 4); |
|||
GET_UINT32_BE (W[2], data, 8); |
|||
GET_UINT32_BE (W[3], data, 12); |
|||
GET_UINT32_BE (W[4], data, 16); |
|||
GET_UINT32_BE (W[5], data, 20); |
|||
GET_UINT32_BE (W[6], data, 24); |
|||
GET_UINT32_BE (W[7], data, 28); |
|||
GET_UINT32_BE (W[8], data, 32); |
|||
GET_UINT32_BE (W[9], data, 36); |
|||
GET_UINT32_BE (W[10], data, 40); |
|||
GET_UINT32_BE (W[11], data, 44); |
|||
GET_UINT32_BE (W[12], data, 48); |
|||
GET_UINT32_BE (W[13], data, 52); |
|||
GET_UINT32_BE (W[14], data, 56); |
|||
GET_UINT32_BE (W[15], data, 60); |
|||
|
|||
#define S(x,n) ((x << n) | ((x & 0xFFFFFFFF) >> (32 - n))) |
|||
|
|||
#define R(t) ( \ |
|||
temp = W[(t - 3) & 0x0F] ^ W[(t - 8) & 0x0F] ^ \ |
|||
W[(t - 14) & 0x0F] ^ W[ t & 0x0F], \ |
|||
( W[t & 0x0F] = S(temp,1) ) \ |
|||
) |
|||
|
|||
#define P(a,b,c,d,e,x) { \ |
|||
e += S(a,5) + F(b,c,d) + K + x; b = S(b,30); \ |
|||
} |
|||
|
|||
A = ctx->state[0]; |
|||
B = ctx->state[1]; |
|||
C = ctx->state[2]; |
|||
D = ctx->state[3]; |
|||
E = ctx->state[4]; |
|||
|
|||
#define F(x,y,z) (z ^ (x & (y ^ z))) |
|||
#define K 0x5A827999 |
|||
|
|||
P (A, B, C, D, E, W[0]); |
|||
P (E, A, B, C, D, W[1]); |
|||
P (D, E, A, B, C, W[2]); |
|||
P (C, D, E, A, B, W[3]); |
|||
P (B, C, D, E, A, W[4]); |
|||
P (A, B, C, D, E, W[5]); |
|||
P (E, A, B, C, D, W[6]); |
|||
P (D, E, A, B, C, W[7]); |
|||
P (C, D, E, A, B, W[8]); |
|||
P (B, C, D, E, A, W[9]); |
|||
P (A, B, C, D, E, W[10]); |
|||
P (E, A, B, C, D, W[11]); |
|||
P (D, E, A, B, C, W[12]); |
|||
P (C, D, E, A, B, W[13]); |
|||
P (B, C, D, E, A, W[14]); |
|||
P (A, B, C, D, E, W[15]); |
|||
P (E, A, B, C, D, R (16)); |
|||
P (D, E, A, B, C, R (17)); |
|||
P (C, D, E, A, B, R (18)); |
|||
P (B, C, D, E, A, R (19)); |
|||
|
|||
#undef K |
|||
#undef F |
|||
|
|||
#define F(x,y,z) (x ^ y ^ z) |
|||
#define K 0x6ED9EBA1 |
|||
|
|||
P (A, B, C, D, E, R (20)); |
|||
P (E, A, B, C, D, R (21)); |
|||
P (D, E, A, B, C, R (22)); |
|||
P (C, D, E, A, B, R (23)); |
|||
P (B, C, D, E, A, R (24)); |
|||
P (A, B, C, D, E, R (25)); |
|||
P (E, A, B, C, D, R (26)); |
|||
P (D, E, A, B, C, R (27)); |
|||
P (C, D, E, A, B, R (28)); |
|||
P (B, C, D, E, A, R (29)); |
|||
P (A, B, C, D, E, R (30)); |
|||
P (E, A, B, C, D, R (31)); |
|||
P (D, E, A, B, C, R (32)); |
|||
P (C, D, E, A, B, R (33)); |
|||
P (B, C, D, E, A, R (34)); |
|||
P (A, B, C, D, E, R (35)); |
|||
P (E, A, B, C, D, R (36)); |
|||
P (D, E, A, B, C, R (37)); |
|||
P (C, D, E, A, B, R (38)); |
|||
P (B, C, D, E, A, R (39)); |
|||
|
|||
#undef K |
|||
#undef F |
|||
|
|||
#define F(x,y,z) ((x & y) | (z & (x | y))) |
|||
#define K 0x8F1BBCDC |
|||
|
|||
P (A, B, C, D, E, R (40)); |
|||
P (E, A, B, C, D, R (41)); |
|||
P (D, E, A, B, C, R (42)); |
|||
P (C, D, E, A, B, R (43)); |
|||
P (B, C, D, E, A, R (44)); |
|||
P (A, B, C, D, E, R (45)); |
|||
P (E, A, B, C, D, R (46)); |
|||
P (D, E, A, B, C, R (47)); |
|||
P (C, D, E, A, B, R (48)); |
|||
P (B, C, D, E, A, R (49)); |
|||
P (A, B, C, D, E, R (50)); |
|||
P (E, A, B, C, D, R (51)); |
|||
P (D, E, A, B, C, R (52)); |
|||
P (C, D, E, A, B, R (53)); |
|||
P (B, C, D, E, A, R (54)); |
|||
P (A, B, C, D, E, R (55)); |
|||
P (E, A, B, C, D, R (56)); |
|||
P (D, E, A, B, C, R (57)); |
|||
P (C, D, E, A, B, R (58)); |
|||
P (B, C, D, E, A, R (59)); |
|||
|
|||
#undef K |
|||
#undef F |
|||
|
|||
#define F(x,y,z) (x ^ y ^ z) |
|||
#define K 0xCA62C1D6 |
|||
|
|||
P (A, B, C, D, E, R (60)); |
|||
P (E, A, B, C, D, R (61)); |
|||
P (D, E, A, B, C, R (62)); |
|||
P (C, D, E, A, B, R (63)); |
|||
P (B, C, D, E, A, R (64)); |
|||
P (A, B, C, D, E, R (65)); |
|||
P (E, A, B, C, D, R (66)); |
|||
P (D, E, A, B, C, R (67)); |
|||
P (C, D, E, A, B, R (68)); |
|||
P (B, C, D, E, A, R (69)); |
|||
P (A, B, C, D, E, R (70)); |
|||
P (E, A, B, C, D, R (71)); |
|||
P (D, E, A, B, C, R (72)); |
|||
P (C, D, E, A, B, R (73)); |
|||
P (B, C, D, E, A, R (74)); |
|||
P (A, B, C, D, E, R (75)); |
|||
P (E, A, B, C, D, R (76)); |
|||
P (D, E, A, B, C, R (77)); |
|||
P (C, D, E, A, B, R (78)); |
|||
P (B, C, D, E, A, R (79)); |
|||
|
|||
#undef K |
|||
#undef F |
|||
|
|||
ctx->state[0] += A; |
|||
ctx->state[1] += B; |
|||
ctx->state[2] += C; |
|||
ctx->state[3] += D; |
|||
ctx->state[4] += E; |
|||
} |
|||
|
|||
/* |
|||
* SHA-1 process buffer |
|||
*/ |
|||
void sha1_update(sha1_context *ctx, const unsigned char *input, |
|||
unsigned int ilen) |
|||
{ |
|||
int fill; |
|||
unsigned long left; |
|||
|
|||
if (ilen <= 0) |
|||
return; |
|||
|
|||
left = ctx->total[0] & 0x3F; |
|||
fill = 64 - left; |
|||
|
|||
ctx->total[0] += ilen; |
|||
ctx->total[0] &= 0xFFFFFFFF; |
|||
|
|||
if (ctx->total[0] < (unsigned long) ilen) |
|||
ctx->total[1]++; |
|||
|
|||
if (left && ilen >= fill) { |
|||
memcpy ((void *) (ctx->buffer + left), (void *) input, fill); |
|||
sha1_process (ctx, ctx->buffer); |
|||
input += fill; |
|||
ilen -= fill; |
|||
left = 0; |
|||
} |
|||
|
|||
while (ilen >= 64) { |
|||
sha1_process (ctx, input); |
|||
input += 64; |
|||
ilen -= 64; |
|||
} |
|||
|
|||
if (ilen > 0) { |
|||
memcpy ((void *) (ctx->buffer + left), (void *) input, ilen); |
|||
} |
|||
} |
|||
|
|||
static const unsigned char sha1_padding[64] = { |
|||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
|||
}; |
|||
|
|||
/* |
|||
* SHA-1 final digest |
|||
*/ |
|||
void sha1_finish (sha1_context * ctx, unsigned char output[20]) |
|||
{ |
|||
unsigned long last, padn; |
|||
unsigned long high, low; |
|||
unsigned char msglen[8]; |
|||
|
|||
high = (ctx->total[0] >> 29) |
|||
| (ctx->total[1] << 3); |
|||
low = (ctx->total[0] << 3); |
|||
|
|||
PUT_UINT32_BE (high, msglen, 0); |
|||
PUT_UINT32_BE (low, msglen, 4); |
|||
|
|||
last = ctx->total[0] & 0x3F; |
|||
padn = (last < 56) ? (56 - last) : (120 - last); |
|||
|
|||
sha1_update (ctx, (unsigned char *) sha1_padding, padn); |
|||
sha1_update (ctx, msglen, 8); |
|||
|
|||
PUT_UINT32_BE (ctx->state[0], output, 0); |
|||
PUT_UINT32_BE (ctx->state[1], output, 4); |
|||
PUT_UINT32_BE (ctx->state[2], output, 8); |
|||
PUT_UINT32_BE (ctx->state[3], output, 12); |
|||
PUT_UINT32_BE (ctx->state[4], output, 16); |
|||
} |
|||
|
|||
/* |
|||
* Output = SHA-1( input buffer ) |
|||
*/ |
|||
void sha1_csum(const unsigned char *input, unsigned int ilen, |
|||
unsigned char *output) |
|||
{ |
|||
sha1_context ctx; |
|||
|
|||
sha1_starts (&ctx); |
|||
sha1_update (&ctx, input, ilen); |
|||
sha1_finish (&ctx, output); |
|||
} |
|||
|
|||
/* |
|||
* Output = SHA-1( input buffer ). Trigger the watchdog every 'chunk_sz' |
|||
* bytes of input processed. |
|||
*/ |
|||
void sha1_csum_wd(const unsigned char *input, unsigned int ilen, |
|||
unsigned char *output, unsigned int chunk_sz) |
|||
{ |
|||
sha1_context ctx; |
|||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) |
|||
const unsigned char *end, *curr; |
|||
int chunk; |
|||
#endif |
|||
|
|||
sha1_starts (&ctx); |
|||
|
|||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) |
|||
curr = input; |
|||
end = input + ilen; |
|||
while (curr < end) { |
|||
chunk = end - curr; |
|||
if (chunk > chunk_sz) |
|||
chunk = chunk_sz; |
|||
sha1_update (&ctx, curr, chunk); |
|||
curr += chunk; |
|||
WATCHDOG_RESET (); |
|||
} |
|||
#else |
|||
sha1_update (&ctx, input, ilen); |
|||
#endif |
|||
|
|||
sha1_finish (&ctx, output); |
|||
} |
|||
|
|||
/* |
|||
* Output = HMAC-SHA-1( input buffer, hmac key ) |
|||
*/ |
|||
void sha1_hmac(const unsigned char *key, int keylen, |
|||
const unsigned char *input, unsigned int ilen, |
|||
unsigned char *output) |
|||
{ |
|||
int i; |
|||
sha1_context ctx; |
|||
unsigned char k_ipad[64]; |
|||
unsigned char k_opad[64]; |
|||
unsigned char tmpbuf[20]; |
|||
|
|||
memset (k_ipad, 0x36, 64); |
|||
memset (k_opad, 0x5C, 64); |
|||
|
|||
for (i = 0; i < keylen; i++) { |
|||
if (i >= 64) |
|||
break; |
|||
|
|||
k_ipad[i] ^= key[i]; |
|||
k_opad[i] ^= key[i]; |
|||
} |
|||
|
|||
sha1_starts (&ctx); |
|||
sha1_update (&ctx, k_ipad, 64); |
|||
sha1_update (&ctx, input, ilen); |
|||
sha1_finish (&ctx, tmpbuf); |
|||
|
|||
sha1_starts (&ctx); |
|||
sha1_update (&ctx, k_opad, 64); |
|||
sha1_update (&ctx, tmpbuf, 20); |
|||
sha1_finish (&ctx, output); |
|||
|
|||
memset (k_ipad, 0, 64); |
|||
memset (k_opad, 0, 64); |
|||
memset (tmpbuf, 0, 20); |
|||
memset (&ctx, 0, sizeof (sha1_context)); |
|||
} |
|||
|
|||
static const char _sha1_src[] = "_sha1_src"; |
|||
|
|||
#ifdef SELF_TEST |
|||
/* |
|||
* FIPS-180-1 test vectors |
|||
*/ |
|||
static const char sha1_test_str[3][57] = { |
|||
{"abc"}, |
|||
{"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"}, |
|||
{""} |
|||
}; |
|||
|
|||
static const unsigned char sha1_test_sum[3][20] = { |
|||
{0xA9, 0x99, 0x3E, 0x36, 0x47, 0x06, 0x81, 0x6A, 0xBA, 0x3E, |
|||
0x25, 0x71, 0x78, 0x50, 0xC2, 0x6C, 0x9C, 0xD0, 0xD8, 0x9D}, |
|||
{0x84, 0x98, 0x3E, 0x44, 0x1C, 0x3B, 0xD2, 0x6E, 0xBA, 0xAE, |
|||
0x4A, 0xA1, 0xF9, 0x51, 0x29, 0xE5, 0xE5, 0x46, 0x70, 0xF1}, |
|||
{0x34, 0xAA, 0x97, 0x3C, 0xD4, 0xC4, 0xDA, 0xA4, 0xF6, 0x1E, |
|||
0xEB, 0x2B, 0xDB, 0xAD, 0x27, 0x31, 0x65, 0x34, 0x01, 0x6F} |
|||
}; |
|||
|
|||
/* |
|||
* Checkup routine |
|||
*/ |
|||
int sha1_self_test (void) |
|||
{ |
|||
int i, j; |
|||
unsigned char buf[1000]; |
|||
unsigned char sha1sum[20]; |
|||
sha1_context ctx; |
|||
|
|||
for (i = 0; i < 3; i++) { |
|||
printf (" SHA-1 test #%d: ", i + 1); |
|||
|
|||
sha1_starts (&ctx); |
|||
|
|||
if (i < 2) |
|||
sha1_update (&ctx, (unsigned char *) sha1_test_str[i], |
|||
strlen (sha1_test_str[i])); |
|||
else { |
|||
memset (buf, 'a', 1000); |
|||
for (j = 0; j < 1000; j++) |
|||
sha1_update (&ctx, buf, 1000); |
|||
} |
|||
|
|||
sha1_finish (&ctx, sha1sum); |
|||
|
|||
if (memcmp (sha1sum, sha1_test_sum[i], 20) != 0) { |
|||
printf ("failed\n"); |
|||
return (1); |
|||
} |
|||
|
|||
printf ("passed\n"); |
|||
} |
|||
|
|||
printf ("\n"); |
|||
return (0); |
|||
} |
|||
#else |
|||
int sha1_self_test (void) |
|||
{ |
|||
return (0); |
|||
} |
|||
#endif |
|||
@ -0,0 +1,118 @@ |
|||
/** |
|||
* \file sha1.h |
|||
* based from http://xyssl.org/code/source/sha1/ |
|||
* FIPS-180-1 compliant SHA-1 implementation |
|||
* |
|||
* Copyright (C) 2003-2006 Christophe Devine |
|||
* |
|||
* This library is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU Lesser General Public |
|||
* License, version 2.1 as published by the Free Software Foundation. |
|||
* |
|||
* 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., 51 Franklin Street, Fifth Floor, Boston, |
|||
* MA 02110-1301 USA |
|||
*/ |
|||
/* |
|||
* The SHA-1 standard was published by NIST in 1993. |
|||
* |
|||
* http://www.itl.nist.gov/fipspubs/fip180-1.htm |
|||
*/ |
|||
#ifndef _SHA1_H |
|||
#define _SHA1_H |
|||
|
|||
#ifdef __cplusplus |
|||
extern "C" { |
|||
#endif |
|||
|
|||
#define SHA1_SUM_POS -0x20 |
|||
#define SHA1_SUM_LEN 20 |
|||
|
|||
/** |
|||
* \brief SHA-1 context structure |
|||
*/ |
|||
typedef struct |
|||
{ |
|||
unsigned long total[2]; /*!< number of bytes processed */ |
|||
unsigned long state[5]; /*!< intermediate digest state */ |
|||
unsigned char buffer[64]; /*!< data block being processed */ |
|||
} |
|||
sha1_context; |
|||
|
|||
/** |
|||
* \brief SHA-1 context setup |
|||
* |
|||
* \param ctx SHA-1 context to be initialized |
|||
*/ |
|||
void sha1_starts( sha1_context *ctx ); |
|||
|
|||
/** |
|||
* \brief SHA-1 process buffer |
|||
* |
|||
* \param ctx SHA-1 context |
|||
* \param input buffer holding the data |
|||
* \param ilen length of the input data |
|||
*/ |
|||
void sha1_update(sha1_context *ctx, const unsigned char *input, |
|||
unsigned int ilen); |
|||
|
|||
/** |
|||
* \brief SHA-1 final digest |
|||
* |
|||
* \param ctx SHA-1 context |
|||
* \param output SHA-1 checksum result |
|||
*/ |
|||
void sha1_finish( sha1_context *ctx, unsigned char output[20] ); |
|||
|
|||
/** |
|||
* \brief Output = SHA-1( input buffer ) |
|||
* |
|||
* \param input buffer holding the data |
|||
* \param ilen length of the input data |
|||
* \param output SHA-1 checksum result |
|||
*/ |
|||
void sha1_csum(const unsigned char *input, unsigned int ilen, |
|||
unsigned char *output); |
|||
|
|||
/** |
|||
* \brief Output = SHA-1( input buffer ), with watchdog triggering |
|||
* |
|||
* \param input buffer holding the data |
|||
* \param ilen length of the input data |
|||
* \param output SHA-1 checksum result |
|||
* \param chunk_sz watchdog triggering period (in bytes of input processed) |
|||
*/ |
|||
void sha1_csum_wd(const unsigned char *input, unsigned int ilen, |
|||
unsigned char *output, unsigned int chunk_sz); |
|||
|
|||
/** |
|||
* \brief Output = HMAC-SHA-1( input buffer, hmac key ) |
|||
* |
|||
* \param key HMAC secret key |
|||
* \param keylen length of the HMAC key |
|||
* \param input buffer holding the data |
|||
* \param ilen length of the input data |
|||
* \param output HMAC-SHA-1 result |
|||
*/ |
|||
void sha1_hmac(const unsigned char *key, int keylen, |
|||
const unsigned char *input, unsigned int ilen, |
|||
unsigned char *output); |
|||
|
|||
/** |
|||
* \brief Checkup routine |
|||
* |
|||
* \return 0 if successful, or 1 if the test failed |
|||
*/ |
|||
int sha1_self_test( void ); |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
|
|||
#endif /* sha1.h */ |
|||
@ -0,0 +1,283 @@ |
|||
/* |
|||
* FIPS-180-2 compliant SHA-256 implementation |
|||
* |
|||
* Copyright (C) 2001-2003 Christophe Devine |
|||
* |
|||
* SPDX-License-Identifier: GPL-2.0+ |
|||
*/ |
|||
|
|||
//#ifndef USE_HOSTCC |
|||
//#include <common.h> |
|||
//#endif /* USE_HOSTCC */ |
|||
//#include <watchdog.h> |
|||
//#include <linux/string.h> |
|||
#include "sha256.h" |
|||
|
|||
/* |
|||
* 32-bit integer manipulation macros (big endian) |
|||
*/ |
|||
#ifndef GET_UINT32_BE |
|||
#define GET_UINT32_BE(n,b,i) { \ |
|||
(n) = ( (unsigned long) (b)[(i) ] << 24 ) \ |
|||
| ( (unsigned long) (b)[(i) + 1] << 16 ) \ |
|||
| ( (unsigned long) (b)[(i) + 2] << 8 ) \ |
|||
| ( (unsigned long) (b)[(i) + 3] ); \ |
|||
} |
|||
#endif |
|||
#ifndef PUT_UINT32_BE |
|||
#define PUT_UINT32_BE(n,b,i) { \ |
|||
(b)[(i) ] = (unsigned char) ( (n) >> 24 ); \ |
|||
(b)[(i) + 1] = (unsigned char) ( (n) >> 16 ); \ |
|||
(b)[(i) + 2] = (unsigned char) ( (n) >> 8 ); \ |
|||
(b)[(i) + 3] = (unsigned char) ( (n) ); \ |
|||
} |
|||
#endif |
|||
|
|||
void sha256_starts(sha256_context * ctx) |
|||
{ |
|||
ctx->total[0] = 0; |
|||
ctx->total[1] = 0; |
|||
|
|||
ctx->state[0] = 0x6A09E667; |
|||
ctx->state[1] = 0xBB67AE85; |
|||
ctx->state[2] = 0x3C6EF372; |
|||
ctx->state[3] = 0xA54FF53A; |
|||
ctx->state[4] = 0x510E527F; |
|||
ctx->state[5] = 0x9B05688C; |
|||
ctx->state[6] = 0x1F83D9AB; |
|||
ctx->state[7] = 0x5BE0CD19; |
|||
} |
|||
|
|||
static void sha256_process(sha256_context *ctx, const uint8_t data[64]) |
|||
{ |
|||
uint32_t temp1, temp2; |
|||
uint32_t W[64]; |
|||
uint32_t A, B, C, D, E, F, G, H; |
|||
|
|||
GET_UINT32_BE(W[0], data, 0); |
|||
GET_UINT32_BE(W[1], data, 4); |
|||
GET_UINT32_BE(W[2], data, 8); |
|||
GET_UINT32_BE(W[3], data, 12); |
|||
GET_UINT32_BE(W[4], data, 16); |
|||
GET_UINT32_BE(W[5], data, 20); |
|||
GET_UINT32_BE(W[6], data, 24); |
|||
GET_UINT32_BE(W[7], data, 28); |
|||
GET_UINT32_BE(W[8], data, 32); |
|||
GET_UINT32_BE(W[9], data, 36); |
|||
GET_UINT32_BE(W[10], data, 40); |
|||
GET_UINT32_BE(W[11], data, 44); |
|||
GET_UINT32_BE(W[12], data, 48); |
|||
GET_UINT32_BE(W[13], data, 52); |
|||
GET_UINT32_BE(W[14], data, 56); |
|||
GET_UINT32_BE(W[15], data, 60); |
|||
|
|||
#define SHR(x,n) ((x & 0xFFFFFFFF) >> n) |
|||
#define ROTR(x,n) (SHR(x,n) | (x << (32 - n))) |
|||
|
|||
#define S0(x) (ROTR(x, 7) ^ ROTR(x,18) ^ SHR(x, 3)) |
|||
#define S1(x) (ROTR(x,17) ^ ROTR(x,19) ^ SHR(x,10)) |
|||
|
|||
#define S2(x) (ROTR(x, 2) ^ ROTR(x,13) ^ ROTR(x,22)) |
|||
#define S3(x) (ROTR(x, 6) ^ ROTR(x,11) ^ ROTR(x,25)) |
|||
|
|||
#define F0(x,y,z) ((x & y) | (z & (x | y))) |
|||
#define F1(x,y,z) (z ^ (x & (y ^ z))) |
|||
|
|||
#define R(t) \ |
|||
( \ |
|||
W[t] = S1(W[t - 2]) + W[t - 7] + \ |
|||
S0(W[t - 15]) + W[t - 16] \ |
|||
) |
|||
|
|||
#define P(a,b,c,d,e,f,g,h,x,K) { \ |
|||
temp1 = h + S3(e) + F1(e,f,g) + K + x; \ |
|||
temp2 = S2(a) + F0(a,b,c); \ |
|||
d += temp1; h = temp1 + temp2; \ |
|||
} |
|||
|
|||
A = ctx->state[0]; |
|||
B = ctx->state[1]; |
|||
C = ctx->state[2]; |
|||
D = ctx->state[3]; |
|||
E = ctx->state[4]; |
|||
F = ctx->state[5]; |
|||
G = ctx->state[6]; |
|||
H = ctx->state[7]; |
|||
|
|||
P(A, B, C, D, E, F, G, H, W[0], 0x428A2F98); |
|||
P(H, A, B, C, D, E, F, G, W[1], 0x71374491); |
|||
P(G, H, A, B, C, D, E, F, W[2], 0xB5C0FBCF); |
|||
P(F, G, H, A, B, C, D, E, W[3], 0xE9B5DBA5); |
|||
P(E, F, G, H, A, B, C, D, W[4], 0x3956C25B); |
|||
P(D, E, F, G, H, A, B, C, W[5], 0x59F111F1); |
|||
P(C, D, E, F, G, H, A, B, W[6], 0x923F82A4); |
|||
P(B, C, D, E, F, G, H, A, W[7], 0xAB1C5ED5); |
|||
P(A, B, C, D, E, F, G, H, W[8], 0xD807AA98); |
|||
P(H, A, B, C, D, E, F, G, W[9], 0x12835B01); |
|||
P(G, H, A, B, C, D, E, F, W[10], 0x243185BE); |
|||
P(F, G, H, A, B, C, D, E, W[11], 0x550C7DC3); |
|||
P(E, F, G, H, A, B, C, D, W[12], 0x72BE5D74); |
|||
P(D, E, F, G, H, A, B, C, W[13], 0x80DEB1FE); |
|||
P(C, D, E, F, G, H, A, B, W[14], 0x9BDC06A7); |
|||
P(B, C, D, E, F, G, H, A, W[15], 0xC19BF174); |
|||
P(A, B, C, D, E, F, G, H, R(16), 0xE49B69C1); |
|||
P(H, A, B, C, D, E, F, G, R(17), 0xEFBE4786); |
|||
P(G, H, A, B, C, D, E, F, R(18), 0x0FC19DC6); |
|||
P(F, G, H, A, B, C, D, E, R(19), 0x240CA1CC); |
|||
P(E, F, G, H, A, B, C, D, R(20), 0x2DE92C6F); |
|||
P(D, E, F, G, H, A, B, C, R(21), 0x4A7484AA); |
|||
P(C, D, E, F, G, H, A, B, R(22), 0x5CB0A9DC); |
|||
P(B, C, D, E, F, G, H, A, R(23), 0x76F988DA); |
|||
P(A, B, C, D, E, F, G, H, R(24), 0x983E5152); |
|||
P(H, A, B, C, D, E, F, G, R(25), 0xA831C66D); |
|||
P(G, H, A, B, C, D, E, F, R(26), 0xB00327C8); |
|||
P(F, G, H, A, B, C, D, E, R(27), 0xBF597FC7); |
|||
P(E, F, G, H, A, B, C, D, R(28), 0xC6E00BF3); |
|||
P(D, E, F, G, H, A, B, C, R(29), 0xD5A79147); |
|||
P(C, D, E, F, G, H, A, B, R(30), 0x06CA6351); |
|||
P(B, C, D, E, F, G, H, A, R(31), 0x14292967); |
|||
P(A, B, C, D, E, F, G, H, R(32), 0x27B70A85); |
|||
P(H, A, B, C, D, E, F, G, R(33), 0x2E1B2138); |
|||
P(G, H, A, B, C, D, E, F, R(34), 0x4D2C6DFC); |
|||
P(F, G, H, A, B, C, D, E, R(35), 0x53380D13); |
|||
P(E, F, G, H, A, B, C, D, R(36), 0x650A7354); |
|||
P(D, E, F, G, H, A, B, C, R(37), 0x766A0ABB); |
|||
P(C, D, E, F, G, H, A, B, R(38), 0x81C2C92E); |
|||
P(B, C, D, E, F, G, H, A, R(39), 0x92722C85); |
|||
P(A, B, C, D, E, F, G, H, R(40), 0xA2BFE8A1); |
|||
P(H, A, B, C, D, E, F, G, R(41), 0xA81A664B); |
|||
P(G, H, A, B, C, D, E, F, R(42), 0xC24B8B70); |
|||
P(F, G, H, A, B, C, D, E, R(43), 0xC76C51A3); |
|||
P(E, F, G, H, A, B, C, D, R(44), 0xD192E819); |
|||
P(D, E, F, G, H, A, B, C, R(45), 0xD6990624); |
|||
P(C, D, E, F, G, H, A, B, R(46), 0xF40E3585); |
|||
P(B, C, D, E, F, G, H, A, R(47), 0x106AA070); |
|||
P(A, B, C, D, E, F, G, H, R(48), 0x19A4C116); |
|||
P(H, A, B, C, D, E, F, G, R(49), 0x1E376C08); |
|||
P(G, H, A, B, C, D, E, F, R(50), 0x2748774C); |
|||
P(F, G, H, A, B, C, D, E, R(51), 0x34B0BCB5); |
|||
P(E, F, G, H, A, B, C, D, R(52), 0x391C0CB3); |
|||
P(D, E, F, G, H, A, B, C, R(53), 0x4ED8AA4A); |
|||
P(C, D, E, F, G, H, A, B, R(54), 0x5B9CCA4F); |
|||
P(B, C, D, E, F, G, H, A, R(55), 0x682E6FF3); |
|||
P(A, B, C, D, E, F, G, H, R(56), 0x748F82EE); |
|||
P(H, A, B, C, D, E, F, G, R(57), 0x78A5636F); |
|||
P(G, H, A, B, C, D, E, F, R(58), 0x84C87814); |
|||
P(F, G, H, A, B, C, D, E, R(59), 0x8CC70208); |
|||
P(E, F, G, H, A, B, C, D, R(60), 0x90BEFFFA); |
|||
P(D, E, F, G, H, A, B, C, R(61), 0xA4506CEB); |
|||
P(C, D, E, F, G, H, A, B, R(62), 0xBEF9A3F7); |
|||
P(B, C, D, E, F, G, H, A, R(63), 0xC67178F2); |
|||
|
|||
ctx->state[0] += A; |
|||
ctx->state[1] += B; |
|||
ctx->state[2] += C; |
|||
ctx->state[3] += D; |
|||
ctx->state[4] += E; |
|||
ctx->state[5] += F; |
|||
ctx->state[6] += G; |
|||
ctx->state[7] += H; |
|||
} |
|||
|
|||
void sha256_update(sha256_context *ctx, const uint8_t *input, uint32_t length) |
|||
{ |
|||
uint32_t left, fill; |
|||
|
|||
if (!length) |
|||
return; |
|||
|
|||
left = ctx->total[0] & 0x3F; |
|||
fill = 64 - left; |
|||
|
|||
ctx->total[0] += length; |
|||
ctx->total[0] &= 0xFFFFFFFF; |
|||
|
|||
if (ctx->total[0] < length) |
|||
ctx->total[1]++; |
|||
|
|||
if (left && length >= fill) { |
|||
memcpy((void *) (ctx->buffer + left), (void *) input, fill); |
|||
sha256_process(ctx, ctx->buffer); |
|||
length -= fill; |
|||
input += fill; |
|||
left = 0; |
|||
} |
|||
|
|||
while (length >= 64) { |
|||
sha256_process(ctx, input); |
|||
length -= 64; |
|||
input += 64; |
|||
} |
|||
|
|||
if (length) |
|||
memcpy((void *) (ctx->buffer + left), (void *) input, length); |
|||
} |
|||
|
|||
static uint8_t sha256_padding[64] = { |
|||
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
|||
}; |
|||
|
|||
void sha256_finish(sha256_context * ctx, uint8_t digest[32]) |
|||
{ |
|||
uint32_t last, padn; |
|||
uint32_t high, low; |
|||
uint8_t msglen[8]; |
|||
|
|||
high = ((ctx->total[0] >> 29) |
|||
| (ctx->total[1] << 3)); |
|||
low = (ctx->total[0] << 3); |
|||
|
|||
PUT_UINT32_BE(high, msglen, 0); |
|||
PUT_UINT32_BE(low, msglen, 4); |
|||
|
|||
last = ctx->total[0] & 0x3F; |
|||
padn = (last < 56) ? (56 - last) : (120 - last); |
|||
|
|||
sha256_update(ctx, sha256_padding, padn); |
|||
sha256_update(ctx, msglen, 8); |
|||
|
|||
PUT_UINT32_BE(ctx->state[0], digest, 0); |
|||
PUT_UINT32_BE(ctx->state[1], digest, 4); |
|||
PUT_UINT32_BE(ctx->state[2], digest, 8); |
|||
PUT_UINT32_BE(ctx->state[3], digest, 12); |
|||
PUT_UINT32_BE(ctx->state[4], digest, 16); |
|||
PUT_UINT32_BE(ctx->state[5], digest, 20); |
|||
PUT_UINT32_BE(ctx->state[6], digest, 24); |
|||
PUT_UINT32_BE(ctx->state[7], digest, 28); |
|||
} |
|||
|
|||
/* |
|||
* Output = SHA-256( input buffer ). Trigger the watchdog every 'chunk_sz' |
|||
* bytes of input processed. |
|||
*/ |
|||
void sha256_csum_wd(const unsigned char *input, unsigned int ilen, |
|||
unsigned char *output, unsigned int chunk_sz) |
|||
{ |
|||
sha256_context ctx; |
|||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) |
|||
unsigned char *end, *curr; |
|||
int chunk; |
|||
#endif |
|||
|
|||
sha256_starts(&ctx); |
|||
|
|||
#if defined(CONFIG_HW_WATCHDOG) || defined(CONFIG_WATCHDOG) |
|||
curr = input; |
|||
end = input + ilen; |
|||
while (curr < end) { |
|||
chunk = end - curr; |
|||
if (chunk > chunk_sz) |
|||
chunk = chunk_sz; |
|||
sha256_update(&ctx, curr, chunk); |
|||
curr += chunk; |
|||
WATCHDOG_RESET(); |
|||
} |
|||
#else |
|||
sha256_update(&ctx, input, ilen); |
|||
#endif |
|||
|
|||
sha256_finish(&ctx, output); |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
#ifndef _SHA256_H |
|||
#define _SHA256_H |
|||
|
|||
#include "../base/basicTypes.h" |
|||
|
|||
#define SHA256_SUM_LEN 32 |
|||
|
|||
/* Reset watchdog each time we process this many bytes */ |
|||
#define CHUNKSZ_SHA256 (64 * 1024) |
|||
|
|||
typedef struct { |
|||
uint32_t total[2]; |
|||
uint32_t state[8]; |
|||
uint8_t buffer[64]; |
|||
} sha256_context; |
|||
|
|||
void sha256_starts(sha256_context * ctx); |
|||
void sha256_update(sha256_context *ctx, const uint8_t *input, uint32_t length); |
|||
void sha256_finish(sha256_context * ctx, uint8_t digest[SHA256_SUM_LEN]); |
|||
|
|||
void sha256_csum_wd(const unsigned char *input, unsigned int ilen, |
|||
unsigned char *output, unsigned int chunk_sz); |
|||
|
|||
#endif /* _SHA256_H */ |
|||
@ -0,0 +1,29 @@ |
|||
/* |
|||
assert.h |
|||
*/ |
|||
|
|||
#ifdef __cplusplus |
|||
extern "C" { |
|||
#endif |
|||
|
|||
#include "_ansi.h" |
|||
|
|||
#undef assert |
|||
|
|||
#ifdef NDEBUG /* required by ANSI standard */ |
|||
#define assert(p) ((void)0) |
|||
#else |
|||
|
|||
#ifdef __STDC__ |
|||
#define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e)) |
|||
#else /* PCC */ |
|||
#define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, "e")) |
|||
#endif |
|||
|
|||
#endif /* NDEBUG */ |
|||
|
|||
void _EXFUN(__assert,(const char *, int, const char *)); |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
@ -0,0 +1,78 @@ |
|||
#ifndef __SPS2_SYSTEM_CONFIGURATION_HEADER__ |
|||
#define __SPS2_SYSTEM_CONFIGURATION_HEADER__ |
|||
// System Info: |
|||
/* |
|||
CPU: MIPS III R5900-based "Emotion Engine", clocked at 294.912 MHz (299 MHz on newer versions), with 128-bit SIMD capabilities |
|||
250-nm CMOS manufacturing (ending with 65-nm CMOS), 13.5 million transistors, 225 mm? die size, 15 W dissipation (combined EE+GS in SCPH-7500x and later SCPH-7000x): 86 mm?, 53.5 million transistors) |
|||
(combined EE+GS+RDRAM+DRAM in SCPH-7900x ended with 65 nm CMOS design) |
|||
|
|||
CPU core: MIPS R5900 (COP0), 64-bit, little endian (mipsel). |
|||
CPU is a superscalar, in-order execution 2-issue design with 6-stage long integer pipelines, |
|||
32 32-bit GPR registers, |
|||
32 128-bit SIMD linear scalar registers, |
|||
two 64-bit integer ALUs, |
|||
128-bit load-store unit (LSU) and a branch execution unit (BXU). |
|||
Instruction set: MIPS III, MIPS IV subset with Sony's proprietary 107 vector SIMD multimedia instructions (MMI). |
|||
The custom instruction set was implemented by grouping the two 64-bit integer ALUs. |
|||
32-bit FPU coprocessor (COP1) with 6-stage long pipeline (floating point multiply accumulator |
|||
1, floating point divider |
|||
1). FPU is not IEEE compliant. |
|||
Two 32-bit VLIW-SIMD vector units at 294.912 MHz: VPU0 and VPU1 (floating point multiply accumulator |
|||
9, floating point divider |
|||
1) each VPU contains a vector unit (VU), instruction cache, data cache and interface unit. |
|||
Each vector unit also has upper execution unit containing |
|||
4 FMAC and lower execution unit containing FDIV, integer ALU, load-store unit, branch logic, |
|||
16 16-bit integer registers and |
|||
32 128-bit floating point registers. |
|||
VPU1 has an additional EFU unit. |
|||
VPU0 (COP2; FMAC ? 4, FDIV ? 1) is tightly coupled with the main CPU and is typically used for polygon and geometry transformations (under parallel or serial connection), |
|||
physics and other gameplay related tasks |
|||
VPU1 (Elementary Functional Unit, EFU; FMAC ? 5, FDIV ? 2) operates independently controlled by microcode, parallel to the CPU core, |
|||
is typically used for polygon and geometry transformations, clipping, culling, lighting and other visual based calculations (texture matrix able for 2 coordinates (UV/ST)) |
|||
|
|||
Parallel: results of VU0/FPU sent as another display list via MFIFO (for e.g. complex characters/vehicles/etc.) |
|||
|
|||
Serial: results of VU0/FPU sent to VU1 (via 3 methods) and can act as an optional geometry pre-processor that does all base work to update the scene every frame |
|||
(for e.g. camera, perspective, boning and laws of movement such as animations or physics) |
|||
|
|||
Image Processing Unit (IPU): MPEG-2 compressed image macroblock layer decoder allowing playback of DVDs and game FMV. |
|||
It also allowed vector quantization for 2D graphics data. |
|||
Memory management unit (MMU),[12] RDRAM controller and DMA controller: handle memory access within the system |
|||
Cache memory: 16 KB instruction cache, 8 KB + 16 KB scratchpad (ScrP) data cache |
|||
Scratchpad (SPR) is extended area of memory visible to the EE CPU. |
|||
This extended memory provides 16 kilobytes of fast RAM available to be used by the application. |
|||
Scratchpad memory can be used to store temporary data that is waiting to be sent via DMA or for any other temporary storage that the programmer can define. |
|||
|
|||
I/O processor interconnection: remote procedure call over a serial link, DMA controller for bulk transfer |
|||
Main RDRAM memory bus. Bandwidth: 3.2 GB/s |
|||
Graphics interface (GIF), DMA channel that connects the EE CPU to the GS co-processor. To draw something to the screen, one must send render commands to the GS via the GIF channel: 64-bit, 150 MHz bus, maximum theoretical bandwidth of 1.2 GB/s.[6] |
|||
Display lists generated by CPU/VPU0 and VPU1 are sent to the GIF, which prioritizes them before dispatching them to the Graphics Synthesizer for rendering. |
|||
Vector Unit Interface (VIF), consists of two DMA channels VIF0 for VPU0 and VIF1 for VPU1. Vector units and the main CPU communicate via VIF DMA channels. |
|||
SIF – Serial Interface or Subsystem Interface which consists of 3 DMA channels: |
|||
Subsystem Interface 0 (SIF0) and Subsystem Interface 1 (SIF1), used for communication between the EE main CPU and IOP co-processor. These are serial DMA channels where both CPUs can send commands and establish communication through an RPC protocol. |
|||
Subsystem Interface 2 (SIF2), used for backwards compatibility with PS1 games and debugging. |
|||
*/ |
|||
|
|||
#include "basicTypes.h" |
|||
|
|||
#if !defined(_EE) && !defined(_IOP) |
|||
#error Either _EE or _IOP must be defined! |
|||
#endif |
|||
|
|||
#ifndef __BYTE_ORDER |
|||
#define __BYTE_ORDER __LITTLE_ENDIAN |
|||
#endif |
|||
|
|||
typedef struct s_ps2_sysconf { |
|||
uint16_t timezone; |
|||
uint8_t aspect; |
|||
uint8_t datenotation; |
|||
uint8_t language; |
|||
uint8_t spdif; |
|||
uint8_t summertime; |
|||
uint8_t timenotation; |
|||
uint8_t video; |
|||
}ps2_sysconf_t; |
|||
|
|||
|
|||
#endif |
|||
@ -0,0 +1,364 @@ |
|||
#ifndef __SPS2_BASIC_TYPES_HEADER__ |
|||
#define __SPS2_BASIC_TYPES_HEADER__ |
|||
|
|||
#include "errno.h" |
|||
#include "assert.h" |
|||
|
|||
#if !defined(_EE) && !defined(_IOP) |
|||
#error Either _EE or _IOP must be defined! |
|||
#endif |
|||
|
|||
typedef unsigned char uint8_t; |
|||
typedef unsigned short uint16_t; |
|||
|
|||
typedef uint8_t * puint8_t; |
|||
typedef uint8_t * puint16_t; |
|||
|
|||
typedef volatile uint8_t vuint8_t; |
|||
typedef volatile uint16_t vuint16_t; |
|||
|
|||
typedef vuint8_t * pvuint8_t; |
|||
typedef vuint16_t * pvuint16_t; |
|||
|
|||
#ifdef _EE |
|||
#ifndef __BYTE_ORDER |
|||
#define __BYTE_ORDER __LITTLE_ENDIAN |
|||
#endif |
|||
typedef unsigned int uint32_t; |
|||
|
|||
#if __GNUC__ > 3 |
|||
typedef unsigned long long uint64_t; |
|||
#else |
|||
typedef unsigned long uint64_t; |
|||
#endif |
|||
typedef unsigned int uint128_t __attribute__(( mode(TI) )); |
|||
|
|||
typedef uint32_t * puint32_t; |
|||
typedef uint64_t * puint64_t; |
|||
typedef uint128_t * puint128_t; |
|||
|
|||
typedef volatile uint32_t vuint32_t; |
|||
typedef volatile uint64_t vuint64_t; |
|||
typedef volatile uint128_t vuint128_t __attribute__(( mode(TI) )); |
|||
|
|||
typedef vuint32_t * pvuint32_t; |
|||
typedef vuint64_t * pvuint64_t; |
|||
typedef vuint128_t * pvuint128_t; |
|||
|
|||
#endif //_EE |
|||
|
|||
#ifdef _IOP |
|||
typedef unsigned long uint32_t; |
|||
typedef unsigned long long uint64_t; |
|||
|
|||
typedef volatile uint32_t vuint32_t; |
|||
typedef volatile uint64_t vuint64_t; |
|||
#endif |
|||
|
|||
typedef signed char int8_t; |
|||
typedef signed short int16_t; |
|||
typedef volatile int8_t vint8_t; |
|||
typedef volatile int16_t vint16_t; |
|||
|
|||
#ifdef _EE |
|||
typedef signed int int32_t; |
|||
#if __GNUC__ > 3 |
|||
typedef signed long long int64_t; |
|||
#else |
|||
typedef signed long int64_t; |
|||
#endif |
|||
typedef signed int int128_t __attribute__(( mode(TI) )); |
|||
|
|||
typedef int32_t * pint32_t; |
|||
typedef int64_t * pint64_t; |
|||
typedef int128_t * pint128_t; |
|||
|
|||
typedef volatile int32_t vint32_t; |
|||
typedef volatile int64_t vint64_t; |
|||
typedef volatile int128_t vint128_t __attribute__(( mode(TI) )); |
|||
|
|||
typedef vint32_t * pvint32_t; |
|||
typedef vint64_t * pvint64_t; |
|||
typedef vint128_t * pvint128_t; |
|||
|
|||
#endif |
|||
|
|||
#ifdef _IOP |
|||
typedef signed long int32_t; |
|||
typedef signed long long int64_t; |
|||
typedef volatile int32_t vint32_t; |
|||
typedef volatile int64_t vint64_t; |
|||
#endif |
|||
|
|||
#ifdef _EE |
|||
typedef union u_qword_t{ |
|||
uint128_t qw; |
|||
uint8_t b[16]; |
|||
uint16_t hw[8]; |
|||
uint32_t sw[4]; |
|||
uint64_t dw[2]; |
|||
} qword_t; |
|||
#endif |
|||
|
|||
#ifndef NULL |
|||
#define NULL (void *)0 |
|||
#endif |
|||
|
|||
static inline uint8_t _lb(uint32_t addr) { return *(vuint8_t *)addr; } |
|||
static inline uint16_t _lh(uint32_t addr) { return *(vuint16_t *)addr; } |
|||
static inline uint32_t _lw(uint32_t addr) { return *(vuint32_t *)addr; } |
|||
|
|||
static inline void _sb(uint8_t val, uint32_t addr) { *(vuint8_t *)addr = val; } |
|||
static inline void _sh(uint16_t val, uint32_t addr) { *(vuint16_t *)addr = val; } |
|||
static inline void _sw(uint32_t val, uint32_t addr) { *(vuint32_t *)addr = val; } |
|||
|
|||
#ifdef _EE |
|||
static inline uint64_t _ld(uint32_t addr) { return *(vuint64_t *)addr; } |
|||
static inline uint128_t _lq(uint32_t addr) { return *(vuint128_t *)addr; } |
|||
static inline void _sd(uint64_t val, uint32_t addr) { *(vuint64_t *)addr = val; } |
|||
static inline void _sq(uint128_t val, uint32_t addr) { *(vuint128_t *)addr = val; } |
|||
#endif |
|||
|
|||
#define uswap_16(x) \ |
|||
((((x) & 0xff00) >> 8) | \ |
|||
(((x) & 0x00ff) << 8)) |
|||
|
|||
#define uswap_32(x) \ |
|||
((((x) & 0xff000000) >> 24) | \ |
|||
(((x) & 0x00ff0000) >> 8) | \ |
|||
(((x) & 0x0000ff00) << 8) | \ |
|||
(((x) & 0x000000ff) << 24)) |
|||
|
|||
#define _uswap_64(x, sfx) \ |
|||
((((x) & 0xff00000000000000##sfx) >> 56) | \ |
|||
(((x) & 0x00ff000000000000##sfx) >> 40) | \ |
|||
(((x) & 0x0000ff0000000000##sfx) >> 24) | \ |
|||
(((x) & 0x000000ff00000000##sfx) >> 8) | \ |
|||
(((x) & 0x00000000ff000000##sfx) << 8) | \ |
|||
(((x) & 0x0000000000ff0000##sfx) << 24) | \ |
|||
(((x) & 0x000000000000ff00##sfx) << 40) | \ |
|||
(((x) & 0x00000000000000ff##sfx) << 56)) |
|||
|
|||
#define _uswap_128(x, sfx) \ |
|||
((((x) & 0xff000000000000000000000000000000##sfx) >> 120) | \ |
|||
(((x) & 0x00ff0000000000000000000000000000##sfx) >> 104) | \ |
|||
(((x) & 0x0000ff00000000000000000000000000##sfx) >> 88) | \ |
|||
(((x) & 0x000000ff000000000000000000000000##sfx) >> 72) | \ |
|||
(((x) & 0x00000000ff0000000000000000000000##sfx) >> 56) | \ |
|||
(((x) & 0x0000000000ff00000000000000000000##sfx) >> 40) | \ |
|||
(((x) & 0x000000000000ff000000000000000000##sfx) >> 24) | \ |
|||
(((x) & 0x00000000000000ff0000000000000000##sfx) >> 8) | \ |
|||
(((x) & 0x0000000000000000ff00000000000000##sfx) << 8) | \ |
|||
(((x) & 0x000000000000000000ff000000000000##sfx) << 24) | \ |
|||
(((x) & 0x00000000000000000000ff0000000000##sfx) << 40) | \ |
|||
(((x) & 0x0000000000000000000000ff00000000##sfx) << 56) | \ |
|||
(((x) & 0x000000000000000000000000ff000000##sfx) << 72) | \ |
|||
(((x) & 0x00000000000000000000000000ff0000##sfx) << 88) | \ |
|||
(((x) & 0x0000000000000000000000000000ff00##sfx) << 104) | \ |
|||
(((x) & 0x000000000000000000000000000000ff##sfx) << 120)) |
|||
|
|||
|
|||
#if defined(__GNUC__) |
|||
#define uswap_64(x) _uswap_64(x, ull) |
|||
#define uswap_128(x) _uswap_128(x, ull) |
|||
#else |
|||
#define uswap_64(x) _uswap_64(x, ) |
|||
#define uswap_128(x) _uswap_128(x, ) |
|||
#endif |
|||
|
|||
#if __BYTE_ORDER == __LITTLE_ENDIAN |
|||
#define cpu_to_le16(x) (x) |
|||
#define cpu_to_le32(x) (x) |
|||
#define cpu_to_le64(x) (x) |
|||
#define cpu_to_le128(x) (x) |
|||
#define le16_to_cpu(x) (x) |
|||
#define le32_to_cpu(x) (x) |
|||
#define le64_to_cpu(x) (x) |
|||
#define le128_to_cpu(x) (x) |
|||
#define cpu_to_be16(x) uswap_16(x) |
|||
#define cpu_to_be32(x) uswap_32(x) |
|||
#define cpu_to_be64(x) uswap_64(x) |
|||
#define cpu_to_be128(x) uswap_128(x) |
|||
#define be16_to_cpu(x) uswap_16(x) |
|||
#define be32_to_cpu(x) uswap_32(x) |
|||
#define be64_to_cpu(x) uswap_64(x) |
|||
#define be128_to_cpu(x) uswap_128(x) |
|||
#else |
|||
#define cpu_to_le16(x) uswap_16(x) |
|||
#define cpu_to_le32(x) uswap_32(x) |
|||
#define cpu_to_le64(x) uswap_64(x) |
|||
#define cpu_to_le128(x) uswap_128(x) |
|||
#define le16_to_cpu(x) uswap_16(x) |
|||
#define le32_to_cpu(x) uswap_32(x) |
|||
#define le64_to_cpu(x) uswap_64(x) |
|||
#define le128_to_cpu(x) uswap_128(x) |
|||
#define cpu_to_be16(x) (x) |
|||
#define cpu_to_be32(x) (x) |
|||
#define cpu_to_be64(x) (x) |
|||
#define cpu_to_be128(x) (x) |
|||
#define be16_to_cpu(x) (x) |
|||
#define be32_to_cpu(x) (x) |
|||
#define be64_to_cpu(x) (x) |
|||
#define be128_to_cpu(x) (x) |
|||
#endif |
|||
|
|||
//#include <linux/posix_types.h> |
|||
//#include <asm/types.h> |
|||
//#include <stdbool.h> |
|||
#ifndef _SIZE_T |
|||
#define _SIZE_T |
|||
typedef uint32_t size_t; |
|||
#endif |
|||
|
|||
#ifndef __externC |
|||
#ifdef __cplusplus |
|||
#define __externC extern "C" |
|||
#else |
|||
#define __externC extern |
|||
#endif |
|||
#endif |
|||
|
|||
#ifdef __KERNEL_STRICT_NAMES_____________ |
|||
|
|||
typedef __kernel_fd_set fd_set; |
|||
typedef __kernel_dev_t dev_t; |
|||
typedef __kernel_ino_t ino_t; |
|||
typedef __kernel_mode_t mode_t; |
|||
typedef __kernel_nlink_t nlink_t; |
|||
typedef __kernel_off_t off_t; |
|||
typedef __kernel_pid_t pid_t; |
|||
typedef __kernel_daddr_t daddr_t; |
|||
typedef __kernel_key_t key_t; |
|||
typedef __kernel_suseconds_t suseconds_t; |
|||
|
|||
#ifdef __KERNEL__ |
|||
typedef __kernel_uid32_t uid_t; |
|||
typedef __kernel_gid32_t gid_t; |
|||
typedef __kernel_uid16_t uid16_t; |
|||
typedef __kernel_gid16_t gid16_t; |
|||
|
|||
#ifdef CONFIG_UID16 |
|||
/* This is defined by include/asm-{arch}/posix_types.h */ |
|||
typedef __kernel_old_uid_t old_uid_t; |
|||
typedef __kernel_old_gid_t old_gid_t; |
|||
#endif /* CONFIG_UID16 */ |
|||
|
|||
/* libc5 includes this file to define uid_t, thus uid_t can never change |
|||
* when it is included by non-kernel code |
|||
*/ |
|||
#else |
|||
typedef __kernel_uid_t uid_t; |
|||
typedef __kernel_gid_t gid_t; |
|||
#endif /* __KERNEL__ */ |
|||
|
|||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) |
|||
typedef __kernel_loff_t loff_t; |
|||
#endif |
|||
|
|||
/* |
|||
* The following typedefs are also protected by individual ifdefs for |
|||
* historical reasons: |
|||
*/ |
|||
#ifndef _SIZE_T |
|||
#define _SIZE_T |
|||
typedef __kernel_size_t size_t; |
|||
#endif |
|||
|
|||
#ifndef _SSIZE_T |
|||
#define _SSIZE_T |
|||
typedef __kernel_ssize_t ssize_t; |
|||
#endif |
|||
|
|||
#ifndef _PTRDIFF_T |
|||
#define _PTRDIFF_T |
|||
typedef __kernel_ptrdiff_t ptrdiff_t; |
|||
#endif |
|||
|
|||
#ifndef _TIME_T |
|||
#define _TIME_T |
|||
typedef __kernel_time_t time_t; |
|||
#endif |
|||
|
|||
#ifndef _CLOCK_T |
|||
#define _CLOCK_T |
|||
typedef __kernel_clock_t clock_t; |
|||
#endif |
|||
|
|||
#ifndef _CADDR_T |
|||
#define _CADDR_T |
|||
typedef __kernel_caddr_t caddr_t; |
|||
#endif |
|||
|
|||
/* bsd */ |
|||
typedef unsigned char u_char; |
|||
typedef unsigned short u_short; |
|||
typedef unsigned int u_int; |
|||
typedef unsigned long u_long; |
|||
|
|||
/* sysv */ |
|||
typedef unsigned char unchar; |
|||
typedef unsigned short ushort; |
|||
typedef unsigned int uint; |
|||
typedef unsigned long ulong; |
|||
|
|||
#ifndef __BIT_TYPES_DEFINED__ |
|||
#define __BIT_TYPES_DEFINED__ |
|||
|
|||
typedef __u8 u_int8_t; |
|||
typedef __s8 int8_t; |
|||
typedef __u16 u_int16_t; |
|||
typedef __s16 int16_t; |
|||
typedef __u32 u_int32_t; |
|||
typedef __s32 int32_t; |
|||
#endif /* !(__BIT_TYPES_DEFINED__) */ |
|||
|
|||
typedef __u8 uint8_t; |
|||
typedef __u16 uint16_t; |
|||
typedef __u32 uint32_t; |
|||
|
|||
#if defined(__GNUC__) && !defined(__STRICT_ANSI__) |
|||
typedef __u64 uint64_t; |
|||
typedef __u64 u_int64_t; |
|||
typedef __s64 int64_t; |
|||
#endif |
|||
#endif /* __KERNEL_STRICT_NAMES */ |
|||
|
|||
/* |
|||
* Below are truly Linux-specific types that should never collide with |
|||
* any application/library that wants linux/types.h. |
|||
*/ |
|||
#ifdef __CHECKER__ |
|||
#define __bitwise__ __attribute__((bitwise)) |
|||
#else |
|||
#define __bitwise__ |
|||
#endif |
|||
|
|||
#ifdef __CHECK_ENDIAN__ |
|||
#define __bitwise __bitwise__ |
|||
#else |
|||
#define __bitwise |
|||
#endif |
|||
|
|||
//typedef __u16 __bitwise __le16; |
|||
//typedef __u16 __bitwise __be16; |
|||
//typedef __u32 __bitwise __le32; |
|||
//typedef __u32 __bitwise __be32; |
|||
|
|||
//#if defined(__GNUC__) |
|||
// typedef __u64 __bitwise __le64; |
|||
// typedef __u64 __bitwise __be64; |
|||
//#endif |
|||
|
|||
//typedef __u16 __bitwise __sum16; |
|||
//typedef __u32 __bitwise __wsum; |
|||
|
|||
typedef unsigned __bitwise__ gfp_t; |
|||
|
|||
//struct ustat { |
|||
// __kernel_daddr_t f_tfree; |
|||
// __kernel_ino_t f_tinode; |
|||
// char f_fname[6]; |
|||
// char f_fpack[6]; |
|||
//}; |
|||
|
|||
#endif |
|||
@ -0,0 +1,573 @@ |
|||
/* |
|||
* Copyright (c) 1995, 1996, 2001, 2002 |
|||
* Erik Theisen. All rights reserved. |
|||
* |
|||
* SPDX-License-Identifier: BSD-3-Clause |
|||
*/ |
|||
|
|||
/* |
|||
* This is the ELF ABI header file |
|||
* formerly known as "elf_abi.h". |
|||
*/ |
|||
|
|||
#ifndef _ELF_H |
|||
#define _ELF_H |
|||
|
|||
#include "compiler.h" |
|||
|
|||
/* |
|||
* This version doesn't work for 64-bit ABIs - Erik. |
|||
*/ |
|||
|
|||
/* |
|||
* These typedefs need to be handled better. |
|||
*/ |
|||
typedef uint32_t Elf32_Addr; /* Unsigned program address */ |
|||
typedef uint32_t Elf32_Off; /* Unsigned file offset */ |
|||
typedef int32_t Elf32_Sword; /* Signed large integer */ |
|||
typedef uint32_t Elf32_Word; /* Unsigned large integer */ |
|||
typedef uint16_t Elf32_Half; /* Unsigned medium integer */ |
|||
|
|||
/* e_ident[] identification indexes */ |
|||
#define EI_MAG0 0 /* file ID */ |
|||
#define EI_MAG1 1 /* file ID */ |
|||
#define EI_MAG2 2 /* file ID */ |
|||
#define EI_MAG3 3 /* file ID */ |
|||
#define EI_CLASS 4 /* file class */ |
|||
#define EI_DATA 5 /* data encoding */ |
|||
#define EI_VERSION 6 /* ELF header version */ |
|||
#define EI_OSABI 7 /* OS/ABI specific ELF extensions */ |
|||
#define EI_ABIVERSION 8 /* ABI target version */ |
|||
#define EI_PAD 9 /* start of pad bytes */ |
|||
#define EI_NIDENT 16 /* Size of e_ident[] */ |
|||
|
|||
/* e_ident[] magic number */ |
|||
#define ELFMAG0 0x7f /* e_ident[EI_MAG0] */ |
|||
#define ELFMAG1 'E' /* e_ident[EI_MAG1] */ |
|||
#define ELFMAG2 'L' /* e_ident[EI_MAG2] */ |
|||
#define ELFMAG3 'F' /* e_ident[EI_MAG3] */ |
|||
#define ELFMAG "\177ELF" /* magic */ |
|||
#define SELFMAG 4 /* size of magic */ |
|||
|
|||
/* e_ident[] file class */ |
|||
#define ELFCLASSNONE 0 /* invalid */ |
|||
#define ELFCLASS32 1 /* 32-bit objs */ |
|||
#define ELFCLASS64 2 /* 64-bit objs */ |
|||
#define ELFCLASSNUM 3 /* number of classes */ |
|||
|
|||
/* e_ident[] data encoding */ |
|||
#define ELFDATANONE 0 /* invalid */ |
|||
#define ELFDATA2LSB 1 /* Little-Endian */ |
|||
#define ELFDATA2MSB 2 /* Big-Endian */ |
|||
#define ELFDATANUM 3 /* number of data encode defines */ |
|||
|
|||
/* e_ident[] OS/ABI specific ELF extensions */ |
|||
#define ELFOSABI_NONE 0 /* No extension specified */ |
|||
#define ELFOSABI_HPUX 1 /* Hewlett-Packard HP-UX */ |
|||
#define ELFOSABI_NETBSD 2 /* NetBSD */ |
|||
#define ELFOSABI_LINUX 3 /* Linux */ |
|||
#define ELFOSABI_SOLARIS 6 /* Sun Solaris */ |
|||
#define ELFOSABI_AIX 7 /* AIX */ |
|||
#define ELFOSABI_IRIX 8 /* IRIX */ |
|||
#define ELFOSABI_FREEBSD 9 /* FreeBSD */ |
|||
#define ELFOSABI_TRU64 10 /* Compaq TRU64 UNIX */ |
|||
#define ELFOSABI_MODESTO 11 /* Novell Modesto */ |
|||
#define ELFOSABI_OPENBSD 12 /* OpenBSD */ |
|||
/* 64-255 Architecture-specific value range */ |
|||
|
|||
/* e_ident[] ABI Version */ |
|||
#define ELFABIVERSION 0 |
|||
|
|||
/* e_ident */ |
|||
#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \ |
|||
(ehdr).e_ident[EI_MAG1] == ELFMAG1 && \ |
|||
(ehdr).e_ident[EI_MAG2] == ELFMAG2 && \ |
|||
(ehdr).e_ident[EI_MAG3] == ELFMAG3) |
|||
|
|||
/* ELF Header */ |
|||
typedef struct elfhdr{ |
|||
unsigned char e_ident[EI_NIDENT]; /* ELF Identification */ |
|||
Elf32_Half e_type; /* object file type */ |
|||
Elf32_Half e_machine; /* machine */ |
|||
Elf32_Word e_version; /* object file version */ |
|||
Elf32_Addr e_entry; /* virtual entry point */ |
|||
Elf32_Off e_phoff; /* program header table offset */ |
|||
Elf32_Off e_shoff; /* section header table offset */ |
|||
Elf32_Word e_flags; /* processor-specific flags */ |
|||
Elf32_Half e_ehsize; /* ELF header size */ |
|||
Elf32_Half e_phentsize; /* program header entry size */ |
|||
Elf32_Half e_phnum; /* number of program header entries */ |
|||
Elf32_Half e_shentsize; /* section header entry size */ |
|||
Elf32_Half e_shnum; /* number of section header entries */ |
|||
Elf32_Half e_shstrndx; /* section header table's "section |
|||
header string table" entry offset */ |
|||
} Elf32_Ehdr; |
|||
|
|||
/* e_type */ |
|||
#define ET_NONE 0 /* No file type */ |
|||
#define ET_REL 1 /* relocatable file */ |
|||
#define ET_EXEC 2 /* executable file */ |
|||
#define ET_DYN 3 /* shared object file */ |
|||
#define ET_CORE 4 /* core file */ |
|||
#define ET_NUM 5 /* number of types */ |
|||
#define ET_LOOS 0xfe00 /* reserved range for operating */ |
|||
#define ET_HIOS 0xfeff /* system specific e_type */ |
|||
#define ET_LOPROC 0xff00 /* reserved range for processor */ |
|||
#define ET_HIPROC 0xffff /* specific e_type */ |
|||
|
|||
/* e_machine */ |
|||
#define EM_NONE 0 /* No Machine */ |
|||
#define EM_M32 1 /* AT&T WE 32100 */ |
|||
#define EM_SPARC 2 /* SPARC */ |
|||
#define EM_386 3 /* Intel 80386 */ |
|||
#define EM_68K 4 /* Motorola 68000 */ |
|||
#define EM_88K 5 /* Motorola 88000 */ |
|||
#if 0 |
|||
#define EM_486 6 /* RESERVED - was Intel 80486 */ |
|||
#endif |
|||
#define EM_860 7 /* Intel 80860 */ |
|||
#define EM_MIPS 8 /* MIPS R3000 Big-Endian only */ |
|||
#define EM_S370 9 /* IBM System/370 Processor */ |
|||
#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */ |
|||
#if 0 |
|||
#define EM_SPARC64 11 /* RESERVED - was SPARC v9 |
|||
64-bit unoffical */ |
|||
#endif |
|||
/* RESERVED 11-14 for future use */ |
|||
#define EM_PARISC 15 /* HPPA */ |
|||
/* RESERVED 16 for future use */ |
|||
#define EM_VPP500 17 /* Fujitsu VPP500 */ |
|||
#define EM_SPARC32PLUS 18 /* Enhanced instruction set SPARC */ |
|||
#define EM_960 19 /* Intel 80960 */ |
|||
#define EM_PPC 20 /* PowerPC */ |
|||
#define EM_PPC64 21 /* 64-bit PowerPC */ |
|||
#define EM_S390 22 /* IBM System/390 Processor */ |
|||
/* RESERVED 23-35 for future use */ |
|||
#define EM_V800 36 /* NEC V800 */ |
|||
#define EM_FR20 37 /* Fujitsu FR20 */ |
|||
#define EM_RH32 38 /* TRW RH-32 */ |
|||
#define EM_RCE 39 /* Motorola RCE */ |
|||
#define EM_ARM 40 /* Advanced Risc Machines ARM */ |
|||
#define EM_ALPHA 41 /* Digital Alpha */ |
|||
#define EM_SH 42 /* Hitachi SH */ |
|||
#define EM_SPARCV9 43 /* SPARC Version 9 */ |
|||
#define EM_TRICORE 44 /* Siemens TriCore embedded processor */ |
|||
#define EM_ARC 45 /* Argonaut RISC Core */ |
|||
#define EM_H8_300 46 /* Hitachi H8/300 */ |
|||
#define EM_H8_300H 47 /* Hitachi H8/300H */ |
|||
#define EM_H8S 48 /* Hitachi H8S */ |
|||
#define EM_H8_500 49 /* Hitachi H8/500 */ |
|||
#define EM_IA_64 50 /* Intel Merced */ |
|||
#define EM_MIPS_X 51 /* Stanford MIPS-X */ |
|||
#define EM_COLDFIRE 52 /* Motorola Coldfire */ |
|||
#define EM_68HC12 53 /* Motorola M68HC12 */ |
|||
#define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/ |
|||
#define EM_PCP 55 /* Siemens PCP */ |
|||
#define EM_NCPU 56 /* Sony nCPU embeeded RISC */ |
|||
#define EM_NDR1 57 /* Denso NDR1 microprocessor */ |
|||
#define EM_STARCORE 58 /* Motorola Start*Core processor */ |
|||
#define EM_ME16 59 /* Toyota ME16 processor */ |
|||
#define EM_ST100 60 /* STMicroelectronic ST100 processor */ |
|||
#define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/ |
|||
#define EM_X86_64 62 /* AMD x86-64 */ |
|||
#define EM_PDSP 63 /* Sony DSP Processor */ |
|||
/* RESERVED 64,65 for future use */ |
|||
#define EM_FX66 66 /* Siemens FX66 microcontroller */ |
|||
#define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */ |
|||
#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */ |
|||
#define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */ |
|||
#define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */ |
|||
#define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */ |
|||
#define EM_68HC05 72 /* Motorola MC68HC05 microcontroller */ |
|||
#define EM_SVX 73 /* Silicon Graphics SVx */ |
|||
#define EM_ST19 74 /* STMicroelectronics ST19 8 bit mc */ |
|||
#define EM_VAX 75 /* Digital VAX */ |
|||
#define EM_CHRIS 76 /* Axis Communications embedded proc. */ |
|||
#define EM_JAVELIN 77 /* Infineon Technologies emb. proc. */ |
|||
#define EM_FIREPATH 78 /* Element 14 64-bit DSP Processor */ |
|||
#define EM_ZSP 79 /* LSI Logic 16-bit DSP Processor */ |
|||
#define EM_MMIX 80 /* Donald Knuth's edu 64-bit proc. */ |
|||
#define EM_HUANY 81 /* Harvard University mach-indep objs */ |
|||
#define EM_PRISM 82 /* SiTera Prism */ |
|||
#define EM_AVR 83 /* Atmel AVR 8-bit microcontroller */ |
|||
#define EM_FR30 84 /* Fujitsu FR30 */ |
|||
#define EM_D10V 85 /* Mitsubishi DV10V */ |
|||
#define EM_D30V 86 /* Mitsubishi DV30V */ |
|||
#define EM_V850 87 /* NEC v850 */ |
|||
#define EM_M32R 88 /* Mitsubishi M32R */ |
|||
#define EM_MN10300 89 /* Matsushita MN10200 */ |
|||
#define EM_MN10200 90 /* Matsushita MN10200 */ |
|||
#define EM_PJ 91 /* picoJava */ |
|||
#define EM_NUM 92 /* number of machine types */ |
|||
|
|||
/* Version */ |
|||
#define EV_NONE 0 /* Invalid */ |
|||
#define EV_CURRENT 1 /* Current */ |
|||
#define EV_NUM 2 /* number of versions */ |
|||
|
|||
/* Section Header */ |
|||
typedef struct { |
|||
Elf32_Word sh_name; /* name - index into section header |
|||
string table section */ |
|||
Elf32_Word sh_type; /* type */ |
|||
Elf32_Word sh_flags; /* flags */ |
|||
Elf32_Addr sh_addr; /* address */ |
|||
Elf32_Off sh_offset; /* file offset */ |
|||
Elf32_Word sh_size; /* section size */ |
|||
Elf32_Word sh_link; /* section header table index link */ |
|||
Elf32_Word sh_info; /* extra information */ |
|||
Elf32_Word sh_addralign; /* address alignment */ |
|||
Elf32_Word sh_entsize; /* section entry size */ |
|||
} Elf32_Shdr; |
|||
|
|||
/* Special Section Indexes */ |
|||
#define SHN_UNDEF 0 /* undefined */ |
|||
#define SHN_LORESERVE 0xff00 /* lower bounds of reserved indexes */ |
|||
#define SHN_LOPROC 0xff00 /* reserved range for processor */ |
|||
#define SHN_HIPROC 0xff1f /* specific section indexes */ |
|||
#define SHN_LOOS 0xff20 /* reserved range for operating */ |
|||
#define SHN_HIOS 0xff3f /* specific semantics */ |
|||
#define SHN_ABS 0xfff1 /* absolute value */ |
|||
#define SHN_COMMON 0xfff2 /* common symbol */ |
|||
#define SHN_XINDEX 0xffff /* Index is an extra table */ |
|||
#define SHN_HIRESERVE 0xffff /* upper bounds of reserved indexes */ |
|||
|
|||
/* sh_type */ |
|||
#define SHT_NULL 0 /* inactive */ |
|||
#define SHT_PROGBITS 1 /* program defined information */ |
|||
#define SHT_SYMTAB 2 /* symbol table section */ |
|||
#define SHT_STRTAB 3 /* string table section */ |
|||
#define SHT_RELA 4 /* relocation section with addends*/ |
|||
#define SHT_HASH 5 /* symbol hash table section */ |
|||
#define SHT_DYNAMIC 6 /* dynamic section */ |
|||
#define SHT_NOTE 7 /* note section */ |
|||
#define SHT_NOBITS 8 /* no space section */ |
|||
#define SHT_REL 9 /* relation section without addends */ |
|||
#define SHT_SHLIB 10 /* reserved - purpose unknown */ |
|||
#define SHT_DYNSYM 11 /* dynamic symbol table section */ |
|||
#define SHT_INIT_ARRAY 14 /* Array of constructors */ |
|||
#define SHT_FINI_ARRAY 15 /* Array of destructors */ |
|||
#define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ |
|||
#define SHT_GROUP 17 /* Section group */ |
|||
#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */ |
|||
#define SHT_NUM 19 /* number of section types */ |
|||
#define SHT_LOOS 0x60000000 /* Start OS-specific */ |
|||
#define SHT_HIOS 0x6fffffff /* End OS-specific */ |
|||
#define SHT_LOPROC 0x70000000 /* reserved range for processor */ |
|||
#define SHT_HIPROC 0x7fffffff /* specific section header types */ |
|||
#define SHT_LOUSER 0x80000000 /* reserved range for application */ |
|||
#define SHT_HIUSER 0xffffffff /* specific indexes */ |
|||
|
|||
/* Section names */ |
|||
#define ELF_BSS ".bss" /* uninitialized data */ |
|||
#define ELF_COMMENT ".comment" /* version control information */ |
|||
#define ELF_DATA ".data" /* initialized data */ |
|||
#define ELF_DATA1 ".data1" /* initialized data */ |
|||
#define ELF_DEBUG ".debug" /* debug */ |
|||
#define ELF_DYNAMIC ".dynamic" /* dynamic linking information */ |
|||
#define ELF_DYNSTR ".dynstr" /* dynamic string table */ |
|||
#define ELF_DYNSYM ".dynsym" /* dynamic symbol table */ |
|||
#define ELF_FINI ".fini" /* termination code */ |
|||
#define ELF_FINI_ARRAY ".fini_array" /* Array of destructors */ |
|||
#define ELF_GOT ".got" /* global offset table */ |
|||
#define ELF_HASH ".hash" /* symbol hash table */ |
|||
#define ELF_INIT ".init" /* initialization code */ |
|||
#define ELF_INIT_ARRAY ".init_array" /* Array of constuctors */ |
|||
#define ELF_INTERP ".interp" /* Pathname of program interpreter */ |
|||
#define ELF_LINE ".line" /* Symbolic line numnber information */ |
|||
#define ELF_NOTE ".note" /* Contains note section */ |
|||
#define ELF_PLT ".plt" /* Procedure linkage table */ |
|||
#define ELF_PREINIT_ARRAY ".preinit_array" /* Array of pre-constructors */ |
|||
#define ELF_REL_DATA ".rel.data" /* relocation data */ |
|||
#define ELF_REL_FINI ".rel.fini" /* relocation termination code */ |
|||
#define ELF_REL_INIT ".rel.init" /* relocation initialization code */ |
|||
#define ELF_REL_DYN ".rel.dyn" /* relocaltion dynamic link info */ |
|||
#define ELF_REL_RODATA ".rel.rodata" /* relocation read-only data */ |
|||
#define ELF_REL_TEXT ".rel.text" /* relocation code */ |
|||
#define ELF_RODATA ".rodata" /* read-only data */ |
|||
#define ELF_RODATA1 ".rodata1" /* read-only data */ |
|||
#define ELF_SHSTRTAB ".shstrtab" /* section header string table */ |
|||
#define ELF_STRTAB ".strtab" /* string table */ |
|||
#define ELF_SYMTAB ".symtab" /* symbol table */ |
|||
#define ELF_SYMTAB_SHNDX ".symtab_shndx"/* symbol table section index */ |
|||
#define ELF_TBSS ".tbss" /* thread local uninit data */ |
|||
#define ELF_TDATA ".tdata" /* thread local init data */ |
|||
#define ELF_TDATA1 ".tdata1" /* thread local init data */ |
|||
#define ELF_TEXT ".text" /* code */ |
|||
|
|||
/* Section Attribute Flags - sh_flags */ |
|||
#define SHF_WRITE 0x1 /* Writable */ |
|||
#define SHF_ALLOC 0x2 /* occupies memory */ |
|||
#define SHF_EXECINSTR 0x4 /* executable */ |
|||
#define SHF_MERGE 0x10 /* Might be merged */ |
|||
#define SHF_STRINGS 0x20 /* Contains NULL terminated strings */ |
|||
#define SHF_INFO_LINK 0x40 /* sh_info contains SHT index */ |
|||
#define SHF_LINK_ORDER 0x80 /* Preserve order after combining*/ |
|||
#define SHF_OS_NONCONFORMING 0x100 /* Non-standard OS specific handling */ |
|||
#define SHF_GROUP 0x200 /* Member of section group */ |
|||
#define SHF_TLS 0x400 /* Thread local storage */ |
|||
#define SHF_MASKOS 0x0ff00000 /* OS specific */ |
|||
#define SHF_MASKPROC 0xf0000000 /* reserved bits for processor */ |
|||
/* specific section attributes */ |
|||
|
|||
/* Section Group Flags */ |
|||
#define GRP_COMDAT 0x1 /* COMDAT group */ |
|||
#define GRP_MASKOS 0x0ff00000 /* Mask OS specific flags */ |
|||
#define GRP_MASKPROC 0xf0000000 /* Mask processor specific flags */ |
|||
|
|||
/* Symbol Table Entry */ |
|||
typedef struct elf32_sym { |
|||
Elf32_Word st_name; /* name - index into string table */ |
|||
Elf32_Addr st_value; /* symbol value */ |
|||
Elf32_Word st_size; /* symbol size */ |
|||
unsigned char st_info; /* type and binding */ |
|||
unsigned char st_other; /* 0 - no defined meaning */ |
|||
Elf32_Half st_shndx; /* section header index */ |
|||
} Elf32_Sym; |
|||
|
|||
/* Symbol table index */ |
|||
#define STN_UNDEF 0 /* undefined */ |
|||
|
|||
/* Extract symbol info - st_info */ |
|||
#define ELF32_ST_BIND(x) ((x) >> 4) |
|||
#define ELF32_ST_TYPE(x) (((unsigned int) x) & 0xf) |
|||
#define ELF32_ST_INFO(b,t) (((b) << 4) + ((t) & 0xf)) |
|||
#define ELF32_ST_VISIBILITY(x) ((x) & 0x3) |
|||
|
|||
/* Symbol Binding - ELF32_ST_BIND - st_info */ |
|||
#define STB_LOCAL 0 /* Local symbol */ |
|||
#define STB_GLOBAL 1 /* Global symbol */ |
|||
#define STB_WEAK 2 /* like global - lower precedence */ |
|||
#define STB_NUM 3 /* number of symbol bindings */ |
|||
#define STB_LOOS 10 /* reserved range for operating */ |
|||
#define STB_HIOS 12 /* system specific symbol bindings */ |
|||
#define STB_LOPROC 13 /* reserved range for processor */ |
|||
#define STB_HIPROC 15 /* specific symbol bindings */ |
|||
|
|||
/* Symbol type - ELF32_ST_TYPE - st_info */ |
|||
#define STT_NOTYPE 0 /* not specified */ |
|||
#define STT_OBJECT 1 /* data object */ |
|||
#define STT_FUNC 2 /* function */ |
|||
#define STT_SECTION 3 /* section */ |
|||
#define STT_FILE 4 /* file */ |
|||
#define STT_NUM 5 /* number of symbol types */ |
|||
#define STT_TLS 6 /* Thread local storage symbol */ |
|||
#define STT_LOOS 10 /* reserved range for operating */ |
|||
#define STT_HIOS 12 /* system specific symbol types */ |
|||
#define STT_LOPROC 13 /* reserved range for processor */ |
|||
#define STT_HIPROC 15 /* specific symbol types */ |
|||
|
|||
/* Symbol visibility - ELF32_ST_VISIBILITY - st_other */ |
|||
#define STV_DEFAULT 0 /* Normal visibility rules */ |
|||
#define STV_INTERNAL 1 /* Processor specific hidden class */ |
|||
#define STV_HIDDEN 2 /* Symbol unavailable in other mods */ |
|||
#define STV_PROTECTED 3 /* Not preemptible, not exported */ |
|||
|
|||
|
|||
/* Relocation entry with implicit addend */ |
|||
typedef struct |
|||
{ |
|||
Elf32_Addr r_offset; /* offset of relocation */ |
|||
Elf32_Word r_info; /* symbol table index and type */ |
|||
} Elf32_Rel; |
|||
|
|||
/* Relocation entry with explicit addend */ |
|||
typedef struct |
|||
{ |
|||
Elf32_Addr r_offset; /* offset of relocation */ |
|||
Elf32_Word r_info; /* symbol table index and type */ |
|||
Elf32_Sword r_addend; |
|||
} Elf32_Rela; |
|||
|
|||
/* Extract relocation info - r_info */ |
|||
#define ELF32_R_SYM(i) ((i) >> 8) |
|||
#define ELF32_R_TYPE(i) ((unsigned char) (i)) |
|||
#define ELF32_R_INFO(s,t) (((s) << 8) + (unsigned char)(t)) |
|||
|
|||
/* Program Header */ |
|||
typedef struct { |
|||
Elf32_Word p_type; /* segment type */ |
|||
Elf32_Off p_offset; /* segment offset */ |
|||
Elf32_Addr p_vaddr; /* virtual address of segment */ |
|||
Elf32_Addr p_paddr; /* physical address - ignored? */ |
|||
Elf32_Word p_filesz; /* number of bytes in file for seg. */ |
|||
Elf32_Word p_memsz; /* number of bytes in mem. for seg. */ |
|||
Elf32_Word p_flags; /* flags */ |
|||
Elf32_Word p_align; /* memory alignment */ |
|||
} Elf32_Phdr; |
|||
|
|||
/* Segment types - p_type */ |
|||
#define PT_NULL 0 /* unused */ |
|||
#define PT_LOAD 1 /* loadable segment */ |
|||
#define PT_DYNAMIC 2 /* dynamic linking section */ |
|||
#define PT_INTERP 3 /* the RTLD */ |
|||
#define PT_NOTE 4 /* auxiliary information */ |
|||
#define PT_SHLIB 5 /* reserved - purpose undefined */ |
|||
#define PT_PHDR 6 /* program header */ |
|||
#define PT_TLS 7 /* Thread local storage template */ |
|||
#define PT_NUM 8 /* Number of segment types */ |
|||
#define PT_LOOS 0x60000000 /* reserved range for operating */ |
|||
#define PT_HIOS 0x6fffffff /* system specific segment types */ |
|||
#define PT_LOPROC 0x70000000 /* reserved range for processor */ |
|||
#define PT_HIPROC 0x7fffffff /* specific segment types */ |
|||
|
|||
/* Segment flags - p_flags */ |
|||
#define PF_X 0x1 /* Executable */ |
|||
#define PF_W 0x2 /* Writable */ |
|||
#define PF_R 0x4 /* Readable */ |
|||
#define PF_MASKOS 0x0ff00000 /* OS specific segment flags */ |
|||
#define PF_MASKPROC 0xf0000000 /* reserved bits for processor */ |
|||
/* specific segment flags */ |
|||
/* Dynamic structure */ |
|||
typedef struct |
|||
{ |
|||
Elf32_Sword d_tag; /* controls meaning of d_val */ |
|||
union |
|||
{ |
|||
Elf32_Word d_val; /* Multiple meanings - see d_tag */ |
|||
Elf32_Addr d_ptr; /* program virtual address */ |
|||
} d_un; |
|||
} Elf32_Dyn; |
|||
|
|||
extern Elf32_Dyn _DYNAMIC[]; |
|||
|
|||
/* Dynamic Array Tags - d_tag */ |
|||
#define DT_NULL 0 /* marks end of _DYNAMIC array */ |
|||
#define DT_NEEDED 1 /* string table offset of needed lib */ |
|||
#define DT_PLTRELSZ 2 /* size of relocation entries in PLT */ |
|||
#define DT_PLTGOT 3 /* address PLT/GOT */ |
|||
#define DT_HASH 4 /* address of symbol hash table */ |
|||
#define DT_STRTAB 5 /* address of string table */ |
|||
#define DT_SYMTAB 6 /* address of symbol table */ |
|||
#define DT_RELA 7 /* address of relocation table */ |
|||
#define DT_RELASZ 8 /* size of relocation table */ |
|||
#define DT_RELAENT 9 /* size of relocation entry */ |
|||
#define DT_STRSZ 10 /* size of string table */ |
|||
#define DT_SYMENT 11 /* size of symbol table entry */ |
|||
#define DT_INIT 12 /* address of initialization func. */ |
|||
#define DT_FINI 13 /* address of termination function */ |
|||
#define DT_SONAME 14 /* string table offset of shared obj */ |
|||
#define DT_RPATH 15 /* string table offset of library |
|||
search path */ |
|||
#define DT_SYMBOLIC 16 /* start sym search in shared obj. */ |
|||
#define DT_REL 17 /* address of rel. tbl. w addends */ |
|||
#define DT_RELSZ 18 /* size of DT_REL relocation table */ |
|||
#define DT_RELENT 19 /* size of DT_REL relocation entry */ |
|||
#define DT_PLTREL 20 /* PLT referenced relocation entry */ |
|||
#define DT_DEBUG 21 /* bugger */ |
|||
#define DT_TEXTREL 22 /* Allow rel. mod. to unwritable seg */ |
|||
#define DT_JMPREL 23 /* add. of PLT's relocation entries */ |
|||
#define DT_BIND_NOW 24 /* Process relocations of object */ |
|||
#define DT_INIT_ARRAY 25 /* Array with addresses of init fct */ |
|||
#define DT_FINI_ARRAY 26 /* Array with addresses of fini fct */ |
|||
#define DT_INIT_ARRAYSZ 27 /* Size in bytes of DT_INIT_ARRAY */ |
|||
#define DT_FINI_ARRAYSZ 28 /* Size in bytes of DT_FINI_ARRAY */ |
|||
#define DT_RUNPATH 29 /* Library search path */ |
|||
#define DT_FLAGS 30 /* Flags for the object being loaded */ |
|||
#define DT_ENCODING 32 /* Start of encoded range */ |
|||
#define DT_PREINIT_ARRAY 32 /* Array with addresses of preinit fct*/ |
|||
#define DT_PREINIT_ARRAYSZ 33 /* size in bytes of DT_PREINIT_ARRAY */ |
|||
#define DT_NUM 34 /* Number used. */ |
|||
#define DT_LOOS 0x60000000 /* reserved range for OS */ |
|||
#define DT_HIOS 0x6fffffff /* specific dynamic array tags */ |
|||
#define DT_LOPROC 0x70000000 /* reserved range for processor */ |
|||
#define DT_HIPROC 0x7fffffff /* specific dynamic array tags */ |
|||
|
|||
/* Dynamic Tag Flags - d_un.d_val */ |
|||
#define DF_ORIGIN 0x01 /* Object may use DF_ORIGIN */ |
|||
#define DF_SYMBOLIC 0x02 /* Symbol resolutions starts here */ |
|||
#define DF_TEXTREL 0x04 /* Object contains text relocations */ |
|||
#define DF_BIND_NOW 0x08 /* No lazy binding for this object */ |
|||
#define DF_STATIC_TLS 0x10 /* Static thread local storage */ |
|||
|
|||
/* Standard ELF hashing function */ |
|||
unsigned long elf_hash(const unsigned char *name); |
|||
|
|||
#define ELF_TARG_VER 1 /* The ver for which this code is intended */ |
|||
|
|||
/* |
|||
* XXX - PowerPC defines really don't belong in here, |
|||
* but we'll put them in for simplicity. |
|||
*/ |
|||
|
|||
/* Values for Elf32/64_Ehdr.e_flags. */ |
|||
#define EF_PPC_EMB 0x80000000 /* PowerPC embedded flag */ |
|||
|
|||
/* Cygnus local bits below */ |
|||
#define EF_PPC_RELOCATABLE 0x00010000 /* PowerPC -mrelocatable flag*/ |
|||
#define EF_PPC_RELOCATABLE_LIB 0x00008000 /* PowerPC -mrelocatable-lib |
|||
flag */ |
|||
|
|||
/* PowerPC relocations defined by the ABIs */ |
|||
#define R_PPC_NONE 0 |
|||
#define R_PPC_ADDR32 1 /* 32bit absolute address */ |
|||
#define R_PPC_ADDR24 2 /* 26bit address, 2 bits ignored. */ |
|||
#define R_PPC_ADDR16 3 /* 16bit absolute address */ |
|||
#define R_PPC_ADDR16_LO 4 /* lower 16bit of absolute address */ |
|||
#define R_PPC_ADDR16_HI 5 /* high 16bit of absolute address */ |
|||
#define R_PPC_ADDR16_HA 6 /* adjusted high 16bit */ |
|||
#define R_PPC_ADDR14 7 /* 16bit address, 2 bits ignored */ |
|||
#define R_PPC_ADDR14_BRTAKEN 8 |
|||
#define R_PPC_ADDR14_BRNTAKEN 9 |
|||
#define R_PPC_REL24 10 /* PC relative 26 bit */ |
|||
#define R_PPC_REL14 11 /* PC relative 16 bit */ |
|||
#define R_PPC_REL14_BRTAKEN 12 |
|||
#define R_PPC_REL14_BRNTAKEN 13 |
|||
#define R_PPC_GOT16 14 |
|||
#define R_PPC_GOT16_LO 15 |
|||
#define R_PPC_GOT16_HI 16 |
|||
#define R_PPC_GOT16_HA 17 |
|||
#define R_PPC_PLTREL24 18 |
|||
#define R_PPC_COPY 19 |
|||
#define R_PPC_GLOB_DAT 20 |
|||
#define R_PPC_JMP_SLOT 21 |
|||
#define R_PPC_RELATIVE 22 |
|||
#define R_PPC_LOCAL24PC 23 |
|||
#define R_PPC_UADDR32 24 |
|||
#define R_PPC_UADDR16 25 |
|||
#define R_PPC_REL32 26 |
|||
#define R_PPC_PLT32 27 |
|||
#define R_PPC_PLTREL32 28 |
|||
#define R_PPC_PLT16_LO 29 |
|||
#define R_PPC_PLT16_HI 30 |
|||
#define R_PPC_PLT16_HA 31 |
|||
#define R_PPC_SDAREL16 32 |
|||
#define R_PPC_SECTOFF 33 |
|||
#define R_PPC_SECTOFF_LO 34 |
|||
#define R_PPC_SECTOFF_HI 35 |
|||
#define R_PPC_SECTOFF_HA 36 |
|||
/* Keep this the last entry. */ |
|||
#define R_PPC_NUM 37 |
|||
|
|||
/* The remaining relocs are from the Embedded ELF ABI, and are not |
|||
in the SVR4 ELF ABI. */ |
|||
#define R_PPC_EMB_NADDR32 101 |
|||
#define R_PPC_EMB_NADDR16 102 |
|||
#define R_PPC_EMB_NADDR16_LO 103 |
|||
#define R_PPC_EMB_NADDR16_HI 104 |
|||
#define R_PPC_EMB_NADDR16_HA 105 |
|||
#define R_PPC_EMB_SDAI16 106 |
|||
#define R_PPC_EMB_SDA2I16 107 |
|||
#define R_PPC_EMB_SDA2REL 108 |
|||
#define R_PPC_EMB_SDA21 109 /* 16 bit offset in SDA */ |
|||
#define R_PPC_EMB_MRKREF 110 |
|||
#define R_PPC_EMB_RELSEC16 111 |
|||
#define R_PPC_EMB_RELST_LO 112 |
|||
#define R_PPC_EMB_RELST_HI 113 |
|||
#define R_PPC_EMB_RELST_HA 114 |
|||
#define R_PPC_EMB_BIT_FLD 115 |
|||
#define R_PPC_EMB_RELSDA 116 /* 16 bit relative offset in SDA */ |
|||
|
|||
/* Diab tool relocations. */ |
|||
#define R_PPC_DIAB_SDA21_LO 180 /* like EMB_SDA21, but lower 16 bit */ |
|||
#define R_PPC_DIAB_SDA21_HI 181 /* like EMB_SDA21, but high 16 bit */ |
|||
#define R_PPC_DIAB_SDA21_HA 182 /* like EMB_SDA21, adjusted high 16 */ |
|||
#define R_PPC_DIAB_RELSDA_LO 183 /* like EMB_RELSDA, but lower 16 bit */ |
|||
#define R_PPC_DIAB_RELSDA_HI 184 /* like EMB_RELSDA, but high 16 bit */ |
|||
#define R_PPC_DIAB_RELSDA_HA 185 /* like EMB_RELSDA, adjusted high 16 */ |
|||
|
|||
/* This is a phony reloc to handle any old fashioned TOC16 references |
|||
that may still be in object files. */ |
|||
#define R_PPC_TOC16 255 |
|||
|
|||
#endif /* _ELF_H */ |
|||
@ -0,0 +1,140 @@ |
|||
/* |
|||
* U-boot - errno.h Error number defines |
|||
* |
|||
* Copyright (c) 2005-2007 Analog Devices Inc. |
|||
* |
|||
* SPDX-License-Identifier: GPL-2.0+ |
|||
*/ |
|||
|
|||
#ifndef _GENERIC_ERRNO_H |
|||
#define _GENERIC_ERRNO_H |
|||
|
|||
#define EPERM 1 /* Operation not permitted */ |
|||
#define ENOENT 2 /* No such file or directory */ |
|||
#define ESRCH 3 /* No such process */ |
|||
#define EINTR 4 /* Interrupted system call */ |
|||
#define EIO 5 /* I/O error */ |
|||
#define ENXIO 6 /* No such device or address */ |
|||
#define E2BIG 7 /* Argument list too long */ |
|||
#define ENOEXEC 8 /* Exec format error */ |
|||
#define EBADF 9 /* Bad file number */ |
|||
#define ECHILD 10 /* No child processes */ |
|||
#define EAGAIN 11 /* Try again */ |
|||
#define ENOMEM 12 /* Out of memory */ |
|||
#define EACCES 13 /* Permission denied */ |
|||
#define EFAULT 14 /* Bad address */ |
|||
#define ENOTBLK 15 /* Block device required */ |
|||
#define EBUSY 16 /* Device or resource busy */ |
|||
#define EEXIST 17 /* File exists */ |
|||
#define EXDEV 18 /* Cross-device link */ |
|||
#define ENODEV 19 /* No such device */ |
|||
#define ENOTDIR 20 /* Not a directory */ |
|||
#define EISDIR 21 /* Is a directory */ |
|||
#define EINVAL 22 /* Invalid argument */ |
|||
#define ENFILE 23 /* File table overflow */ |
|||
#define EMFILE 24 /* Too many open files */ |
|||
#define ENOTTY 25 /* Not a typewriter */ |
|||
#define ETXTBSY 26 /* Text file busy */ |
|||
#define EFBIG 27 /* File too large */ |
|||
#define ENOSPC 28 /* No space left on device */ |
|||
#define ESPIPE 29 /* Illegal seek */ |
|||
#define EROFS 30 /* Read-only file system */ |
|||
#define EMLINK 31 /* Too many links */ |
|||
#define EPIPE 32 /* Broken pipe */ |
|||
#define EDOM 33 /* Math argument out of domain of func */ |
|||
#define ERANGE 34 /* Math result not representable */ |
|||
#define EDEADLK 35 /* Resource deadlock would occur */ |
|||
#define ENAMETOOLONG 36 /* File name too long */ |
|||
#define ENOLCK 37 /* No record locks available */ |
|||
#define ENOSYS 38 /* Function not implemented */ |
|||
#define ENOTEMPTY 39 /* Directory not empty */ |
|||
#define ELOOP 40 /* Too many symbolic links encountered */ |
|||
#define EWOULDBLOCK EAGAIN 41 /* Operation would block */ |
|||
#define ENOMSG 42 /* No message of desired type */ |
|||
#define EIDRM 43 /* Identifier removed */ |
|||
#define ECHRNG 44 /* Channel number out of range */ |
|||
#define EL2NSYNC 45 /* Level 2 not synchronized */ |
|||
#define EL3HLT 46 /* Level 3 halted */ |
|||
#define EL3RST 47 /* Level 3 reset */ |
|||
#define ELNRNG 48 /* Link number out of range */ |
|||
#define EUNATCH 49 /* Protocol driver not attached */ |
|||
#define ENOCSI 50 /* No CSI structure available */ |
|||
#define EL2HLT 51 /* Level 2 halted */ |
|||
#define EBADE 52 /* Invalid exchange */ |
|||
#define EBADR 53 /* Invalid request descriptor */ |
|||
#define EXFULL 54 /* Exchange full */ |
|||
#define ENOANO 55 /* No anode */ |
|||
#define EBADRQC 56 /* Invalid request code */ |
|||
#define EBADSLT 57 /* Invalid slot */ |
|||
|
|||
#define EDEADLOCK EDEADLK |
|||
|
|||
#define EBFONT 59 /* Bad font file format */ |
|||
#define ENOSTR 60 /* Device not a stream */ |
|||
#define ENODATA 61 /* No data available */ |
|||
#define ETIME 62 /* Timer expired */ |
|||
#define ENOSR 63 /* Out of streams resources */ |
|||
#define ENONET 64 /* Machine is not on the network */ |
|||
#define ENOPKG 65 /* Package not installed */ |
|||
#define EREMOTE 66 /* Object is remote */ |
|||
#define ENOLINK 67 /* Link has been severed */ |
|||
#define EADV 68 /* Advertise error */ |
|||
#define ESRMNT 69 /* Srmount error */ |
|||
#define ECOMM 70 /* Communication error on send */ |
|||
#define EPROTO 71 /* Protocol error */ |
|||
#define EMULTIHOP 72 /* Multihop attempted */ |
|||
#define EDOTDOT 73 /* RFS specific error */ |
|||
#define EBADMSG 74 /* Not a data message */ |
|||
#define EOVERFLOW 75 /* Value too large for defined data type */ |
|||
#define ENOTUNIQ 76 /* Name not unique on network */ |
|||
#define EBADFD 77 /* File descriptor in bad state */ |
|||
#define EREMCHG 78 /* Remote address changed */ |
|||
#define ELIBACC 79 /* Can not access a needed shared library */ |
|||
#define ELIBBAD 80 /* Accessing a corrupted shared library */ |
|||
#define ELIBSCN 81 /* .lib section in a.out corrupted */ |
|||
#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ |
|||
#define ELIBEXEC 83 /* Cannot exec a shared library directly */ |
|||
#define EILSEQ 84 /* Illegal byte sequence */ |
|||
#define ERESTART 85 /* Interrupted system call should be restarted */ |
|||
#define ESTRPIPE 86 /* Streams pipe error */ |
|||
#define EUSERS 87 /* Too many users */ |
|||
#define ENOTSOCK 88 /* Socket operation on non-socket */ |
|||
#define EDESTADDRREQ 89 /* Destination address required */ |
|||
#define EMSGSIZE 90 /* Message too long */ |
|||
#define EPROTOTYPE 91 /* Protocol wrong type for socket */ |
|||
#define ENOPROTOOPT 92 /* Protocol not available */ |
|||
#define EPROTONOSUPPORT 93 /* Protocol not supported */ |
|||
#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ |
|||
#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ |
|||
#define EPFNOSUPPORT 96 /* Protocol family not supported */ |
|||
#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ |
|||
#define EADDRINUSE 98 /* Address already in use */ |
|||
#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ |
|||
#define ENETDOWN 100 /* Network is down */ |
|||
#define ENETUNREACH 101 /* Network is unreachable */ |
|||
#define ENETRESET 102 /* Network dropped connection because of reset */ |
|||
#define ECONNABORTED 103 /* Software caused connection abort */ |
|||
#define ECONNRESET 104 /* Connection reset by peer */ |
|||
#define ENOBUFS 105 /* No buffer space available */ |
|||
#define EISCONN 106 /* Transport endpoint is already connected */ |
|||
#define ENOTCONN 107 /* Transport endpoint is not connected */ |
|||
#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ |
|||
#define ETOOMANYREFS 109 /* Too many references: cannot splice */ |
|||
#define ETIMEDOUT 110 /* Connection timed out */ |
|||
#define ECONNREFUSED 111 /* Connection refused */ |
|||
#define EHOSTDOWN 112 /* Host is down */ |
|||
#define EHOSTUNREACH 113 /* No route to host */ |
|||
#define EALREADY 114 /* Operation already in progress */ |
|||
#define EINPROGRESS 115 /* Operation now in progress */ |
|||
#define ESTALE 116 /* Stale NFS file handle */ |
|||
#define EUCLEAN 117 /* Structure needs cleaning */ |
|||
#define ENOTNAM 118 /* Not a XENIX named type file */ |
|||
#define ENAVAIL 119 /* No XENIX semaphores available */ |
|||
#define EISNAM 120 /* Is a named type file */ |
|||
#define EREMOTEIO 121 /* Remote I/O error */ |
|||
#define EDQUOT 122 /* Quota exceeded */ |
|||
#define ENOMEDIUM 123 /* No medium found */ |
|||
#define EMEDIUMTYPE 124 /* Wrong medium type */ |
|||
|
|||
#endif |
|||
|
|||
@ -0,0 +1,34 @@ |
|||
OBJECTSEKS = eks1.o eks2.o eks3.o vutest.o eks4.o eks5.o eks5vu.o eks6.o eks7.o eks7vu.o |
|||
OBJECTSLIB = texture.o math.o dma.o matrix.o gif.o vu.o malloc.o |
|||
OBJECTSDATA = logo.o logo_alpha.o dot.o dot2.o font.o font_alpha.o mainbg1.o mainbg1_alpha.o mainbg2.o mainbg2_alpha.o fslogo.o kantlogo.o kantfade.o scroll.o druckluft.o druckluft_a.o gibson.o gibson_a.o |
|||
|
|||
OBJECTS = main.o $(OBJECTSEKS) $(OBJECTSLIB) $(OBJECTSDATA) |
|||
EXEFILE = main.elf |
|||
|
|||
#CPATH = ../ee-bin/bin/mips64r5900-sce-elf-
|
|||
CPATH = |
|||
CC = $(CPATH)gcc.exe |
|||
VAS = $(CPATH)dvp-as.exe |
|||
AS = $(CPATH)as.exe |
|||
LD = $(CPATH)ld.exe |
|||
OBJCOPY = $(CPATH)objcopy.exe |
|||
ASFLAGS = -mcpu=5900 -EL |
|||
CPPFLAGS = -fshort-double -O6 -c -Werror |
|||
LFLAGS = -Tlinkfile |
|||
|
|||
.SUFFIXES: .c .s .vsm .o .pcx .elf .asm |
|||
|
|||
.c.o: |
|||
$(CC) $(CPPFLAGS) $< -o $@ |
|||
.pcx.asm: |
|||
./rawtoasm $< $@ $@ |
|||
.asm.o: |
|||
$(AS) $(ASFLAGS) $< -o $@ |
|||
.vsm.o: |
|||
$(VAS) $< -o $@ |
|||
.s.o: |
|||
$(AS) $(ASFLAGS) $< -o $@ |
|||
$(EXEFILE):$(OBJECTS); |
|||
$(CC) $(LFLAGS) -o $(EXEFILE) $(OBJECTS) |
|||
crt0.s.o: |
|||
$(AS) $(ASFLAGS) crt0.s -o crt0.o |
|||
@ -0,0 +1,457 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org> |
|||
# Copyright (c) 2004 adresd <adresd_ps2dev@yahoo.com> |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* Basic alloc library |
|||
*/ |
|||
|
|||
#include <stdarg.h> |
|||
|
|||
#include "types.h" |
|||
#include "defs.h" |
|||
#include "alloc.h" |
|||
#include "irx_imports.h" |
|||
|
|||
|
|||
#define MODNAME "alloc" |
|||
IRX_ID("Basic alloc library", 1, 1); |
|||
|
|||
extern struct irx_export_table _exp_alloc; |
|||
|
|||
static vs32 alloc_sema = -1; |
|||
|
|||
#define DEFAULT_HEAP_SIZE 128 * 1024 |
|||
|
|||
u32 heap_size = DEFAULT_HEAP_SIZE; |
|||
static u8 * heap_start, * heap_end, * _heap_ptr; |
|||
|
|||
static void alloc_lock() { |
|||
if (alloc_sema >= 0) { |
|||
WaitSema(alloc_sema); |
|||
} |
|||
} |
|||
|
|||
static void alloc_unlock() { |
|||
if (alloc_sema >= 0) { |
|||
SignalSema(alloc_sema); |
|||
} |
|||
} |
|||
|
|||
int _start(int argc, char **argv) |
|||
{ |
|||
iop_sema_t sem_info; |
|||
|
|||
if (RegisterLibraryEntries(&_exp_alloc) != 0) |
|||
return 1; |
|||
|
|||
// check arguments for a heap_size parameter. |
|||
if (argc > 1) { |
|||
heap_size = strtoul(argv[1], NULL, 0); |
|||
} |
|||
|
|||
if (!(heap_start = AllocSysMemory(ALLOC_FIRST, heap_size, NULL))) |
|||
return -1; |
|||
heap_end = heap_start + heap_size; |
|||
_heap_ptr = heap_start; |
|||
|
|||
sem_info.attr = 1; |
|||
sem_info.option = 1; |
|||
sem_info.initial = 1; |
|||
sem_info.max = 1; |
|||
|
|||
alloc_sema = CreateSema(&sem_info); |
|||
|
|||
return 0; |
|||
} |
|||
|
|||
|
|||
int shutdown() |
|||
{ |
|||
if (alloc_sema >= 0) { |
|||
DeleteSema(alloc_sema); |
|||
} |
|||
|
|||
FreeSysMemory(heap_start); |
|||
|
|||
return 0; |
|||
} |
|||
|
|||
/** Use this to set the default malloc() alignment. */ |
|||
#define DEFAULT_ALIGNMENT 16 |
|||
|
|||
#ifndef ALIGN |
|||
#define ALIGN(x, align) (((x)+((align)-1))&~((align)-1)) |
|||
#endif |
|||
|
|||
/* _heap_mem_block_header structure. */ |
|||
typedef struct _heap_mem_header { |
|||
void * ptr; |
|||
size_t size; |
|||
struct _heap_mem_header * prev; |
|||
struct _heap_mem_header * next; |
|||
} heap_mem_header_t; |
|||
|
|||
static void * __alloc_heap_base = NULL; |
|||
static heap_mem_header_t *__alloc_heap_head = NULL; |
|||
static heap_mem_header_t *__alloc_heap_tail = NULL; |
|||
|
|||
static void * alloc_sbrk(size_t increment) |
|||
{ |
|||
u8 *mp, *ret = (void *)-1; |
|||
|
|||
if (increment == 0) |
|||
return _heap_ptr; |
|||
|
|||
/* If the area we want to allocated is past the end of our heap, we have a problem. */ |
|||
mp = _heap_ptr + increment; |
|||
if (mp <= heap_end) { |
|||
ret = _heap_ptr; |
|||
_heap_ptr = mp; |
|||
} |
|||
|
|||
return ret; |
|||
} |
|||
|
|||
/** Find the lowest block that we can allocate AFTER, returning NULL if there are none. */ |
|||
static heap_mem_header_t * _heap_mem_fit(heap_mem_header_t *head, size_t size) |
|||
{ |
|||
heap_mem_header_t *prev_mem = head; |
|||
u32 prev_top, next_bot; |
|||
|
|||
while (prev_mem != NULL) { |
|||
if (prev_mem->next != NULL) { |
|||
prev_top = (u32)prev_mem->ptr + prev_mem->size; |
|||
next_bot = (u32)prev_mem->next - prev_top; |
|||
if (next_bot >= size) |
|||
return prev_mem; |
|||
} |
|||
|
|||
prev_mem = prev_mem->next; |
|||
} |
|||
|
|||
return prev_mem; |
|||
} |
|||
|
|||
void * malloc(size_t size) |
|||
{ |
|||
void *ptr = NULL, *mem_ptr; |
|||
heap_mem_header_t *new_mem, *prev_mem; |
|||
size_t mem_sz, heap_align_bytes; |
|||
|
|||
mem_sz = size + sizeof(heap_mem_header_t); |
|||
|
|||
if ((mem_sz & (DEFAULT_ALIGNMENT - 1)) != 0) |
|||
mem_sz = ALIGN(mem_sz, DEFAULT_ALIGNMENT); |
|||
|
|||
alloc_lock(); |
|||
|
|||
/* If we don't have any allocated blocks, reserve the first block from |
|||
the OS and initialize __alloc_heap_tail. */ |
|||
if (__alloc_heap_head == NULL) { |
|||
/* Align the bottom of the heap to our default alignment. */ |
|||
if (__alloc_heap_base == NULL) { |
|||
heap_align_bytes = (u32)alloc_sbrk(0) & (DEFAULT_ALIGNMENT - 1); |
|||
alloc_sbrk(heap_align_bytes); |
|||
__alloc_heap_base = alloc_sbrk(0); |
|||
} |
|||
|
|||
/* Allocate the physical heap and setup the head block. */ |
|||
if ((mem_ptr = alloc_sbrk(mem_sz)) == (void *)-1) |
|||
return ptr; /* NULL */ |
|||
|
|||
ptr = (void *)((u32)mem_ptr + sizeof(heap_mem_header_t)); |
|||
|
|||
__alloc_heap_head = (heap_mem_header_t *)mem_ptr; |
|||
__alloc_heap_head->ptr = ptr; |
|||
__alloc_heap_head->size = mem_sz - sizeof(heap_mem_header_t); |
|||
__alloc_heap_head->prev = NULL; |
|||
__alloc_heap_head->next = NULL; |
|||
|
|||
__alloc_heap_tail = __alloc_heap_head; |
|||
|
|||
alloc_unlock(); |
|||
return ptr; |
|||
} |
|||
|
|||
/* Check to see if there's free space at the bottom of the heap. */ |
|||
if ((__alloc_heap_base + mem_sz) < (void *)__alloc_heap_head) { |
|||
new_mem = (heap_mem_header_t *)__alloc_heap_base; |
|||
ptr = (void *)((u32)new_mem + sizeof(heap_mem_header_t)); |
|||
|
|||
new_mem->ptr = ptr; |
|||
new_mem->size = mem_sz - sizeof(heap_mem_header_t); |
|||
new_mem->prev = NULL; |
|||
new_mem->next = __alloc_heap_head; |
|||
new_mem->next->prev = new_mem; |
|||
__alloc_heap_head = new_mem; |
|||
|
|||
alloc_unlock(); |
|||
return ptr; |
|||
} |
|||
|
|||
/* See if we can allocate the block without extending the heap. */ |
|||
prev_mem = _heap_mem_fit(__alloc_heap_head, mem_sz); |
|||
if (prev_mem != NULL) { |
|||
new_mem = (heap_mem_header_t *)((u32)prev_mem->ptr + prev_mem->size); |
|||
ptr = (void *)((u32)new_mem + sizeof(heap_mem_header_t)); |
|||
|
|||
new_mem->ptr = ptr; |
|||
new_mem->size = mem_sz - sizeof(heap_mem_header_t); |
|||
new_mem->prev = prev_mem; |
|||
new_mem->next = prev_mem->next; |
|||
new_mem->next->prev = new_mem; |
|||
prev_mem->next = new_mem; |
|||
|
|||
alloc_unlock(); |
|||
return ptr; |
|||
} |
|||
|
|||
/* Extend the heap, but make certain the block is inserted in |
|||
order. */ |
|||
if ((mem_ptr = alloc_sbrk(mem_sz)) == (void *)-1) { |
|||
alloc_unlock(); |
|||
return ptr; /* NULL */ |
|||
} |
|||
|
|||
ptr = (void *)((u32)mem_ptr + sizeof(heap_mem_header_t)); |
|||
|
|||
new_mem = (heap_mem_header_t *)mem_ptr; |
|||
new_mem->ptr = ptr; |
|||
new_mem->size = mem_sz - sizeof(heap_mem_header_t); |
|||
new_mem->prev = __alloc_heap_tail; |
|||
new_mem->next = NULL; |
|||
|
|||
__alloc_heap_tail->next = new_mem; |
|||
__alloc_heap_tail = new_mem; |
|||
|
|||
alloc_unlock(); |
|||
return ptr; |
|||
} |
|||
|
|||
void * realloc(void *ptr, size_t size) |
|||
{ |
|||
heap_mem_header_t *prev_mem; |
|||
void *new_ptr = NULL; |
|||
|
|||
if (!size && ptr != NULL) { |
|||
free(ptr); |
|||
return new_ptr; |
|||
} |
|||
|
|||
if (ptr == NULL) |
|||
return malloc(size); |
|||
|
|||
if ((size & (DEFAULT_ALIGNMENT - 1)) != 0) |
|||
size = ALIGN(size, DEFAULT_ALIGNMENT); |
|||
|
|||
alloc_lock(); |
|||
prev_mem = (heap_mem_header_t *)((u32)ptr - sizeof(heap_mem_header_t)); |
|||
|
|||
|
|||
/* Don't do anything if asked for same sized block. */ |
|||
/* If the new size is shorter, let's just shorten the block. */ |
|||
if (prev_mem->size >= size) { |
|||
/* However, if this is the last block, we have to shrink the heap. */ |
|||
if (!prev_mem->next) |
|||
alloc_sbrk(ptr + size - alloc_sbrk(0)); |
|||
prev_mem->size = size; |
|||
|
|||
alloc_unlock(); |
|||
return ptr; |
|||
} |
|||
|
|||
|
|||
/* We are asked for a larger block of memory. */ |
|||
|
|||
/* Are we the last memory block ? */ |
|||
if (!prev_mem->next) { |
|||
/* Yes, let's just extend the heap then. */ |
|||
if (alloc_sbrk(size - prev_mem->size) == (void*) -1) |
|||
return NULL; |
|||
prev_mem->size = size; |
|||
|
|||
alloc_unlock(); |
|||
return ptr; |
|||
} |
|||
|
|||
/* Is the next block far enough so we can extend the current block ? */ |
|||
if ((prev_mem->next->ptr - ptr) > size) { |
|||
prev_mem->size = size; |
|||
|
|||
alloc_unlock(); |
|||
return ptr; |
|||
} |
|||
|
|||
alloc_unlock(); |
|||
|
|||
/* We got out of luck, let's allocate a new block of memory. */ |
|||
if ((new_ptr = malloc(size)) == NULL) |
|||
return new_ptr; |
|||
|
|||
/* New block is larger, we only copy the old data. */ |
|||
memcpy(new_ptr, ptr, prev_mem->size); |
|||
|
|||
free(ptr); |
|||
return new_ptr; |
|||
} |
|||
|
|||
void * calloc(size_t n, size_t size) |
|||
{ |
|||
void *ptr = NULL; |
|||
size_t sz = n * size; |
|||
|
|||
if ((ptr = malloc(sz)) == NULL) |
|||
return ptr; |
|||
|
|||
memset(ptr, 0, sz); |
|||
return ptr; |
|||
} |
|||
|
|||
void * memalign(size_t align, size_t size) |
|||
{ |
|||
heap_mem_header_t new_mem; |
|||
heap_mem_header_t *cur_mem; |
|||
heap_mem_header_t *old_mem; |
|||
void *ptr = NULL; |
|||
|
|||
if (align <= DEFAULT_ALIGNMENT) |
|||
return malloc(size); |
|||
|
|||
/* Allocate with extra alignment bytes just in case it isn't aligned |
|||
properly by malloc. */ |
|||
if ((ptr = malloc(size + align)) == NULL) |
|||
return ptr; /* NULL */ |
|||
|
|||
/* If malloc returned it aligned for us we're fine. */ |
|||
if (((u32)ptr & (align - 1)) == 0) |
|||
return ptr; |
|||
|
|||
alloc_lock(); |
|||
cur_mem = (heap_mem_header_t *)((u32)ptr - sizeof(heap_mem_header_t)); |
|||
cur_mem->size -= align; |
|||
|
|||
/* Otherwise, align the pointer and fixup our hearder accordingly. */ |
|||
ptr = (void *)ALIGN((u32)ptr, align); |
|||
|
|||
old_mem = cur_mem; |
|||
|
|||
/* Copy the heap_mem_header_t locally, before repositioning (to make |
|||
sure we don't overwrite ourselves. */ |
|||
memcpy(&new_mem, cur_mem, sizeof(heap_mem_header_t)); |
|||
cur_mem = (heap_mem_header_t *)((u32)ptr - sizeof(heap_mem_header_t)); |
|||
memcpy(cur_mem, &new_mem, sizeof(heap_mem_header_t)); |
|||
|
|||
if (cur_mem->prev) |
|||
cur_mem->prev->next = cur_mem; |
|||
if (cur_mem->next) |
|||
cur_mem->next->prev = cur_mem; |
|||
|
|||
if (__alloc_heap_head == old_mem) |
|||
__alloc_heap_head = cur_mem; |
|||
|
|||
if (__alloc_heap_tail == old_mem) |
|||
__alloc_heap_tail = cur_mem; |
|||
|
|||
cur_mem->ptr = ptr; |
|||
|
|||
alloc_unlock(); |
|||
return ptr; |
|||
} |
|||
|
|||
void free(void *ptr) |
|||
{ |
|||
heap_mem_header_t *cur; |
|||
void *heap_top; |
|||
size_t size; |
|||
|
|||
if (!ptr) |
|||
return; |
|||
|
|||
alloc_lock(); |
|||
|
|||
if (!__alloc_heap_head) { |
|||
alloc_unlock(); |
|||
return; |
|||
} |
|||
|
|||
|
|||
/* Freeing the head pointer is a special case. */ |
|||
if (ptr == __alloc_heap_head->ptr) { |
|||
size = __alloc_heap_head->size + |
|||
(size_t)(__alloc_heap_head->ptr - (void *)__alloc_heap_head); |
|||
|
|||
__alloc_heap_head = __alloc_heap_head->next; |
|||
|
|||
if (__alloc_heap_head != NULL) { |
|||
__alloc_heap_head->prev = NULL; |
|||
} else { |
|||
__alloc_heap_tail = NULL; |
|||
|
|||
alloc_sbrk(-size); |
|||
} |
|||
|
|||
alloc_unlock(); |
|||
return; |
|||
} |
|||
|
|||
cur = __alloc_heap_head; |
|||
while (ptr != cur->ptr) { |
|||
/* ptr isn't in our list */ |
|||
if (cur->next == NULL) { |
|||
alloc_unlock(); |
|||
return; |
|||
} |
|||
|
|||
cur = cur->next; |
|||
} |
|||
|
|||
/* Deallocate the block. */ |
|||
if (cur->next != NULL) { |
|||
cur->next->prev = cur->prev; |
|||
} else { |
|||
/* If this block was the last one in the list, shrink the heap. */ |
|||
__alloc_heap_tail = cur->prev; |
|||
|
|||
/* We need to free (heap top) - (prev->ptr + prev->size), or else |
|||
we'll end up with an unallocatable block of heap. */ |
|||
heap_top = alloc_sbrk(0); |
|||
size = (u32)heap_top - (u32)(cur->prev->ptr + cur->prev->size); |
|||
alloc_sbrk(-size); |
|||
} |
|||
|
|||
cur->prev->next = cur->next; |
|||
|
|||
alloc_unlock(); |
|||
} |
|||
|
|||
void * __mem_walk_begin() { |
|||
return __alloc_heap_head; |
|||
} |
|||
|
|||
void __mem_walk_read(void * token, u32 * size, void ** ptr, int * valid) { |
|||
heap_mem_header_t * cur = (heap_mem_header_t *) token; |
|||
|
|||
*valid = 1; |
|||
|
|||
*size = cur->size; |
|||
*ptr = cur->ptr; |
|||
} |
|||
|
|||
void * __mem_walk_inc(void * token) { |
|||
heap_mem_header_t * cur = (heap_mem_header_t *) token; |
|||
|
|||
return cur->next; |
|||
} |
|||
|
|||
int __mem_walk_end(void * token) { |
|||
return token == NULL; |
|||
} |
|||
@ -0,0 +1,45 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* Basic alloc library |
|||
*/ |
|||
|
|||
#ifndef __ALLOC_H__ |
|||
#define __ALLOC_H__ |
|||
|
|||
#include <types.h> |
|||
#include <irx.h> |
|||
|
|||
void * malloc(size_t size); |
|||
void * realloc(void * ptr, size_t size); |
|||
void free(void * ptr); |
|||
void * calloc(size_t n, size_t size); |
|||
void * memalign(size_t align, size_t size); |
|||
void * __mem_walk_begin(); |
|||
void __mem_walk_read(void * token, u32 * size, void ** ptr, int * valid); |
|||
void * __mem_walk_inc(void * token); |
|||
int __mem_walk_end(void * token); |
|||
|
|||
#define alloc_IMPORTS_start DECLARE_IMPORT_TABLE(alloc, 1, 1) |
|||
#define alloc_IMPORTS_end END_IMPORT_TABLE |
|||
|
|||
#define I_malloc DECLARE_IMPORT(4, malloc) |
|||
#define I_realloc DECLARE_IMPORT(5, realloc) |
|||
#define I_free DECLARE_IMPORT(6, free) |
|||
#define I_calloc DECLARE_IMPORT(7, calloc) |
|||
#define I_memalign DECLARE_IMPORT(8, memalign) |
|||
#define I___mem_walk_begin DECLARE_IMPORT(9, __mem_walk_begin) |
|||
#define I___mem_walk_read DECLARE_IMPORT(10, __mem_walk_read) |
|||
#define I___mem_walk_inc DECLARE_IMPORT(11, __mem_walk_inc) |
|||
#define I___mem_walk_end DECLARE_IMPORT(12, __mem_walk_end) |
|||
|
|||
#endif /* __ALLOC_H__ */ |
|||
@ -0,0 +1,12 @@ |
|||
# _____ ___ ____ ___ ____
|
|||
# ____| | ____| | | |____|
|
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
|||
#-----------------------------------------------------------------------
|
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
|
|||
# Licenced under Academic Free License version 2.0
|
|||
# Review ps2sdk README & LICENSE files for further details.
|
|||
|
|||
SUBDIRS = iopdebug iop_sbusdbg ioptrap sior |
|||
|
|||
include $(PS2SDKSRC)/Defs.make |
|||
include $(PS2SDKSRC)/Rules.make |
|||
@ -0,0 +1,29 @@ |
|||
/* |
|||
assert.h |
|||
*/ |
|||
|
|||
#ifdef __cplusplus |
|||
extern "C" { |
|||
#endif |
|||
|
|||
#include "_ansi.h" |
|||
|
|||
#undef assert |
|||
|
|||
#ifdef NDEBUG /* required by ANSI standard */ |
|||
#define assert(p) ((void)0) |
|||
#else |
|||
|
|||
#ifdef __STDC__ |
|||
#define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, #e)) |
|||
#else /* PCC */ |
|||
#define assert(e) ((e) ? (void)0 : __assert(__FILE__, __LINE__, "e")) |
|||
#endif |
|||
|
|||
#endif /* NDEBUG */ |
|||
|
|||
void _EXFUN(__assert,(const char *, int, const char *)); |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
@ -0,0 +1,16 @@ |
|||
# _____ ___ ____ ___ ____
|
|||
# ____| | ____| | | |____|
|
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
|||
#-----------------------------------------------------------------------
|
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
|
|||
# Licenced under Academic Free License version 2.0
|
|||
# Review ps2sdk README & LICENSE files for further details.
|
|||
|
|||
IOP_INCS += -I$(PS2SDKSRC)/common/sbus/include -I$(PS2SDKSRC)/iop/debug/iopdebug/include |
|||
|
|||
IOP_OBJS = main.o sbus_dbg_low.o sbus_tty.o sbus_dbg.o imports.o |
|||
|
|||
include $(PS2SDKSRC)/Defs.make |
|||
include $(PS2SDKSRC)/iop/Rules.bin.make |
|||
include $(PS2SDKSRC)/iop/Rules.make |
|||
include $(PS2SDKSRC)/iop/Rules.release |
|||
@ -0,0 +1,38 @@ |
|||
/** |
|||
* @file |
|||
* IOP SBUS debug library. |
|||
*/ |
|||
|
|||
#ifndef __IOP_SBUSDBG_H__ |
|||
#define __IOP_SBUSDBG_H__ |
|||
|
|||
#include <types.h> |
|||
#include <ps2_debug.h> |
|||
|
|||
int iop_dbg_install(void); |
|||
int iop_dbg_remove(void); |
|||
|
|||
u32 iop_dbg_get_dcic(void); |
|||
u32 iop_dbg_get_bpc(void); |
|||
u32 iop_dbg_get_bpcm(void); |
|||
u32 iop_dbg_get_bda(void); |
|||
u32 iop_dbg_get_bdam(void); |
|||
|
|||
void iop_dbg_set_dcic(u32 v); |
|||
void iop_dbg_set_bpc(u32 v); |
|||
void iop_dbg_set_bpcm(u32 v); |
|||
void iop_dbg_set_bda(u32 v); |
|||
void iop_dbg_set_bdam(u32 v); |
|||
|
|||
void iop_dbg_set_bpr(u32 addr, u32 mask, u32 user_mask); |
|||
void iop_dbg_set_bpw(u32 addr, u32 mask, u32 user_mask); |
|||
void iop_dbg_set_bpx(u32 addr, u32 mask, u32 user_mask); |
|||
|
|||
void iop_dbg_clear(void); |
|||
void iop_dbg_clr_bpda(void); |
|||
void iop_dbg_clr_bpx(void); |
|||
|
|||
void tty_puts(const char *str); |
|||
void signal_iop_exception(IOP_RegFrame *frame); |
|||
|
|||
#endif /* __IOP_SBUSDBG_H__ */ |
|||
@ -0,0 +1,62 @@ |
|||
loadcore_IMPORTS_start |
|||
I_FlushIcache |
|||
I_FlushDcache |
|||
loadcore_IMPORTS_end |
|||
|
|||
sysmem_IMPORTS_start |
|||
I_Kprintf |
|||
I_KprintfSet |
|||
sysmem_IMPORTS_end |
|||
|
|||
stdio_IMPORTS_start |
|||
I_printf |
|||
stdio_IMPORTS_end |
|||
|
|||
sysclib_IMPORTS_start |
|||
I_prnt |
|||
I_setjmp |
|||
I_strcmp |
|||
I_strncmp |
|||
I_strcpy |
|||
I_memcpy |
|||
I_strlen |
|||
I_memcmp |
|||
sysclib_IMPORTS_end |
|||
|
|||
ioman_IMPORTS_start |
|||
I_open |
|||
I_read |
|||
I_close |
|||
I_AddDrv |
|||
I_DelDrv |
|||
ioman_IMPORTS_end |
|||
|
|||
excepman_IMPORTS_start |
|||
I_RegisterDefaultExceptionHandler |
|||
I_RegisterPriorityExceptionHandler |
|||
excepman_IMPORTS_end |
|||
|
|||
intrman_IMPORTS_start |
|||
I_CpuSuspendIntr |
|||
I_CpuResumeIntr |
|||
intrman_IMPORTS_end |
|||
|
|||
sbus_IMPORTS_start |
|||
I_SIF2_send_cmd |
|||
I_SIF2_set_cmd_handler |
|||
I_SBUS_check_intr |
|||
sbus_IMPORTS_end |
|||
|
|||
thbase_IMPORTS_start |
|||
I_GetThreadId |
|||
I_CreateThread |
|||
I_StartThread |
|||
I_SleepThread |
|||
I_iWakeupThread |
|||
thbase_IMPORTS_end |
|||
|
|||
iopdebug_IMPORTS_start |
|||
I_iop_dbg_set_handler |
|||
I_iop_dbg_get_reg_frames |
|||
iopdebug_IMPORTS_end |
|||
|
|||
@ -0,0 +1,30 @@ |
|||
/* |
|||
* irx_imports.h - Defines all IRX imports. |
|||
* |
|||
* Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org> |
|||
* |
|||
* See the file LICENSE included with this distribution for licensing terms. |
|||
*/ |
|||
|
|||
#ifndef IOP_IRX_IMPORTS_H |
|||
#define IOP_IRX_IMPORTS_H |
|||
|
|||
#include "irx.h" |
|||
|
|||
/* Please keep these in alphabetical order! */ |
|||
#include "cdvdman.h" |
|||
#include "loadcore.h" |
|||
#include "sifman.h" |
|||
#include "sifcmd.h" |
|||
#include "stdio.h" |
|||
#include "sysmem.h" |
|||
#include "sysclib.h" |
|||
#include "thbase.h" |
|||
#include "ioman.h" |
|||
#include "modload.h" |
|||
#include "intrman.h" |
|||
#include "excepman.h" |
|||
#include "ps2_sbus.h" |
|||
#include "iopdebug.h" |
|||
|
|||
#endif /* IOP_IRX_IMPORTS_H */ |
|||
@ -0,0 +1,107 @@ |
|||
#include <tamtypes.h> |
|||
#include <stdio.h> |
|||
#include <loadcore.h> |
|||
#include <thbase.h> |
|||
#include <iop_cop0_defs.h> |
|||
#include <ps2_sbus.h> |
|||
#include <iopdebug.h> |
|||
#include <excepman.h> |
|||
#include "sbus_tty.h" |
|||
|
|||
IRX_ID("sbusdebug", 1, 0); |
|||
|
|||
volatile int _iop_controlled = 0; |
|||
volatile int _iop_exception_state = 0; |
|||
|
|||
extern void signal_iop_exception(IOP_RegFrame *frame); |
|||
|
|||
// this is called by the IOP debug/exception handler |
|||
void _iop_ex_handler(IOP_RegFrame *frame) |
|||
{ |
|||
int excode = M_IOP_GET_CAUSE_EXCODE(frame->cause); |
|||
|
|||
if(excode == IOP_EXCEPTION_HDB) |
|||
{ |
|||
_iop_exception_state = 2; |
|||
} |
|||
else |
|||
{ |
|||
_iop_exception_state = 1; |
|||
} |
|||
|
|||
_iop_controlled = 1; |
|||
|
|||
// signal to the EE that an IOP exception occured. |
|||
signal_iop_exception(frame); |
|||
|
|||
// wait for EE to send a "IOP control" command and release the IOP. |
|||
while(_iop_controlled) |
|||
{ |
|||
// since we're spinning in an interrupt-disabled state, we have to manually |
|||
// poll for SBUS interrupts from EE, otherwise we'll never get released! |
|||
SBUS_check_intr(); |
|||
} |
|||
} |
|||
|
|||
int tid; |
|||
|
|||
extern void soft_break(void); |
|||
|
|||
void _controller_thread(void) |
|||
{ |
|||
while(1) |
|||
{ |
|||
// printf("IOP: Controller thread going to sleep(%d)...\n", _iop_exception_state); |
|||
SleepThread(); |
|||
// printf("IOP: Controller thread woke up!\n"); |
|||
soft_break(); |
|||
} |
|||
} |
|||
|
|||
void create_th(void) |
|||
{ |
|||
iop_thread_t param; |
|||
|
|||
param.attr = TH_C; |
|||
param.thread = (void *) _controller_thread; |
|||
param.priority = 9; // highest possible priority |
|||
param.stacksize = 512; // tiny stack, not much is needed! |
|||
param.option = 0; |
|||
|
|||
tid = CreateThread(¶m); |
|||
StartThread(tid, 0); |
|||
} |
|||
|
|||
extern void SBUS_dbg_init(void); |
|||
|
|||
int _start(int argc, char *argv[]) |
|||
{ |
|||
int i; |
|||
|
|||
for(i = 2; i <= 7; i++) |
|||
{ |
|||
iop_dbg_set_handler(i, (IOP_ExceptionHandler *) _iop_ex_handler); |
|||
} |
|||
|
|||
for(i = 9; i <= 15; i++) |
|||
{ |
|||
iop_dbg_set_handler(i, (IOP_ExceptionHandler *) _iop_ex_handler); |
|||
} |
|||
|
|||
create_th(); |
|||
|
|||
if(sbus_tty_init() != 0) |
|||
{ |
|||
printf("Failed initializing SBUS TTY system!\n"); |
|||
return(1); |
|||
} |
|||
|
|||
SBUS_dbg_init(); |
|||
|
|||
FlushIcache(); |
|||
FlushDcache(); |
|||
|
|||
printf("IOP SBUS Debug installed!\n"); |
|||
|
|||
return(0); // return resident! |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
#include <tamtypes.h> |
|||
#include <stdio.h> |
|||
#include <stdarg.h> |
|||
#include <sysclib.h> |
|||
#include <sysmem.h> |
|||
#include <excepman.h> |
|||
#include <intrman.h> |
|||
#include <loadcore.h> |
|||
#include <thbase.h> |
|||
#include <ioman.h> |
|||
#include <ps2_debug.h> |
|||
#include <ps2_sbus.h> |
|||
|
|||
#include "iopdebug.h" |
|||
|
|||
#define SIF2_CMD_DBG_PUTS (1) |
|||
#define SIF2_CMD_DBG_EXC (2) |
|||
#define SIF2_CMD_DBG_CTRL (3) |
|||
|
|||
extern int _iop_exception_state; |
|||
|
|||
static IOP_RegFrame *_iop_ex_def_frame; |
|||
static IOP_RegFrame *_iop_ex_dbg_frame; |
|||
|
|||
typedef struct st_SBUS_ControlCPU_Params |
|||
{ |
|||
u32 mode; // 0 = update register frame and release, 1 = control |
|||
IOP_RegFrame reg_frame; |
|||
} SBUS_ControlCPU_Params; |
|||
|
|||
extern int _iop_controlled; |
|||
|
|||
// send a string to EE for output. |
|||
void sbus_tty_puts(const char *str) |
|||
{ |
|||
SIF2_send_cmd(SIF2_CMD_DBG_PUTS, (void *) str, strlen(str) + 1); |
|||
} |
|||
|
|||
void signal_iop_exception(IOP_RegFrame *frame) |
|||
{ |
|||
SIF2_send_cmd(SIF2_CMD_DBG_EXC, (void *) frame, sizeof(IOP_RegFrame)); |
|||
} |
|||
|
|||
extern int tid; |
|||
|
|||
void _sif2_cmd_dbg_control(SIF2_CmdPkt *cmd, void *param) |
|||
{ |
|||
SBUS_ControlCPU_Params *params; |
|||
IOP_RegFrame *frame; |
|||
|
|||
params = (SBUS_ControlCPU_Params *) ((((u32) cmd) + sizeof(SIF2_CmdPkt)) | 0x00000000); |
|||
|
|||
if(params->mode == 1) |
|||
{ |
|||
// wake up the controller thread. |
|||
iWakeupThread(tid); |
|||
} |
|||
else |
|||
{ |
|||
if(_iop_exception_state == 0) { return; } |
|||
|
|||
if(_iop_exception_state == 1) { frame = _iop_ex_def_frame; } |
|||
else { frame = _iop_ex_dbg_frame; } |
|||
|
|||
// update the register frame and release the CPU. |
|||
memcpy(frame, ¶ms->reg_frame, sizeof(IOP_RegFrame)); |
|||
|
|||
FlushIcache(); |
|||
FlushDcache(); |
|||
|
|||
_iop_exception_state = 0; |
|||
_iop_controlled = 0; |
|||
} |
|||
} |
|||
|
|||
void SBUS_dbg_init(void) |
|||
{ |
|||
iop_dbg_get_reg_frames(&_iop_ex_def_frame, &_iop_ex_dbg_frame); |
|||
SIF2_set_cmd_handler(SIF2_CMD_DBG_CTRL, &_sif2_cmd_dbg_control, NULL); |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
.set push |
|||
.set noreorder |
|||
.set noat |
|||
|
|||
.global soft_break |
|||
.ent soft_break |
|||
soft_break: |
|||
nop |
|||
break |
|||
nop |
|||
jr $ra |
|||
nop |
|||
.end soft_break |
|||
|
|||
.set pop |
|||
@ -0,0 +1,176 @@ |
|||
/* |
|||
|
|||
IOP->EE TTY over SBUS by Herben |
|||
|
|||
This file contains the file system driver and glue needed to create a TTY file file system and redirect it to EE over SBUS. |
|||
|
|||
Additionally it installs a Kprintf handler so you can even see the things you don't normally see like the error messages WaitSema gives |
|||
for those naughty ps2ip modules. ;) |
|||
|
|||
Of course this requires that the EE-side code accept this command and output the string to screen/sio... |
|||
|
|||
*/ |
|||
|
|||
#include <tamtypes.h> |
|||
#include <stdio.h> |
|||
#include <stdarg.h> |
|||
#include <sysclib.h> |
|||
#include <sysmem.h> |
|||
#include <excepman.h> |
|||
#include <intrman.h> |
|||
#include <ioman.h> |
|||
#include <fileXio.h> |
|||
#include <ps2_debug.h> |
|||
#include <ps2_sbus.h> |
|||
|
|||
#include "iopdebug.h" |
|||
|
|||
extern void sbus_tty_puts(const char *str); |
|||
|
|||
static int ttyfs_error() { return -1; } |
|||
|
|||
static int ttyfs_init() |
|||
{ |
|||
//DBG_puts("SIOTTY: FS Init()\n"); |
|||
return 0; |
|||
} |
|||
|
|||
static int ttyfs_deinit() |
|||
{ |
|||
//DBG_puts("SIOTTY: FS Deinit()\n"); |
|||
return 0; |
|||
} |
|||
|
|||
static int ttyfs_open(iop_file_t *file, const char *name, int flags, int mode) |
|||
{ |
|||
//DBG_puts("SIOTTY: FS Open()\n"); |
|||
return 0; |
|||
} |
|||
|
|||
static int ttyfs_close(iop_file_t *file, int fd) |
|||
{ |
|||
//DBG_puts("SIOTTY: FS Close()\n"); |
|||
return(0); |
|||
} |
|||
|
|||
static int ttyfs_read(iop_file_t *file, void *ptr, size_t size) { |
|||
//DBG_puts("SIOTTY: FS Read()\n"); |
|||
return(-1); |
|||
} |
|||
|
|||
static int ttyfs_write(iop_file_t *file, u8 *ptr, size_t size) { |
|||
char temp[65]; |
|||
int bCount = 0, toWrite; |
|||
|
|||
//DBG_puts("SIOTTY: FS Write()\n"); |
|||
|
|||
while(bCount < size) |
|||
{ |
|||
toWrite = (size - bCount); |
|||
if(toWrite > 64) |
|||
toWrite = 64; |
|||
|
|||
memcpy(temp, &ptr[bCount], toWrite); |
|||
temp[toWrite] = '\0'; |
|||
sbus_tty_puts(temp); |
|||
|
|||
bCount += toWrite; |
|||
} |
|||
|
|||
return(bCount); |
|||
} |
|||
|
|||
static int ttyfs_lseek(iop_file_t *file, int offset, int mode) { |
|||
//DBG_puts("SIOTTY: FS Lseek()\n"); |
|||
|
|||
return(-1); |
|||
} |
|||
|
|||
static int ttyfs_format(iop_file_t *file, const char *dev, const char *blockdev, void *arg, size_t arglen) { |
|||
//DBG_puts("SIOTTY: FS Format()\n"); |
|||
|
|||
return(-1); |
|||
} |
|||
|
|||
static int ttyfs_remove(iop_file_t *file, const char *name) { |
|||
//DBG_puts("SIOTTY: FS Remove()\n"); |
|||
|
|||
return(-1); |
|||
} |
|||
|
|||
static int ttyfs_dread(iop_file_t *file, iox_dirent_t *dirent) { |
|||
//DBG_puts("SIOTTY: FS Dread()\n"); |
|||
|
|||
return(-1); |
|||
} |
|||
|
|||
static int ttyfs_getstat(iop_file_t *file, const char *name, iox_stat_t *stat) { |
|||
//DBG_puts("SIOTTY: FS GetStat()\n"); |
|||
|
|||
return(-1); |
|||
} |
|||
|
|||
static int ttyfs_devctl(iop_file_t *file, const char *name, int cmd, void *arg, size_t arglen, void *buf, size_t buflen) { |
|||
//DBG_puts("SIOTTY: FS DEVCTL()\n"); |
|||
|
|||
return(-1); |
|||
} |
|||
|
|||
static int ttyfs_ioctl2(iop_file_t *file, int cmd, void *arg, size_t arglen, void *buf, size_t buflen) { |
|||
//DBG_puts("SIOTTY: FS IOCTL2()\n"); |
|||
|
|||
return(-1); |
|||
} |
|||
|
|||
|
|||
static void *fsd_ops[] = { ttyfs_init, ttyfs_deinit, ttyfs_format, ttyfs_open, ttyfs_close, |
|||
ttyfs_read, ttyfs_write, ttyfs_lseek, ttyfs_error, ttyfs_remove, ttyfs_error, ttyfs_error, |
|||
ttyfs_open, ttyfs_close, ttyfs_dread, ttyfs_getstat, ttyfs_error, ttyfs_error, ttyfs_error, |
|||
ttyfs_error, ttyfs_error, ttyfs_error, ttyfs_error, ttyfs_devctl, ttyfs_error, ttyfs_error, |
|||
ttyfs_ioctl2 |
|||
}; |
|||
|
|||
iop_device_t tty_fsd = |
|||
{ |
|||
"tty", |
|||
0x10, |
|||
1, |
|||
"TTY via EE SIO", |
|||
(iop_device_ops_t *) &fsd_ops |
|||
}; |
|||
|
|||
void sprintf_putchar(void *context, int c) |
|||
{ |
|||
char **string = (char **)context; |
|||
|
|||
if(c < 0x100) { ((*string)++)[0] = c; } |
|||
else { (*string)[0] = 0; } |
|||
} |
|||
|
|||
extern int _vsprintf(char * str, const char * format, va_list ap); |
|||
|
|||
static char kprint_buffer[1024]; |
|||
|
|||
int _kPrintf(void *context, const char * format, va_list ap) |
|||
{ |
|||
int r = prnt(&sprintf_putchar, &format, format, ap); |
|||
sbus_tty_puts(kprint_buffer); |
|||
return r; |
|||
} |
|||
|
|||
int sbus_tty_init(void) |
|||
{ |
|||
close(0); |
|||
close(1); |
|||
DelDrv("tty"); |
|||
DelDrv("dummytty"); |
|||
|
|||
if(AddDrv(&tty_fsd) != 0) { return(-1); } |
|||
|
|||
open("tty:", O_RDONLY); |
|||
open("tty:", O_WRONLY); |
|||
|
|||
KprintfSet(&_kPrintf, NULL); |
|||
|
|||
return(0); |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
#ifndef _SBUS_TTY_H |
|||
#define _SBUS_TTY_H |
|||
|
|||
#include "tamtypes.h" |
|||
|
|||
// Prototypes |
|||
int sbus_tty_init(void); |
|||
|
|||
#endif |
|||
@ -0,0 +1,14 @@ |
|||
# _____ ___ ____ ___ ____
|
|||
# ____| | ____| | | |____|
|
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
|||
#-----------------------------------------------------------------------
|
|||
# Copyright 2001-2009, ps2dev - http://www.ps2dev.org
|
|||
# Licenced under Academic Free License version 2.0
|
|||
# Review ps2sdk README & LICENSE files for further details.
|
|||
|
|||
IOP_OBJS = main.o iop_debug.o iop_exceptions.o iop_dbg_low.o imports.o exports.o |
|||
|
|||
include $(PS2SDKSRC)/Defs.make |
|||
include $(PS2SDKSRC)/iop/Rules.bin.make |
|||
include $(PS2SDKSRC)/iop/Rules.make |
|||
include $(PS2SDKSRC)/iop/Rules.release |
|||
@ -0,0 +1,79 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2009, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* IOPDEBUG - IOP debugging library. |
|||
* Definitions for the IOPDEBUG library. |
|||
*/ |
|||
|
|||
#ifndef __IOPDEBUG_H__ |
|||
#define __IOPDEBUG_H__ |
|||
|
|||
#include <types.h> |
|||
#include <irx.h> |
|||
#include <iop_cop0_defs.h> |
|||
#include <ps2_debug.h> |
|||
|
|||
typedef int (IOP_ExceptionHandler)(struct st_IOP_RegFrame *); |
|||
|
|||
int iop_dbg_install(void); |
|||
int iop_dbg_remove(void); |
|||
IOP_ExceptionHandler *iop_dbg_get_handler(int cause); |
|||
IOP_ExceptionHandler *iop_dbg_set_handler(int cause, IOP_ExceptionHandler *handler); |
|||
void iop_dbg_get_reg_frames(IOP_RegFrame **def_frame_ptr, IOP_RegFrame **dbg_frame_ptr); |
|||
u32 iop_dbg_get_dcic(void); |
|||
void iop_dbg_set_dcic(u32 v); |
|||
|
|||
u32 iop_dbg_get_bpc(void); |
|||
void iop_dbg_set_bpc(u32 v); |
|||
|
|||
u32 iop_dbg_get_bpcm(void); |
|||
void iop_dbg_set_bpcm(u32 v); |
|||
|
|||
u32 iop_dbg_get_bda(void); |
|||
void iop_dbg_set_bda(u32 v); |
|||
u32 iop_dbg_get_bdam(void); |
|||
void iop_dbg_set_bdam(u32 v); |
|||
|
|||
void iop_dbg_set_bpr(u32 addr, u32 mask, u32 user_mask); |
|||
void iop_dbg_set_bpw(u32 addr, u32 mask, u32 user_mask); |
|||
void iop_dbg_set_bpx(u32 addr, u32 mask, u32 user_mask); |
|||
|
|||
void iop_dbg_clr_bps(void); |
|||
void iop_dbg_clr_bpda(void); |
|||
void iop_dbg_clr_bpx(void); |
|||
|
|||
#define iopdebug_IMPORTS_start DECLARE_IMPORT_TABLE(iopdebug, 1, 1) |
|||
#define iopdebug_IMPORTS_end END_IMPORT_TABLE |
|||
|
|||
#define I_iop_dbg_install DECLARE_IMPORT(5, iop_dbg_install) |
|||
#define I_iop_dbg_remove DECLARE_IMPORT(6, iop_dbg_remove) |
|||
#define I_iop_dbg_get_handler DECLARE_IMPORT(7, iop_dbg_get_handler) |
|||
#define I_iop_dbg_set_handler DECLARE_IMPORT(8, iop_dbg_set_handler) |
|||
#define I_iop_dbg_get_reg_frames DECLARE_IMPORT(9, iop_dbg_get_reg_frames) |
|||
#define I_iop_dbg_get_dcic DECLARE_IMPORT(10, iop_dbg_get_dcic) |
|||
#define I_iop_dbg_set_dcic DECLARE_IMPORT(11, iop_dbg_set_dcic) |
|||
#define I_iop_dbg_get_bpc DECLARE_IMPORT(12, iop_dbg_get_bpc) |
|||
#define I_iop_dbg_set_bpc DECLARE_IMPORT(13, iop_dbg_set_bpc) |
|||
#define I_iop_dbg_get_bpcm DECLARE_IMPORT(14, iop_dbg_get_bpcm) |
|||
#define I_iop_dbg_set_bpcm DECLARE_IMPORT(15, iop_dbg_set_bpcm) |
|||
#define I_iop_dbg_bda DECLARE_IMPORT(16, iop_dbg_bda) |
|||
#define I_iop_dbg_set_bda DECLARE_IMPORT(17, iop_dbg_set_bda) |
|||
#define I_iop_dbg_bdam DECLARE_IMPORT(18, iop_dbg_bdam) |
|||
#define I_iop_dbg_set_bdam DECLARE_IMPORT(19, iop_dbg_bdam) |
|||
#define I_iop_dbg_set_bpr DECLARE_IMPORT(20, iop_dbg_set_bpr) |
|||
#define I_iop_dbg_set_bpw DECLARE_IMPORT(21, iop_dbg_set_bpw) |
|||
#define I_iop_dbg_set_bpx DECLARE_IMPORT(22, iop_dbg_bpx) |
|||
#define I_iop_dbg_clr_bps DECLARE_IMPORT(23, iop_dbg_clr_bps) |
|||
#define I_iop_dbg_clr_bpda DECLARE_IMPORT(24, iop_dbg_clr_bpda) |
|||
#define I_iop_dbg_clr_bpx DECLARE_IMPORT(25, iop_dbg_clr_bpx) |
|||
|
|||
#endif /* __IOPDEBUG_H__ */ |
|||
@ -0,0 +1,39 @@ |
|||
/* Exports for IOPDEBUG */ |
|||
|
|||
DECLARE_EXPORT_TABLE(iopdebug, 1, 1) |
|||
DECLARE_EXPORT(_start) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_stop) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_retonly) |
|||
/* 5 */ |
|||
DECLARE_EXPORT(iop_dbg_install) |
|||
DECLARE_EXPORT(iop_dbg_remove) |
|||
DECLARE_EXPORT(iop_dbg_get_handler) |
|||
DECLARE_EXPORT(iop_dbg_set_handler) |
|||
DECLARE_EXPORT(iop_dbg_get_reg_frames) |
|||
/* 10 */ |
|||
DECLARE_EXPORT(iop_dbg_get_dcic) |
|||
DECLARE_EXPORT(iop_dbg_set_dcic) |
|||
DECLARE_EXPORT(iop_dbg_get_bpc) |
|||
DECLARE_EXPORT(iop_dbg_set_bpc) |
|||
DECLARE_EXPORT(iop_dbg_get_bpcm) |
|||
/* 15 */ |
|||
DECLARE_EXPORT(iop_dbg_set_bpcm) |
|||
DECLARE_EXPORT(iop_dbg_get_bda) |
|||
DECLARE_EXPORT(iop_dbg_set_bda) |
|||
DECLARE_EXPORT(iop_dbg_get_bdam) |
|||
DECLARE_EXPORT(iop_dbg_set_bdam) |
|||
/* 20 */ |
|||
DECLARE_EXPORT(iop_dbg_set_bpr) |
|||
DECLARE_EXPORT(iop_dbg_set_bpw) |
|||
DECLARE_EXPORT(iop_dbg_set_bpx) |
|||
DECLARE_EXPORT(iop_dbg_clr_bps) |
|||
DECLARE_EXPORT(iop_dbg_clr_bpda) |
|||
/* 25 */ |
|||
DECLARE_EXPORT(iop_dbg_clr_bpx) |
|||
|
|||
END_EXPORT_TABLE |
|||
|
|||
void _retonly() {} |
|||
|
|||
@ -0,0 +1,31 @@ |
|||
loadcore_IMPORTS_start |
|||
I_RegisterLibraryEntries |
|||
I_FlushIcache |
|||
I_FlushDcache |
|||
loadcore_IMPORTS_end |
|||
|
|||
stdio_IMPORTS_start |
|||
I_printf |
|||
stdio_IMPORTS_end |
|||
|
|||
sysclib_IMPORTS_start |
|||
I_prnt |
|||
I_setjmp |
|||
I_strcmp |
|||
I_strncmp |
|||
I_strcpy |
|||
I_memcpy |
|||
I_strlen |
|||
I_memcmp |
|||
sysclib_IMPORTS_end |
|||
|
|||
excepman_IMPORTS_start |
|||
I_RegisterDefaultExceptionHandler |
|||
I_RegisterPriorityExceptionHandler |
|||
excepman_IMPORTS_end |
|||
|
|||
intrman_IMPORTS_start |
|||
I_CpuSuspendIntr |
|||
I_CpuResumeIntr |
|||
intrman_IMPORTS_end |
|||
|
|||
@ -0,0 +1,172 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2009, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* IOPDEBUG - IOP debugging library. |
|||
* low-level IOP "debug" helper functions. |
|||
*/ |
|||
|
|||
#include <iop_cop0_defs.h> |
|||
#include "iopdebug_defs.h" |
|||
#include "as_reg_compat.h" |
|||
|
|||
.set push |
|||
.set noreorder |
|||
.set noat |
|||
|
|||
.global iop_dbg_get_dcic |
|||
.ent iop_dbg_get_dcic |
|||
iop_dbg_get_dcic: |
|||
mfc0 $v0, IOP_COP0_DCIC |
|||
nop |
|||
jr $ra |
|||
nop |
|||
.end iop_dbg_get_dcic |
|||
|
|||
.global iop_dbg_get_bpc |
|||
.ent iop_dbg_get_bpc |
|||
iop_dbg_get_bpc: |
|||
mtc0 $v0, IOP_COP0_BPC |
|||
nop |
|||
jr $ra |
|||
nop |
|||
.end iop_dbg_get_bpc |
|||
|
|||
.global iop_dbg_get_bpcm |
|||
.ent iop_dbg_get_bpcm |
|||
iop_dbg_get_bpcm: |
|||
mfc0 $v0, IOP_COP0_BPCM |
|||
nop |
|||
jr $ra |
|||
nop |
|||
|
|||
.end iop_dbg_get_bpcm |
|||
|
|||
.global iop_dbg_get_bda |
|||
.ent iop_dbg_get_bda |
|||
iop_dbg_get_bda: |
|||
mfc0 $v0, IOP_COP0_BDA |
|||
nop |
|||
jr $ra |
|||
nop |
|||
.end iop_dbg_get_bda |
|||
|
|||
.global iop_dbg_get_bdam |
|||
.ent iop_dbg_get_bdam |
|||
iop_dbg_get_bdam: |
|||
mfc0 $v0, IOP_COP0_BDAM |
|||
nop |
|||
jr $ra |
|||
nop |
|||
.end iop_dbg_get_bdam |
|||
|
|||
.global iop_dbg_set_dcic |
|||
.ent iop_dbg_set_dcic |
|||
iop_dbg_set_dcic: |
|||
mtc0 $a0, IOP_COP0_DCIC |
|||
nop |
|||
jr $ra |
|||
nop |
|||
.end iop_dbg_set_dcic |
|||
|
|||
.global iop_dbg_set_bpc |
|||
.ent iop_dbg_set_bpc |
|||
iop_dbg_set_bpc: |
|||
mtc0 $a0, IOP_COP0_BPC |
|||
nop |
|||
jr $ra |
|||
nop |
|||
.end iop_dbg_set_bpc |
|||
|
|||
.global iop_dbg_set_bpcm |
|||
.ent iop_dbg_set_bpcm |
|||
iop_dbg_set_bpcm: |
|||
mtc0 $a0, IOP_COP0_BPCM |
|||
nop |
|||
jr $ra |
|||
nop |
|||
.end iop_dbg_set_bpcm |
|||
|
|||
|
|||
.global iop_dbg_set_bda |
|||
.ent iop_dbg_set_bda |
|||
iop_dbg_set_bda: |
|||
mtc0 $a0, IOP_COP0_BDA |
|||
nop |
|||
jr $ra |
|||
nop |
|||
.end iop_dbg_set_bda |
|||
|
|||
.global iop_dbg_set_bdam |
|||
.ent iop_dbg_set_bdam |
|||
iop_dbg_set_bdam: |
|||
mtc0 $a0, IOP_COP0_BDAM |
|||
nop |
|||
jr $ra |
|||
nop |
|||
.end iop_dbg_set_bdam |
|||
|
|||
.global _iop_dbg_set_bpda |
|||
.ent _iop_dbg_set_bpda |
|||
_iop_dbg_set_bpda: |
|||
|
|||
mfc0 $t0, IOP_COP0_DCIC |
|||
nop |
|||
nop |
|||
mtc0 $zero, IOP_COP0_DCIC |
|||
nop |
|||
nop |
|||
|
|||
mtc0 $a0, IOP_COP0_BDA |
|||
mtc0 $a1, IOP_COP0_BDAM |
|||
|
|||
li $t1, ~(IOP_DCIC_DR | IOP_DCIC_DW) |
|||
and $t0, $t0, $t1 |
|||
|
|||
li $t1, (IOP_DCIC_TR | IOP_DCIC_DAE | IOP_DCIC_DE) |
|||
or $t0, $t0, $t1 |
|||
or $t0, $t0, $a2 |
|||
mtc0 $t0, IOP_COP0_DCIC |
|||
nop |
|||
jr $ra |
|||
nop |
|||
|
|||
.end _iop_dbg_set_bpda |
|||
|
|||
.global _iop_dbg_set_bpx |
|||
.ent _iop_dbg_set_bpx |
|||
_iop_dbg_set_bpx: |
|||
|
|||
mfc0 $t0, IOP_COP0_DCIC |
|||
nop |
|||
nop |
|||
mtc0 $zero, IOP_COP0_DCIC |
|||
nop |
|||
nop |
|||
|
|||
mtc0 $a0, IOP_COP0_BPC |
|||
mtc0 $a1, IOP_COP0_BPCM |
|||
nop |
|||
|
|||
li $t1, ~(IOP_DCIC_PC) |
|||
and $t0, $t0, $t1 |
|||
|
|||
li $t1, (IOP_DCIC_TR | IOP_DCIC_PCE | IOP_DCIC_DE) |
|||
or $t0, $t0, $t1 |
|||
or $t0, $t0, $a2 |
|||
mtc0 $t0, IOP_COP0_DCIC |
|||
nop |
|||
jr $ra |
|||
nop |
|||
|
|||
.end _iop_dbg_set_bpx |
|||
|
|||
.set pop |
|||
@ -0,0 +1,198 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2009, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* IOPDEBUG - IOP debugging library. |
|||
* high-level IOP debugging library code. |
|||
*/ |
|||
|
|||
#include <tamtypes.h> |
|||
#include <excepman.h> |
|||
#include <iop_cop0_defs.h> |
|||
#include <ps2_debug.h> |
|||
|
|||
#include "iopdebug.h" |
|||
#include "iopdebug_priv.h" |
|||
#include "iopdebug_defs.h" |
|||
|
|||
u32 _iop_ex_def_stack[_EX_DEF_STACK_SIZE / 4]; |
|||
u32 _iop_ex_dbg_stack[_EX_DBG_STACK_SIZE / 4]; |
|||
|
|||
IOP_RegFrame _iop_ex_def_frame; |
|||
IOP_RegFrame _iop_ex_dbg_frame; |
|||
|
|||
static int _is_iop_dbg_installed = 0; |
|||
|
|||
static void *orig_iop_def_ex_handler = NULL; |
|||
static void *orig_iop_break_ex_handler = NULL; |
|||
static void *orig_iop_dbg_ex_handler = NULL; |
|||
|
|||
static IOP_ExceptionHandler *iop_exception_handlers[16]; |
|||
|
|||
IOP_ExceptionHandler *iop_dbg_get_handler(int cause) |
|||
{ |
|||
if((cause < 0) || (cause > 15)) { return(NULL); } |
|||
|
|||
return(iop_exception_handlers[cause]); |
|||
} |
|||
|
|||
IOP_ExceptionHandler *iop_dbg_set_handler(int cause, IOP_ExceptionHandler *handler) |
|||
{ |
|||
IOP_ExceptionHandler *old_handler; |
|||
u32 old_state; |
|||
|
|||
if((cause < 0) || (cause > 15)) { return(NULL); } |
|||
|
|||
EnterCritical(&old_state); |
|||
|
|||
old_handler = iop_exception_handlers[cause]; |
|||
iop_exception_handlers[cause] = handler; |
|||
|
|||
ExitCritical(old_state); |
|||
|
|||
return(old_handler); |
|||
} |
|||
|
|||
// this is called by the IOP debug/exception handlers |
|||
void iop_exception_dispatcher(IOP_RegFrame *frame) |
|||
{ |
|||
int excode = M_IOP_GET_CAUSE_EXCODE(frame->cause); |
|||
IOP_ExceptionHandler *handler = iop_exception_handlers[excode]; |
|||
|
|||
if(handler) |
|||
{ |
|||
handler(frame); |
|||
} |
|||
} |
|||
|
|||
extern void _iop_dbg_set_bpda(u32 addr, u32 mask, u32 user_mask); |
|||
extern void _iop_dbg_set_bpx(u32 addr, u32 mask, u32 user_mask); |
|||
|
|||
// ex: iop_dbg_set_bpr(&var, 0xFFFFFFFF, (IOP_DCIC_UD | IOP_DCIC_KD)); |
|||
void iop_dbg_set_bpr(u32 addr, u32 mask, u32 user_mask) { _iop_dbg_set_bpda(addr, mask, IOP_DCIC_DR | user_mask); } |
|||
|
|||
// ex: iop_dbg_set_bpw(&var, 0xFFFFFFFF, (IOP_DCIC_UD | IOP_DCIC_KD)); |
|||
void iop_dbg_set_bpw(u32 addr, u32 mask, u32 user_mask) { _iop_dbg_set_bpda(addr, mask, IOP_DCIC_DW | user_mask); } |
|||
|
|||
// ex: iop_dbg_set_bpx(&func, 0xFFFFFFFF, (IOP_DCIC_UD | IOP_DCIC_KD)); |
|||
void iop_dbg_set_bpx(u32 addr, u32 mask, u32 user_mask) { _iop_dbg_set_bpx(addr, mask, user_mask); } |
|||
|
|||
void iop_dbg_clr_bpda(void) |
|||
{ |
|||
u32 dcic = iop_dbg_get_dcic(); |
|||
dcic &= ~(IOP_DCIC_DW | IOP_DCIC_DR | IOP_DCIC_DAE); |
|||
if(!(dcic & IOP_DCIC_PCE)) { dcic = 0; } |
|||
iop_dbg_set_dcic(dcic); |
|||
} |
|||
|
|||
void iop_dbg_clr_bpx(void) |
|||
{ |
|||
u32 dcic = iop_dbg_get_dcic(); |
|||
dcic &= ~(IOP_DCIC_PCE); |
|||
if(!(dcic & IOP_DCIC_DAE)) { dcic = 0; } |
|||
iop_dbg_set_dcic(dcic); |
|||
} |
|||
|
|||
void iop_dbg_clr_bps(void) |
|||
{ |
|||
iop_dbg_set_dcic(0); |
|||
iop_dbg_set_bda(0); |
|||
iop_dbg_set_bdam(0); |
|||
iop_dbg_set_bpc(0); |
|||
iop_dbg_set_bpcm(0); |
|||
} |
|||
|
|||
extern void _iop_ex_def_handler(void); |
|||
extern void _iop_ex_dbg_handler(void); |
|||
extern void _iop_ex_break_handler(void); |
|||
|
|||
int iop_dbg_install(void) |
|||
{ |
|||
int i; |
|||
|
|||
// if already installed, return with an error. |
|||
if(_is_iop_dbg_installed) { return(-1); } |
|||
|
|||
// initialize our exception handler pointers. |
|||
for(i = 0; i < 16; i++) |
|||
{ |
|||
iop_exception_handlers[i] = NULL; |
|||
} |
|||
|
|||
// todo: preserve original exception handlers here! |
|||
// This will require using "EXCEPMAN" export 3.. |
|||
|
|||
// register our "default" exception handler. |
|||
if(RegisterDefaultExceptionHandler((exception_handler_t) _iop_ex_def_handler) < 0) |
|||
{ |
|||
orig_iop_def_ex_handler = NULL; |
|||
return(-2); |
|||
} |
|||
|
|||
// register our "BREAK" instruction exception handler. |
|||
if(RegisterPriorityExceptionHandler(IOP_EXCEPTION_BP, 0, (exception_handler_t) _iop_ex_break_handler) < 0) |
|||
{ |
|||
RegisterDefaultExceptionHandler((exception_handler_t) orig_iop_def_ex_handler); |
|||
orig_iop_def_ex_handler = NULL; |
|||
orig_iop_break_ex_handler = NULL; |
|||
return(-3); |
|||
} |
|||
|
|||
// register our "Hardware DeBug"(aka "Hardware BreakPoint") exception handler. |
|||
if(RegisterPriorityExceptionHandler(IOP_EXCEPTION_HDB, 0, (exception_handler_t) _iop_ex_dbg_handler) < 0) |
|||
{ |
|||
RegisterDefaultExceptionHandler((exception_handler_t) orig_iop_def_ex_handler); |
|||
orig_iop_def_ex_handler = NULL; |
|||
|
|||
RegisterPriorityExceptionHandler(IOP_EXCEPTION_BP, 0, (exception_handler_t) orig_iop_break_ex_handler); |
|||
orig_iop_break_ex_handler = NULL; |
|||
|
|||
orig_iop_dbg_ex_handler = NULL; |
|||
return(-4); |
|||
} |
|||
|
|||
_is_iop_dbg_installed = 1; |
|||
return(0); |
|||
} |
|||
|
|||
int iop_dbg_remove(void) |
|||
{ |
|||
// if not installed, return with an error. |
|||
if(!_is_iop_dbg_installed) { return(-1); } |
|||
|
|||
if(orig_iop_def_ex_handler) |
|||
{ |
|||
RegisterDefaultExceptionHandler((exception_handler_t) orig_iop_def_ex_handler); |
|||
orig_iop_def_ex_handler = NULL; |
|||
} |
|||
|
|||
if(orig_iop_break_ex_handler) |
|||
{ |
|||
RegisterPriorityExceptionHandler(IOP_EXCEPTION_BP, 0, (exception_handler_t) orig_iop_break_ex_handler); |
|||
orig_iop_break_ex_handler = NULL; |
|||
} |
|||
|
|||
if(orig_iop_dbg_ex_handler) |
|||
{ |
|||
RegisterPriorityExceptionHandler(IOP_EXCEPTION_HDB, 0, (exception_handler_t) orig_iop_dbg_ex_handler); |
|||
orig_iop_dbg_ex_handler = NULL; |
|||
} |
|||
|
|||
_is_iop_dbg_installed = 0; |
|||
return(0); |
|||
} |
|||
|
|||
void iop_dbg_get_reg_frames(IOP_RegFrame **def_frame_ptr, IOP_RegFrame **dbg_frame_ptr) |
|||
{ |
|||
if(def_frame_ptr) { *def_frame_ptr = &_iop_ex_def_frame; } |
|||
if(dbg_frame_ptr) { *dbg_frame_ptr = &_iop_ex_dbg_frame; } |
|||
} |
|||
|
|||
@ -0,0 +1,288 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2009, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* IOPDEBUG - IOP debugging library. |
|||
* low-level IOP exception-handler code. |
|||
*/ |
|||
|
|||
#include <iop_cop0_defs.h> |
|||
#include "iopdebug_defs.h" |
|||
#include "as_reg_compat.h" |
|||
|
|||
.set push |
|||
.set noreorder |
|||
.set noat |
|||
|
|||
.global _iop_save_frame |
|||
.ent _iop_save_frame |
|||
_iop_save_frame: |
|||
sw $zero, 0x000($s0) |
|||
|
|||
sw $at, 0x004($s0) |
|||
|
|||
sw $v0, 0x008($s0) |
|||
sw $v1, 0x00C($s0) |
|||
|
|||
sw $a0, 0x010($s0) |
|||
sw $a1, 0x014($s0) |
|||
sw $a2, 0x018($s0) |
|||
sw $a3, 0x01C($s0) |
|||
|
|||
sw $t0, 0x020($s0) |
|||
sw $t1, 0x024($s0) |
|||
sw $t2, 0x028($s0) |
|||
sw $t3, 0x02C($s0) |
|||
sw $t4, 0x030($s0) |
|||
sw $t5, 0x034($s0) |
|||
sw $t6, 0x038($s0) |
|||
sw $t7, 0x03C($s0) |
|||
|
|||
// sw $s0, 0x040($s0) |
|||
sw $s1, 0x044($s0) |
|||
sw $s2, 0x048($s0) |
|||
sw $s3, 0x04C($s0) |
|||
sw $s4, 0x050($s0) |
|||
sw $s5, 0x054($s0) |
|||
sw $s6, 0x058($s0) |
|||
sw $s7, 0x05C($s0) |
|||
|
|||
sw $t8, 0x060($s0) |
|||
sw $t9, 0x064($s0) |
|||
|
|||
// sw $k0, 0x068($s0) |
|||
sw $k1, 0x06C($s0) |
|||
|
|||
sw $gp, 0x070($s0) |
|||
// sw $sp, 0x074($s0) |
|||
sw $fp, 0x078($s0) |
|||
// sw $ra, 0x07C($s0) |
|||
|
|||
mfhi $t0 // hi |
|||
mflo $t1 // lo |
|||
nop // necessary?? |
|||
sw $t0, 0x080($s0) |
|||
sw $t1, 0x084($s0) |
|||
nop // necessary?? |
|||
|
|||
mfc0 $t0, $3 // IOP_COP0_BPC |
|||
mfc0 $t1, $5 // IOP_COP0_BDA |
|||
mfc0 $t2, $8 // IOP_COP0_BADVADDR |
|||
mfc0 $t3, $9 // IOP_COP0_BDAM |
|||
mfc0 $t4, $11 // IOP_COP0_BPCM |
|||
mfc0 $t5, $12 // SR |
|||
mfc0 $t6, $13 // Cause |
|||
mfc0 $t7, $14 // EPC |
|||
|
|||
sw $t0, 0x088($s0) |
|||
sw $t1, 0x08C($s0) |
|||
// gap for IOP_COP0_DCIC |
|||
sw $t2, 0x094($s0) |
|||
sw $t3, 0x098($s0) |
|||
sw $t4, 0x09C($s0) |
|||
sw $t5, 0x0A0($s0) |
|||
sw $t6, 0x0A4($s0) |
|||
sw $t7, 0x0A8($s0) |
|||
|
|||
jr $ra |
|||
nop |
|||
.end _iop_save_frame |
|||
|
|||
.global _iop_load_frame |
|||
.ent _iop_load_frame |
|||
_iop_load_frame: |
|||
// lw $zero, 0x000($s0) |
|||
|
|||
lw $at, 0x004($s0) |
|||
|
|||
lw $v0, 0x008($s0) |
|||
lw $v1, 0x00C($s0) |
|||
|
|||
lw $a0, 0x010($s0) |
|||
lw $a1, 0x014($s0) |
|||
lw $a2, 0x018($s0) |
|||
lw $a3, 0x01C($s0) |
|||
|
|||
// lw $s0, 0x040($s0) |
|||
lw $s1, 0x044($s0) |
|||
lw $s2, 0x048($s0) |
|||
lw $s3, 0x04C($s0) |
|||
lw $s4, 0x050($s0) |
|||
lw $s5, 0x054($s0) |
|||
lw $s6, 0x058($s0) |
|||
lw $s7, 0x05C($s0) |
|||
|
|||
lw $t8, 0x060($s0) |
|||
lw $t9, 0x064($s0) |
|||
|
|||
// lw $k0, 0x068($s0) |
|||
lw $k1, 0x06C($s0) |
|||
|
|||
lw $gp, 0x070($s0) |
|||
// lw $sp, 0x074($s0) |
|||
lw $fp, 0x078($s0) |
|||
// lw $ra, 0x07C($s0) |
|||
|
|||
lw $t0, 0x080($s0) |
|||
lw $t1, 0x084($s0) |
|||
mthi $t0 // hi |
|||
mtlo $t1 // lo |
|||
nop |
|||
nop |
|||
|
|||
lw $t0, 0x088($s0) |
|||
lw $t1, 0x08C($s0) |
|||
mtc0 $t0, $3 // IOP_COP0_BPC |
|||
mtc0 $t1, $5 // IOP_COP0_BDA |
|||
|
|||
// gap for IOP_COP0_DCIC |
|||
lw $t2, 0x094($s0) |
|||
lw $t3, 0x098($s0) |
|||
mtc0 $t2, $8 // IOP_COP0_BADVADDR |
|||
mtc0 $t3, $9 // IOP_COP0_BDAM |
|||
|
|||
lw $t4, 0x09C($s0) |
|||
lw $t5, 0x0A0($s0) |
|||
mtc0 $t4, $11 // IOP_COP0_BPCM |
|||
mtc0 $t5, $12 // SR |
|||
|
|||
lw $t6, 0x0A4($s0) |
|||
lw $t7, 0x0A8($s0) |
|||
mtc0 $t6, $13 // Cause |
|||
mtc0 $t7, $14 // EPC |
|||
|
|||
lw $t0, 0x020($s0) |
|||
lw $t1, 0x024($s0) |
|||
lw $t2, 0x028($s0) |
|||
lw $t3, 0x02c($s0) |
|||
lw $t4, 0x030($s0) |
|||
lw $t5, 0x034($s0) |
|||
lw $t6, 0x038($s0) |
|||
lw $t7, 0x03C($s0) |
|||
|
|||
jr $ra |
|||
nop |
|||
.end _iop_load_frame |
|||
|
|||
.global _iop_ex_cmn |
|||
.ent _iop_ex_cmn |
|||
_iop_ex_cmn: |
|||
addiu $sp, $sp, -0x10 |
|||
sw $ra, 0x00($sp) |
|||
nop |
|||
|
|||
jal _iop_save_frame |
|||
nop |
|||
|
|||
jal iop_exception_dispatcher |
|||
move $a0, $s0 |
|||
|
|||
jal _iop_load_frame |
|||
nop |
|||
|
|||
lw $ra, 0x00($sp) |
|||
nop |
|||
jr $ra |
|||
addiu $sp, $sp, 0x10 |
|||
.end _iop_ex_cmn |
|||
|
|||
.global _iop_ex_def_handler |
|||
.ent _iop_ex_def_handler |
|||
_iop_ex_def_handler: |
|||
nop |
|||
nop |
|||
|
|||
___iop_ex_def_handler_start: |
|||
la $k0, _iop_ex_def_frame |
|||
|
|||
sw $s0, 0x040($k0) // Save $s0 |
|||
sw $sp, 0x074($k0) // Save $sp |
|||
mfc0 $s0, IOP_COP0_DCIC |
|||
sw $ra, 0x07C($k0) // Save $ra |
|||
lw $sp, 0x410($zero) // k0 saved here by default exception prologue (at 0x80) |
|||
sw $s0, 0x090($k0) // Save IOP_COP0_DCIC |
|||
sw $sp, 0x068($k0) // Save $k0 |
|||
lw $at, 0x400($0) // at is saved here by default exception prologue (at 0x80) |
|||
la $sp, _iop_ex_def_stack + _EX_DEF_STACK_SIZE |
|||
|
|||
jal _iop_ex_cmn |
|||
move $s0, $k0 |
|||
|
|||
lw $k0, 0x068($s0) // restore k0 |
|||
lw $sp, 0x074($s0) // restore sp |
|||
lw $ra, 0x07C($s0) // restore ra |
|||
|
|||
lw $k1, 0x090($s0) // restore IOP_COP0_DCIC |
|||
nop |
|||
mtc0 $k1, IOP_COP0_DCIC |
|||
nop |
|||
|
|||
lw $k1, 0x0A8($s0) |
|||
nop |
|||
mtc0 $k1, $14 // EPC |
|||
lw $s0, 0x040($s0) // restore s0 |
|||
nop |
|||
jr $k1 |
|||
cop0 0x10 |
|||
nop |
|||
nop |
|||
.end _iop_ex_def_handler |
|||
|
|||
.global _iop_ex_break_handler |
|||
.ent _iop_ex_break_handler |
|||
_iop_ex_break_handler: |
|||
nop |
|||
nop |
|||
j ___iop_ex_def_handler_start |
|||
nop |
|||
.end _iop_ex_break_handler |
|||
|
|||
.global _iop_ex_dbg_handler |
|||
.ent _iop_ex_dbg_handler |
|||
_iop_ex_dbg_handler: |
|||
nop |
|||
nop |
|||
|
|||
la $k0, _iop_ex_dbg_frame |
|||
|
|||
sw $s0, 0x040($k0) // Save $s0 |
|||
sw $sp, 0x074($k0) // Save $sp |
|||
sw $ra, 0x07C($k0) // Save $ra |
|||
lw $sp, 0x420($zero) // k0 saved here by debug exception prologue (at 0x40) |
|||
lw $s0, 0x430($0) // IOP_COP0_DCIC is saved here by debug exception prologue (at 0x40) |
|||
sw $sp, 0x068($k0) // Save $k0 |
|||
sw $s0, 0x090($k0) // Save IOP_COP0_DCIC |
|||
la $sp, _iop_ex_dbg_stack + _EX_DBG_STACK_SIZE |
|||
|
|||
jal _iop_ex_cmn |
|||
move $s0, $k0 |
|||
|
|||
lw $k0, 0x068($s0) // restore k0 |
|||
lw $sp, 0x074($s0) // restore sp |
|||
lw $ra, 0x07C($s0) // restore ra |
|||
|
|||
lw $k1, 0x090($s0) // restore IOP_COP0_DCIC |
|||
nop |
|||
mtc0 $k1, IOP_COP0_DCIC |
|||
nop |
|||
|
|||
lw $k1, 0x0A8($s0) |
|||
nop |
|||
mtc0 $k1, $14 // EPC |
|||
lw $s0, 0x040($s0) // restore s0 |
|||
nop |
|||
jr $k1 |
|||
cop0 0x10 |
|||
nop |
|||
nop |
|||
.end _iop_ex_dbg_handler |
|||
|
|||
.set pop |
|||
@ -0,0 +1,27 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2009, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* IOPDEBUG - IOP debugging library. |
|||
* internal definitions for the IOPDEBUG project. Must be ".S"-friendly! |
|||
*/ |
|||
|
|||
#ifndef _IOPDEBUG_DEFS_H_ |
|||
#define _IOPDEBUG_DEFS_H_ |
|||
|
|||
/** size of the IOP "default" exception handler stack, in bytes. */ |
|||
#define _EX_DEF_STACK_SIZE (4 * 1024) |
|||
|
|||
/** size of the IOP "debug" exception handler stack, in bytes. */ |
|||
#define _EX_DBG_STACK_SIZE (4 * 1024) |
|||
|
|||
#endif // #ifndef _IOPDEBUG_DEFS_H_ |
|||
|
|||
@ -0,0 +1,37 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2009, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* IOPDEBUG - IOP debugging library. |
|||
* "private" header for internal definitions for the IOPDEBUG project. |
|||
*/ |
|||
|
|||
#ifndef _IOP_DEBUG_PRIV_H |
|||
#define _IOP_DEBUG_PRIV_H |
|||
|
|||
#include <tamtypes.h> |
|||
#include <intrman.h> |
|||
|
|||
#ifdef __cplusplus |
|||
extern "C" { |
|||
#endif |
|||
|
|||
/** Enter a critical state(interrupts are disabled) */ |
|||
static inline void EnterCritical(u32 *old_state) { CpuSuspendIntr((int *) old_state); } |
|||
|
|||
/** Exit a critical state(interrupts are resumed) */ |
|||
static inline void ExitCritical(u32 old_state) { CpuResumeIntr((int) old_state); } |
|||
|
|||
#ifdef __cplusplus |
|||
} |
|||
#endif |
|||
|
|||
#endif // #ifndef _IOP_DEBUG_PRIV_H |
|||
@ -0,0 +1,29 @@ |
|||
/* |
|||
* irx_imports.h - Defines all IRX imports. |
|||
* |
|||
* Copyright (c) 2009 PS2DEV.org |
|||
* |
|||
* See the file LICENSE included with this distribution for licensing terms. |
|||
*/ |
|||
|
|||
#ifndef IOP_IRX_IMPORTS_H |
|||
#define IOP_IRX_IMPORTS_H |
|||
|
|||
#include "irx.h" |
|||
|
|||
/* Please keep these in alphabetical order! */ |
|||
#include "cdvdman.h" |
|||
#include "loadcore.h" |
|||
#include "sifman.h" |
|||
#include "sifcmd.h" |
|||
#include "stdio.h" |
|||
#include "sysmem.h" |
|||
#include "sysclib.h" |
|||
#include "thbase.h" |
|||
#include "ioman.h" |
|||
#include "modload.h" |
|||
#include "intrman.h" |
|||
#include "excepman.h" |
|||
|
|||
#endif /* IOP_IRX_IMPORTS_H */ |
|||
|
|||
@ -0,0 +1,54 @@ |
|||
/** |
|||
* @file |
|||
* IOPDEBUG - IOP debugging library. |
|||
* startup code |
|||
*/ |
|||
|
|||
#include <tamtypes.h> |
|||
#include <stdio.h> |
|||
#include <loadcore.h> |
|||
#include <thbase.h> |
|||
#include "iopdebug.h" |
|||
|
|||
#include "iopdebug_priv.h" |
|||
|
|||
IRX_ID("iopdebug", 1, 0); |
|||
|
|||
extern struct irx_export_table _exp_iopdebug; |
|||
int _start(int argc, char *argv[]) |
|||
{ |
|||
// install IOP debug system. |
|||
if(iop_dbg_install() != 0) |
|||
{ |
|||
//printf("Failed installing IOP debug system!\n"); |
|||
return(1); // return "non-resident" |
|||
} |
|||
|
|||
// register our IRX exports. |
|||
if(RegisterLibraryEntries(&_exp_iopdebug) != 0) |
|||
{ |
|||
iop_dbg_remove(); |
|||
|
|||
//printf("Error registering library!\n"); |
|||
return(1); |
|||
} |
|||
|
|||
FlushIcache(); |
|||
FlushDcache(); |
|||
|
|||
//printf("IOPDEBUG installed!\n"); |
|||
|
|||
return(0); // return "resident" |
|||
} |
|||
// export 2, called when the module is being unloaded(like when IOP is being "rebooted"). |
|||
int _stop(int argc, char *argv[]) |
|||
{ |
|||
// remove IOP debug system. |
|||
if(iop_dbg_remove() != 0) |
|||
{ |
|||
//printf("Failed removing IOP debug handlers!\n"); |
|||
} |
|||
|
|||
return(1); // return "non-resident" |
|||
} |
|||
|
|||
@ -0,0 +1,16 @@ |
|||
# _____ ___ ____ ___ ____
|
|||
# ____| | ____| | | |____|
|
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
|||
#-----------------------------------------------------------------------
|
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
|
|||
# Licenced under Academic Free License version 2.0
|
|||
# Review ps2sdk README & LICENSE files for further details.
|
|||
|
|||
# IOP_CFLAGS += -DTEST_TRAP
|
|||
|
|||
IOP_OBJS = ioptrap.o handler.o breakpoint.o exports.o imports.o |
|||
|
|||
include $(PS2SDKSRC)/Defs.make |
|||
include $(PS2SDKSRC)/iop/Rules.bin.make |
|||
include $(PS2SDKSRC)/iop/Rules.make |
|||
include $(PS2SDKSRC)/iop/Rules.release |
|||
@ -0,0 +1,96 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* IOP exception handling. |
|||
*/ |
|||
|
|||
#ifndef __IOPTRAP_H__ |
|||
#define __IOPTRAP_H__ |
|||
|
|||
#include <types.h> |
|||
#include <irx.h> |
|||
|
|||
/* IDT_R3000_20.pdf 3-11 table 3.5 */ |
|||
typedef enum { |
|||
EXCEPTION_Int, /* note you can't really work with this one. */ |
|||
EXCEPTION_Mod, |
|||
EXCEPTION_TLBL, |
|||
EXCEPTION_TLBS, |
|||
EXCEPTION_AdEL, |
|||
EXCEPTION_AdES, |
|||
EXCEPTION_IBE, |
|||
EXCEPTION_DBE, |
|||
EXCEPTION_Syscall, |
|||
EXCEPTION_Bp, |
|||
EXCEPTION_RI, |
|||
EXCEPTION_CpU, |
|||
EXCEPTION_Ov, |
|||
EXCEPTION_RESERVED13, |
|||
EXCEPTION_RESERVED14 /* would be FPE, but that's not going to happen on the IOP */ |
|||
} exception_type_t; |
|||
|
|||
typedef struct exception_frame |
|||
{ |
|||
u32 epc; |
|||
u32 cause; |
|||
u32 badvaddr; |
|||
u32 sr; |
|||
u32 regs[32]; |
|||
u32 hi; |
|||
u32 lo; |
|||
u32 dcic; |
|||
} exception_frame_t; |
|||
|
|||
/* Beware: the handler will be run in a 'bad' state. Consider you are |
|||
on interrupt mode, so, only i* functions. */ |
|||
typedef void (*trap_exception_handler_t)(exception_type_t, exception_frame_t *); |
|||
|
|||
#define DCIC_WR (1 << 27) |
|||
#define DCIC_RD (1 << 26) |
|||
#define DCIC_DA (1 << 25) |
|||
#define DCIC_PC (1 << 24) |
|||
|
|||
const char *get_exception_name(exception_type_t type); |
|||
|
|||
/* Will act as a setjmp. Returns 0 to say it was the first call, |
|||
otherwise, returns the exception number. (note that you'll never |
|||
get any interrupt...) Note that using this will completely disable |
|||
user defined exception handlers. */ |
|||
exception_type_t dbg_setjmp(); |
|||
|
|||
/* Will return the old handler. */ |
|||
trap_exception_handler_t set_exception_handler(exception_type_t type, trap_exception_handler_t handler); |
|||
trap_exception_handler_t get_exception_handler(exception_type_t type); |
|||
|
|||
/* Breakpoint stuff. */ |
|||
void set_dba(u32 v); |
|||
void set_dbam(u32 v); |
|||
void set_dcic(u32 v); |
|||
u32 get_dba(); |
|||
u32 get_dbam(); |
|||
u32 get_dcic(); |
|||
|
|||
#define ioptrap_IMPORTS_start DECLARE_IMPORT_TABLE(ioptrap, 1, 1) |
|||
#define ioptrap_IMPORTS_end END_IMPORT_TABLE |
|||
|
|||
#define I_get_exception_name DECLARE_IMPORT(4, get_exception_name) |
|||
#define I_dbg_setjmp DECLARE_IMPORT(5, dbg_setjmp) |
|||
#define I_set_exception_handler DECLARE_IMPORT(6, set_exception_handler) |
|||
#define I_get_exception_handler DECLARE_IMPORT(7, get_exception_handler) |
|||
#define I_set_dba DECLARE_IMPORT(8, set_dba) |
|||
#define I_set_dbam DECLARE_IMPORT(9, set_dbam) |
|||
#define I_set_dcic DECLARE_IMPORT(10, set_dcic) |
|||
#define I_get_dba DECLARE_IMPORT(11, get_dba) |
|||
#define I_get_dbam DECLARE_IMPORT(12, get_dbam) |
|||
#define I_get_dcic DECLARE_IMPORT(13, get_dcic) |
|||
|
|||
#endif /* __IOPTRAP_H__ */ |
|||
@ -0,0 +1,43 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
#include "ioptrap.h" |
|||
|
|||
void set_dba(u32 v) { |
|||
__asm__ __volatile__("mtc0 %0, $5" : : "r" (v)); |
|||
} |
|||
|
|||
void set_dbam(u32 v) { |
|||
__asm__ __volatile__("mtc0 %0, $9" : : "r" (v)); |
|||
} |
|||
|
|||
void set_dcic(u32 v) { |
|||
__asm__ __volatile__("mtc0 %0, $7" : : "r" (v)); |
|||
} |
|||
|
|||
u32 get_dba() { |
|||
u32 v; |
|||
__asm__ __volatile__("mfc0 %0, $5" : "=&r" (v)); |
|||
return v; |
|||
} |
|||
|
|||
u32 get_dbam() { |
|||
u32 v; |
|||
__asm__ __volatile__("mfc0 %0, $9" : "=&r" (v)); |
|||
return v; |
|||
} |
|||
|
|||
u32 get_dcic() { |
|||
u32 v; |
|||
__asm__ __volatile__("mfc0 %0, $7" : "=&r" (v)); |
|||
return v; |
|||
} |
|||
|
|||
|
|||
@ -0,0 +1,20 @@ |
|||
DECLARE_EXPORT_TABLE(ioptrap, 1, 1) |
|||
DECLARE_EXPORT(_start) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(shutdown) |
|||
DECLARE_EXPORT(_retonly) |
|||
|
|||
DECLARE_EXPORT(get_exception_name) |
|||
/*05*/ DECLARE_EXPORT(dbg_setjmp) |
|||
DECLARE_EXPORT(set_exception_handler) |
|||
DECLARE_EXPORT(get_exception_handler) |
|||
DECLARE_EXPORT(set_dba) |
|||
DECLARE_EXPORT(set_dbam) |
|||
/*10*/ DECLARE_EXPORT(set_dcic) |
|||
DECLARE_EXPORT(get_dba) |
|||
DECLARE_EXPORT(get_dbam) |
|||
DECLARE_EXPORT(get_dcic) |
|||
|
|||
END_EXPORT_TABLE |
|||
|
|||
void _retonly() {} |
|||
@ -0,0 +1,291 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
|
|||
#include "as_reg_compat.h" |
|||
|
|||
#define GENERAL_ATSAVE 0x400 |
|||
#define GENERAL_SRSAVE |
|||
|
|||
.global def_exc_handler |
|||
.ent def_exc_handler |
|||
def_exc_handler: |
|||
.set noreorder |
|||
.set noat |
|||
.word 0 |
|||
.word 0 |
|||
la $k0, __trap_frame |
|||
sw $0, 0x10($k0) |
|||
|
|||
lw $1, 0x400($0) |
|||
nop |
|||
sw $1, 0x14($k0) |
|||
|
|||
sw $2, 0x18($k0) |
|||
sw $3, 0x1c($k0) |
|||
sw $4, 0x20($k0) |
|||
sw $5, 0x24($k0) |
|||
sw $6, 0x28($k0) |
|||
sw $7, 0x2c($k0) |
|||
sw $8, 0x30($k0) |
|||
sw $9, 0x34($k0) |
|||
sw $10, 0x38($k0) |
|||
sw $11, 0x3c($k0) |
|||
sw $12, 0x40($k0) |
|||
sw $13, 0x44($k0) |
|||
sw $14, 0x48($k0) |
|||
sw $15, 0x4c($k0) |
|||
sw $16, 0x50($k0) |
|||
sw $17, 0x54($k0) |
|||
sw $18, 0x58($k0) |
|||
sw $19, 0x5c($k0) |
|||
sw $20, 0x60($k0) |
|||
sw $21, 0x64($k0) |
|||
sw $22, 0x68($k0) |
|||
sw $23, 0x6c($k0) |
|||
sw $24, 0x70($k0) |
|||
sw $25, 0x74($k0) |
|||
sw $26, 0x78($k0) |
|||
sw $27, 0x7c($k0) |
|||
sw $28, 0x80($k0) |
|||
sw $29, 0x84($k0) |
|||
sw $30, 0x88($k0) |
|||
sw $31, 0x8c($k0) |
|||
mfhi $a0 |
|||
nop |
|||
sw $a0, 0x90($k0) |
|||
|
|||
mflo $a0 |
|||
nop |
|||
sw $a0, 0x94($k0) |
|||
|
|||
|
|||
# lw $a0, 0x404($0) # saved EPC |
|||
mfc0 $a0, $14 # EPC |
|||
nop |
|||
sw $a0, 0($k0) |
|||
|
|||
# lw $a0, 0x408($0) # saved SR |
|||
mfc0 $a0, $12 # SR |
|||
nop |
|||
sw $a0, 0xc($k0) |
|||
|
|||
mfc0 $a0, $8 # BadVaddr |
|||
nop |
|||
sw $a0, 0x8($k0) |
|||
|
|||
sw $0, 0x98($k0) |
|||
|
|||
|
|||
# lw $a0, 0x40c($0) # saved Cause |
|||
mfc0 $a0, $13 # Cause |
|||
nop |
|||
sw $a0, 4($k0) |
|||
|
|||
sll $a0, 25 |
|||
srl $a0, 27 |
|||
jal trap |
|||
or $a1, $k0, $0 |
|||
|
|||
la $k0, __trap_frame |
|||
|
|||
lw $a0, 0x94($k0) |
|||
nop |
|||
mtlo $a0 |
|||
|
|||
lw $a0, 0x90($k0) |
|||
nop |
|||
mthi $a0 |
|||
|
|||
# lw $0, 0x10($k0) |
|||
lw $1, 0x14($k0) |
|||
lw $2, 0x18($k0) |
|||
lw $3, 0x1c($k0) |
|||
lw $4, 0x20($k0) |
|||
lw $5, 0x24($k0) |
|||
lw $6, 0x28($k0) |
|||
lw $7, 0x2c($k0) |
|||
lw $8, 0x30($k0) |
|||
lw $9, 0x34($k0) |
|||
lw $10, 0x38($k0) |
|||
lw $11, 0x3c($k0) |
|||
lw $12, 0x40($k0) |
|||
lw $13, 0x44($k0) |
|||
lw $14, 0x48($k0) |
|||
lw $15, 0x4c($k0) |
|||
lw $16, 0x50($k0) |
|||
lw $17, 0x54($k0) |
|||
lw $18, 0x58($k0) |
|||
lw $19, 0x5c($k0) |
|||
lw $20, 0x60($k0) |
|||
lw $21, 0x64($k0) |
|||
lw $22, 0x68($k0) |
|||
lw $23, 0x6c($k0) |
|||
lw $24, 0x70($k0) |
|||
lw $25, 0x74($k0) |
|||
# lw $26, 0x78($k0) |
|||
# lw $27, 0x7c($k0) |
|||
lw $28, 0x80($k0) |
|||
lw $29, 0x84($k0) |
|||
lw $30, 0x88($k0) |
|||
lw $31, 0x8c($k0) |
|||
|
|||
lw $k1, 0xc($k0) |
|||
nop |
|||
srl $k1, 1 |
|||
sll $k1, 1 |
|||
mtc0 $k1, $12 # restore SR |
|||
|
|||
lw $k1, 0($k0) |
|||
lw $k0, 0x410($0) # k0 saved here by exception prologue (at 0x80) |
|||
jr $k1 |
|||
cop0 0x10 |
|||
nop |
|||
.end def_exc_handler |
|||
|
|||
.global bp_exc_handler |
|||
.ent bp_exc_handler |
|||
bp_exc_handler: |
|||
.set noreorder |
|||
.set noat |
|||
.word 0 |
|||
.word 0 |
|||
la $k0, __trap_frame |
|||
sw $0, 0x10($k0) |
|||
sw $1, 0x14($k0) |
|||
sw $2, 0x18($k0) |
|||
sw $3, 0x1c($k0) |
|||
sw $4, 0x20($k0) |
|||
sw $5, 0x24($k0) |
|||
sw $6, 0x28($k0) |
|||
sw $7, 0x2c($k0) |
|||
sw $8, 0x30($k0) |
|||
sw $9, 0x34($k0) |
|||
sw $10, 0x38($k0) |
|||
sw $11, 0x3c($k0) |
|||
sw $12, 0x40($k0) |
|||
sw $13, 0x44($k0) |
|||
sw $14, 0x48($k0) |
|||
sw $15, 0x4c($k0) |
|||
sw $16, 0x50($k0) |
|||
sw $17, 0x54($k0) |
|||
sw $18, 0x58($k0) |
|||
sw $19, 0x5c($k0) |
|||
sw $20, 0x60($k0) |
|||
sw $21, 0x64($k0) |
|||
sw $22, 0x68($k0) |
|||
sw $23, 0x6c($k0) |
|||
sw $24, 0x70($k0) |
|||
sw $25, 0x74($k0) |
|||
sw $26, 0x78($k0) |
|||
sw $27, 0x7c($k0) |
|||
sw $28, 0x80($k0) |
|||
sw $29, 0x84($k0) |
|||
sw $30, 0x88($k0) |
|||
sw $31, 0x8c($k0) |
|||
mfhi $a0 |
|||
nop |
|||
sw $a0, 0x90($k0) |
|||
|
|||
mflo $a0 |
|||
nop |
|||
sw $a0, 0x94($k0) |
|||
|
|||
|
|||
# lw $a0, 0x424($0) # saved EPC |
|||
mfc0 $a0, $14 # EPC |
|||
nop |
|||
sw $a0, 0($k0) |
|||
|
|||
# lw $a0, 0x42c($0) # saved SR |
|||
mfc0 $a0, $12 # SR |
|||
nop |
|||
sw $a0, 0xc($k0) |
|||
|
|||
mfc0 $a0, $8 # BadVaddr |
|||
nop |
|||
sw $a0, 0x8($k0) |
|||
|
|||
lw $a0, 0x430($0) # saved DCIC |
|||
nop |
|||
sw $a0, 0x98($k0) |
|||
|
|||
|
|||
# lw $a0, 0x428($0) # saved Cause |
|||
mfc0 $a0, $13 # Cause |
|||
nop |
|||
sw $a0, 4($k0) |
|||
|
|||
sll $a0, 25 |
|||
srl $a0, 27 |
|||
jal trap |
|||
or $a1, $k0, $0 |
|||
|
|||
|
|||
la $k0, __trap_frame |
|||
|
|||
lw $a0, 0x94($k0) |
|||
nop |
|||
mtlo $a0 |
|||
|
|||
lw $a0, 0x90($k0) |
|||
nop |
|||
mthi $a0 |
|||
|
|||
lw $a0, 0x98($k0) |
|||
nop |
|||
mtc0 $a0, $7 |
|||
|
|||
# lw $0, 0x10($k0) |
|||
lw $1, 0x14($k0) |
|||
lw $2, 0x18($k0) |
|||
lw $3, 0x1c($k0) |
|||
lw $4, 0x20($k0) |
|||
lw $5, 0x24($k0) |
|||
lw $6, 0x28($k0) |
|||
lw $7, 0x2c($k0) |
|||
lw $8, 0x30($k0) |
|||
lw $9, 0x34($k0) |
|||
lw $10, 0x38($k0) |
|||
lw $11, 0x3c($k0) |
|||
lw $12, 0x40($k0) |
|||
lw $13, 0x44($k0) |
|||
lw $14, 0x48($k0) |
|||
lw $15, 0x4c($k0) |
|||
lw $16, 0x50($k0) |
|||
lw $17, 0x54($k0) |
|||
lw $18, 0x58($k0) |
|||
lw $19, 0x5c($k0) |
|||
lw $20, 0x60($k0) |
|||
lw $21, 0x64($k0) |
|||
lw $22, 0x68($k0) |
|||
lw $23, 0x6c($k0) |
|||
lw $24, 0x70($k0) |
|||
lw $25, 0x74($k0) |
|||
# lw $26, 0x78($k0) |
|||
# lw $27, 0x7c($k0) |
|||
lw $28, 0x80($k0) |
|||
lw $29, 0x84($k0) |
|||
lw $30, 0x88($k0) |
|||
lw $31, 0x8c($k0) |
|||
|
|||
lw $k1, 0xc($k0) |
|||
nop |
|||
srl $k1, 1 |
|||
sll $k1, 1 |
|||
mtc0 $k1, $12 # restore SR |
|||
|
|||
lw $k1, 0($k0) |
|||
lw $k0, 0x420($0) # k0 saved here by debug exception prologue (at 0x40) |
|||
jr $k1 |
|||
cop0 0x10 |
|||
nop |
|||
.end bp_exc_handler |
|||
|
|||
@ -0,0 +1,31 @@ |
|||
#ifdef TEST_TRAP |
|||
thbase_IMPORTS_start |
|||
I_CreateThread |
|||
I_DelayThread |
|||
I_StartThread |
|||
I_ExitDeleteThread |
|||
thbase_IMPORTS_end |
|||
#endif |
|||
|
|||
loadcore_IMPORTS_start |
|||
I_RegisterLibraryEntries |
|||
loadcore_IMPORTS_end |
|||
|
|||
excepman_IMPORTS_start |
|||
I_RegisterDefaultExceptionHandler |
|||
I_RegisterPriorityExceptionHandler |
|||
excepman_IMPORTS_end |
|||
|
|||
intrman_IMPORTS_start |
|||
I_CpuSuspendIntr |
|||
I_CpuResumeIntr |
|||
intrman_IMPORTS_end |
|||
|
|||
stdio_IMPORTS_start |
|||
I_printf |
|||
stdio_IMPORTS_end |
|||
|
|||
sysclib_IMPORTS_start |
|||
I_setjmp |
|||
I_memset |
|||
sysclib_IMPORTS_end |
|||
@ -0,0 +1,230 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* IOP exception handling. |
|||
*/ |
|||
|
|||
#include "types.h" |
|||
#include "defs.h" |
|||
#include "irx.h" |
|||
|
|||
#include "ioptrap.h" |
|||
|
|||
#include "excepman.h" |
|||
#include "loadcore.h" |
|||
#include "intrman.h" |
|||
#include "sifman.h" |
|||
#include "stdio.h" |
|||
#include "sysclib.h" |
|||
#include "thbase.h" |
|||
|
|||
IRX_ID("ioptrap_driver", 1, 1); |
|||
|
|||
extern struct irx_export_table _exp_ioptrap; |
|||
|
|||
|
|||
static const char *exception_type_name[] = { |
|||
"Interrupt", |
|||
"TLB Modification", |
|||
"TLB Miss Load", |
|||
"TLB Miss Store", |
|||
"Address Error Load", |
|||
"Address Error Store", |
|||
"Instruction Bus Error", |
|||
"Data Bus Error", |
|||
"Syscall", |
|||
"Breakpoint", |
|||
"Reserved Instruction", |
|||
"Coprocessor Unusable", |
|||
"Overflow", |
|||
"Reserved 13", |
|||
"Reserved 14" /* "Floating point exception" */ |
|||
}; |
|||
|
|||
const char *get_exception_name(exception_type_t type) |
|||
{ |
|||
return exception_type_name[type]; |
|||
} |
|||
|
|||
exception_frame_t __trap_frame; |
|||
extern void def_exc_handler(); |
|||
extern void bp_exc_handler(); |
|||
|
|||
int dbg_jmp_buf_setup = 0; |
|||
jmp_buf dbg_jmp_buf; |
|||
|
|||
exception_type_t dbg_setjmp() |
|||
{ |
|||
int v; |
|||
if (0 == (v = setjmp(dbg_jmp_buf))) { |
|||
dbg_jmp_buf_setup = 1; |
|||
} else { |
|||
dbg_jmp_buf_setup = 0; |
|||
} |
|||
return v; |
|||
} |
|||
|
|||
#define JUMP_BUF_PC 0 |
|||
#define JUMP_BUF_SP 1 |
|||
#define JUMP_BUF_FP 2 |
|||
#define JUMP_BUF_S0 3 |
|||
#define JUMP_BUF_S1 4 |
|||
#define JUMP_BUF_S2 5 |
|||
#define JUMP_BUF_S3 6 |
|||
#define JUMP_BUF_S4 7 |
|||
#define JUMP_BUF_S5 8 |
|||
#define JUMP_BUF_S6 9 |
|||
#define JUMP_BUF_S7 10 |
|||
#define JUMP_BUF_GP 11 |
|||
|
|||
// Define this to something else if you want... maybe some ee_sio stuff :P |
|||
#define TRAP_PRINTF(args...) |
|||
|
|||
static trap_exception_handler_t handlers[16]; |
|||
|
|||
trap_exception_handler_t set_exception_handler(exception_type_t type, trap_exception_handler_t handler) |
|||
{ |
|||
trap_exception_handler_t old_handler = handlers[type]; |
|||
handlers[type] = handler; |
|||
return old_handler; |
|||
} |
|||
|
|||
trap_exception_handler_t get_exception_handler(exception_type_t type) |
|||
{ |
|||
return handlers[type]; |
|||
} |
|||
|
|||
void trap(exception_type_t type, struct exception_frame *ex) |
|||
{ |
|||
u32 i; |
|||
if (dbg_jmp_buf_setup) { |
|||
u32 *p = (u32 *)dbg_jmp_buf; |
|||
/* simulate longjmp */ |
|||
ex->epc = p[JUMP_BUF_PC]; |
|||
ex->regs[29] = p[JUMP_BUF_SP]; |
|||
ex->regs[30] = p[JUMP_BUF_FP]; |
|||
ex->regs[16] = p[JUMP_BUF_S0]; |
|||
ex->regs[17] = p[JUMP_BUF_S1]; |
|||
ex->regs[18] = p[JUMP_BUF_S2]; |
|||
ex->regs[19] = p[JUMP_BUF_S3]; |
|||
ex->regs[20] = p[JUMP_BUF_S4]; |
|||
ex->regs[21] = p[JUMP_BUF_S5]; |
|||
ex->regs[22] = p[JUMP_BUF_S6]; |
|||
ex->regs[23] = p[JUMP_BUF_S7]; |
|||
ex->regs[28] = p[JUMP_BUF_GP]; |
|||
ex->regs[2] = type; /* return value from setjmp */ |
|||
return; |
|||
} |
|||
TRAP_PRINTF("IOP Exception : %s\n", exception_type_name[type]); |
|||
TRAP_PRINTF("EPC=%08x CAUSE=%08x SR=%08x BADVADDR=%08x DCIC=%08x\n", ex->epc, ex->cause, ex->sr, ex->badvaddr, ex->dcic); |
|||
for (i = 0; i != 32; i += 4) { |
|||
TRAP_PRINTF("r[%02d]=%08x r[%02d]=%08x r[%02d]=%08x r[%02d]=%08x", |
|||
i, ex->regs[i], i + 1, ex->regs[i + 1], i + 2, ex->regs[i + 2], i + 3, ex->regs[i + 3]); |
|||
} |
|||
|
|||
if (handlers[type]) { |
|||
handlers[type](type, ex); |
|||
} |
|||
|
|||
if (type == EXCEPTION_Bp) { |
|||
ex->dcic = 0; |
|||
} else { |
|||
if (ex->cause & (1 << 31)) { |
|||
ex->cause &= ~(1 << 31); /* clear BD */ |
|||
} else { |
|||
ex->epc += 4; |
|||
} |
|||
} |
|||
} |
|||
|
|||
#ifdef TEST_TRAP |
|||
static void trigger() |
|||
{ |
|||
u32 v; |
|||
printf("trigger=%p\n", trigger); |
|||
printf("badaddr\n"); |
|||
if (0 == (v = setjmp(dbg_jmp_buf))) { |
|||
dbg_jmp_buf_setup = 1; |
|||
*(u32 *)0xdeadbeef = 0xfeedface; |
|||
} else { |
|||
printf("exception occurred in command, v=%08x\n", v); |
|||
} |
|||
dbg_jmp_buf_setup = 0; |
|||
printf("done.\n"); |
|||
} |
|||
|
|||
void main_thread(void *unused) |
|||
{ |
|||
int i = 0; |
|||
|
|||
DelayThread(1000 * 1000); |
|||
|
|||
printf("IOP: about to trap!\n"); |
|||
trigger(); |
|||
printf("IOP: back from trap!\n"); |
|||
while (1) { |
|||
printf("IOP: still running %d\n", i++); |
|||
DelayThread(2000 * 1000); |
|||
if (i == 10) |
|||
break; |
|||
} |
|||
ExitDeleteThread(); |
|||
} |
|||
|
|||
int create_main_thread(void) |
|||
{ |
|||
iop_thread_t thread; |
|||
|
|||
thread.attr = 0x2000000; |
|||
thread.option = 0; |
|||
thread.thread = main_thread; |
|||
thread.stacksize = 0x8000; |
|||
thread.priority = 0x18; |
|||
return CreateThread(&thread); |
|||
} |
|||
|
|||
void do_tests() |
|||
{ |
|||
int thid; |
|||
thid = create_main_thread(); |
|||
StartThread(thid, NULL); |
|||
} |
|||
#else |
|||
#define do_tests() |
|||
#endif |
|||
|
|||
int _start(int argc, char **argv) |
|||
{ |
|||
int rv; |
|||
|
|||
if (RegisterLibraryEntries(&_exp_ioptrap) != 0) |
|||
return 1; |
|||
|
|||
memset(handlers, 0, sizeof(trap_exception_handler_t) * 16); |
|||
printf("ioptrap starts.\n"); |
|||
if ((rv = RegisterDefaultExceptionHandler((exception_handler_t)def_exc_handler)) < 0) { |
|||
printf("RegisterDefaultExceptionHandler failed, rv=%d\n", rv); |
|||
return 1; |
|||
} |
|||
if ((rv = RegisterPriorityExceptionHandler(IOP_EXCEPTION_HDB, 0, (exception_handler_t)bp_exc_handler)) < 0) { |
|||
// shouldn't we release the default exception handler here... ? |
|||
printf("RegisterDefaultExceptionHandler failed, rv=%d\n", rv); |
|||
return 1; |
|||
} |
|||
do_tests(); |
|||
return 0; |
|||
} |
|||
|
|||
int shutdown() |
|||
{ |
|||
return 0; |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org> |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
# |
|||
# Defines all IRX imports. |
|||
*/ |
|||
|
|||
#ifndef IOP_IRX_IMPORTS_H |
|||
#define IOP_IRX_IMPORTS_H |
|||
|
|||
#include "irx.h" |
|||
|
|||
/* Please keep these in alphabetical order! */ |
|||
#include "excepman.h" |
|||
#include "loadcore.h" |
|||
#include "intrman.h" |
|||
#include "sifman.h" |
|||
#include "stdio.h" |
|||
#include "sysclib.h" |
|||
#ifdef TEST_TRAP |
|||
#include "thbase.h" |
|||
#endif |
|||
|
|||
#endif /* IOP_IRX_IMPORTS_H */ |
|||
@ -0,0 +1,14 @@ |
|||
# _____ ___ ____ ___ ____
|
|||
# ____| | ____| | | |____|
|
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
|||
#-----------------------------------------------------------------------
|
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
|
|||
# Licenced under Academic Free License version 2.0
|
|||
# Review ps2sdk README & LICENSE files for further details.
|
|||
|
|||
IOP_OBJS = sior.o xprintf.o exports.o imports.o |
|||
|
|||
include $(PS2SDKSRC)/Defs.make |
|||
include $(PS2SDKSRC)/iop/Rules.bin.make |
|||
include $(PS2SDKSRC)/iop/Rules.make |
|||
include $(PS2SDKSRC)/iop/Rules.release |
|||
@ -0,0 +1,22 @@ |
|||
DECLARE_EXPORT_TABLE(sior, 1, 1) |
|||
DECLARE_EXPORT(_start) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_retonly) |
|||
|
|||
DECLARE_EXPORT(sio_init) |
|||
/*05*/ DECLARE_EXPORT(sio_putc) |
|||
DECLARE_EXPORT(sio_getc) |
|||
DECLARE_EXPORT(sio_getc_block) |
|||
DECLARE_EXPORT(sio_write) |
|||
DECLARE_EXPORT(sio_read) |
|||
/*10*/ DECLARE_EXPORT(sio_puts) |
|||
DECLARE_EXPORT(sio_putsn) |
|||
DECLARE_EXPORT(sio_gets) |
|||
DECLARE_EXPORT(sio_flush) |
|||
DECLARE_EXPORT(sio_printf) |
|||
/*15*/ DECLARE_EXPORT(sio_vprintf) |
|||
|
|||
END_EXPORT_TABLE |
|||
|
|||
void _retonly() {} |
|||
@ -0,0 +1,24 @@ |
|||
loadcore_IMPORTS_start |
|||
I_FlushDcache |
|||
I_RegisterLibraryEntries |
|||
loadcore_IMPORTS_end |
|||
|
|||
sifcmd_IMPORTS_start |
|||
I_sceSifBindRpc |
|||
I_sceSifCallRpc |
|||
sifcmd_IMPORTS_end |
|||
|
|||
stdio_IMPORTS_start |
|||
I_printf |
|||
stdio_IMPORTS_end |
|||
|
|||
sysclib_IMPORTS_start |
|||
I_memset |
|||
I_strlen |
|||
//I_vsprintf broken !!! |
|||
I_look_ctype_table |
|||
sysclib_IMPORTS_end |
|||
|
|||
thbase_IMPORTS_start |
|||
I_DelayThread |
|||
thbase_IMPORTS_end |
|||
@ -0,0 +1,25 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright (c) 2001, 2005 ps2dev - http;//www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
# |
|||
# Defines all IRX imports. |
|||
*/ |
|||
|
|||
#ifndef IOP_IRX_IMPORTS_H |
|||
#define IOP_IRX_IMPORTS_H |
|||
|
|||
#include "irx.h" |
|||
|
|||
/* Please keep these in alphabetical order! */ |
|||
#include "loadcore.h" |
|||
#include "sifcmd.h" |
|||
#include "stdio.h" |
|||
#include "sysclib.h" |
|||
#include "thbase.h" |
|||
|
|||
#endif /* IOP_IRX_IMPORTS_H */ |
|||
@ -0,0 +1,141 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
# |
|||
# IOP exception handling. |
|||
*/ |
|||
|
|||
#include <stdarg.h> |
|||
|
|||
#include "types.h" |
|||
#include "defs.h" |
|||
#include "irx.h" |
|||
|
|||
#include "sior.h" |
|||
#include "xprintf.h" |
|||
|
|||
#include "irx_imports.h" |
|||
IRX_ID("sioremote_driver", 1, 1); |
|||
|
|||
extern struct irx_export_table _exp_sior; |
|||
|
|||
static struct t_SifRpcClientData cd0; |
|||
static union siorCommsData buffer; |
|||
static char tbuf[2048]; |
|||
|
|||
void sio_init(u32 baudrate, u8 lcr_ueps, u8 lcr_upen, u8 lcr_usbl, u8 lcr_umode) { |
|||
struct siorInitArgs * i = &buffer.init; |
|||
i->baudrate = baudrate; |
|||
i->lcr_ueps = lcr_ueps; |
|||
i->lcr_upen = lcr_upen; |
|||
i->lcr_usbl = lcr_usbl; |
|||
i->lcr_umode = lcr_umode; |
|||
SifCallRpc(&cd0, SIOR_INIT, 0, &buffer, sizeof(struct siorInitArgs), NULL, 0, NULL, NULL); |
|||
} |
|||
|
|||
int sio_putc(int c) { |
|||
buffer.result = c; |
|||
SifCallRpc(&cd0, SIOR_PUTC, 0, &buffer, sizeof(int), &buffer, sizeof(int), NULL, NULL); |
|||
return buffer.result; |
|||
} |
|||
|
|||
int sio_getc(void) { |
|||
SifCallRpc(&cd0, SIOR_GETC, 0, 0, 0, &buffer, sizeof(int), NULL, NULL); |
|||
return buffer.result; |
|||
} |
|||
|
|||
int sio_getc_block(void) { |
|||
SifCallRpc(&cd0, SIOR_GETCBLOCK, 0, 0, 0, &buffer, sizeof(int), NULL, NULL); |
|||
return buffer.result; |
|||
} |
|||
|
|||
size_t sio_write(const char *buf, size_t size) { |
|||
buffer.write.buf = buf; |
|||
buffer.write.len = size; |
|||
SifCallRpc(&cd0, SIOR_WRITE, 0, &buffer, 8, &buffer, 4, NULL, NULL); |
|||
return buffer.result; |
|||
} |
|||
|
|||
size_t sio_read(char *buf, size_t size) { |
|||
buffer.read.buf = buf; |
|||
buffer.read.len = size; |
|||
SifCallRpc(&cd0, SIOR_READ, 0, &buffer, 8, &buffer, 4, NULL, NULL); |
|||
return buffer.result; |
|||
} |
|||
|
|||
int sio_puts(const char * str) { |
|||
buffer.cstr = str; |
|||
SifCallRpc(&cd0, SIOR_PUTS, 0, &buffer, 4, &buffer, 4, NULL, NULL); |
|||
return buffer.result; |
|||
} |
|||
|
|||
int sio_putsn(const char * str) { |
|||
buffer.cstr = str; |
|||
SifCallRpc(&cd0, SIOR_PUTSN, 0, &buffer, 4, &buffer, 4, NULL, NULL); |
|||
return buffer.result; |
|||
} |
|||
|
|||
char *sio_gets(char * str) { |
|||
buffer.str = str; |
|||
SifCallRpc(&cd0, SIOR_GETS, 0, &buffer, 4, &buffer, 4, NULL, NULL); |
|||
return buffer.str; |
|||
} |
|||
|
|||
void sio_flush(void) { |
|||
SifCallRpc(&cd0, SIOR_FLUSH, 0, NULL, 0, NULL, 0, NULL, NULL); |
|||
} |
|||
|
|||
int sio_vprintf(const char * str, va_list args) { |
|||
int res; |
|||
|
|||
res = vsnprintf(tbuf, sizeof(tbuf), str, args); |
|||
printf("%s", tbuf); |
|||
sio_putsn(tbuf); |
|||
|
|||
return res; |
|||
} |
|||
|
|||
int sio_printf(const char * str, ...) { |
|||
int res; |
|||
va_list args; |
|||
|
|||
va_start(args, str); |
|||
res = sio_vprintf(str, args); |
|||
va_end(args); |
|||
|
|||
return res; |
|||
} |
|||
|
|||
int _start(int argc, char **argv) |
|||
{ |
|||
int retries; |
|||
|
|||
memset(&cd0, 0, sizeof(cd0)); |
|||
|
|||
for (retries = 0; retries < 15; retries++) { |
|||
printf("Binding RPC.\n"); |
|||
if (SifBindRpc(&cd0, SIOR_IRX, 0) < 0) { |
|||
printf("Failed!\n"); |
|||
return MODULE_NO_RESIDENT_END; |
|||
} |
|||
if (cd0.server != 0) { |
|||
printf("Registering library.\n"); |
|||
if (RegisterLibraryEntries(&_exp_sior)) { |
|||
printf("Couldn't register.\n"); |
|||
return MODULE_NO_RESIDENT_END; |
|||
} |
|||
return MODULE_RESIDENT_END; |
|||
} |
|||
printf("Huh, not available, retrying... ?\n"); |
|||
DelayThread(1000); |
|||
} |
|||
|
|||
printf("Giving up.\n"); |
|||
|
|||
return MODULE_NO_RESIDENT_END; |
|||
} |
|||
1119
sps2_basement/hardware/debug/sior/src/xprintf.c
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,40 @@ |
|||
/* |
|||
* xprinf.h |
|||
* |
|||
* Copyright (C) 2007-2009 misfire <misfire@xploderfreax.de> |
|||
* |
|||
* Licensed under the Academic Free License version 2.0. See file LICENSE. |
|||
*/ |
|||
|
|||
#ifndef _XPRINTF_H_ |
|||
#define _XPRINTF_H_ |
|||
|
|||
#include <stdarg.h> |
|||
|
|||
/* Define available functions here */ |
|||
#define F_vxprintf |
|||
#define NOFLOATINGPOINT /* won't compile without it */ |
|||
#define F___sout |
|||
|
|||
//#define F_sprintf |
|||
//#define F_snprintf |
|||
//#define F_vsprintf |
|||
#define F_vsnprintf |
|||
|
|||
#ifdef F_sprintf |
|||
int sprintf(char *str, const char *format, ...); |
|||
#endif |
|||
|
|||
#ifdef F_snprintf |
|||
int snprintf(char *str, size_t sz, const char *format, ...); |
|||
#endif |
|||
|
|||
#ifdef F_vsprintf |
|||
int vsprintf(char *buf, const char *fmt, va_list ap); |
|||
#endif |
|||
|
|||
#ifdef F_vsnprintf |
|||
int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap); |
|||
#endif |
|||
|
|||
#endif /* _XPRINTF_H_ */ |
|||
@ -0,0 +1,12 @@ |
|||
# _____ ___ ____ ___ ____
|
|||
# ____| | ____| | | |____|
|
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
|||
#-----------------------------------------------------------------------
|
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
|
|||
# Licenced under Academic Free License version 2.0
|
|||
# Review ps2sdk README & LICENSE files for further details.
|
|||
|
|||
SUBDIRS = dev9 extflash poweroff atad hdpro_atad pvrdrv |
|||
|
|||
include $(PS2SDKSRC)/Defs.make |
|||
include $(PS2SDKSRC)/Rules.make |
|||
@ -0,0 +1,45 @@ |
|||
# _____ ___ ____ ___ ____
|
|||
# ____| | ____| | | |____|
|
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
|||
#-----------------------------------------------------------------------
|
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
|
|||
# Licenced under Academic Free License version 2.0
|
|||
# Review ps2sdk README & LICENSE files for further details.
|
|||
|
|||
# Enable to perform the SCE HDD check at the end of ATA device initialization.
|
|||
ATA_SCE_AUTH_HDD ?= 0 |
|||
|
|||
# Enable to enable support for Multi-Word DMA (MWDMA) modes, as in early ATAD modules.
|
|||
ATA_MWDMA_MODES ?= 0 |
|||
|
|||
# Enable to enable support for PIO modes 0-4 (as in early ATAD modules), instead of just PIO mode 0.
|
|||
ATA_ALL_PIO_MODES ?= 0 |
|||
|
|||
# Disable to disable the workaround for bad GameStar compatible adaptors.
|
|||
ATA_GAMESTAR_WORKAROUND ?= 1 |
|||
|
|||
IOP_BIN ?= ps2atad.irx |
|||
|
|||
IOP_INCS += -I$(PS2SDKSRC)/iop/dev9/dev9/include |
|||
IOP_OBJS = ps2atad.o imports.o exports.o |
|||
|
|||
ifeq ($(ATA_SCE_AUTH_HDD),1) |
|||
IOP_CFLAGS += -DATA_SCE_AUTH_HDD=1 |
|||
endif |
|||
|
|||
ifeq ($(ATA_MWDMA_MODES),1) |
|||
IOP_CFLAGS += -DATA_MWDMA_MODES=1 |
|||
endif |
|||
|
|||
ifeq ($(ATA_ALL_PIO_MODES),1) |
|||
IOP_CFLAGS += -DATA_ALL_PIO_MODES=1 |
|||
endif |
|||
|
|||
ifeq ($(ATA_GAMESTAR_WORKAROUND),1) |
|||
IOP_CFLAGS += -DATA_GAMESTAR_WORKAROUND=1 |
|||
endif |
|||
|
|||
include $(PS2SDKSRC)/Defs.make |
|||
include $(PS2SDKSRC)/iop/Rules.bin.make |
|||
include $(PS2SDKSRC)/iop/Rules.make |
|||
include $(PS2SDKSRC)/iop/Rules.release |
|||
@ -0,0 +1,96 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org> |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* ATA Device Driver definitions and imports. |
|||
*/ |
|||
|
|||
#ifndef __ATAD_H__ |
|||
#define __ATAD_H__ |
|||
|
|||
#include <types.h> |
|||
#include <irx.h> |
|||
|
|||
/* These are used with the dir parameter of ata_device_sector_io(). */ |
|||
#define ATA_DIR_READ 0 |
|||
#define ATA_DIR_WRITE 1 |
|||
|
|||
typedef struct _ata_devinfo |
|||
{ |
|||
/** Was successfully probed. */ |
|||
s32 exists; |
|||
/** Supports the PACKET command set. */ |
|||
s32 has_packet; |
|||
/** Total number of user sectors. */ |
|||
u32 total_sectors; |
|||
/** Word 0x100 of the identify info. */ |
|||
u32 security_status; |
|||
/** Supports the 48-bit LBA command set (unofficial). */ |
|||
u32 lba48; |
|||
/** Total number of 48-bit LBA user sectors (unofficial). */ |
|||
u32 total_sectors_lba48; |
|||
} ata_devinfo_t; |
|||
|
|||
/* Error definitions. */ |
|||
#define ATA_RES_ERR_NOTREADY -501 |
|||
#define ATA_RES_ERR_TIMEOUT -502 |
|||
#define ATA_RES_ERR_IO -503 |
|||
#define ATA_RES_ERR_NODATA -504 |
|||
#define ATA_RES_ERR_NODEV -505 |
|||
#define ATA_RES_ERR_CMD -506 |
|||
#define ATA_RES_ERR_LOCKED -509 |
|||
#define ATA_RES_ERR_ICRC -510 |
|||
|
|||
ata_devinfo_t *ata_get_devinfo(int device); |
|||
|
|||
int ata_reset_devices(void); |
|||
|
|||
int ata_io_start(void *buf, u32 blkcount, u16 feature, u16 nsector, u16 sector, u16 lcyl, u16 hcyl, u16 select, u16 command); |
|||
int ata_io_finish(void); |
|||
|
|||
int ata_get_error(void); |
|||
|
|||
#define ata_device_dma_transfer ata_device_sector_io // Backward-compatibility |
|||
int ata_device_sector_io(int device, void *buf, u32 lba, u32 nsectors, int dir); |
|||
|
|||
// DRM functions that were meant to keep users from sharing disks (and hence the contained content). Supported by only Sony-modified HDDs (e.g. the SCPH-20400). |
|||
int ata_device_sce_sec_set_password(int device, void *password); |
|||
int ata_device_sce_sec_unlock(int device, void *password); |
|||
int ata_device_sce_sec_erase(int device); |
|||
|
|||
int ata_device_idle(int device, int period); |
|||
int ata_device_sce_identify_drive(int device, void *data); |
|||
int ata_device_smart_get_status(int device); |
|||
int ata_device_smart_save_attr(int device); |
|||
int ata_device_flush_cache(int device); |
|||
int ata_device_idle_immediate(int device); |
|||
|
|||
#define atad_IMPORTS_start DECLARE_IMPORT_TABLE(atad, 1, 3) |
|||
#define atad_IMPORTS_end END_IMPORT_TABLE |
|||
|
|||
#define I_ata_get_devinfo DECLARE_IMPORT(4, ata_get_devinfo) |
|||
#define I_ata_reset_devices DECLARE_IMPORT(5, ata_reset_devices) |
|||
#define I_ata_io_start DECLARE_IMPORT(6, ata_io_start) |
|||
#define I_ata_io_finish DECLARE_IMPORT(7, ata_io_finish) |
|||
#define I_ata_get_error DECLARE_IMPORT(8, ata_get_error) |
|||
#define I_ata_device_dma_transfer I_ata_device_sector_io // Backward-compatibility |
|||
#define I_ata_device_sector_io DECLARE_IMPORT(9, ata_device_sector_io) |
|||
#define I_ata_device_sce_sec_set_password DECLARE_IMPORT(10, ata_device_sce_sec_set_password) |
|||
#define I_ata_device_sce_sec_unlock DECLARE_IMPORT(11, ata_device_sce_sec_unlock) |
|||
#define I_ata_device_sce_sec_erase DECLARE_IMPORT(12, ata_device_sce_sec_erase) |
|||
#define I_ata_device_idle DECLARE_IMPORT(13, ata_device_idle) |
|||
#define I_ata_device_sce_identify_drive DECLARE_IMPORT(14, ata_device_sce_identify_drive) |
|||
#define I_ata_device_smart_get_status DECLARE_IMPORT(15, ata_device_smart_get_status) |
|||
#define I_ata_device_smart_save_attr DECLARE_IMPORT(16, ata_device_smart_save_attr) |
|||
#define I_ata_device_flush_cache DECLARE_IMPORT(17, ata_device_flush_cache) |
|||
#define I_ata_device_idle_immediate DECLARE_IMPORT(18, ata_device_idle_immediate) |
|||
|
|||
#endif /* __ATAD_H__ */ |
|||
@ -0,0 +1,26 @@ |
|||
/* We conform to the 1.3 version of atad.irx exports. */ |
|||
|
|||
DECLARE_EXPORT_TABLE(atad, 1, 3) |
|||
DECLARE_EXPORT(_start) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_exit) |
|||
DECLARE_EXPORT(_retonly) |
|||
|
|||
DECLARE_EXPORT(ata_get_devinfo) |
|||
/*05*/ DECLARE_EXPORT(ata_reset_devices) |
|||
DECLARE_EXPORT(ata_io_start) |
|||
DECLARE_EXPORT(ata_io_finish) |
|||
DECLARE_EXPORT(ata_get_error) |
|||
DECLARE_EXPORT(ata_device_sector_io) |
|||
/*10*/ DECLARE_EXPORT(ata_device_sce_sec_set_password) |
|||
DECLARE_EXPORT(ata_device_sce_sec_unlock) |
|||
DECLARE_EXPORT(ata_device_sce_sec_erase) |
|||
DECLARE_EXPORT(ata_device_idle) |
|||
DECLARE_EXPORT(ata_device_sce_identify_drive) |
|||
/*15*/ DECLARE_EXPORT(ata_device_smart_get_status) |
|||
DECLARE_EXPORT(ata_device_smart_save_attr) |
|||
DECLARE_EXPORT(ata_device_flush_cache) |
|||
DECLARE_EXPORT(ata_device_idle_immediate) |
|||
END_EXPORT_TABLE |
|||
|
|||
void _retonly() {} |
|||
@ -0,0 +1,37 @@ |
|||
loadcore_IMPORTS_start |
|||
I_RegisterLibraryEntries |
|||
loadcore_IMPORTS_end |
|||
|
|||
thbase_IMPORTS_start |
|||
I_DelayThread |
|||
I_SetAlarm |
|||
I_CancelAlarm |
|||
I_USec2SysClock |
|||
thbase_IMPORTS_end |
|||
|
|||
thevent_IMPORTS_start |
|||
I_CreateEventFlag |
|||
I_iSetEventFlag |
|||
I_ClearEventFlag |
|||
I_WaitEventFlag |
|||
thevent_IMPORTS_end |
|||
|
|||
stdio_IMPORTS_start |
|||
I_printf |
|||
stdio_IMPORTS_end |
|||
|
|||
sysclib_IMPORTS_start |
|||
I_memcpy |
|||
I_memset |
|||
sysclib_IMPORTS_end |
|||
|
|||
dev9_IMPORTS_start |
|||
I_dev9RegisterIntrCb |
|||
I_dev9DmaTransfer |
|||
I_dev9IntrEnable |
|||
I_dev9IntrDisable |
|||
I_dev9LEDCtl |
|||
I_dev9RegisterShutdownCb |
|||
I_dev9RegisterPreDmaCb |
|||
I_dev9RegisterPostDmaCb |
|||
dev9_IMPORTS_end |
|||
@ -0,0 +1,26 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org> |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
# |
|||
# Defines all IRX imports. |
|||
*/ |
|||
|
|||
#ifndef IOP_IRX_IMPORTS_H |
|||
#define IOP_IRX_IMPORTS_H |
|||
|
|||
#include <irx.h> |
|||
|
|||
/* Please keep these in alphabetical order! */ |
|||
#include <dev9.h> |
|||
#include <loadcore.h> |
|||
#include <stdio.h> |
|||
#include <sysclib.h> |
|||
#include <thbase.h> |
|||
#include <thevent.h> |
|||
|
|||
#endif /* IOP_IRX_IMPORTS_H */ |
|||
1241
sps2_basement/hardware/dev9/atad/src/ps2atad.c
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,38 @@ |
|||
# _____ ___ ____ ___ ____
|
|||
# ____| | ____| | | |____|
|
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
|||
#-----------------------------------------------------------------------
|
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
|
|||
# Licenced under Academic Free License version 2.0
|
|||
# Review ps2sdk README & LICENSE files for further details.
|
|||
|
|||
# Enable to disable initialization of SMAP within DEV9 (i.e. clone adaptor compatibility).
|
|||
DEV9_SKIP_SMAP_INIT ?= 0 |
|||
|
|||
# Enable to enable support for the PSX's devices
|
|||
DEV9_PSX_SUPPORT ?= 1 |
|||
|
|||
# Disable to disable the workaround (skip SMAP initialization) for bad GameStar compatible adaptors.
|
|||
DEV9_GAMESTAR_WORKAROUND ?= 1 |
|||
|
|||
IOP_BIN ?= ps2dev9.irx |
|||
|
|||
IOP_INCS += -I$(PS2SDKSRC)/iop/dev9/poweroff/include |
|||
IOP_OBJS = ps2dev9.o exports.o imports.o |
|||
|
|||
ifeq ($(DEV9_SKIP_SMAP_INIT),1) |
|||
IOP_CFLAGS += -DDEV9_SKIP_SMAP_INIT=1 |
|||
endif |
|||
|
|||
ifeq ($(DEV9_PSX_SUPPORT),1) |
|||
IOP_CFLAGS += -DDEV9_PSX_SUPPORT=1 |
|||
endif |
|||
|
|||
ifeq ($(DEV9_GAMESTAR_WORKAROUND),1) |
|||
IOP_CFLAGS += -DDEV9_GAMESTAR_WORKAROUND=1 |
|||
endif |
|||
|
|||
include $(PS2SDKSRC)/Defs.make |
|||
include $(PS2SDKSRC)/iop/Rules.bin.make |
|||
include $(PS2SDKSRC)/iop/Rules.make |
|||
include $(PS2SDKSRC)/iop/Rules.release |
|||
@ -0,0 +1,64 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org> |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* DEV9 Device Driver definitions and imports. |
|||
*/ |
|||
|
|||
#ifndef __DEV9_H__ |
|||
#define __DEV9_H__ |
|||
|
|||
#include <types.h> |
|||
#include <irx.h> |
|||
|
|||
#include <hdd-ioctl.h> |
|||
|
|||
typedef int (*dev9_intr_cb_t)(int flag); |
|||
typedef void (*dev9_shutdown_cb_t)(void); |
|||
typedef void (*dev9_dma_cb_t)(int bcr, int dir); |
|||
|
|||
void dev9RegisterIntrCb(int intr, dev9_intr_cb_t cb); |
|||
|
|||
int dev9DmaTransfer(int ctrl, void *buf, int bcr, int dir); |
|||
|
|||
void dev9Shutdown(void); |
|||
void dev9IntrEnable(int mask); |
|||
void dev9IntrDisable(int mask); |
|||
|
|||
int dev9GetEEPROM(u16 *buf); |
|||
|
|||
void dev9LEDCtl(int ctl); |
|||
void dev9LED2Ctl(int ctl); |
|||
void dev9ControlPIO3(int ctl); |
|||
|
|||
int dev9RegisterShutdownCb(int idx, dev9_shutdown_cb_t cb); |
|||
|
|||
void dev9RegisterPreDmaCb(int ctrl, dev9_dma_cb_t cb); |
|||
|
|||
void dev9RegisterPostDmaCb(int ctrl, dev9_dma_cb_t cb); |
|||
|
|||
#define dev9_IMPORTS_start DECLARE_IMPORT_TABLE(dev9, 1, 9) |
|||
#define dev9_IMPORTS_end END_IMPORT_TABLE |
|||
|
|||
#define I_dev9RegisterIntrCb DECLARE_IMPORT(4, dev9RegisterIntrCb) |
|||
#define I_dev9DmaTransfer DECLARE_IMPORT(5, dev9DmaTransfer) |
|||
#define I_dev9Shutdown DECLARE_IMPORT(6, dev9Shutdown) |
|||
#define I_dev9IntrEnable DECLARE_IMPORT(7, dev9IntrEnable) |
|||
#define I_dev9IntrDisable DECLARE_IMPORT(8, dev9IntrDisable) |
|||
#define I_dev9GetEEPROM DECLARE_IMPORT(9, dev9GetEEPROM) |
|||
#define I_dev9LEDCtl DECLARE_IMPORT(10, dev9LEDCtl) |
|||
#define I_dev9RegisterShutdownCb DECLARE_IMPORT(11, dev9RegisterShutdownCb) |
|||
#define I_dev9RegisterPreDmaCb DECLARE_IMPORT(12, dev9RegisterPreDmaCb) |
|||
#define I_dev9RegisterPostDmaCb DECLARE_IMPORT(13, dev9RegisterPostDmaCb) |
|||
#define I_dev9ControlPIO3 DECLARE_IMPORT(14, dev9ControlPIO3) |
|||
#define I_dev9LED2Ctl DECLARE_IMPORT(15, dev9LED2Ctl) |
|||
|
|||
#endif /* __DEV9_H__ */ |
|||
@ -0,0 +1,22 @@ |
|||
DECLARE_EXPORT_TABLE(dev9, 1, 9) |
|||
DECLARE_EXPORT(_start) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_exit) |
|||
DECLARE_EXPORT(_retonly) |
|||
|
|||
/* 4 */ |
|||
DECLARE_EXPORT(dev9RegisterIntrCb) |
|||
DECLARE_EXPORT(dev9DmaTransfer) |
|||
DECLARE_EXPORT(dev9Shutdown) |
|||
DECLARE_EXPORT(dev9IntrEnable) |
|||
DECLARE_EXPORT(dev9IntrDisable) |
|||
DECLARE_EXPORT(dev9GetEEPROM) |
|||
DECLARE_EXPORT(dev9LEDCtl) |
|||
DECLARE_EXPORT(dev9RegisterShutdownCb) |
|||
DECLARE_EXPORT(dev9RegisterPreDmaCb) |
|||
DECLARE_EXPORT(dev9RegisterPostDmaCb) |
|||
DECLARE_EXPORT(dev9ControlPIO3) |
|||
DECLARE_EXPORT(dev9LED2Ctl) |
|||
END_EXPORT_TABLE |
|||
|
|||
void _retonly() {} |
|||
@ -0,0 +1,41 @@ |
|||
dmacman_IMPORTS_start |
|||
I_dmac_get_dpcr2 |
|||
I_dmac_set_dpcr2 |
|||
dmacman_IMPORTS_end |
|||
|
|||
intrman_IMPORTS_start |
|||
I_RegisterIntrHandler |
|||
I_EnableIntr |
|||
I_DisableIntr |
|||
I_CpuSuspendIntr |
|||
I_CpuResumeIntr |
|||
intrman_IMPORTS_end |
|||
|
|||
ioman_IMPORTS_start |
|||
I_AddDrv |
|||
I_DelDrv |
|||
ioman_IMPORTS_end |
|||
|
|||
loadcore_IMPORTS_start |
|||
I_RegisterLibraryEntries |
|||
I_QueryBootMode |
|||
loadcore_IMPORTS_end |
|||
|
|||
stdio_IMPORTS_start |
|||
I_printf |
|||
stdio_IMPORTS_end |
|||
|
|||
sysclib_IMPORTS_start |
|||
I_strcmp |
|||
I_strrchr |
|||
sysclib_IMPORTS_end |
|||
|
|||
thbase_IMPORTS_start |
|||
I_DelayThread |
|||
thbase_IMPORTS_end |
|||
|
|||
thsemap_IMPORTS_start |
|||
I_CreateSema |
|||
I_SignalSema |
|||
I_WaitSema |
|||
thsemap_IMPORTS_end |
|||
@ -0,0 +1,28 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org> |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
# |
|||
# Defines all IRX imports. |
|||
*/ |
|||
|
|||
#ifndef IOP_IRX_IMPORTS_H |
|||
#define IOP_IRX_IMPORTS_H |
|||
|
|||
#include "irx.h" |
|||
|
|||
/* Please keep these in alphabetical order! */ |
|||
#include "dmacman.h" |
|||
#include "intrman.h" |
|||
#include "ioman.h" |
|||
#include "loadcore.h" |
|||
#include "stdio.h" |
|||
#include "sysclib.h" |
|||
#include "thbase.h" |
|||
#include "thsemap.h" |
|||
|
|||
#endif /* IOP_IRX_IMPORTS_H */ |
|||
1282
sps2_basement/hardware/dev9/dev9/src/ps2dev9.c
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,18 @@ |
|||
# _____ ___ ____ ___ ____
|
|||
# ____| | ____| | | |____|
|
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
|
|||
#-----------------------------------------------------------------------
|
|||
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
|
|||
# Licenced under Academic Free License version 2.0
|
|||
# Review ps2sdk README & LICENSE files for further details.
|
|||
|
|||
IOP_BIN_ALTNAMES = flash.irx |
|||
|
|||
IOP_INCS += -I$(PS2SDKSRC)/iop/dev9/dev9/include |
|||
|
|||
IOP_OBJS = extflash.o exports.o imports.o |
|||
|
|||
include $(PS2SDKSRC)/Defs.make |
|||
include $(PS2SDKSRC)/iop/Rules.bin.make |
|||
include $(PS2SDKSRC)/iop/Rules.make |
|||
include $(PS2SDKSRC)/iop/Rules.release |
|||
@ -0,0 +1,29 @@ |
|||
extflash - Flash interface via expansion port. |
|||
|
|||
Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org> |
|||
-- |
|||
|
|||
The PS2 50000 series BIOS introduced a new expansion (Dev9) device driver for |
|||
NAND (serial) flash and a method for booting off of this device - the "External |
|||
Flash ROM". This flash is the same type as the 64Mbit flash found in the PS2 |
|||
memory card. As far as I know, these chips come from either Samsung or Toshiba |
|||
(datasheets can be found on their semiconductor websites). Toshiba part numbers |
|||
are listed below. |
|||
|
|||
Part No. Size |
|||
TC48V64BFT 64Mbit (8MB) |
|||
TC58128AFT 128Mbit (16MB) |
|||
TC58256AFT 256Mbit (32MB) |
|||
TC58512FT 512Mbit (64MB) |
|||
TH58100FT 1024Mbit (128MB) |
|||
|
|||
These devices are accessed via SmartMedia commands. |
|||
|
|||
Apparently these devices are formatted using MCFS, the filesystem used on |
|||
normal PS2 memory cards. The OSD can boot from these devices the same way it |
|||
can boot from the HDD. |
|||
|
|||
Why SCEI would include this driver within the 50k BIOS remains a mystery. It's |
|||
possible that this is the "firmware update" inside the PSX. I wrote the |
|||
extflash driver to get a better understanding of the hardware interface to |
|||
these devices. |
|||
@ -0,0 +1,45 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org> |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
*/ |
|||
|
|||
/** |
|||
* @file |
|||
* Expansion bay flash driver. |
|||
* Supported in ROM in SCPH-5xxxx models and integrated in DESR-xxxx models. |
|||
*/ |
|||
|
|||
#ifndef __FLS_H__ |
|||
#define __FLS_H__ |
|||
|
|||
typedef struct { |
|||
u32 id; |
|||
u32 mbits; |
|||
u32 page_bytes; /* bytes/page */ |
|||
u32 block_pages; /* pages/block */ |
|||
u32 blocks; |
|||
} flash_info_t; |
|||
|
|||
extern int flash_detect(void); |
|||
extern int flash_device_reset(void); |
|||
extern int flash_get_info(flash_info_t *info); |
|||
extern int flash_page_erase(flash_info_t *info, u32 page); |
|||
extern int flash_page_read(flash_info_t *info, u32 page, u32 count, void *buf); |
|||
extern int flash_page_write(flash_info_t *info, u32 page, void *buf); |
|||
|
|||
#define fls_IMPORTS_start DECLARE_IMPORT_TABLE(fls, 1, 1) |
|||
#define fls_IMPORTS_end END_IMPORT_TABLE |
|||
|
|||
#define I_flash_detect DECLARE_IMPORT(4, flash_detect) |
|||
#define I_flash_device_reset DECLARE_IMPORT(5, flash_device_reset) |
|||
#define I_flash_get_info DECLARE_IMPORT(6, flash_get_info) |
|||
#define I_flash_page_erase DECLARE_IMPORT(7, flash_page_erase) |
|||
#define I_flash_page_read DECLARE_IMPORT(8, flash_page_read) |
|||
#define I_flash_page_write DECLARE_IMPORT(9, flash_page_write) |
|||
|
|||
#endif |
|||
@ -0,0 +1,19 @@ |
|||
DECLARE_EXPORT_TABLE(fls, 1, 1) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(flash_detect) |
|||
DECLARE_EXPORT(flash_device_reset) |
|||
DECLARE_EXPORT(flash_get_info) |
|||
DECLARE_EXPORT(flash_page_erase) |
|||
DECLARE_EXPORT(flash_page_read) |
|||
DECLARE_EXPORT(flash_page_write) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_retonly) |
|||
DECLARE_EXPORT(_start) |
|||
END_EXPORT_TABLE |
|||
|
|||
void _retonly() {} |
|||
@ -0,0 +1,362 @@ |
|||
/* |
|||
# _____ ___ ____ ___ ____ |
|||
# ____| | ____| | | |____| |
|||
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
|||
#----------------------------------------------------------------------- |
|||
# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org> |
|||
# Licenced under Academic Free License version 2.0 |
|||
# Review ps2sdk README & LICENSE files for further details. |
|||
# |
|||
# NAND Flash via Dev9 driver. |
|||
*/ |
|||
|
|||
#include "types.h" |
|||
#include "defs.h" |
|||
#include "irx.h" |
|||
|
|||
#include "loadcore.h" |
|||
#include "thbase.h" |
|||
#include "stdio.h" |
|||
#include "sysclib.h" |
|||
|
|||
#include "dev9regs.h" |
|||
#include "speedregs.h" |
|||
|
|||
#include "fls.h" |
|||
|
|||
#define MODNAME "flash" |
|||
#define M_PRINTF(format, args...) \ |
|||
printf(MODNAME ": " format, ## args) |
|||
|
|||
IRX_ID(MODNAME, 0, 0); |
|||
|
|||
#define FLASH_ID_64MBIT 0xe6 |
|||
#define FLASH_ID_128MBIT 0x73 |
|||
#define FLASH_ID_256MBIT 0x75 |
|||
#define FLASH_ID_512MBIT 0x76 |
|||
#define FLASH_ID_1024MBIT 0x79 |
|||
|
|||
/* SmartMedia commands. */ |
|||
#define SM_CMD_READ1 0x00 |
|||
#define SM_CMD_READ2 0x01 |
|||
#define SM_CMD_READ3 0x50 |
|||
#define SM_CMD_RESET 0xff |
|||
#define SM_CMD_WRITEDATA 0x80 |
|||
#define SM_CMD_PROGRAMPAGE 0x10 |
|||
#define SM_CMD_ERASEBLOCK 0x60 |
|||
#define SM_CMD_ERASECONFIRM 0xd0 |
|||
#define SM_CMD_GETSTATUS 0x70 |
|||
#define SM_CMD_READID 0x90 |
|||
|
|||
static flash_info_t devices[] = { |
|||
{ FLASH_ID_64MBIT, 64, 528, 16, 1024 }, |
|||
{ FLASH_ID_128MBIT, 128, 528, 32, 1024 }, |
|||
{ FLASH_ID_256MBIT, 256, 528, 32, 2048 }, |
|||
{ FLASH_ID_512MBIT, 512, 528, 32, 4096 }, |
|||
{ FLASH_ID_1024MBIT, 1024, 528, 32, 8192 } |
|||
}; |
|||
#define NUM_DEVICES (sizeof(devices)/sizeof(flash_info_t)) |
|||
|
|||
static iop_sys_clock_t timeout; |
|||
static u32 timeout_cb(void *); |
|||
|
|||
extern struct irx_export_table _exp_fls; |
|||
|
|||
int _start(int argc, char *argv[]) |
|||
{ |
|||
if (flash_detect() < 0) |
|||
return MODULE_NO_RESIDENT_END; |
|||
|
|||
return RegisterLibraryEntries(&_exp_fls) != 0; |
|||
} |
|||
|
|||
/* #4: Check to see if flash is connected to the expansion bay. */ |
|||
int flash_detect(void) |
|||
{ |
|||
USE_DEV9_REGS; |
|||
USE_SPD_REGS; |
|||
u16 rev; |
|||
|
|||
if ((DEV9_REG(DEV9_R_REV) & 0xf0) != DEV9_DEV9C_9611) { |
|||
M_PRINTF("CXD9611 required for flash interface.\n"); |
|||
return -1; |
|||
} |
|||
|
|||
/* Check bit 5 of the revision register. */ |
|||
if ((rev = SPD_REG16(SPD_R_REV_3)) & SPD_CAPS_FLASH) { |
|||
M_PRINTF("Detected flash (rev3 0x%02x).\n", rev); |
|||
return 0; |
|||
} |
|||
|
|||
M_PRINTF("No flash detected (rev3 0x%02x).\n", rev); |
|||
return -1; |
|||
} |
|||
|
|||
/* #5: Reset the device. */ |
|||
int flash_device_reset(void) |
|||
{ |
|||
USE_SPD_REGS; |
|||
u32 has_timedout = 0; |
|||
u16 tmp __attribute__((unused)); |
|||
|
|||
SPD_REG16(0x480c) = 0x100; |
|||
SPD_REG16(0x4804) = SM_CMD_RESET; |
|||
tmp = SPD_REG16(0x480c); |
|||
tmp = SPD_REG16(0x480c); |
|||
|
|||
SetAlarm(&timeout, (void *)timeout_cb, &has_timedout); |
|||
|
|||
while ((SPD_REG16(0x480c) & 0x01) == 0) { |
|||
if (has_timedout) { |
|||
if (SPD_REG16(0x480c) & 0x01) |
|||
break; |
|||
|
|||
M_PRINTF("Device erase: timed out.\n"); |
|||
return -3; |
|||
} |
|||
} |
|||
|
|||
CancelAlarm((void *)timeout_cb, &has_timedout); |
|||
|
|||
SPD_REG16(0x4804) = SM_CMD_GETSTATUS; |
|||
if (SPD_REG16(0x4814) & 0x01) { |
|||
M_PRINTF("Device erase: status error.\n"); |
|||
return -6; |
|||
} |
|||
|
|||
SPD_REG16(0x480c) = 0; |
|||
return 0; |
|||
} |
|||
|
|||
/* #6: Get information about the attached device. */ |
|||
int flash_get_info(flash_info_t *info) |
|||
{ |
|||
USE_SPD_REGS; |
|||
int i; |
|||
u16 tmp __attribute__((unused)), id; |
|||
|
|||
SPD_REG16(0x480c) = 0x100; |
|||
SPD_REG16(0x4804) = SM_CMD_READID; |
|||
SPD_REG16(0x4808) = 0; |
|||
tmp = SPD_REG16(0x480c); |
|||
tmp = SPD_REG16(0x4814); |
|||
id = SPD_REG16(0x4814); |
|||
SPD_REG16(0x480c) = 0; |
|||
|
|||
memset(info, 0, sizeof(flash_info_t)); |
|||
|
|||
for (i = 0; i < NUM_DEVICES; i++) { |
|||
if (id != devices[i].id) |
|||
continue; |
|||
|
|||
memcpy(info, &devices[i], sizeof(flash_info_t)); |
|||
M_PRINTF("Device: ID 0x%02x, %ld Mbit, %ld bytes/page, %ld pages/block, %ld blocks total.\n", |
|||
id, info->mbits, info->page_bytes, info->block_pages, info->blocks); |
|||
return 0; |
|||
} |
|||
|
|||
return -5; |
|||
} |
|||
|
|||
/* Set the page offset register based on the type of flash (id). */ |
|||
static void flash_set_page(u32 id, u32 pageofs) |
|||
{ |
|||
USE_SPD_REGS; |
|||
|
|||
switch (id) { |
|||
case FLASH_ID_64MBIT: |
|||
SPD_REG16(0x4808) = ((pageofs >> 9) & 0xff) | 0x100; |
|||
SPD_REG16(0x4808) = ((pageofs >> 17) & 0x3f); |
|||
break; |
|||
case FLASH_ID_128MBIT: |
|||
SPD_REG16(0x4808) = ((pageofs >> 9) & 0xff) | 0x100; |
|||
SPD_REG16(0x4808) = ((pageofs >> 17) & 0x7f); |
|||
break; |
|||
case FLASH_ID_256MBIT: |
|||
SPD_REG16(0x4808) = ((pageofs >> 9) & 0xff) | 0x100; |
|||
SPD_REG16(0x4808) = ((pageofs >> 17) & 0xff); |
|||
break; |
|||
case FLASH_ID_512MBIT: |
|||
SPD_REG16(0x4808) = ((pageofs >> 17) & 0xff) | 0x100; |
|||
SPD_REG16(0x4808) = ((pageofs >> 25) & 0x01); |
|||
break; |
|||
case FLASH_ID_1024MBIT: |
|||
SPD_REG16(0x4808) = ((pageofs >> 17) & 0xff) | 0x100; |
|||
SPD_REG16(0x4808) = ((pageofs >> 25) & 0x02); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
/* #7: Erase a page. */ |
|||
int flash_page_erase(flash_info_t *info, u32 page) |
|||
{ |
|||
USE_SPD_REGS; |
|||
u32 pageofs = page * 512; |
|||
u32 has_timedout = 0; |
|||
u16 tmp __attribute__((unused)); |
|||
|
|||
SPD_REG16(0x480c) = 0x180; |
|||
SPD_REG16(0x4804) = SM_CMD_ERASEBLOCK; |
|||
|
|||
flash_set_page(info->id, pageofs); |
|||
|
|||
SPD_REG16(0x4804) = SM_CMD_ERASECONFIRM; |
|||
tmp = SPD_REG16(0x480c); |
|||
tmp = SPD_REG16(0x480c); |
|||
|
|||
SetAlarm(&timeout, (void *)timeout_cb, &has_timedout); |
|||
|
|||
while ((SPD_REG16(0x480c) & 0x01) == 0) { |
|||
if (has_timedout) { |
|||
if (SPD_REG16(0x480c) & 0x01) |
|||
break; |
|||
|
|||
M_PRINTF("Page erase: timed out.\n"); |
|||
return -3; |
|||
} |
|||
} |
|||
|
|||
CancelAlarm((void *)timeout_cb, &has_timedout); |
|||
|
|||
SPD_REG16(0x4804) = SM_CMD_GETSTATUS; |
|||
if (SPD_REG16(0x4814) & 0x01) { |
|||
M_PRINTF("Page erase: status error.\n"); |
|||
return -6; |
|||
} |
|||
|
|||
SPD_REG16(0x480c) = 0; |
|||
return 0; |
|||
} |
|||
|
|||
/* #8: Read one or more pages. You can select how much of the page you want to |
|||
* read by setting the page_bytes member of the info struct. The default set |
|||
* by the driver is 528 bytes: |
|||
* Bytes 0 - 511: Data |
|||
* Bytes 512 - 527: Metadata? |
|||
* |
|||
* You can also set page_bytes to 512 or 16 bytes. */ |
|||
int flash_page_read(flash_info_t *info, u32 page, u32 count, void *buf) |
|||
{ |
|||
USE_SPD_REGS; |
|||
u32 *buf_w; |
|||
u16 *buf_h; |
|||
int i, j; |
|||
u32 byteofs, pageofs = page * 512; |
|||
u32 has_timedout; |
|||
u16 tmp __attribute__((unused)), func = 0x100; |
|||
|
|||
if (info->page_bytes == 512) |
|||
func = 0x1100; |
|||
|
|||
SPD_REG16(0x480c) = func; |
|||
|
|||
if (info->page_bytes == 16) { |
|||
SPD_REG16(0x4804) = SM_CMD_READ3; |
|||
byteofs = pageofs & 0x0f; |
|||
} else { |
|||
SPD_REG16(0x4804) = SM_CMD_READ1; |
|||
byteofs = pageofs & 0x1ff; |
|||
} |
|||
|
|||
SPD_REG16(0x4808) = (byteofs & 0xff) | 0x100; |
|||
/* Set the rest of the page info. */ |
|||
flash_set_page(info->id, pageofs); |
|||
|
|||
buf_w = (u32 *)buf; |
|||
buf_h = (u16 *)buf; |
|||
|
|||
for (i = 0; i < count; i++) { |
|||
tmp = SPD_REG16(0x480c); |
|||
tmp = SPD_REG16(0x480c); |
|||
|
|||
has_timedout = 0; |
|||
SetAlarm(&timeout, (void *)timeout_cb, &has_timedout); |
|||
|
|||
while ((SPD_REG16(0x480c) & 0x01) == 0) { |
|||
if (has_timedout) { |
|||
if (SPD_REG16(0x480c) & 0x01) |
|||
break; |
|||
|
|||
M_PRINTF("Page read: timed out.\n"); |
|||
return -3; |
|||
} |
|||
} |
|||
|
|||
CancelAlarm((void *)timeout_cb, &has_timedout); |
|||
|
|||
SPD_REG16(0x480c) = func | 0x800; |
|||
|
|||
if (byteofs == 0) { |
|||
/* 32-bit copy. */ |
|||
for (j = 0; j < (info->page_bytes / 4); j++) |
|||
*buf_w++ = SPD_REG32(0x4800); |
|||
} else { |
|||
/* 16-bit copy. */ |
|||
for (j = (byteofs + (byteofs >> 31)) / 2; j < (info->page_bytes / 2); j++) |
|||
*buf_h++ = SPD_REG16(0x4800); |
|||
} |
|||
|
|||
byteofs = 0; |
|||
SPD_REG16(0x480c) = func; |
|||
} |
|||
|
|||
SPD_REG16(0x480c) = 0; |
|||
return 0; |
|||
} |
|||
|
|||
/* #9: Write a single page. |
|||
* Bytes 0 - 511: Data |
|||
* Bytes 512 - 527: Metadata? */ |
|||
int flash_page_write(flash_info_t *info, u32 page, void *buf) |
|||
{ |
|||
USE_SPD_REGS; |
|||
u16 *buf_h = buf; |
|||
int i; |
|||
u32 pageofs = page * 512; |
|||
u32 has_timedout = 0; |
|||
u16 tmp __attribute__((unused)); |
|||
|
|||
SPD_REG16(0x480c) = 0x180; |
|||
SPD_REG16(0x4804) = SM_CMD_WRITEDATA; |
|||
|
|||
SPD_REG16(0x4808) = 0x100; |
|||
flash_set_page(info->id, pageofs); |
|||
|
|||
for (i = 0; i < (info->page_bytes / 2); i++) |
|||
SPD_REG16(0x4800) = *buf_h++; |
|||
|
|||
SPD_REG16(0x4804) = SM_CMD_PROGRAMPAGE; |
|||
tmp = SPD_REG16(0x480c); |
|||
tmp = SPD_REG16(0x480c); |
|||
|
|||
SetAlarm(&timeout, (void *)timeout_cb, &has_timedout); |
|||
|
|||
while ((SPD_REG16(0x480c) & 0x01) == 0) { |
|||
if (has_timedout) { |
|||
if (SPD_REG16(0x480c) & 0x01) |
|||
break; |
|||
|
|||
M_PRINTF("Page write: timed out.\n"); |
|||
return -3; |
|||
} |
|||
} |
|||
|
|||
CancelAlarm((void *)timeout_cb, &has_timedout); |
|||
|
|||
SPD_REG16(0x4804) = SM_CMD_GETSTATUS; |
|||
if (SPD_REG16(0x4814) & 0x01) { |
|||
M_PRINTF("Page write: status error.\n"); |
|||
return -6; |
|||
} |
|||
|
|||
SPD_REG16(0x480c) = 0; |
|||
return 0; |
|||
} |
|||
|
|||
static u32 timeout_cb(void *arg) |
|||
{ |
|||
u32 *has_timedout = (u32 *)arg; |
|||
|
|||
*has_timedout = 1; |
|||
return 0; |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
loadcore_IMPORTS_start |
|||
I_RegisterLibraryEntries |
|||
loadcore_IMPORTS_end |
|||
|
|||
stdio_IMPORTS_start |
|||
I_printf |
|||
stdio_IMPORTS_end |
|||
|
|||
thbase_IMPORTS_start |
|||
I_SetAlarm |
|||
I_CancelAlarm |
|||
thbase_IMPORTS_end |
|||
|
|||
sysclib_IMPORTS_start |
|||
I_memcpy |
|||
I_memset |
|||
sysclib_IMPORTS_end |
|||
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue