Linux-MIPS Archive on lore.kernel.org
 help / color / Atom feed
From: Denis Efremov <efremov@linux.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: Denis Efremov <efremov@linux.com>,
	Paul Burton <paulburton@kernel.org>,
	James Hogan <jhogan@kernel.org>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] MIPS: Add KSEG*ADDR definitions to CONFIG_64BIT
Date: Tue, 10 Dec 2019 20:27:39 +0300
Message-ID: <20191210172739.27131-1-efremov@linux.com> (raw)

The patch adds KSEG0ADDR, KSEG1ADDR, KSEG2ADDR, KSEG3ADDR
definitions to CONFIG_64BIT ifdef. This fixes broken compilation:
  CC      drivers/watchdog/mtx-1_wdt.o
In file included from drivers/watchdog/mtx-1_wdt.c:44:
./arch/mips/include/asm/mach-au1x00/au1000.h: In function ‘alchemy_rdsys’:
./arch/mips/include/asm/mach-au1x00/au1000.h:603:36: error: implicit
  declaration of function ‘KSEG1ADDR’; did you mean ‘CKSEG1ADDR’?
  [-Werror=implicit-function-declaration]

Signed-off-by: Denis Efremov <efremov@linux.com>
---
 arch/mips/include/asm/addrspace.h | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/mips/include/asm/addrspace.h b/arch/mips/include/asm/addrspace.h
index 59a48c60a065..db663654c1fd 100644
--- a/arch/mips/include/asm/addrspace.h
+++ b/arch/mips/include/asm/addrspace.h
@@ -65,6 +65,10 @@
 #define XKSSEG			_CONST64_(0x4000000000000000)
 #define XKPHYS			_CONST64_(0x8000000000000000)
 #define XKSEG			_CONST64_(0xc000000000000000)
+#define KSEG0			_CONST64_(0xffffffff80000000)
+#define KSEG1			_CONST64_(0xffffffffa0000000)
+#define KSSEG			_CONST64_(0xffffffffc0000000)
+#define KSEG3			_CONST64_(0xffffffffe0000000)
 #define CKSEG0			_CONST64_(0xffffffff80000000)
 #define CKSEG1			_CONST64_(0xffffffffa0000000)
 #define CKSSEG			_CONST64_(0xffffffffc0000000)
@@ -75,6 +79,14 @@
 #define CKSEG2ADDR(a)		(CPHYSADDR(a) | CKSEG2)
 #define CKSEG3ADDR(a)		(CPHYSADDR(a) | CKSEG3)
 
+/*
+ * Map an address to a certain kernel segment
+ */
+#define KSEG0ADDR(a)		(CPHYSADDR(a) | KSEG0)
+#define KSEG1ADDR(a)		(CPHYSADDR(a) | KSEG1)
+#define KSEG2ADDR(a)		(CPHYSADDR(a) | KSEG2)
+#define KSEG3ADDR(a)		(CPHYSADDR(a) | KSEG3)
+
 #else
 
 #define CKSEG0ADDR(a)		(CPHYSADDR(a) | KSEG0)
-- 
2.20.1


             reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 17:27 Denis Efremov [this message]
2019-12-10 18:57 ` Paul Burton
2019-12-10 20:14   ` Denis Efremov
2019-12-10 23:04     ` Florian Fainelli
2019-12-11 10:27       ` Denis Efremov

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=20191210172739.27131-1-efremov@linux.com \
    --to=efremov@linux.com \
    --cc=jhogan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paulburton@kernel.org \
    --cc=ralf@linux-mips.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

Linux-MIPS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mips/0 linux-mips/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mips linux-mips/ https://lore.kernel.org/linux-mips \
		linux-mips@vger.kernel.org
	public-inbox-index linux-mips

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mips


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git