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

Add exec and execve support #10

Merged
merged 1 commit into from
Mar 12, 2024
Merged

Conversation

fjtrujy
Copy link
Member

@fjtrujy fjtrujy commented Mar 11, 2024

This PR solves possible issues with fork, wait, and some others.
Additionally, it includes some other execv functions, which require _execve to be implemented in libcglue.

This PR also requires to be merged: https://github.com/pspdev/pspsdk/compare/master...fjtrujy:posixExec?expand=1

@fjtrujy fjtrujy marked this pull request as ready for review March 11, 2024 15:10
@fjtrujy fjtrujy mentioned this pull request Mar 11, 2024
@fjtrujy fjtrujy merged commit b8e1eb3 into allegrex-v4.4.0 Mar 12, 2024
1 of 2 checks passed
@sharkwouter sharkwouter deleted the allegrex-v4.4.0_execvc branch March 12, 2024 10:12
elvisdukaj pushed a commit to elvisdukaj/psp-newlib that referenced this pull request Feb 2, 2025
gcc-14 will default to c99 and as a result a fair amount of old code in newlib
(particularly libgloss) is failing to build.  I don't offhand know how many
patches will be necessary to fix the various failures. I'll just pick them off
one by one from my tree.

This particular patch works around the return-mismatch problem syscalls.c for
fr30.

That file is a bit odd in that most functions are declared as returning an
integer, but the implementations look like:

> int
> _read (file, ptr, len)
>      int    file;
>      char * ptr;
>      int    len;
> {
>   asm ("ldi:8 %0, r0" :: "i" (SYS_read) : "r0");
>   asm ("int   pspdev#10");
>
>   return;
> }

Note the lack of a value on the "return" statement.  The assumption is that the
interrupt handler implementing syscalls will put the return value into the
proper register, so falling off the end of the C function or returning with no
value works in the expected way.  It's not good code, but it probably works.

Working from that assumption I decided to just use a pragma to disable the
upgraded diagnostic from GCC -- essentially preserving existing behavior.

This is the only fr30 specific issue that needs to be resolved and the only
issue (so far) I've seen of this specific nature.
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.

2 participants