GNU as has a directive to "align to the next N byte boundary if there
are fewer than X bytes to the boundary".
It's there because of some Intel optimisation recommendation, I think
maybe EGCS uses it.
Anyway, that would be the appropriate thing to use to avoid crossing a
page boundary. This should sort out cache line alignment, prefetch
queue flush, not crossing a page boundary, and keeping the prefetch
(subseqeuent instructions) also within the same page. Overkill perhaps,
but thorough :-)
pushl %cs
pushl $0f
lretl # Far jump forces prefetch queue flush.
.balign 32 # Size of Pentium & later cache lines.
.balign 4096,,64 # Align to page if prefetch (two cache lines)
# would cross the next page boundary.
0: decl %eax
jns 0b
retl
-- Jamie
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/