mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/5] include: move PAGE_ definitions into linux/pagemap.h
Date: Mon, 11 Sep 2023 17:08:56 +0200	[thread overview]
Message-ID: <20230911150900.3584523-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20230911150900.3584523-1-a.fatoum@pengutronix.de>

<common.h> is a fat header and we shouldn't need to include it just to
get a definition for PAGE_SIZE. In Linux PAGE_SIZE is defined per
architecture, but in barebox we only have 4K pages so far, so let's move
it into <linux/pagemap.h>.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/common.h        | 6 +-----
 include/linux/pagemap.h | 8 +++++++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/include/common.h b/include/common.h
index cf3e0447a09a..b7b4d9e35094 100644
--- a/include/common.h
+++ b/include/common.h
@@ -16,6 +16,7 @@
 #include <linux/string.h>
 #include <linux/kernel.h>
 #include <linux/stddef.h>
+#include <linux/pagemap.h>
 #include <asm/common.h>
 #include <asm/io.h>
 #include <linux/printk.h>
@@ -105,11 +106,6 @@ void shutdown_barebox(void);
 	char __##name[sizeof(type) * (size) + (align) - 1];	\
 	type *name = (type *)ALIGN((uintptr_t)__##name, align)
 
-#define PAGE_SIZE	4096
-#define PAGE_SHIFT	12
-#define PAGE_ALIGN(s)	ALIGN(s, PAGE_SIZE)
-#define PAGE_ALIGN_DOWN(x) ALIGN_DOWN(x, PAGE_SIZE)
-
 int mem_parse_options(int argc, char *argv[], char *optstr, int *mode,
 		char **sourcefile, char **destfile, int *swab);
 int memcpy_parse_options(int argc, char *argv[], int *sourcefd,
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 20c38a0b8912..01cbfc17c57b 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -3,11 +3,17 @@
 #ifndef _LINUX_PAGEMAP_H
 #define _LINUX_PAGEMAP_H
 
+#include <linux/kernel.h>
+
 /*
  * Copyright 1995 Linus Torvalds
  */
 
-#include <common.h>
+
+#define PAGE_SIZE	4096
+#define PAGE_SHIFT	12
+#define PAGE_ALIGN(s)	ALIGN(s, PAGE_SIZE)
+#define PAGE_ALIGN_DOWN(x) ALIGN_DOWN(x, PAGE_SIZE)
 
 #define PAGE_CACHE_SHIFT        PAGE_SHIFT
 #define PAGE_CACHE_SIZE         PAGE_SIZE
-- 
2.39.2




  reply	other threads:[~2023-09-11 15:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 15:08 [PATCH 0/5] add stack protector and guard page support Ahmad Fatoum
2023-09-11 15:08 ` Ahmad Fatoum [this message]
2023-09-11 15:08 ` [PATCH 2/5] ARM: mark early C setup functions as __prereloc Ahmad Fatoum
2023-09-11 15:08 ` [PATCH 3/5] lib: add stackprotector support Ahmad Fatoum
2023-09-21  8:52   ` [PATCH] fixup! " Ahmad Fatoum
2023-09-11 15:08 ` [PATCH 4/5] ARM: mmu: catch stack overflowing into TTB with stack guard page Ahmad Fatoum
2023-09-11 15:09 ` [PATCH 5/5] commands: add stacksmash command for causing stack overflows Ahmad Fatoum
2023-09-12  4:48   ` Thorsten Scherer
2023-09-11 15:47 ` [PATCH] fixup! lib: add stackprotector support Ahmad Fatoum
2023-09-14  9:14 ` [PATCH] fixup! commands: add stacksmash command for causing stack overflows Ahmad Fatoum
2023-09-14 10:22   ` Thorsten Scherer
2023-09-14 11:05     ` Ahmad Fatoum
2023-09-21  8:49 ` [PATCH 0/5] add stack protector and guard page support Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230911150900.3584523-2-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox