Resent-Date: Wed, 27 Jan 1999 12:53:45 +0100 (MET)
To: linux-m68k@lists.linux-m68k.org
Subject: X problems in 2.2.0pre
From: Jes Sorensen <Jes.Sorensen@cern.ch>
Date: 27 Jan 1999 12:52:31 +0100
In-Reply-To: zippel@fh-brandenburg.de's message of "Wed, 27 Jan 1999 10:21:41 +0100 (MET)"
Resent-From: linux-m68k@phil.uni-sb.de

Hi

For those of you who had problems with X on Z2 devices since 2.1.127
or something, could you please try it out and tell me if it solves the
problem and/or breaks anything for you (I would also like to hear from
users of the z2ram device).

Problem was that the Z2 pages were not marked as being reserved thus
the mmap() thought they were mapped as normal memory in the system.

Jes

--- /data/tmp/linux-2.2.0pre7/arch/m68k/mm/init.c	Mon Jan 18 15:06:52 1999
+++ linux/arch/m68k/mm/init.c	Wed Jan 27 12:41:14 1999
@@ -392,6 +392,21 @@
 	return PAGE_ALIGN(free_area_init(start_mem, end_mem));
 }
 
+#ifdef CONFIG_AMIGA
+void __init reserve_z2_ram(void)
+{
+#define Z2_PHYSBASE	0
+#define Z2_SIZE		16*1024*1024
+
+	unsigned long z2addr = Z2_PHYSBASE;
+
+	mem_map_t *mapp = &mem_map[MAP_NR(z2addr)];
+
+	for( ; z2addr < Z2_PHYSBASE+Z2_SIZE; z2addr += PAGE_SIZE, ++mapp )
+		set_bit( PG_reserved, &mapp->flags );
+}
+#endif
+
 void __init mem_init(unsigned long start_mem, unsigned long end_mem)
 {
 	int codepages = 0;
@@ -403,6 +418,11 @@
 	end_mem &= PAGE_MASK;
 	high_memory = (void *) end_mem;
 	max_mapnr = num_physpages = MAP_NR(end_mem);
+
+#ifdef CONFIG_AMIGA
+	if (MACH_IS_AMIGA)
+		reserve_z2_ram();
+#endif
 
 	tmp = start_mem = PAGE_ALIGN(start_mem);
 	while (tmp < end_mem) {


