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

[update] Modified syscalls mechanism #4

Merged
merged 4 commits into from
Jun 11, 2019
Merged

[update] Modified syscalls mechanism #4

merged 4 commits into from
Jun 11, 2019

Conversation

arnauldm
Copy link
Contributor

@arnauldm arnauldm commented Jun 5, 2019

  • Therefore, each syscall is requested by a distinct SVC interrupt

Rationale:

  • Code simplification

* Therefore, each syscall is requested by a distinct SVC interrupt
@PThierry
Copy link
Contributor

PThierry commented Jun 5, 2019

Hello Arnauld !

Thanks for this PR ! It's clearly simplify the 'oldy' syscall handling.

3 questions here:

  1. is it possible to avoid the 'when others' before calling exec_syncrhonous_syscall, as the t_svc type is strictly typed and the userspace may generate any SVC input value that may be invalid and generate an Ada exception
  2. Are the end_of_task and end_of_isr dedicated SVC are stored in SVC value smaller than SVC syscall area ? (i.e. specific, non-syscalls SVC could be 1 and 2, and syscalls start at 10, to keep possible 8 free slots for any possible future specific SVC, and if syscalls number increase, the specific SVC are not impacted
  3. is the replacement of the userspace do_syscall with a switch case impacting in term of performances ? As the syscall list is flat, the execution cost may increase for some constrained syscalls (e.g. get_systick)

What is your point of view on this ?

@PThierry
Copy link
Contributor

PThierry commented Jun 5, 2019

Re,

Is it possible to define a t_syscall_svc as a subset of t_svc for syscall execution functions (i.e. push_syscall and do_syncrhonous_syscall) ?

@PThierry PThierry added the enhancement New feature or request label Jun 5, 2019
@PThierry
Copy link
Contributor

PThierry commented Jun 5, 2019

INFO: patch in association with libstd PR 1

@arnauldm
Copy link
Contributor Author

arnauldm commented Jun 5, 2019

  • is it possible to avoid the 'when others' before calling exec_syncrhonous_syscall, as the t_svc type is strictly typed and the userspace may generate any SVC input value that may be invalid and generate an Ada exception

Good comment ! I slightly modified the ewok.syscall.handler package and I removed the 'exec_synchronous' function whose presence was no more justified.

  • Are the end_of_task and end_of_isr dedicated SVC are stored in SVC value smaller than SVC syscall area ? (i.e. specific, non-syscalls SVC could be 1 and 2, and syscalls start at 10, to keep possible 8 free slots for any possible future specific SVC, and if syscalls number increase, the specific SVC are not impacted

I'm not sure that end_of_task() and end_of_isr() syscalls should be considered as special services.

  • is the replacement of the userspace do_syscall with a switch case impacting in term of performances ? As the syscall list is flat, the execution cost may increase for some constrained syscalls (e.g. get_systick)

It should not because switch statements are optimized by gcc using jump tables and ARM architectures have special instructions to deal with that kind of construct (TBB and TBH instructions).

@PThierry
Copy link
Contributor

PThierry commented Jun 5, 2019

Hello !

I'm asking myself... Should end_of_task and end_of_isr be replaced with a trap on effective return address on the isr root function or main function ? This would not be a svc no more, but a real trap. Svc would then be only syscalls, not events.

What do you think about it ?

@PThierry
Copy link
Contributor

PThierry commented Jun 6, 2019

Ack for sys_exit() 👍 Using task current state instead of defining 2 independent system calls is cleaner to handle ISR & thread exit

* Replacing SVC_TASK_DONE and SVC_ISR_DONE by SVC_EXIT
* Renaming some syscalls so their name is more self-explanatory
@PThierry PThierry merged commit 3768a22 into wookey-project:master Jun 11, 2019
@arnauldm arnauldm deleted the ami/syscalls branch June 17, 2019 09:56
@PThierry PThierry added this to the 1.0.0 milestone Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants