summaryrefslogtreecommitdiff
path: root/arch/um/include/shared/as-layout.h
diff options
context:
space:
mode:
authorTiwei Bie <tiwei.btw@antgroup.com>2025-08-27 08:57:03 +0800
committerJohannes Berg <johannes.berg@intel.com>2025-09-10 14:23:52 +0200
commite047f9af9d6948728614f7eea41ba53d5b767e9f (patch)
tree42bda26d92b48016f25c9445dd509406e55fe0ab /arch/um/include/shared/as-layout.h
parentb765d69a1adf83b969f1f0c8353b80c3c18ef2f7 (diff)
um: Centralize stub size calculations
Currently, the stub size is calculated in multiple places. Define a macro that performs the calculation so that the code is easier to read and maintain. Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'arch/um/include/shared/as-layout.h')
-rw-r--r--arch/um/include/shared/as-layout.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/um/include/shared/as-layout.h b/arch/um/include/shared/as-layout.h
index eacf18ec9d0c..7c7e17bce403 100644
--- a/arch/um/include/shared/as-layout.h
+++ b/arch/um/include/shared/as-layout.h
@@ -24,7 +24,8 @@
#define STUB_CODE STUB_START
#define STUB_DATA (STUB_CODE + UM_KERN_PAGE_SIZE)
#define STUB_DATA_PAGES 2
-#define STUB_END (STUB_DATA + STUB_DATA_PAGES * UM_KERN_PAGE_SIZE)
+#define STUB_SIZE ((1 + STUB_DATA_PAGES) * UM_KERN_PAGE_SIZE)
+#define STUB_END (STUB_START + STUB_SIZE)
#ifndef __ASSEMBLER__