Skip to content

Commit

Permalink
Merge pull request #11 from pspdev/allegrex-v4.4.0-lockAPI
Browse files Browse the repository at this point in the history
Allegrex v4.4.0 lock api & Fix `CLOCKS_PER_SEC`
  • Loading branch information
diamant3 committed Apr 25, 2024
2 parents b8e1eb3 + a42edf3 commit 579341c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion newlib/configure.host
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ case "${host}" in
mips*-psp-*)
sys_dir=psp
posix_dir=posix
newlib_cflags="${newlib_cflags} -DHAVE_NANOSLEEP -DHAVE_RENAME -DHAVE_FCNTL -D_NO_POSIX_SPAWN"
newlib_cflags="${newlib_cflags} -DHAVE_NANOSLEEP -DHAVE_RENAME -DHAVE_FCNTL -D_NO_POSIX_SPAWN -DHAVE_DD_LOCK"
;;
mmix-knuth-mmixware)
sys_dir=mmixware
Expand Down
6 changes: 6 additions & 0 deletions newlib/libc/machine/mips/machine/time.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef _MACHTIME_H_
#define _MACHTIME_H_

#define _CLOCKS_PER_SEC_ 1000000

#endif /* _MACHTIME_H_ */
4 changes: 3 additions & 1 deletion newlib/libc/misc/lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ subroutines are required for linking multi-threaded applications.

/* dummy lock routines and static locks for single-threaded apps */

#ifndef __SINGLE_THREAD__
#include <newlib.h>

#if defined(__SINGLE_THREAD__)

#include <sys/lock.h>

Expand Down
1 change: 1 addition & 0 deletions newlib/libc/sys/psp/sys/dirent.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ typedef struct __dirdesc {
char *dd_buf; /* buffer */
int dd_len; /* buffer length */
int dd_size; /* amount of data in buffer */
void *dd_lock; /* lock */
} DIR;

# define __dirfd(dp) ((dp)->dd_fd)
Expand Down

0 comments on commit 579341c

Please sign in to comment.