summaryrefslogtreecommitdiff
path: root/arch/m68k/sun3
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68k/sun3')
-rw-r--r--arch/m68k/sun3/config.c13
-rw-r--r--arch/m68k/sun3/idprom.c4
-rw-r--r--arch/m68k/sun3/intersil.c1
-rw-r--r--arch/m68k/sun3/leds.c2
-rw-r--r--arch/m68k/sun3/mmu_emu.c43
-rw-r--r--arch/m68k/sun3/prom/printf.c5
-rw-r--r--arch/m68k/sun3/sun3.h22
-rw-r--r--arch/m68k/sun3/sun3dvma.c17
-rw-r--r--arch/m68k/sun3/sun3ints.c12
9 files changed, 64 insertions, 55 deletions
diff --git a/arch/m68k/sun3/config.c b/arch/m68k/sun3/config.c
index 203f428a0344..cd8af809e0ca 100644
--- a/arch/m68k/sun3/config.c
+++ b/arch/m68k/sun3/config.c
@@ -17,6 +17,7 @@
#include <linux/init.h>
#include <linux/memblock.h>
#include <linux/platform_device.h>
+#include <linux/linkage.h>
#include <asm/oplib.h>
#include <asm/setup.h>
@@ -32,12 +33,13 @@
#include <asm/irq.h>
#include <asm/sections.h>
#include <asm/sun3ints.h>
+#include <asm/config.h>
+
+#include "sun3.h"
char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
static void sun3_sched_init(void);
-extern void sun3_get_model (char* model);
-extern int sun3_hwclk(int set, struct rtc_time *t);
volatile char* clock_va;
extern unsigned long availmem;
@@ -48,7 +50,7 @@ static void sun3_get_hardware_list(struct seq_file *m)
seq_printf(m, "PROM Revision:\t%s\n", romvec->pv_monid);
}
-void __init sun3_init(void)
+asmlinkage void __init sun3_init(void)
{
unsigned char enable_register;
int i;
@@ -107,13 +109,10 @@ static void sun3_halt (void)
static void __init sun3_bootmem_alloc(unsigned long memory_start,
unsigned long memory_end)
{
- unsigned long start_page;
-
/* align start/end to page boundaries */
memory_start = ((memory_start + (PAGE_SIZE-1)) & PAGE_MASK);
memory_end = memory_end & PAGE_MASK;
- start_page = __pa(memory_start) >> PAGE_SHIFT;
max_pfn = num_pages = __pa(memory_end) >> PAGE_SHIFT;
high_memory = (void *)memory_end;
@@ -200,7 +199,7 @@ static const struct resource sun3_scsi_rsrc[] __initconst = {
},
};
-int __init sun3_platform_init(void)
+static int __init sun3_platform_init(void)
{
switch (idprom->id_machtype) {
case SM_SUN3 | SM_3_160:
diff --git a/arch/m68k/sun3/idprom.c b/arch/m68k/sun3/idprom.c
index 1ace5353d78f..ca633a5f5eb1 100644
--- a/arch/m68k/sun3/idprom.c
+++ b/arch/m68k/sun3/idprom.c
@@ -17,6 +17,8 @@
#include <asm/idprom.h>
#include <asm/machines.h> /* Fun with Sun released architectures. */
+#include "sun3.h"
+
struct idprom *idprom;
EXPORT_SYMBOL(idprom);
@@ -83,7 +85,7 @@ static void __init display_system_type(unsigned char machtype)
prom_halt();
}
-void sun3_get_model(unsigned char* model)
+void sun3_get_model(char *model)
{
register int i;
diff --git a/arch/m68k/sun3/intersil.c b/arch/m68k/sun3/intersil.c
index 8fc74864de81..29674cfa9bb3 100644
--- a/arch/m68k/sun3/intersil.c
+++ b/arch/m68k/sun3/intersil.c
@@ -17,6 +17,7 @@
#include <asm/intersil.h>
#include <asm/machdep.h>
+#include "sun3.h"
/* bits to set for start/run of the intersil */
#define STOP_VAL (INTERSIL_STOP | INTERSIL_INT_ENABLE | INTERSIL_24H_MODE)
diff --git a/arch/m68k/sun3/leds.c b/arch/m68k/sun3/leds.c
index 7c67b58ebf13..4bb95318fd54 100644
--- a/arch/m68k/sun3/leds.c
+++ b/arch/m68k/sun3/leds.c
@@ -3,6 +3,8 @@
#include <asm/sun3mmu.h>
#include <asm/io.h>
+#include "sun3.h"
+
void sun3_leds(unsigned char byte)
{
unsigned char dfc;
diff --git a/arch/m68k/sun3/mmu_emu.c b/arch/m68k/sun3/mmu_emu.c
index 7321b3b76283..119bd32efcfb 100644
--- a/arch/m68k/sun3/mmu_emu.c
+++ b/arch/m68k/sun3/mmu_emu.c
@@ -27,6 +27,7 @@
#include <asm/mmu_context.h>
#include <asm/dvma.h>
+#include "sun3.h"
#undef DEBUG_MMU_EMU
#define DEBUG_PROM_MAPS
@@ -67,7 +68,7 @@ static unsigned char ctx_avail = CONTEXTS_NUM-1;
unsigned long rom_pages[256];
/* Print a PTE value in symbolic form. For debugging. */
-void print_pte (pte_t pte)
+static void print_pte(pte_t pte)
{
#if 0
/* Verbose version. */
@@ -206,32 +207,32 @@ void __init mmu_emu_init(unsigned long bootmem_end)
context for when they're cleared */
void clear_context(unsigned long context)
{
- unsigned char oldctx;
- unsigned long i;
+ unsigned char oldctx;
+ unsigned long i;
- if(context) {
- if(!ctx_alloc[context])
- panic("%s: context not allocated\n", __func__);
+ if (context) {
+ if (!ctx_alloc[context])
+ panic("%s: context not allocated\n", __func__);
- ctx_alloc[context]->context = SUN3_INVALID_CONTEXT;
- ctx_alloc[context] = (struct mm_struct *)0;
- ctx_avail++;
- }
+ ctx_alloc[context]->context = SUN3_INVALID_CONTEXT;
+ ctx_alloc[context] = (struct mm_struct *)0;
+ ctx_avail++;
+ }
- oldctx = sun3_get_context();
+ oldctx = sun3_get_context();
- sun3_put_context(context);
+ sun3_put_context(context);
- for(i = 0; i < SUN3_INVALID_PMEG; i++) {
- if((pmeg_ctx[i] == context) && (pmeg_alloc[i] == 1)) {
- sun3_put_segmap(pmeg_vaddr[i], SUN3_INVALID_PMEG);
- pmeg_ctx[i] = 0;
- pmeg_alloc[i] = 0;
- pmeg_vaddr[i] = 0;
- }
- }
+ for (i = 0; i < SUN3_INVALID_PMEG; i++) {
+ if ((pmeg_ctx[i] == context) && (pmeg_alloc[i] == 1)) {
+ sun3_put_segmap(pmeg_vaddr[i], SUN3_INVALID_PMEG);
+ pmeg_ctx[i] = 0;
+ pmeg_alloc[i] = 0;
+ pmeg_vaddr[i] = 0;
+ }
+ }
- sun3_put_context(oldctx);
+ sun3_put_context(oldctx);
}
/* gets an empty context. if full, kills the next context listed to
diff --git a/arch/m68k/sun3/prom/printf.c b/arch/m68k/sun3/prom/printf.c
index b6724cc66795..db5537ef1250 100644
--- a/arch/m68k/sun3/prom/printf.c
+++ b/arch/m68k/sun3/prom/printf.c
@@ -25,15 +25,14 @@ prom_printf(char *fmt, ...)
{
va_list args;
char ch, *bptr;
- int i;
va_start(args, fmt);
#ifdef CONFIG_KGDB
ppbuf[0] = 'O';
- i = vsprintf(ppbuf + 1, fmt, args) + 1;
+ vsprintf(ppbuf + 1, fmt, args) + 1;
#else
- i = vsprintf(ppbuf, fmt, args);
+ vsprintf(ppbuf, fmt, args);
#endif
bptr = ppbuf;
diff --git a/arch/m68k/sun3/sun3.h b/arch/m68k/sun3/sun3.h
new file mode 100644
index 000000000000..8d98c0aaedc0
--- /dev/null
+++ b/arch/m68k/sun3/sun3.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#include <linux/linkage.h>
+
+struct rtc_time;
+
+/* config.c */
+asmlinkage void sun3_init(void);
+
+/* idprom.c */
+void sun3_get_model(char *model);
+
+/* intersil.c */
+int sun3_hwclk(int set, struct rtc_time *t);
+
+/* leds.c */
+void sun3_leds(unsigned char byte);
+
+/* mmu_emu.c */
+void mmu_emu_init(unsigned long bootmem_end);
+int mmu_emu_handle_fault(unsigned long vaddr, int read_flag, int kernel_fault);
+void print_pte_vaddr(unsigned long vaddr);
diff --git a/arch/m68k/sun3/sun3dvma.c b/arch/m68k/sun3/sun3dvma.c
index 4b560f4d3960..6ebf52740ad7 100644
--- a/arch/m68k/sun3/sun3dvma.c
+++ b/arch/m68k/sun3/sun3dvma.c
@@ -20,18 +20,6 @@
#undef DVMA_DEBUG
-#ifdef CONFIG_SUN3X
-extern void dvma_unmap_iommu(unsigned long baddr, int len);
-#else
-static inline void dvma_unmap_iommu(unsigned long a, int b)
-{
-}
-#endif
-
-#ifdef CONFIG_SUN3
-extern void sun3_dvma_init(void);
-#endif
-
static unsigned long *iommu_use;
#define dvma_index(baddr) ((baddr - DVMA_START) >> DVMA_PAGE_SHIFT)
@@ -205,9 +193,7 @@ static inline int free_baddr(unsigned long baddr)
unsigned long len;
struct hole *hole;
struct list_head *cur;
- unsigned long orig_baddr;
- orig_baddr = baddr;
len = dvma_entry_use(baddr);
dvma_entry_use(baddr) = 0;
baddr &= DVMA_PAGE_MASK;
@@ -274,10 +260,7 @@ void __init dvma_init(void)
dvma_unmap_iommu(DVMA_START, DVMA_SIZE);
-#ifdef CONFIG_SUN3
sun3_dvma_init();
-#endif
-
}
unsigned long dvma_map_align(unsigned long kaddr, int len, int align)
diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c
index 36cc280a4505..32eaf55f87be 100644
--- a/arch/m68k/sun3/sun3ints.c
+++ b/arch/m68k/sun3/sun3ints.c
@@ -17,7 +17,7 @@
#include <asm/irq_regs.h>
#include <linux/seq_file.h>
-extern void sun3_leds (unsigned char);
+#include "sun3.h"
void sun3_disable_interrupts(void)
{
@@ -29,11 +29,11 @@ void sun3_enable_interrupts(void)
sun3_enable_irq(0);
}
-static int led_pattern[8] = {
- ~(0x80), ~(0x01),
- ~(0x40), ~(0x02),
- ~(0x20), ~(0x04),
- ~(0x10), ~(0x08)
+static unsigned char led_pattern[8] = {
+ (u8)~(0x80), (u8)~(0x01),
+ (u8)~(0x40), (u8)~(0x02),
+ (u8)~(0x20), (u8)~(0x04),
+ (u8)~(0x10), (u8)~(0x08)
};
volatile unsigned char* sun3_intreg;