-
Notifications
You must be signed in to change notification settings - Fork 132
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
add generic stub for unsupported ops on ioman(X) #625
add generic stub for unsupported ops on ioman(X) #625
Conversation
52c3fcf
to
7547bd1
Compare
iop/kernel/include/iomanX.h
Outdated
@@ -87,6 +87,11 @@ typedef struct _iomanX_iop_device { | |||
struct _iomanX_iop_device_ops *ops; | |||
} iomanX_iop_device_t; | |||
|
|||
|
|||
#define DECL_NOT_SUPPORTED_OP() \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of using macro
s you can also use:
static inline int not_supported_op (void) {return -134;}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I'll apply the change later.
Although, I would like to read a review of @uyjulian on this regard, specially with the DVR related IRX modules
Suggest to use |
134 corresponds to - |
But I think this is where the issue is coming from, to include |
I thought including errno also includes the array of descriptions that comes with it. Or that is stripped away by the compiler? If that's the case I'll correct it |
It shouldn’t increase binary size, it must be exactly the same, if not something else is wrong |
- improves readability (IMO) - unified return value for unsupported ops (`-ENOTSUP`) making it clear from EE side that the operation that just failed is simply stubbed on the IOP
7547bd1
to
a7d7262
Compare
s64 dvripl_df_null_long() | ||
{ | ||
return -48LL; | ||
return -134LL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have you changed the value here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-ENOTSUP. but as s64
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m ok merging this change @rickgaiser @uyjulian .
However this improvement is quite difficult to check if other devs will maintain.
Just to put an example, uyjulian has created 2 extra PRs where he adds more IOP modules, he is not using that function there…
Well of course he's not using something that has not been merged yet.😬 If this gets merged let's just propagate the change to any open PR. |
Including |
excellent. I thought it did. at least my local copy of errno.h (did not check the one on ps2sdk) had a char** buffer for the descriptions of errno values |
Resolve first conflicts and then I will review it |
done, should b ok now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should work nice! And I don't expect any memory increase at all
I hope so lol |
since ps2dev/ps2sdk/pull/625 was merged This streamlines the unsuported operations by using the same function and also by returning always the same value: `ENOTSUP`
since ps2dev/ps2sdk/pull/625 was merged This streamlines the unsuported operations by using the same function and also by returning always the same value: `ENOTSUP`
-ENOTSUP
) making it clear from EE side that the operation that just failed is simply stubbed on the IOP