-
Notifications
You must be signed in to change notification settings - Fork 165
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
(sccz80) Support struct assignment #1132
Labels
Projects
Comments
suborb
added a commit
that referenced
this issue
Apr 14, 2019
Bit of (non-verified) work on passing parameters + bitfields
suborb
added a commit
that referenced
this issue
Apr 14, 2019
suborb
added a commit
that referenced
this issue
Apr 14, 2019
This was merged as #1134 - all apart from returning structs from functions which I'l leave for a while. |
patacongo
pushed a commit
to patacongo/nuttx
that referenced
this issue
Apr 11, 2020
This commit resolves issue apache#620: Remove CONFIG_CAN_PASS_STRUCTS apache#620 The configuration option CONFIG_CAN_PASS_STRUCTS was added many years ago to support an old version of the SDCC compiler. That compiler is currently used only with the Z80 and Z180 targets. The limitation of that old compiler was that it could not pass structures or unions as either inputs or outputs. For example: #ifdef CONFIG_CAN_PASS_STRUCTS struct mallinfo mallinfo(void); #else int mallinfo(FAR struct mallinfo *info); #endif And even leads to violation of a few POSIX interfaces like: #ifdef CONFIG_CAN_PASS_STRUCTS int sigqueue(int pid, int signo, union sigval value); #else int sigqueue(int pid, int signo, FAR void *sival_ptr); #endif This breaks the 1st INVIOLABLES rule: Strict POSIX compliance ----------------------- o Strict conformance to the portable standard OS interface as defined at OpenGroup.org. o A deeply embedded system requires some special support. Special support must be minimized. o The portable interface must never be compromised only for the sake of expediency. o Expediency or even improved performance are not justifications for violation of the strict POSIX interface Also, it appears that the current SDCC compilers have resolve this issue and so, perhaps, this is no longer a problem: z88dk/z88dk#1132 NOTE: This commit cannot pass the PR checks because it depends on matching changes to the apps/ directory.
Ouss4
pushed a commit
to apache/nuttx
that referenced
this issue
Apr 11, 2020
This commit resolves issue #620: Remove CONFIG_CAN_PASS_STRUCTS #620 The configuration option CONFIG_CAN_PASS_STRUCTS was added many years ago to support an old version of the SDCC compiler. That compiler is currently used only with the Z80 and Z180 targets. The limitation of that old compiler was that it could not pass structures or unions as either inputs or outputs. For example: #ifdef CONFIG_CAN_PASS_STRUCTS struct mallinfo mallinfo(void); #else int mallinfo(FAR struct mallinfo *info); #endif And even leads to violation of a few POSIX interfaces like: #ifdef CONFIG_CAN_PASS_STRUCTS int sigqueue(int pid, int signo, union sigval value); #else int sigqueue(int pid, int signo, FAR void *sival_ptr); #endif This breaks the 1st INVIOLABLES rule: Strict POSIX compliance ----------------------- o Strict conformance to the portable standard OS interface as defined at OpenGroup.org. o A deeply embedded system requires some special support. Special support must be minimized. o The portable interface must never be compromised only for the sake of expediency. o Expediency or even improved performance are not justifications for violation of the strict POSIX interface Also, it appears that the current SDCC compilers have resolve this issue and so, perhaps, this is no longer a problem: z88dk/z88dk#1132 NOTE: This commit cannot pass the PR checks because it depends on matching changes to the apps/ directory.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now that sdcc supports assigning structs, sccz80 should be updated so that source code compatibility is maintained.
The first two should be relatively trivial, passing structs shouldn't be too difficult.
Returning structs is slightly trickier, several ways to do it:
It feels like 1. is the way to go, but will need coordination with sdcc so the ABI is the same.
The text was updated successfully, but these errors were encountered: