summaryrefslogtreecommitdiffstats
path: root/arch/m68k/kernel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-01-10 17:17:53 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-01-10 17:17:53 +0000
commitb2ad5f821b1381492d792ca10b1eb7a107b48f14 (patch)
tree954a648692e7da983db1d2470953705f6a729264 /arch/m68k/kernel
parentc9c06167e7933d93a6e396174c68abf242294abb (diff)
Merge with Linux 2.4.0-prerelease. Big Makefile rewrite, test your
Makefiles.
Diffstat (limited to 'arch/m68k/kernel')
-rw-r--r--arch/m68k/kernel/Makefile12
-rw-r--r--arch/m68k/kernel/semaphore.c5
-rw-r--r--arch/m68k/kernel/setup.c105
-rw-r--r--arch/m68k/kernel/sun3-head.S26
4 files changed, 55 insertions, 93 deletions
diff --git a/arch/m68k/kernel/Makefile b/arch/m68k/kernel/Makefile
index afd9e4040..82e7bfc8b 100644
--- a/arch/m68k/kernel/Makefile
+++ b/arch/m68k/kernel/Makefile
@@ -17,13 +17,13 @@ all: sun3-head.o kernel.o
endif
O_TARGET := kernel.o
-O_OBJS := entry.o process.o traps.o ints.o signal.o ptrace.o \
- sys_m68k.o time.o semaphore.o
-OX_OBJS := setup.o m68k_ksyms.o
-ifdef CONFIG_PCI
-O_OBJS += bios32.o
-endif
+export-objs := setup.o m68k_ksyms.o
+
+obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \
+ sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o
+
+obj-$(CONFIG_PCI) += bios32.o
head.o: head.S m68k_defs.h
diff --git a/arch/m68k/kernel/semaphore.c b/arch/m68k/kernel/semaphore.c
index a3a3e17f1..d824c4e48 100644
--- a/arch/m68k/kernel/semaphore.c
+++ b/arch/m68k/kernel/semaphore.c
@@ -3,9 +3,14 @@
* specific changes in <asm/semaphore-helper.h>
*/
+#include <linux/config.h>
#include <linux/sched.h>
#include <asm/semaphore-helper.h>
+#ifndef CONFIG_RMW_INSNS
+spinlock_t semaphore_wake_lock;
+#endif
+
/*
* Semaphores are implemented using a two-way counter:
* The "count" variable is decremented for each process
diff --git a/arch/m68k/kernel/setup.c b/arch/m68k/kernel/setup.c
index 040f96d97..461628123 100644
--- a/arch/m68k/kernel/setup.c
+++ b/arch/m68k/kernel/setup.c
@@ -91,26 +91,10 @@ 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)
+#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY)
void (*mach_floppy_setup) (char *, int *) __initdata = NULL;
void (*mach_floppy_eject) (void) = NULL;
#endif
-struct serial_struct;
-#ifdef CONFIG_SERIAL
-long serial_rs_init(void);
-int serial_register_serial(struct serial_struct *);
-void serial_unregister_serial(int);
-long ser_console_init(long, long );
-#endif
-#if defined(CONFIG_USERIAL)||defined(CONFIG_HPDCA)||defined(CONFIG_WHIPPET_SERIAL)||defined(CONFIG_MULTIFACE_III_TTY)||defined(CONFIG_GVPIOEXT)||defined(CONFIG_AMIGA_BUILTIN_SERIAL)||defined(CONFIG_MAC_SCC)||defined(CONFIG_ATARI_MIDI)||defined(CONFIG_ATARI_SCC)||defined(CONFIG_ATARI_MFPSER)
-#define M68K_SERIAL
-#endif
-#ifdef M68K_SERIAL
-long m68k_rs_init(void);
-int m68k_register_serial(struct serial_struct *);
-void m68k_unregister_serial(int);
-long m68k_serial_console_init(void);
-#endif
#ifdef CONFIG_HEARTBEAT
void (*mach_heartbeat) (int) = NULL;
EXPORT_SYMBOL(mach_heartbeat);
@@ -137,7 +121,7 @@ extern int mvme147_parse_bootinfo(const struct bi_record *);
extern void config_amiga(void);
extern void config_atari(void);
extern void config_mac(void);
-extern void config_sun3(unsigned long *, unsigned long *);
+extern void config_sun3(void);
extern void config_apollo(void);
extern void config_mvme147(void);
extern void config_mvme16x(void);
@@ -151,6 +135,8 @@ extern void mac_debugging_long (int, long);
#define MASK_256K 0xfffc0000
+extern void paging_init(void);
+
static void __init m68k_parse_bootinfo(const struct bi_record *record)
{
while (record->tag != BI_LAST) {
@@ -221,7 +207,9 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
void __init setup_arch(char **cmdline_p)
{
extern int _etext, _edata, _end;
+#ifndef CONFIG_SUN3
unsigned long endmem, startmem;
+#endif
int i;
char *p, *q;
@@ -305,7 +293,7 @@ void __init setup_arch(char **cmdline_p)
#endif
#ifdef CONFIG_SUN3
case MACH_SUN3:
- config_sun3(memory_start_p, memory_end_p);
+ config_sun3();
break;
#endif
#ifdef CONFIG_APOLLO
@@ -347,13 +335,6 @@ void __init setup_arch(char **cmdline_p)
panic ("No configuration setup");
}
-#ifdef CONFIG_BLK_DEV_INITRD
- if (m68k_ramdisk.size) {
- initrd_start = (unsigned long)phys_to_virt(m68k_ramdisk.addr);
- initrd_end = initrd_start + m68k_ramdisk.size;
- }
-#endif
-
#ifndef CONFIG_SUN3
startmem= m68k_memory[0].addr;
endmem = startmem + m68k_memory[0].size;
@@ -371,10 +352,25 @@ void __init setup_arch(char **cmdline_p)
startmem >> PAGE_SHIFT, endmem >> PAGE_SHIFT);
for (i = 0; i < m68k_num_memory; i++)
- free_bootmem(m68k_memory[0].addr, m68k_memory[0].size);
+ free_bootmem(m68k_memory[i].addr, m68k_memory[i].size);
reserve_bootmem(m68k_memory[0].addr, availmem - m68k_memory[0].addr);
+
+#ifdef CONFIG_BLK_DEV_INITRD
+ if (m68k_ramdisk.size) {
+ reserve_bootmem(m68k_ramdisk.addr, m68k_ramdisk.size);
+ initrd_start = (unsigned long)phys_to_virt(m68k_ramdisk.addr);
+ initrd_end = initrd_start + m68k_ramdisk.size;
+ printk ("initrd: %08lx - %08lx\n", initrd_start, initrd_end);
+ }
+#endif
+
+#ifdef CONFIG_ATARI
+ if (MACH_IS_ATARI)
+ atari_stram_reserve_pages(availmem);
#endif
+#endif /* !CONFIG_SUN3 */
+ paging_init();
}
int get_cpuinfo(char * buffer)
@@ -475,57 +471,8 @@ int get_hardware_list(char *buffer)
return(len);
}
-#if defined(CONFIG_SERIAL) || defined(M68K_SERIAL)
-int rs_init(void)
-{
-#ifdef CONFIG_SERIAL
- if (MACH_IS_Q40)
- return serial_rs_init();
-#endif
-#ifdef M68K_SERIAL
- return m68k_rs_init();
-#endif
-}
-int register_serial(struct serial_struct *p)
-{
-#ifdef CONFIG_SERIAL
- if (MACH_IS_Q40)
- return serial_register_serial(p);
-#endif
-#ifdef M68K_SERIAL
- return m68k_register_serial(p);
-#endif
-}
-void unregister_serial(int i)
-{
-#ifdef CONFIG_SERIAL
- if (MACH_IS_Q40)
- serial_unregister_serial(i);
-#endif
-#ifdef M68K_SERIAL
- m68k_unregister_serial(i);
-#endif
-}
-EXPORT_SYMBOL(register_serial);
-EXPORT_SYMBOL(unregister_serial);
-#ifdef CONFIG_SERIAL_CONSOLE
-void serial_console_init(void)
-{
-#ifdef CONFIG_Q40_SERIAL
- if (MACH_IS_Q40) {
- ser_console_init();
- return;
- }
-#endif
-#if defined(M68K_SERIAL) && defined(CONFIG_SERIAL_CONSOLE)
- m68k_serial_console_init();
-#endif
-}
-#endif
-#endif
-
-#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY) || defined(CONFIG_BLK_DEV_FD)
+#if defined(CONFIG_AMIGA_FLOPPY) || defined(CONFIG_ATARI_FLOPPY)
void __init floppy_setup(char *str, int *ints)
{
if (mach_floppy_setup)
@@ -564,5 +511,7 @@ void check_bugs(void)
printk( KERN_EMERG "(see http://no-fpu.linux-m68k.org)\n" );
panic( "no FPU" );
}
-#endif
+
+#endif /* CONFIG_SUN3 */
+
}
diff --git a/arch/m68k/kernel/sun3-head.S b/arch/m68k/kernel/sun3-head.S
index 66834855d..eabcd6138 100644
--- a/arch/m68k/kernel/sun3-head.S
+++ b/arch/m68k/kernel/sun3-head.S
@@ -11,7 +11,7 @@ CACHES_OFF = 0x00000008 | actually a clear and disable --m
#define MAS_STACK INT_STACK
ROOT_TABLE_SIZE = 128
PAGESIZE = 8192
-
+SUN3_INVALID_PMEG = 255
.globl SYMBOL_NAME(bootup_user_stack)
.globl SYMBOL_NAME(bootup_kernel_stack)
.globl SYMBOL_NAME(pg0)
@@ -20,6 +20,7 @@ PAGESIZE = 8192
.globl SYMBOL_NAME(empty_zero_page)
.globl SYMBOL_NAME(swapper_pg_dir)
.globl SYMBOL_NAME(kernel_pmd_table)
+.globl SYMBOL_NAME(availmem)
.global SYMBOL_NAME(m68k_pgtable_cachemode)
.global SYMBOL_NAME(kpt)
| todo: all these should be in bss!
@@ -47,15 +48,20 @@ ENTRY(_start)
moveq #0, %d0
movsb %d0, AC_CONTEXT
-/* Copy mappings for first megabyte of RAM to address 0xE000000. */
- lea (AC_SEGMAP+0),%a0
+/* map everything the bootloader left us into high memory, clean up the
+ excess later */
+ lea (AC_SEGMAP+0),%a0
lea (AC_SEGMAP+KERNBASE),%a1
- moveq #(0x140000/NBSG-1),%d0
-1: movsb %a0@,%d1
- movsb %d1,%a1@
- addl #NBSG,%a0
+1:
+ movsb %a0@, %d1
+ movsb %d1, %a1@
+ cmpib #SUN3_INVALID_PMEG, %d1
+ beq 2f
+ addl #NBSG,%a0
addl #NBSG,%a1
- dbf %d0,1b
+ jmp 1b
+
+2:
/* Disable caches and jump to high code. */
moveq #ICACHE_ONLY,%d0 | Cache disabled until we're ready to enable it
@@ -83,7 +89,9 @@ ENTRY(_start)
movsb %d0,(AC_SEGMAP+0x0)
jbsr SYMBOL_NAME(sun3_init)
-
+
+ jbsr SYMBOL_NAME(base_trap_init)
+
jbsr SYMBOL_NAME(start_kernel)
trap #15