Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ppu/crt/crt1.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <sys/time.h>
#include <sys/dirent.h>
#include <sys/syscalls.h>
#include <utime.h>
Comment thread
miigotu marked this conversation as resolved.
Outdated

extern void _init();

Expand Down Expand Up @@ -38,6 +39,7 @@ extern int __librt_rmdir_r(struct _reent *r,const char *dirname);
extern int __librt_link_r(struct _reent *r,const char *old,const char *new);
extern int __librt_unlink_r(struct _reent *r,const char *path);
extern int __librt_access_r(struct _reent *r,const char *path,int amode);
extern int __librt_utime_r(struct _reent *r,const char *path,const struct utimbuf *times);

extern int __librt_usleep_r(struct _reent *r,useconds_t usec);
extern unsigned int __librt_sleep_r(struct _reent *r,unsigned int seconds);
Expand Down Expand Up @@ -87,7 +89,8 @@ static void __syscalls_init(void)
__syscalls.rmdir_r = __librt_rmdir_r;
__syscalls.link_r = __librt_link_r;
__syscalls.unlink_r = __librt_unlink_r;
__syscalls.access_r = __librt_access_r;
//__syscalls.access_r = __librt_access_r;
Comment thread
miigotu marked this conversation as resolved.
Outdated
__syscalls.utime_r = __librt_utime_r;

__syscalls.sleep_r = __librt_sleep_r;
__syscalls.usleep_r = __librt_usleep_r;
Expand Down
1 change: 1 addition & 0 deletions ppu/include/lv2/sysfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ s32 sysFsMkdir(const char* path, s32 mode);
s32 sysFsRmdir(const char *path);
s32 sysFsUnlink(const char *path);
s32 sysFsAccess(const char *path,s32 amode);
s32 sysFsUtime(const char *path, sysFSUtimbuf *times);

s32 sysFsOpendir(const char *path, s32 *fd);
s32 sysFsClosedir(s32 fd);
Expand Down
2 changes: 1 addition & 1 deletion ppu/librt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ OBJS := \
sbrk.o exit.o close.o lseek.o read.o open.o sleep.o write.o fstat.o \
socket.o lock.o dirent.o mkdir.o times.o umask.o lv2errno.o heap.o \
chmod.o rename.o rmdir.o isatty.o gettod.o settod.o unlink.o access.o \
link.o truncate.o fsync.o
link.o truncate.o fsync.o utime.o

all: ppu

Expand Down
34 changes: 34 additions & 0 deletions ppu/librt/utime.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#include <stdio.h>
#include <fcntl.h>
#include <_ansi.h>
#include <_syslist.h>
#include <sys/reent.h>
#include <sys/errno.h>
#include <sys/types.h>
#include <sys/lv2errno.h>

#include <sys/file.h>
#include <utime.h>


int _utime(const char *path, const struct utimbuf *times, int* _errno)
Comment thread
miigotu marked this conversation as resolved.
Outdated
{
if (times == NULL) {
struct utimbuf now_time;
time_t now;
now = time(NULL);
now_time.actime = now;
now_time.modtime = now;
return lv2errno(sysLv2FsUtime(path,(sysFSUtimbuf *)&now_time));
}
else return lv2errno(sysLv2FsUtime(path,(sysFSUtimbuf *)times));
}

int
Comment thread
miigotu marked this conversation as resolved.
_DEFUN(__librt_utime_r,(r,path,times),
struct _reent *r _AND
const char *path _AND
const struct utimbuf *times)
{
return _utime(path,times,&r->_errno);
Comment thread
miigotu marked this conversation as resolved.
Outdated
}
1 change: 1 addition & 0 deletions ppu/sprx/libsysfs/exports.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ EXPORT(sysFsOpendir, 0x3F61245C);
EXPORT(sysFsClosedir, 0xFF42DCC3);
EXPORT(sysFsReaddir, 0x5C74903D);
EXPORT(sysFsAccess, 0x06E681ED);
EXPORT(sysFsUtime, 0xBEF554A4);
EXPORT(sysFsAioInit, 0xDB869F20);
EXPORT(sysFsAioReadEx, 0xC1C507E7);
EXPORT(sysFsAioWriteEx, 0x4CEF342E);
Expand Down
1 change: 1 addition & 0 deletions tools/cgcomp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ endif
ifneq (,$(findstring CYGWIN,$(UNAME)))
LDFLAGS += -s
EXEEXT := .exe
CXXFLAGS += -DWIN32
OS := win32
endif

Expand Down
24 changes: 24 additions & 0 deletions tools/cgcomp/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
#include "compiler.h"
#include "compilerfp.h"

#ifdef __CYGWIN__
#include <libgen.h>
#include <unistd.h>
char currdir[1024];
char destfile[1026];
#endif

#if !defined(WIN32)
#include <dlfcn.h>
#endif



Comment thread
miigotu marked this conversation as resolved.
Outdated
#define PROG_TYPE_NONE 0
#define PROG_TYPE_VP 1
#define PROG_TYPE_FP 2
Expand Down Expand Up @@ -119,6 +128,21 @@ void readoptions(struct _options *options,int argc,char *argv[])

options->src_file = argv[i];
options->dst_file = argv[i+1];
#ifdef __CYGWIN__
if (options->src_file[0] == '/') { //workaround to solve full path file source problem with cgywin
getcwd(currdir, sizeof(currdir));
char *fname, *path;
if (options->dst_file[0] != '/') {
sprintf(destfile, "%s/%s",currdir, options->dst_file);
options->dst_file = destfile;
printf("destfile %s\n", options->dst_file);
}
fname = basename((char *)options->src_file);
path = (char *)dirname((char *)options->src_file);
chdir(path);
options->src_file = fname;
}
#endif
}

char* readfile(const char *filename)
Expand Down