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:
.long sys_tgkill /* 265 */
.long sys_utimes
.long sys_fadvise64_64
.long sys_mbind
.long sys_mbind
.long sys_get_mempolicy
.long sys_set_mempolicy /* 270 */
.long sys_mq_open
......
......@@ -3195,7 +3195,7 @@ func_start serial_putc,%d0/%d1/%a0/%a1
jbra L(serial_putc_done)
3:
#endif
L(serial_putc_done):
func_return serial_putc
......
This diff is collapsed.
......@@ -59,15 +59,15 @@ extern struct mem_info m68k_ramdisk;
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 */
unsigned long mac_orig_videoaddr;
/* Mac specific timer functions */
extern unsigned long mac_gettimeoffset (void);
extern int mac_hwclk (int, struct rtc_time *);
extern int mac_set_clock_mmss (unsigned long);
extern unsigned long mac_gettimeoffset(void);
extern int mac_hwclk(int, struct rtc_time *);
extern int mac_set_clock_mmss(unsigned long);
extern int show_mac_interrupts(struct seq_file *, void *);
extern void iop_preinit(void);
extern void iop_init(void);
......@@ -99,51 +99,52 @@ static void mac_sched_init(irq_handler_t vector)
int __init mac_parse_bootinfo(const struct bi_record *record)
{
int unknown = 0;
const u_long *data = record->data;
int unknown = 0;
const u_long *data = record->data;
switch (record->tag) {
switch (record->tag) {
case BI_MAC_MODEL:
mac_bi_data.id = *data;
break;
mac_bi_data.id = *data;
break;
case BI_MAC_VADDR:
mac_bi_data.videoaddr = *data;
break;
mac_bi_data.videoaddr = *data;
break;
case BI_MAC_VDEPTH:
mac_bi_data.videodepth = *data;
break;
mac_bi_data.videodepth = *data;
break;
case BI_MAC_VROW:
mac_bi_data.videorow = *data;
break;
mac_bi_data.videorow = *data;
break;
case BI_MAC_VDIM:
mac_bi_data.dimensions = *data;
break;
mac_bi_data.dimensions = *data;
break;
case BI_MAC_VLOGICAL:
mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
mac_orig_videoaddr = *data;
break;
mac_bi_data.videological = VIDEOMEMBASE + (*data & ~VIDEOMEMMASK);
mac_orig_videoaddr = *data;
break;
case BI_MAC_SCCBASE:
mac_bi_data.sccbase = *data;
break;
mac_bi_data.sccbase = *data;
break;
case BI_MAC_BTIME:
mac_bi_data.boottime = *data;
break;
mac_bi_data.boottime = *data;
break;
case BI_MAC_GMTBIAS:
mac_bi_data.gmtbias = *data;
break;
mac_bi_data.gmtbias = *data;
break;
case BI_MAC_MEMSIZE:
mac_bi_data.memsize = *data;
break;
mac_bi_data.memsize = *data;
break;
case BI_MAC_CPUID:
mac_bi_data.cpuid = *data;
break;
case BI_MAC_ROMBASE:
mac_bi_data.rombase = *data;
break;
mac_bi_data.cpuid = *data;
break;
case BI_MAC_ROMBASE:
mac_bi_data.rombase = *data;
break;
default:
unknown = 1;
}
return(unknown);
unknown = 1;
break;
}
return unknown;
}
/*
......@@ -155,6 +156,7 @@ int __init mac_parse_bootinfo(const struct bi_record *record)
static void mac_cache_card_flush(int writeback)
{
unsigned long flags;
local_irq_save(flags);
via_flush_cache();
local_irq_restore(flags);
......@@ -162,28 +164,27 @@ static void mac_cache_card_flush(int writeback)
void __init config_mac(void)
{
if (!MACH_IS_MAC) {
printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
}
if (!MACH_IS_MAC)
printk(KERN_ERR "ERROR: no Mac, but config_mac() called!! \n");
mach_sched_init = mac_sched_init;
mach_init_IRQ = mac_init_IRQ;
mach_get_model = mac_get_model;
mach_gettimeoffset = mac_gettimeoffset;
mach_sched_init = mac_sched_init;
mach_init_IRQ = mac_init_IRQ;
mach_get_model = mac_get_model;
mach_gettimeoffset = mac_gettimeoffset;
#warning move to adb/via init
#if 0
mach_hwclk = mac_hwclk;
mach_hwclk = mac_hwclk;
#endif
mach_set_clock_mmss = mac_set_clock_mmss;
mach_reset = mac_reset;
mach_halt = mac_poweroff;
mach_power_off = mac_poweroff;
mach_set_clock_mmss = mac_set_clock_mmss;
mach_reset = mac_reset;
mach_halt = mac_poweroff;
mach_power_off = mac_poweroff;
mach_max_dma_address = 0xffffffff;
#if 0
mach_debug_init = mac_debug_init;
mach_debug_init = mac_debug_init;
#endif
#if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE)
mach_beep = mac_mksound;
mach_beep = mac_mksound;
#endif
#ifdef CONFIG_HEARTBEAT
#if 0
......@@ -199,21 +200,22 @@ void __init config_mac(void)
mac_identify();
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
not. */
/*
* 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
* not.
*/
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;
}
/*
* Check for machine specific fixups.
*/
#ifdef OLD_NUBUS_CODE
nubus_sweep_video();
nubus_sweep_video();
#endif
}
......@@ -233,8 +235,7 @@ void __init config_mac(void)
struct mac_model *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.
*/
......@@ -784,12 +785,12 @@ void mac_identify(void)
if (!model) {
/* no bootinfo model id -> NetBSD booter was used! */
/* XXX FIXME: breaks for model > 31 */
model=(mac_bi_data.cpuid>>2)&63;
printk (KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
model = (mac_bi_data.cpuid >> 2) & 63;
printk(KERN_WARNING "No bootinfo model ID, using cpuid instead (hey, use Penguin!)\n");
}
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) {
macintosh_config = m;
break;
......@@ -803,25 +804,25 @@ void mac_identify(void)
iop_preinit();
mac_debug_init();
printk (KERN_INFO "Detected Macintosh model: %d \n", model);
printk(KERN_INFO "Detected Macintosh model: %d \n", model);
/*
* Report booter data:
*/
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 " Penguin bootinfo data:\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.videodepth, mac_bi_data.dimensions & 0xFFFF,
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.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);
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);
#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);
#endif
......@@ -830,22 +831,22 @@ void mac_identify(void)
*/
switch (macintosh_config->scsi_type) {
case MAC_SCSI_OLD:
MACHW_SET(MAC_SCSI_80);
break;
MACHW_SET(MAC_SCSI_80);
break;
case MAC_SCSI_QUADRA:
case MAC_SCSI_QUADRA2:
case MAC_SCSI_QUADRA3:
MACHW_SET(MAC_SCSI_96);
if ((macintosh_config->ident == MAC_MODEL_Q900) ||
(macintosh_config->ident == MAC_MODEL_Q950))
MACHW_SET(MAC_SCSI_96_2);
break;
MACHW_SET(MAC_SCSI_96);
if ((macintosh_config->ident == MAC_MODEL_Q900) ||
(macintosh_config->ident == MAC_MODEL_Q950))
MACHW_SET(MAC_SCSI_96_2);
break;
default:
printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
MACHW_SET(MAC_SCSI_80);
break;
printk(KERN_WARNING "config.c: wtf: unknown scsi, using 53c80\n");
MACHW_SET(MAC_SCSI_80);
break;
}
iop_init();
via_init();
oss_init();
......@@ -860,6 +861,6 @@ void mac_report_hardware(void)
static void mac_get_model(char *str)
{
strcpy(str,"Macintosh ");
strcpy(str, "Macintosh ");
strcat(str, macintosh_config->name);
}
This diff is collapsed.
This diff is collapsed.
......@@ -34,43 +34,43 @@ e_vector *sun3x_prom_vbr;
/* Handle returning to the prom */
void sun3x_halt(void)
{
unsigned long flags;
unsigned long flags;
/* Disable interrupts while we mess with things */
local_irq_save(flags);
/* Disable interrupts while we mess with things */
local_irq_save(flags);
/* Restore prom vbr */
__asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
/* Restore prom vbr */
asm volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
/* Restore prom NMI clock */
// sun3x_disable_intreg(5);
sun3_enable_irq(7);
/* Restore prom NMI clock */
// sun3x_disable_intreg(5);
sun3_enable_irq(7);
/* Let 'er rip */
__asm__ volatile ("trap #14" : : );
/* Let 'er rip */
asm volatile ("trap #14");
/* Restore everything */
sun3_disable_irq(7);
sun3_enable_irq(5);
/* Restore everything */
sun3_disable_irq(7);
sun3_enable_irq(5);
__asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)vectors));
local_irq_restore(flags);
asm volatile ("movec %0,%%vbr" : : "r" ((void*)vectors));
local_irq_restore(flags);
}
void sun3x_reboot(void)
{
/* This never returns, don't bother saving things */
local_irq_disable();
/* This never returns, don't bother saving things */
local_irq_disable();
/* Restore prom vbr */
__asm__ volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
/* Restore prom vbr */
asm volatile ("movec %0,%%vbr" : : "r" ((void*)sun3x_prom_vbr));
/* Restore prom NMI clock */
sun3_disable_irq(5);
sun3_enable_irq(7);
/* Restore prom NMI clock */
sun3_disable_irq(5);
sun3_enable_irq(7);
/* Let 'er rip */
(*romvec->pv_reboot)("vmlinux");
/* Let 'er rip */
(*romvec->pv_reboot)("vmlinux");
}
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,
unsigned int count)
{
while (count--) {
if (*s == '\n')
sun3x_putchar('\r');
sun3x_putchar(*s++);
}
while (count--) {
if (*s == '\n')
sun3x_putchar('\r');
sun3x_putchar(*s++);
}
}
/* debug console - write-only */
static struct console sun3x_debug = {
.name = "debug",
.write = sun3x_prom_write,
.flags = CON_PRINTBUFFER,
.index = -1,
.name = "debug",
.write = sun3x_prom_write,
.flags = CON_PRINTBUFFER,
.index = -1,
};
void sun3x_prom_init(void)
{
/* Read the vector table */
sun3x_putchar = *(void (**)(int)) (SUN3X_P_PUTCHAR);
sun3x_getchar = *(int (**)(void)) (SUN3X_P_GETCHAR);
sun3x_mayget = *(int (**)(void)) (SUN3X_P_MAYGET);
sun3x_mayput = *(int (**)(int)) (SUN3X_P_MAYPUT);
sun3x_prom_reboot = *(void (**)(void)) (SUN3X_P_REBOOT);
sun3x_prom_abort = *(e_vector *) (SUN3X_P_ABORT);
romvec = (struct linux_romvec *)SUN3X_PROM_BASE;
idprom_init();
if(!((idprom->id_machtype & SM_ARCH_MASK) == SM_SUN3X)) {
printk("Warning: machine reports strange type %02x\n",
idprom->id_machtype);
printk("Pretending it's a 3/80, but very afraid...\n");
idprom->id_machtype = SM_SUN3X | SM_3_80;
}
/* point trap #14 at abort.
* XXX this is futile since we restore the vbr first - oops
*/
vectors[VEC_TRAP14] = sun3x_prom_abort;
/* If debug=prom was specified, start the debug console */
if (!strcmp(m68k_debug_device, "prom"))
register_console(&sun3x_debug);
/* Read the vector table */
sun3x_putchar = *(void (**)(int)) (SUN3X_P_PUTCHAR);
sun3x_getchar = *(int (**)(void)) (SUN3X_P_GETCHAR);
sun3x_mayget = *(int (**)(void)) (SUN3X_P_MAYGET);
sun3x_mayput = *(int (**)(int)) (SUN3X_P_MAYPUT);
sun3x_prom_reboot = *(void (**)(void)) (SUN3X_P_REBOOT);
sun3x_prom_abort = *(e_vector *) (SUN3X_P_ABORT);
romvec = (struct linux_romvec *)SUN3X_PROM_BASE;
idprom_init();
if (!((idprom->id_machtype & SM_ARCH_MASK) == SM_SUN3X)) {
printk("Warning: machine reports strange type %02x\n",
idprom->id_machtype);
printk("Pretending it's a 3/80, but very afraid...\n");
idprom->id_machtype = SM_SUN3X | SM_3_80;
}
/* point trap #14 at abort.
* XXX this is futile since we restore the vbr first - oops
*/
vectors[VEC_TRAP14] = sun3x_prom_abort;
/* If debug=prom was specified, start the debug console */
if (!strcmp(m68k_debug_device, "prom"))
register_console(&sun3x_debug);
}
/* some prom functions to export */
......@@ -141,7 +139,6 @@ int prom_getbool (int node, char *prop)
void prom_printf(char *fmt, ...)
{
}
void prom_halt (void)
......@@ -159,7 +156,7 @@ prom_get_idprom(char *idbuf, int num_bytes)
int i;
/* 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];
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