Atari ST-RAM setup
Geert Uytterhoeven
maintainerPATCH 1/1 Atari ST-RAM setup
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 <[email protected]>
arch/m68k/atari/stram.c +24 -5
@@ -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 */ +/* ------------------------------------------------------------------------ */ /* ST-RAM device */
arch/m68k/kernel/setup.c +8 -1
@@ -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 -- [email protected]
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