Skip to content

Commit

Permalink
Merge pull request #18 from fjtrujy/master
Browse files Browse the repository at this point in the history
Upgrade to Posix toolchain
  • Loading branch information
sharkwouter authored Nov 17, 2021
2 parents 9a9512e + 1444b01 commit dbf5b94
Show file tree
Hide file tree
Showing 19 changed files with 130 additions and 61 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: CI

on:
push:
pull_request:
repository_dispatch:
types: [run_build]

jobs:
build:
runs-on: ubuntu-latest
container: ghcr.io/pspdev/pspsdk:latest
steps:
- uses: actions/checkout@v2

- name: Install dependencies
run: |
apk add build-base readline-dev libusb-compat-dev
- name: Compile project
run: |
make -j $(getconf _NPROCESSORS_ONLN) clean
make -j $(getconf _NPROCESSORS_ONLN)
make -j $(getconf _NPROCESSORS_ONLN) -C pspsh install
make -j $(getconf _NPROCESSORS_ONLN) -C usbhostfs_pc
make release
- name: Get short SHA
id: slug
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"

- name: Upload artifacts
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
name: psplinkusb-${{ steps.slug.outputs.sha8 }}
path: release

- name: Extract tag name
if: startsWith(github.ref, 'refs/tags/')
id: tag
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Compress & Rename bin folder
run: |
tar -zcvf psplinkusb.tar.gz release/psplink
- name: Create pre-release
if: github.ref == 'refs/heads/master'
uses: softprops/action-gh-release@v1
with:
files: |
psplinkusb.tar.gz
release/psplink_manual.pdf
prerelease: true
name: "Development build"
tag_name: "latest"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
psplinkusb.tar.gz
release/psplink_manual.pdf
tag_name: ${{ steps.tag.outputs.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
*.ko
*.obj
*.elf
*.PBP
*.prx
*.SFO

# Precompiled Headers
*.gch
Expand Down Expand Up @@ -31,13 +34,12 @@
# Debug files
*.dSYM/

# PSP
*.prx
*.PBP
*.SFO
# Releases & oputput folders
release/
release_oe/

# Built tools
pspsh/pspsh
tools/remotejoy/pcsdl/remotejoy
tools/remotejoy/pc/remotejoy
usbhostfs_pc/usbhostfs_pc
usbhostfs_pc/usbhostfs_pc
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ release:
clean:
$(MAKE) -f Makefile.psp clean
$(MAKE) -f Makefile.tools clean
rm -rf **/*.PBP **/*.SFO
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PSPLINK 3.0.1
# PSPLINK 3.0.2

Please read the manual document for installation instructions and an example
of usage.
Expand Down
4 changes: 2 additions & 2 deletions bootstrap/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
release: all
mksfoex -d MEMSIZE=1 'PSPLink v3.0.1' PARAM.SFO
mksfoex -d MEMSIZE=1 'PSPLink v3.0.2' PARAM.SFO
pack-pbp EBOOT.PBP PARAM.SFO psplink.png NULL NULL NULL NULL psplink_boot.prx NULL

clean_release:
Expand All @@ -10,7 +10,7 @@ TARGET = psplink_boot
OBJS = main.o

INCDIR =
CFLAGS = -O2 -G0 -Wall
CFLAGS = -O2 -G0 -Wall -g
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

Expand Down
5 changes: 1 addition & 4 deletions psplink/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
TARGET = psplink
OBJS = main.o shell.o config.o bitmap.o tty.o decodeaddr.o memoryUID.o kmode.o exception.o exception_asm.o psplinkcnf.o util.o debug.o libs.o apihook.o thctx.o stdio.o usbshell.o modload.o exports.o

# Use the kernel's small inbuilt libc
USE_KERNEL_LIBC = 1
#USE_PSPSDK_LIBC = 1
# Use only kernel libraries
USE_KERNEL_LIBS = 1

INCDIR = ../usbhostfs
CFLAGS = -Os -G0 -Wall -fno-builtin-printf -ggdb
CFLAGS = -Os -Wall -fno-builtin-printf -ggdb
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LDFLAGS=-nodefaultlibs -L../libusbhostfs_driver
Expand Down
24 changes: 20 additions & 4 deletions psplink/shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <pspdebug.h>
#include <pspsdk.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pspusb.h>
#include <pspusbstor.h>
Expand Down Expand Up @@ -1746,9 +1745,9 @@ static int list_dir(const char *name)

sprintf(p, " %8d ", (int) dir.d_stat.st_size);
p += strlen(p);
sprintf(p, "%02d-%02d-%04d %02d:%02d ", dir.d_stat.st_mtime.day,
dir.d_stat.st_mtime.month, dir.d_stat.st_mtime.year,
dir.d_stat.st_mtime.hour, dir.d_stat.st_mtime.minute);
sprintf(p, "%02d-%02d-%04d %02d:%02d ", dir.d_stat.sce_st_ctime.day,
dir.d_stat.sce_st_ctime.month, dir.d_stat.sce_st_ctime.year,
dir.d_stat.sce_st_ctime.hour, dir.d_stat.sce_st_ctime.minute);
p += strlen(p);
sprintf(p, "%s", dir.d_name);
SHELL_PRINT("%s\n", buffer);
Expand Down Expand Up @@ -1997,6 +1996,23 @@ static int remap_cmd(int argc, char **argv, unsigned int *vRet)
return CMD_OK;
}

// Iterative function to implement `atoi()` function in C
static long atoi(const char* S)
{
long num = 0;

int i = 0;

// run till the end of the string is reached, or the
// current character is non-numeric
while (S[i] && (S[i] >= '0' && S[i] <= '9'))
{
num = num * 10 + (S[i] - '0');
i++;
}

return num;
}
static int meminfo_cmd(int argc, char **argv, unsigned int *vRet)
{
int i;
Expand Down
2 changes: 1 addition & 1 deletion psplink/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
#ifndef __VERSION_H__
#define __VERSION_H__

#define PSPLINK_VERSION "v3.0.1"
#define PSPLINK_VERSION "v3.0.2"

#endif
2 changes: 1 addition & 1 deletion psplink_user/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ BUILD_PRX=1
PRX_EXPORTS=exports.exp

INCDIR =
CFLAGS = -O2 -G0 -Wall -I../libpsplink
CFLAGS = -O2 -Wall -I../libpsplink
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
LDFLAGS= -nostartfiles -L../libpsplink
ASFLAGS = $(CFLAGS)
Expand Down
8 changes: 7 additions & 1 deletion pspsh/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
OUTPUT=pspsh
OBJS=pspsh.o parse_args.o pspkerror.o asm.o disasm.o

CXXFLAGS=-Wall -g -D_PCTERM -I../psplink
ifeq ($(DEBUG), 1)
CXXFLAGS += -O0 -g
else
CXXFLAGS += -O3
endif

CXXFLAGS+= -Wall -D_PCTERM -I../psplink
LIBS=-lreadline -lcurses

PREFIX=$(shell psp-config --pspdev-path 2> /dev/null)
Expand Down
2 changes: 0 additions & 2 deletions tools/debugmenu/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
TARGET = debugmenu
OBJS = main.o exports.o

# Use the kernel's small inbuilt libc
USE_KERNEL_LIBC = 1
# Use only kernel libraries
USE_KERNEL_LIBS = 1

Expand Down
5 changes: 1 addition & 4 deletions tools/remotejoy/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
TARGET = remotejoy
OBJS = main.o kmode.o exports.o

# Use the kernel's small inbuilt libc
USE_KERNEL_LIBC = 1
# Use only kernel libraries
USE_KERNEL_LIBS = 1

INCDIR =
#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG
CFLAGS = -Os -G0 -Wall -fno-builtin-printf -I../../usbhostfs -I../../psplink
CFLAGS = -Os -Wall -fno-builtin-printf -I../../usbhostfs -I../../psplink
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LDFLAGS = -L../../libpsplink_driver -L../../libusbhostfs_driver
Expand Down
5 changes: 1 addition & 4 deletions tools/scrkprintf/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
TARGET = scrkprintf
OBJS = main.o

# Use the kernel's small inbuilt libc
USE_KERNEL_LIBC = 1
# Use only kernel libraries
USE_KERNEL_LIBS = 1

INCDIR =
#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG
CFLAGS = -Os -G0 -Wall -fno-builtin-printf
CFLAGS = -Os -Wall -fno-builtin-printf
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

Expand Down
5 changes: 1 addition & 4 deletions tools/siokprintf/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
TARGET = siokprintf
OBJS = main.o

# Use the kernel's small inbuilt libc
USE_KERNEL_LIBC = 1
# Use only kernel libraries
USE_KERNEL_LIBS = 1

INCDIR =
#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG
CFLAGS = -Os -G0 -Wall -fno-builtin-printf
CFLAGS = -Os -Wall -fno-builtin-printf
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

Expand Down
5 changes: 1 addition & 4 deletions tools/usbkprintf/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
TARGET = usbkprintf
OBJS = main.o

# Use the kernel's small inbuilt libc
USE_KERNEL_LIBC = 1
# Use only kernel libraries
USE_KERNEL_LIBS = 1

INCDIR =
#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG
CFLAGS = -Os -G0 -Wall -fno-builtin-printf
CFLAGS = -Os -Wall -fno-builtin-printf
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

Expand Down
5 changes: 1 addition & 4 deletions usbgdb/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
TARGET = usbgdb
OBJS = main.o gdb-stub.o exports.o

# Use the kernel's small inbuilt libc
USE_KERNEL_LIBC = 1
# Use only kernel libraries
USE_KERNEL_LIBS = 1

INCDIR =
#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG
CFLAGS = -Os -G0 -Wall -fno-builtin-printf -I../usbhostfs -I../psplink
CFLAGS = -Os -Wall -fno-builtin-printf -I../usbhostfs -I../psplink
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LDFLAGS = -L../libpsplink_driver -L../libusbhostfs_driver
Expand Down
5 changes: 1 addition & 4 deletions usbhostfs/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
TARGET = usbhostfs
OBJS = main.o host_driver.o kmode.o exports.o

# Use the kernel's small inbuilt libc
USE_KERNEL_LIBC = 1
# Use only kernel libraries
USE_KERNEL_LIBS = 1

INCDIR =
#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG
CFLAGS = -O2 -G0 -Wall -fno-builtin-printf
CFLAGS = -Os -Wall -fno-builtin-printf
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

Expand Down
24 changes: 12 additions & 12 deletions usbhostfs/host_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -784,18 +784,18 @@ static int io_chstat(PspIoDrvFileArg *arg, const char *file, SceIoStat *stat, in
cmd.bits = bits;
cmd.mode = stat->st_mode;
cmd.size = stat->st_size;
cmd.atime.year = stat->st_atime.year;
cmd.atime.month = stat->st_atime.month;
cmd.atime.day = stat->st_atime.day;
cmd.atime.hour = stat->st_atime.hour;
cmd.atime.minute = stat->st_mtime.minute;
cmd.atime.second = stat->st_mtime.second;
cmd.mtime.year = stat->st_mtime.year;
cmd.mtime.month = stat->st_mtime.month;
cmd.mtime.day = stat->st_mtime.day;
cmd.mtime.hour = stat->st_mtime.hour;
cmd.mtime.minute = stat->st_mtime.minute;
cmd.mtime.second = stat->st_mtime.second;
cmd.atime.year = stat->sce_st_atime.year;
cmd.atime.month = stat->sce_st_atime.month;
cmd.atime.day = stat->sce_st_atime.day;
cmd.atime.hour = stat->sce_st_atime.hour;
cmd.atime.minute = stat->sce_st_mtime.minute;
cmd.atime.second = stat->sce_st_mtime.second;
cmd.mtime.year = stat->sce_st_mtime.year;
cmd.mtime.month = stat->sce_st_mtime.month;
cmd.mtime.day = stat->sce_st_mtime.day;
cmd.mtime.hour = stat->sce_st_mtime.hour;
cmd.mtime.minute = stat->sce_st_mtime.minute;
cmd.mtime.second = stat->sce_st_mtime.second;
cmd.fsnum = arg->fs_num;

if(usb_connected())
Expand Down
5 changes: 1 addition & 4 deletions usbshell/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
TARGET = usbshell
OBJS = main.o exports.o

# Use the kernel's small inbuilt libc
USE_KERNEL_LIBC = 1
# Use only kernel libraries
USE_KERNEL_LIBS = 1

INCDIR =
#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG
CFLAGS = -Os -G0 -Wall -fno-builtin-printf -I../usbhostfs
CFLAGS = -Os -Wall -fno-builtin-printf -I../usbhostfs
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LDFLAGS = -L../libpsplink_driver -L../libusbhostfs_driver
Expand Down

0 comments on commit dbf5b94

Please sign in to comment.