summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-06-07 21:25:10 -0400
committerIan Moffett <ian@osmora.org>2024-06-07 21:25:10 -0400
commitf8ce8234aa7247c8f3a4317f5671b5fd40ffb8c8 (patch)
tree4eb0667b44f557ea9c5449d932c19fc1db19889e /sys/arch/amd64
parent19e1b54d12edbe80419b7fde9c602833544eb7ab (diff)
kernel: Add __cacheline_aligned macro
This commit introduces a "__cacheline_aligned" macro which aligns data by the cache line size (COHERENCY_UNIT bytes). This is useful for heavily contended locks. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/conf/link.ld8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/arch/amd64/conf/link.ld b/sys/arch/amd64/conf/link.ld
index b073054..9c47a81 100644
--- a/sys/arch/amd64/conf/link.ld
+++ b/sys/arch/amd64/conf/link.ld
@@ -32,7 +32,7 @@ SECTIONS
. += CONSTANT(MAXPAGESIZE);
.data : {
- *(.data .data.*)
+ *(.data)
} :data
.bss : {
@@ -40,6 +40,12 @@ SECTIONS
*(.bss .bss.*)
} :data
+ /* -- Cache line alignment -- */
+ . = ALIGN(64);
+ .data.cacheline_aligned : {
+ *(.data.cacheline_aligned)
+ }
+
/DISCARD/ : {
*(.eh_frame)
*(.note .note.*)