patch-2.3.17 linux/arch/m68k/kernel/setup.c

Next file: linux/arch/m68k/kernel/sun3-head.S
Previous file: linux/arch/m68k/kernel/semaphore.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.16/linux/arch/m68k/kernel/setup.c linux/arch/m68k/kernel/setup.c
@@ -19,6 +19,7 @@
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/module.h>
 
 #include <asm/bootinfo.h>
 #include <asm/setup.h>
@@ -76,6 +77,8 @@
 int (*mach_hwclk) (int, struct hwclk_time*) = NULL;
 int (*mach_set_clock_mmss) (unsigned long) = NULL;
 void (*mach_reset)( void );
+void (*mach_halt)( void ) = NULL;
+void (*mach_power_off)( void ) = NULL;
 long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
 #if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY) || defined(CONFIG_BLK_DEV_FD)
 void (*mach_floppy_setup) (char *, int *) __initdata = NULL;
@@ -100,6 +103,9 @@
 #ifdef CONFIG_HEARTBEAT
 void (*mach_heartbeat) (int) = NULL;
 #endif
+#ifdef CONFIG_M68K_L2_CACHE
+void (*mach_l2_flush) (int) = NULL;
+#endif
 
 extern void base_trap_init(void);
 
@@ -118,7 +124,7 @@
 extern void config_amiga(void);
 extern void config_atari(void);
 extern void config_mac(void);
-extern void config_sun3(void);
+extern void config_sun3(unsigned long *, unsigned long *);
 extern void config_apollo(void);
 extern void config_mvme147(void);
 extern void config_mvme16x(void);
@@ -127,8 +133,10 @@
 extern void config_q40(void);
 extern void config_sun3x(void);
 
-#define MASK_256K 0xfffc0000
+extern void mac_debugging_short (int, short);
+extern void mac_debugging_long  (int, long);
 
+#define MASK_256K 0xfffc0000
 
 static void __init m68k_parse_bootinfo(const struct bi_record *record)
 {
@@ -205,13 +213,22 @@
 	else if (CPU_IS_060)
 		m68k_is040or060 = 6;
 
+#ifndef CONFIG_SUN3
 	base_trap_init();
+#endif
 
+	/* FIXME: m68k_fputype is passed in by Penguin booter, which can
+	 * be confused by software FPU emulation. BEWARE.
+	 * We should really do our own FPU check at startup.
+	 * [what do we do with buggy 68LC040s? if we have problems
+	 *  with them, we should add a test to check_bugs() below] */
+#ifndef CONFIG_M68KFPU_EMU_ONLY
 	/* clear the fpu if we have one */
 	if (m68k_fputype & (FPU_68881|FPU_68882|FPU_68040|FPU_68060)) {
 		volatile int zero = 0;
 		asm __volatile__ ("frestore %0" : : "m" (zero));
 	}
+#endif	
 
 	init_mm.start_code = PAGE_OFFSET;
 	init_mm.end_code = (unsigned long) &_etext;
@@ -272,7 +289,7 @@
 #endif
 #ifdef CONFIG_SUN3
 	    case MACH_SUN3:
-	    	config_sun3();
+	    	config_sun3(memory_start_p, memory_end_p);
 	    	break;
 #endif
 #ifdef CONFIG_APOLLO
@@ -321,10 +338,12 @@
 	}
 #endif
 
+#ifndef CONFIG_SUN3
 	*memory_start_p = availmem;
 	*memory_end_p = 0;
 	for (i = 0; i < m68k_num_memory; i++)
 		*memory_end_p += m68k_memory[i].size & MASK_256K;
+#endif
 }
 
 int get_cpuinfo(char * buffer)
@@ -354,6 +373,9 @@
 	clockfactor = 0;
     }
 
+#ifdef CONFIG_M68KFPU_EMU_ONLY
+    fpu="none(soft float)";
+#else
     if (m68k_fputype & FPU_68881)
 	fpu = "68881";
     else if (m68k_fputype & FPU_68882)
@@ -366,6 +388,7 @@
 	fpu = "Sun FPA";
     else
 	fpu = "none";
+#endif
 
     if (m68k_mmutype & MMU_68851)
 	mmu = "68851";
@@ -452,6 +475,9 @@
   m68k_unregister_serial(i);
 #endif
 }
+EXPORT_SYMBOL(register_serial);
+EXPORT_SYMBOL(unregister_serial);
+
 #ifdef CONFIG_SERIAL_CONSOLE
 long serial_console_init(long kmem_start, long kmem_end)
 {
@@ -461,6 +487,8 @@
 #endif
 #if defined(M68K_SERIAL) && defined(CONFIG_SERIAL_CONSOLE)
   return m68k_serial_console_init(kmem_start, kmem_end);
+#else
+  return kmem_start;
 #endif
 }
 #endif
@@ -496,7 +524,7 @@
 
 void check_bugs(void)
 {
-#ifndef CONFIG_FPU_EMU
+#ifndef CONFIG_M68KFPU_EMU
 	if (m68k_fputype == 0) {
 		printk( KERN_EMERG "*** YOU DO NOT HAVE A FLOATING POINT UNIT, "
 				"WHICH IS REQUIRED BY LINUX/M68K ***\n" );

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)