[kernel] Ensure all words aligned on word boundaries #1947
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pursuant to the discussion with @Mellvik in calculating 8088 instruction execution speed and on devising a precision timer in Mellvik/TLVC#71.
The biggest find here is that the kernel interrupt stack (which is used whenever a hardware interrupt takes place) was sometimes (only when CONFIG_TRACE set) allocated at an odd address - which on an 8086 CPU increases stack read/write (e.g. PUSH/POP) by 4 cycles each instruction!! Not a super big deal since production versions have CONFIG_TRACE off, but still quite a potential slowdown on real hardware during development.
Data produced by the C compiler is automatically aligned, but all ASM data should use
.p2align 1
for word variables at the start of the.data
or.bss
section..comm
variables have alignment specified in their directive separately.