summaryrefslogtreecommitdiff
path: root/arch/x86/machine/cpu.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-08-04 09:52:26 +0200
committerRichard Braun <rbraun@sceen.net>2018-08-04 09:52:26 +0200
commitee60e7d2a87fa92bb2dbc259bfbf87e9c49193f2 (patch)
tree91f36d86166516971b071ae54c9d737637d19ada /arch/x86/machine/cpu.h
parent9cd5b2f3d0e64ba2d7b8919368d2587732c80d84 (diff)
x86/cpu: improve low level code clarity
Replace magic numbers with macros isolating the computation of offsets in exception frames. The latter are reworked as arrays of words.
Diffstat (limited to 'arch/x86/machine/cpu.h')
-rw-r--r--arch/x86/machine/cpu.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/x86/machine/cpu.h b/arch/x86/machine/cpu.h
index 033c17dc..01d1d39f 100644
--- a/arch/x86/machine/cpu.h
+++ b/arch/x86/machine/cpu.h
@@ -85,9 +85,14 @@
#define CPU_L1_SIZE 64
/*
+ * CPU word size, 4 or 8 bytes.
+ */
+#define CPU_WORD_SIZE (LONG_BIT / 8)
+
+/*
* Data alignment, normally the word size.
*/
-#define CPU_DATA_ALIGN (LONG_BIT / 8)
+#define CPU_DATA_ALIGN CPU_WORD_SIZE
/*
* Function alignment.