Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage of lockAPI #13

Merged
merged 1 commit into from
Apr 14, 2024
Merged

Fix usage of lockAPI #13

merged 1 commit into from
Apr 14, 2024

Conversation

fjtrujy
Copy link
Member

@fjtrujy fjtrujy commented Apr 10, 2024

To have thread-safe operations for all the newlib operations we have been required to do several PR:

This PR skips the usage of the dummy lock API, letting us implement the specific one in the ps2sdk/libcglue

@fjtrujy fjtrujy changed the base branch from master to ee-v4.4.0 April 10, 2024 17:50
@fjtrujy fjtrujy marked this pull request as ready for review April 11, 2024 21:32
@@ -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>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to include newlib.h otherwise you don't have access to the defined macros like __SINGLE_THREAD__

#ifndef __SINGLE_THREAD__
#include <newlib.h>

#if defined(__SINGLE_THREAD__)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is actually a bug.
These are the dummy implementation if user selected _RETARGETABLE_LOCKING but it is still a SINGLE_THREAD configuration.

@@ -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 */
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for HAVE_DD_LOCK

@fjtrujy fjtrujy merged commit de4c896 into ps2dev:ee-v4.4.0 Apr 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant