rpc: Fixed alignment problem. #59

Merged
sb10q merged 1 commits from pca006132/artiq-zynq:rpc into master 2020-07-16 14:16:12 +08:00
Contributor

Fixes issue #42.

Previously there was no fix for the variable alignment.
We calculate the position of the variable based on the size
of the previous variable, so we could break the alignment requirement
for variables. For example, having a i64 after bool could break
the alignment required for i64 and trigger DataAbort or data
corruption.

However, this requires the same data layout and LLVM type for the
variables. If this cannot be maintained, this would break the alignment
on the other side of the RPC, either from host to kernel or kernel to
host.

Fixes issue #42. Previously there was no fix for the variable alignment. We calculate the position of the variable based on the size of the previous variable, so we could break the alignment requirement for variables. For example, having a `i64` after `bool` could break the alignment required for `i64` and trigger DataAbort or data corruption. However, this requires the same data layout and LLVM type for the variables. If this cannot be maintained, this would break the alignment on the other side of the RPC, either from host to kernel or kernel to host.
sb10q closed this pull request 2020-07-16 14:16:12 +08:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/artiq-zynq#59
No description provided.