linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Cc: Linux Kernel Development <linux-kernel@vger.kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH 161] Atari ST-RAM setup
Date: Sat, 2 Oct 2004 19:05:24 +0200	[thread overview]
Message-ID: <200410021705.i92H5Ojg021797@anakin.of.borg> (raw)

Atari ST-RAM updates (from Petr Stehlik):
  - Re-add lost early setup parameter `stram_swap'.
  - Disable the broken ST-RAM swap by default, but allow anyone to enable it
    with the `stram_swap' option.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>

--- linux-2.4.28-pre3/arch/m68k/atari/stram.c	13 Mar 2003 06:45:40 -0000	1.2.2.2
+++ linux-m68k-2.4.28-pre3/arch/m68k/atari/stram.c	7 Aug 2004 08:28:21 -0000
@@ -190,7 +190,7 @@
  * -1 = do swapping (to whole ST-RAM) if it's less than MAX_STRAM_FRACTION of
  *      total memory
  */
-static int max_swap_size = -1;
+static int max_swap_size = 0;
 
 /* start and end of swapping area */
 static void *swap_start, *swap_end;
@@ -306,7 +306,7 @@
 		reserve_bootmem (0, PAGE_SIZE);
 
 #ifdef CONFIG_STRAM_SWAP
-	{
+	if (max_swap_size) {
 		void *swap_data;
 
 		start_mem = (void *) PAGE_ALIGN ((unsigned long) start_mem);
@@ -961,14 +961,33 @@
 	return( max_start );
 }
 
+#ifdef CONFIG_STRAM_SWAP
 
 /* setup parameters from command line */
-void __init stram_swap_setup(char *str, int *ints)
+void __init stram_swap_setup(char *str)
 {
-	if (ints[0] >= 1)
-		max_swap_size = ((ints[1] < 0 ? 0 : ints[1]) * 1024) & PAGE_MASK;
+	int ints[3];
+	get_options(str, ARRAY_SIZE(ints), ints);
+	if (ints[0] >= 1) {
+		if (ints[1] == 1) {
+			/* always use ST-RAM as swap */
+			max_swap_size = -1;
+			if (ints[0] == 2) {
+				max_swap_size = ((ints[2] < 0 ? 0 : ints[2]) * 1024) & PAGE_MASK;
+			}
+		}
+		else if (ints[1] == 0) {
+			/* never use ST-RAM as swap */
+			max_swap_size = 0;
+		}
+		else {
+			printk( KERN_WARNING "stram_swap=%d - invalid value\n", ints[1] );
+		}
+	}
 }
 
+#endif	/* CONFIG_STRAM_SWAP */
+
 \f
 /* ------------------------------------------------------------------------ */
 /*								ST-RAM device								*/
--- linux-2.4.28-pre3/arch/m68k/kernel/setup.c	5 Jul 2004 16:39:16 -0000	1.4.2.11
+++ linux-m68k-2.4.28-pre3/arch/m68k/kernel/setup.c	7 Aug 2004 08:28:22 -0000
@@ -295,13 +295,20 @@
 		i = 1;
 	    }
 #ifdef CONFIG_ATARI
-	    /* This option must be parsed very early */
+	    /* These options must be parsed very early */
 	    if (!strncmp( p, "switches=", 9 )) {
 		extern void atari_switches_setup( const char *, int );
 		atari_switches_setup( p+9, (q = strchr( p+9, ' ' )) ?
 				           (q - (p+9)) : strlen(p+9) );
 		i = 1;
 	    }
+#ifdef CONFIG_STRAM_SWAP
+	    if (!strncmp( p, "stram_swap=", 11 )) {
+		extern void stram_swap_setup( char * );
+		stram_swap_setup( p+11 );
+		i = 1;
+	    }
+#endif	/* CONFIG_STRAM_SWAP */
 #endif
 
 	    if (i) {

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

                 reply	other threads:[~2004-10-02 17:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200410021705.i92H5Ojg021797@anakin.of.borg \
    --to=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    /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;
as well as URLs for NNTP newsgroup(s).