Commit 6ff5801a authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

m68k: reformat various m68k files

Reformat various m68k files, so they actually look like Linux sources.
Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b3e2fd9c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -692,7 +692,7 @@ sys_call_table: ...@@ -692,7 +692,7 @@ sys_call_table:
.long sys_tgkill /* 265 */ .long sys_tgkill /* 265 */
.long sys_utimes .long sys_utimes
.long sys_fadvise64_64 .long sys_fadvise64_64
.long sys_mbind .long sys_mbind
.long sys_get_mempolicy .long sys_get_mempolicy
.long sys_set_mempolicy /* 270 */ .long sys_set_mempolicy /* 270 */
.long sys_mq_open .long sys_mq_open
......
...@@ -3195,7 +3195,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1 ...@@ -3195,7 +3195,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1
jbra L(serial_putc_done) jbra L(serial_putc_done)
3: 3:
#endif #endif
L(serial_putc_done): L(serial_putc_done):
func_return serial_putc func_return serial_putc
......
This diff is collapsed.
...@@ -59,15 +59,15 @@ extern struct mem_info m68k_ramdisk; ...@@ -59,15 +59,15 @@ extern struct mem_info m68k_ramdisk;
extern char m68k_command_line[CL_SIZE]; extern char m68k_command_line[CL_SIZE];
void *mac_env; /* Loaded by the boot asm */ void *mac_env; /* Loaded by the boot asm */
/* The phys. video addr. - might be bogus on some machines */ /* The phys. video addr. - might be bogus on some machines */
unsigned long mac_orig_videoaddr; unsigned long mac_orig_videoaddr;
/* Mac specific timer functions */ /* Mac specific timer functions */
extern unsigned long mac_gettimeoffset (void); extern unsigned long mac_gettimeoffset(void);
extern int mac_hwclk (int, struct rtc_time *); extern int mac_hwclk(int, struct rtc_time *);
extern int mac_set_clock_mmss (unsigned long); extern int mac_set_clock_mmss(unsigned long);
extern int show_mac_interrupts(struct seq_file *, void *); extern int show_mac_interrupts(struct seq_file *, void *);
extern void iop_preinit(void); extern void iop_preinit(void);
extern void iop_init(void); extern void iop_init(void);
...@@ -99,51 +99,52 @@ static void mac_sched_init(irq_handler_t vector) ...@@ -99,51 +99,52 @@ static void mac_sched_init(irq_handler_t vector)
int __init mac_parse_bootinfo(const struct bi_record *record) int __init mac_parse_bootinfo(const struct bi_record *record)
{ {
int unknown = 0; int unknown = 0;
const u_long *data = record->data; const u_long *data = record->data;
switch (record->tag) { switch (record->tag) {
case BI_MAC_MODEL: case BI_MAC_MODEL:
mac_bi_data.id = *data; mac_bi_data.id = *data;
break; break;
case BI_MAC_VADDR: case BI_MAC_VADDR:
mac_bi_data.videoaddr = *data; mac_bi_data.videoaddr = *data;
break; break;
case BI_MAC_VDEPTH: case BI_MAC_VDEPTH:
mac_bi_data.videodepth = *data; mac_bi_data.videodepth = *data;
break; break;
case BI_MAC_VROW: case BI_MAC_VROW:
mac_bi_data.videorow = *data; mac_bi_data.videorow = *data;
break; break;
case BI_MAC_VDIM: case BI_MAC_VDIM:
mac_bi_data.dimensions = *data; mac_bi_data.dimensions = *data;
break; break;
case BI_MAC_VLOGICAL: case BI_MAC_VLOGICAL:
mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK); mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
mac_orig_videoaddr = *data; mac_orig_videoaddr = *data;
break; break;
case BI_MAC_SCCBASE: case BI_MAC_SCCBASE:
mac_bi_data.sccbase = *data; mac_bi_data.sccbase = *data;
break; break;
case BI_MAC_BTIME: case BI_MAC_BTIME:
mac_bi_data.boottime = *data; mac_bi_data.boottime = *data;
break; break;
case BI_MAC_GMTBIAS: case BI_MAC_GMTBIAS:
mac_bi_data.gmtbias = *data; mac_bi_data.gmtbias = *data;
break; break;
case BI_MAC_MEMSIZE: case BI_MAC_MEMSIZE:
mac_bi_data.memsize = *data; mac_bi_data.memsize = *data;
break; break;
case BI_MAC_CPUID: case BI_MAC_CPUID:
mac_bi_data.cpuid = *data; mac_bi_data.cpuid = *data;
break; break;
case BI_MAC_ROMBASE: case BI_MAC_ROMBASE:
mac_bi_data.rombase = *data; mac_bi_data.rombase = *data;
break; break;
default: default:
unknown = 1; unknown = 1;
} break;
return(unknown); }
return unknown;
} }
/* /*
...@@ -155,6 +156,7 @@ int __init mac_parse_bootinfo(const struct bi_record *record) ...@@ -155,6 +156,7 @@ int __init mac_parse_bootinfo(const struct bi_record *record)
static void mac_cache_card_flush(int writeback) static void mac_cache_card_flush(int writeback)
{ {
unsigned long flags; unsigned long flags;
local_irq_save(flags); local_irq_save(flags);
via_flush_cache(); via_flush_cache();
local_irq_restore(flags); local_irq_restore(flags);
...@@ -162,28 +164,27 @@ static void mac_cache_card_flush(int writeback) ...@@ -162,28 +164,27 @@ static void mac_cache_card_flush(int writeback)
void __init config_mac(void) void __init config_mac(void)
{ {
if (!MACH_IS_MAC) { if (!MACH_IS_MAC)
printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n"); printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
}
mach_sched_init = mac_sched_init; mach_sched_init = mac_sched_init;
mach_init_IRQ = mac_init_IRQ; mach_init_IRQ = mac_init_IRQ;
mach_get_model = mac_get_model; mach_get_model = mac_get_model;
mach_gettimeoffset = mac_gettimeoffset; mach_gettimeoffset = mac_gettimeoffset;
#warning move to adb/via init #warning move to adb/via init
#if 0 #if 0
mach_hwclk = mac_hwclk; mach_hwclk = mac_hwclk;
#endif #endif
mach_set_clock_mmss = mac_set_clock_mmss; mach_set_clock_mmss = mac_set_clock_mmss;
mach_reset = mac_reset; mach_reset = mac_reset;
mach_halt = mac_poweroff; mach_halt = mac_poweroff;
mach_power_off = mac_poweroff; mach_power_off = mac_poweroff;
mach_max_dma_address = 0xffffffff; mach_max_dma_address = 0xffffffff;
#if 0 #if 0
mach_debug_init = mac_debug_init; mach_debug_init = mac_debug_init;
#endif #endif
#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
mach_beep = mac_mksound; mach_beep = mac_mksound;
#endif #endif
#ifdef CONFIG_HEARTBEAT #ifdef CONFIG_HEARTBEAT
#if 0 #if 0
...@@ -199,21 +200,22 @@ void __init config_mac(void) ...@@ -199,21 +200,22 @@ void __init config_mac(void)
mac_identify(); mac_identify();
mac_report_hardware(); mac_report_hardware();
/* AFAIK only the IIci takes a cache card. The IIfx has onboard /*
cache ... someone needs to figure out how to tell if it's on or * AFAIK only the IIci takes a cache card. The IIfx has onboard
not. */ * cache ... someone needs to figure out how to tell if it's on or
* not.
*/
if (macintosh_config->ident == MAC_MODEL_IICI if (macintosh_config->ident == MAC_MODEL_IICI
|| macintosh_config->ident == MAC_MODEL_IIFX) { || macintosh_config->ident == MAC_MODEL_IIFX)
mach_l2_flush = mac_cache_card_flush; mach_l2_flush = mac_cache_card_flush;
}
/* /*
* Check for machine specific fixups. * Check for machine specific fixups.
*/ */
#ifdef OLD_NUBUS_CODE #ifdef OLD_NUBUS_CODE
nubus_sweep_video(); nubus_sweep_video();
#endif #endif
} }
...@@ -233,8 +235,7 @@ void __init config_mac(void) ...@@ -233,8 +235,7 @@ void __init config_mac(void)
struct mac_model *macintosh_config; struct mac_model *macintosh_config;
EXPORT_SYMBOL(macintosh_config); EXPORT_SYMBOL(macintosh_config);
static struct mac_model mac_data_table[]= static struct mac_model mac_data_table[] = {
{
/* /*
* We'll pretend to be a Macintosh II, that's pretty safe. * We'll pretend to be a Macintosh II, that's pretty safe.
*/ */
...@@ -784,12 +785,12 @@ void mac_identify(void) ...@@ -784,12 +785,12 @@ void mac_identify(void)
if (!model) { if (!model) {
/* no bootinfo model id -> NetBSD booter was used! */ /* no bootinfo model id -> NetBSD booter was used! */
/* XXX FIXME: breaks for model > 31 */ /* XXX FIXME: breaks for model > 31 */
model=(mac_bi_data.cpuid>>2)&63; model = (mac_bi_data.cpuid >> 2) & 63;
printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n"); printk(KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
} }
macintosh_config = mac_data_table; macintosh_config = mac_data_table;
for (m = macintosh_config ; m->ident != -1 ; m++) { for (m = macintosh_config; m->ident != -1; m++) {
if (m->ident == model) { if (m->ident == model) {
macintosh_config = m; macintosh_config = m;
break; break;
...@@ -803,25 +804,25 @@ void mac_identify(void) ...@@ -803,25 +804,25 @@ void mac_identify(void)
iop_preinit(); iop_preinit();
mac_debug_init(); mac_debug_init();
printk (KERN_INFO "Detected Macintosh model: %d \n", model); printk(KERN_INFO "Detected Macintosh model: %d \n", model);
/* /*
* Report booter data: * Report booter data:
*/ */
printk (KERN_DEBUG " Penguin bootinfo data:\n"); printk(KERN_DEBUG " Penguin bootinfo data:\n");
printk (KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", printk(KERN_DEBUG " Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n",
mac_bi_data.videoaddr, mac_bi_data.videorow, mac_bi_data.videoaddr, mac_bi_data.videorow,
mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF,
mac_bi_data.dimensions >> 16); mac_bi_data.dimensions >> 16);
printk (KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n", printk(KERN_DEBUG " Videological 0x%lx phys. 0x%lx, SCC at 0x%lx \n",
mac_bi_data.videological, mac_orig_videoaddr, mac_bi_data.videological, mac_orig_videoaddr,
mac_bi_data.sccbase); mac_bi_data.sccbase);
printk (KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n", printk(KERN_DEBUG " Boottime: 0x%lx GMTBias: 0x%lx \n",
mac_bi_data.boottime, mac_bi_data.gmtbias); mac_bi_data.boottime, mac_bi_data.gmtbias);
printk (KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n", printk(KERN_DEBUG " Machine ID: %ld CPUid: 0x%lx memory size: 0x%lx \n",
mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize); mac_bi_data.id, mac_bi_data.cpuid, mac_bi_data.memsize);
#if 0 #if 0
printk ("Ramdisk: addr 0x%lx size 0x%lx\n", printk("Ramdisk: addr 0x%lx size 0x%lx\n",
m68k_ramdisk.addr, m68k_ramdisk.size); m68k_ramdisk.addr, m68k_ramdisk.size);
#endif #endif
...@@ -830,22 +831,22 @@ void mac_identify(void) ...@@ -830,22 +831,22 @@ void mac_identify(void)
*/ */
switch (macintosh_config->scsi_type) { switch (macintosh_config->scsi_type) {
case MAC_SCSI_OLD: case MAC_SCSI_OLD:
MACHW_SET(MAC_SCSI_80); MACHW_SET(MAC_SCSI_80);
break; break;
case MAC_SCSI_QUADRA: case MAC_SCSI_QUADRA:
case MAC_SCSI_QUADRA2: case MAC_SCSI_QUADRA2:
case MAC_SCSI_QUADRA3: case MAC_SCSI_QUADRA3:
MACHW_SET(MAC_SCSI_96); MACHW_SET(MAC_SCSI_96);
if ((macintosh_config->ident == MAC_MODEL_Q900) || if ((macintosh_config->ident == MAC_MODEL_Q900) ||
(macintosh_config->ident == MAC_MODEL_Q950)) (macintosh_config->ident == MAC_MODEL_Q950))
MACHW_SET(MAC_SCSI_96_2); MACHW_SET(MAC_SCSI_96_2);
break; break;
default: default:
printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n"); printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
MACHW_SET(MAC_SCSI_80); MACHW_SET(MAC_SCSI_80);
break; break;
} }
iop_init(); iop_init();
via_init(); via_init();
oss_init(); oss_init();
...@@ -860,6 +861,6 @@ void mac_report_hardware(void) ...@@ -860,6 +861,6 @@ void mac_report_hardware(void)
static void mac_get_model(char *str) static void mac_get_model(char *str)
{ {
strcpy(str,"Macintosh "); strcpy(str, "Macintosh ");
strcat(str, macintosh_config->name); strcat(str, macintosh_config->name);
} }
This diff is collapsed.
This diff is collapsed.
...@@ -34,43 +34,43 @@ e_vector *sun3x_prom_vbr; ...@@ -34,43 +34,43 @@ e_vector *sun3x_prom_vbr;
/* Handle returning to the prom */ /* Handle returning to the prom */
void sun3x_halt(void) void sun3x_halt(void)
{ {
unsigned long flags; unsigned long flags;
/* Disable interrupts while we mess with things */ /* Disable interrupts while we mess with things */
local_irq_save(flags); local_irq_save(flags);
/* Restore prom vbr */ /* Restore prom vbr */
__asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr)); asm volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
/* Restore prom NMI clock */ /* Restore prom NMI clock */
// sun3x_disable_intreg(5); // sun3x_disable_intreg(5);
sun3_enable_irq(7); sun3_enable_irq(7);
/* Let 'er rip */ /* Let 'er rip */
__asm__ volatile ("trap #14" : : ); asm volatile ("trap #14");
/* Restore everything */ /* Restore everything */
sun3_disable_irq(7); sun3_disable_irq(7);
sun3_enable_irq(5); sun3_enable_irq(5);
__asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)vectors)); asm volatile ("movec %0,%%vbr" : : "r" ((void*)vectors));
local_irq_restore(flags); local_irq_restore(flags);
} }
void sun3x_reboot(void) void sun3x_reboot(void)
{ {
/* This never returns, don't bother saving things */ /* This never returns, don't bother saving things */
local_irq_disable(); local_irq_disable();
/* Restore prom vbr */ /* Restore prom vbr */
__asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr)); asm volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
/* Restore prom NMI clock */ /* Restore prom NMI clock */
sun3_disable_irq(5); sun3_disable_irq(5);
sun3_enable_irq(7); sun3_enable_irq(7);
/* Let 'er rip */ /* Let 'er rip */
(*romvec->pv_reboot)("vmlinux"); (*romvec->pv_reboot)("vmlinux");
} }
extern char m68k_debug_device[]; extern char m68k_debug_device[];
...@@ -78,54 +78,52 @@ extern char m68k_debug_device[]; ...@@ -78,54 +78,52 @@ extern char m68k_debug_device[];
static void sun3x_prom_write(struct console *co, const char *s, static void sun3x_prom_write(struct console *co, const char *s,
unsigned int count) unsigned int count)
{ {
while (count--) { while (count--) {
if (*s == '\n') if (*s == '\n')
sun3x_putchar('\r'); sun3x_putchar('\r');
sun3x_putchar(*s++); sun3x_putchar(*s++);
} }
} }
/* debug console - write-only */ /* debug console - write-only */
static struct console sun3x_debug = { static struct console sun3x_debug = {
.name = "debug", .name = "debug",
.write = sun3x_prom_write, .write = sun3x_prom_write,
.flags = CON_PRINTBUFFER, .flags = CON_PRINTBUFFER,
.index = -1, .index = -1,
}; };
void sun3x_prom_init(void) void sun3x_prom_init(void)
{ {
/* Read the vector table */ /* Read the vector table */
sun3x_putchar = *(void (**)(int)) (SUN3X_P_PUTCHAR); sun3x_putchar = *(void (**)(int)) (SUN3X_P_PUTCHAR);
sun3x_getchar = *(int (**)(void)) (SUN3X_P_GETCHAR); sun3x_getchar = *(int (**)(void)) (SUN3X_P_GETCHAR);
sun3x_mayget = *(int (**)(void)) (SUN3X_P_MAYGET); sun3x_mayget = *(int (**)(void)) (SUN3X_P_MAYGET);
sun3x_mayput = *(int (**)(int)) (SUN3X_P_MAYPUT); sun3x_mayput = *(int (**)(int)) (SUN3X_P_MAYPUT);
sun3x_prom_reboot = *(void (**)(void)) (SUN3X_P_REBOOT); sun3x_prom_reboot = *(void (**)(void)) (SUN3X_P_REBOOT);
sun3x_prom_abort = *(e_vector *) (SUN3X_P_ABORT); sun3x_prom_abort = *(e_vector *) (SUN3X_P_ABORT);
romvec = (struct linux_romvec *)SUN3X_PROM_BASE; romvec = (struct linux_romvec *)SUN3X_PROM_BASE;
idprom_init(); idprom_init();
if(!((idprom->id_machtype & SM_ARCH_MASK) == SM_SUN3X)) { if (!((idprom->id_machtype & SM_ARCH_MASK) == SM_SUN3X)) {
printk("Warning: machine reports strange type %02x\n", printk("Warning: machine reports strange type %02x\n",
idprom->id_machtype); idprom->id_machtype);
printk("Pretending it's a 3/80, but very afraid...\n"); printk("Pretending it's a 3/80, but very afraid...\n");
idprom->id_machtype = SM_SUN3X | SM_3_80; idprom->id_machtype = SM_SUN3X | SM_3_80;
} }
/* point trap #14 at abort. /* point trap #14 at abort.
* XXX this is futile since we restore the vbr first - oops * XXX this is futile since we restore the vbr first - oops
*/ */
vectors[VEC_TRAP14] = sun3x_prom_abort; vectors[VEC_TRAP14] = sun3x_prom_abort;
/* If debug=prom was specified, start the debug console */ /* If debug=prom was specified, start the debug console */
if (!strcmp(m68k_debug_device, "prom")) if (!strcmp(m68k_debug_device, "prom"))
register_console(&sun3x_debug); register_console(&sun3x_debug);
} }
/* some prom functions to export */ /* some prom functions to export */
...@@ -141,7 +139,6 @@ int prom_getbool (int node, char *prop) ...@@ -141,7 +139,6 @@ int prom_getbool (int node, char *prop)
void prom_printf(char *fmt, ...) void prom_printf(char *fmt, ...)
{ {
} }
void prom_halt (void) void prom_halt (void)
...@@ -159,7 +156,7 @@ prom_get_idprom(char *idbuf, int num_bytes) ...@@ -159,7 +156,7 @@ prom_get_idprom(char *idbuf, int num_bytes)
int i; int i;
/* make a copy of the idprom structure */ /* make a copy of the idprom structure */
for(i = 0; i < num_bytes; i++) for (i = 0; i < num_bytes; i++)
idbuf[i] = ((char *)SUN3X_IDPROM)[i]; idbuf[i] = ((char *)SUN3X_IDPROM)[i];
return idbuf[0]; return idbuf[0];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment