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

Automatically generate structure member offsets for assembly #282

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

wipawel
Copy link
Contributor

@wipawel wipawel commented Aug 22, 2023

Generate offsets of selected structure members to be used in assembly files.

The asm-offsets.c file is compiled into assembly (.s) file and parsed by asm-offsets.sh script to generate the final include header asm-offsets.h.

This is needed to be able to access per-cpu variables in assembly.

@wipawel wipawel added the improvement A small enhancement, that makes already implemented features better label Aug 22, 2023
@wipawel wipawel requested a review from a team as a code owner August 22, 2023 09:32
Generate offsets of selected structure members to be used in assembly
files.

The asm-offsets.c file is compiled into assembly (.s) file and parsed by
asm-offsets.sh script to generate the final include header asm-offsets.h.

This is needed to be able to access per-cpu variables in assembly.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
Now that we have the asm-offsets.h generated for the per-cpu variable,
we can use it directly instead of passing argument from the C code.

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
@minipli-oss
Copy link
Contributor

I reviewed these commits in #284, see my comments there, starting at #284 (review)

Splitting cpu_regs_t into cpu_exc_t and cpu_regs_t using cpu_exc_t
allows to create asm-offset entries for the struct members to be
used directly in entry.S (allows to use different structure offsets
when in exception handler and when in syscall).

Signed-off-by: Pawel Wieczorkiewicz <[email protected]>
@wipawel wipawel enabled auto-merge (rebase) August 27, 2023 15:27
Copy link
Contributor

@minipli-oss minipli-oss left a comment

Choose a reason for hiding this comment

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

LGTM, thanks Pawel!

@wipawel wipawel merged commit b0cfb1e into KernelTestFramework:mainline Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement A small enhancement, that makes already implemented features better
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants