mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 161] Atari ST-RAM setup
@ 2004-10-02 17:05 Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2004-10-02 17:05 UTC (permalink / raw)
  To: Marcelo Tosatti; +Cc: Linux Kernel Development, Geert Uytterhoeven

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-02 17:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-02 17:05 [PATCH 161] Atari ST-RAM setup Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®