Commit 3b1b7195 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k: (30 commits)
  m68k: Fix --build-id breakage for sun3
  m68k: Wire up sys_restart_syscall
  fbdev: Kill Atari vblank cursor blinking
  m68k: zorro - Use %pR to print resources
  m68k: dio - Kill resource_size_t format warnings
  m68k: dmasound - Kill warn_unused_result warnings
  m68k: zorro - Kill warn_unused_result warnings
  m68k: dio - Kill warn_unused_result warnings
  m68k: atafb - Kill warn_unused_result warnings
  m68k: amiserial - Kill warn_unused_result warnings
  m68k: ser_a2232 - Kill warn_unused_result warnings
  m68k: vme_scc - Kill warn_unused_result warnings
  m68k: sun3 core - Kill warn_unused_result warnings
  m68k: mvme147 core - Kill warn_unused_result warnings
  m68k: mac core - Kill warn_unused_result warnings
  m68k: hp300 core - Kill warn_unused_result warnings
  m68k: atari core - Kill warn_unused_result warnings
  m68k: apollo core - Kill warn_unused_result warnings
  m68k: amiga core - Kill warn_unused_result warnings
  m68k: Kill several external declarations in source files
  ...
parents c69e8839 877d5243
...@@ -72,10 +72,14 @@ static struct irq_controller amiga_irq_controller = { ...@@ -72,10 +72,14 @@ static struct irq_controller amiga_irq_controller = {
void __init amiga_init_IRQ(void) void __init amiga_init_IRQ(void)
{ {
request_irq(IRQ_AUTO_1, ami_int1, 0, "int1", NULL); if (request_irq(IRQ_AUTO_1, ami_int1, 0, "int1", NULL))
request_irq(IRQ_AUTO_3, ami_int3, 0, "int3", NULL); pr_err("Couldn't register int%d\n", 1);
request_irq(IRQ_AUTO_4, ami_int4, 0, "int4", NULL); if (request_irq(IRQ_AUTO_3, ami_int3, 0, "int3", NULL))
request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL); pr_err("Couldn't register int%d\n", 3);
if (request_irq(IRQ_AUTO_4, ami_int4, 0, "int4", NULL))
pr_err("Couldn't register int%d\n", 4);
if (request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL))
pr_err("Couldn't register int%d\n", 5);
m68k_setup_irq_controller(&amiga_irq_controller, IRQ_USER, AMI_STD_IRQS); m68k_setup_irq_controller(&amiga_irq_controller, IRQ_USER, AMI_STD_IRQS);
......
...@@ -176,5 +176,7 @@ void __init cia_init_IRQ(struct ciabase *base) ...@@ -176,5 +176,7 @@ void __init cia_init_IRQ(struct ciabase *base)
/* override auto int and install CIA handler */ /* override auto int and install CIA handler */
m68k_setup_irq_controller(&auto_irq_controller, base->handler_irq, 1); m68k_setup_irq_controller(&auto_irq_controller, base->handler_irq, 1);
m68k_irq_startup(base->handler_irq); m68k_irq_startup(base->handler_irq);
request_irq(base->handler_irq, cia_handler, IRQF_SHARED, base->name, base); if (request_irq(base->handler_irq, cia_handler, IRQF_SHARED,
base->name, base))
pr_err("Couldn't register %s interrupt\n", base->name);
} }
...@@ -493,7 +493,8 @@ static void __init amiga_sched_init(irq_handler_t timer_routine) ...@@ -493,7 +493,8 @@ static void __init amiga_sched_init(irq_handler_t timer_routine)
* Please don't change this to use ciaa, as it interferes with the * Please don't change this to use ciaa, as it interferes with the
* SCSI code. We'll have to take a look at this later * SCSI code. We'll have to take a look at this later
*/ */
request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL); if (request_irq(IRQ_AMIGA_CIAB_TA, timer_routine, 0, "timer", NULL))
pr_err("Couldn't register timer interrupt\n");
/* start timer */ /* start timer */
ciab.cra |= 0x11; ciab.cra |= 0x11;
} }
......
...@@ -31,10 +31,6 @@ extern unsigned long dn_gettimeoffset(void); ...@@ -31,10 +31,6 @@ extern unsigned long dn_gettimeoffset(void);
extern int dn_dummy_hwclk(int, struct rtc_time *); extern int dn_dummy_hwclk(int, struct rtc_time *);
extern int dn_dummy_set_clock_mmss(unsigned long); extern int dn_dummy_set_clock_mmss(unsigned long);
extern void dn_dummy_reset(void); extern void dn_dummy_reset(void);
extern void dn_dummy_waitbut(void);
extern struct fb_info *dn_fb_init(long *);
extern void dn_dummy_debug_init(void);
extern irqreturn_t dn_process_int(int irq, struct pt_regs *fp);
#ifdef CONFIG_HEARTBEAT #ifdef CONFIG_HEARTBEAT
static void dn_heartbeat(int on); static void dn_heartbeat(int on);
#endif #endif
...@@ -204,7 +200,8 @@ void dn_sched_init(irq_handler_t timer_routine) ...@@ -204,7 +200,8 @@ void dn_sched_init(irq_handler_t timer_routine)
printk("*(0x10803) %02x\n",*(volatile unsigned char *)(timer+0x3)); printk("*(0x10803) %02x\n",*(volatile unsigned char *)(timer+0x3));
#endif #endif
request_irq(IRQ_APOLLO, dn_timer_int, 0, "time", timer_routine); if (request_irq(IRQ_APOLLO, dn_timer_int, 0, "time", timer_routine))
pr_err("Couldn't register timer interrupt\n");
} }
unsigned long dn_gettimeoffset(void) { unsigned long dn_gettimeoffset(void) {
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
#include <asm/atari_joystick.h> #include <asm/atari_joystick.h>
#include <asm/irq.h> #include <asm/irq.h>
extern unsigned int keymap_count;
/* Hook for MIDI serial driver */ /* Hook for MIDI serial driver */
void (*atari_MIDI_interrupt_hook) (void); void (*atari_MIDI_interrupt_hook) (void);
...@@ -567,14 +566,19 @@ static int atari_keyb_done = 0; ...@@ -567,14 +566,19 @@ static int atari_keyb_done = 0;
int atari_keyb_init(void) int atari_keyb_init(void)
{ {
int error;
if (atari_keyb_done) if (atari_keyb_done)
return 0; return 0;
kb_state.state = KEYBOARD; kb_state.state = KEYBOARD;
kb_state.len = 0; kb_state.len = 0;
request_irq(IRQ_MFP_ACIA, atari_keyboard_interrupt, IRQ_TYPE_SLOW, error = request_irq(IRQ_MFP_ACIA, atari_keyboard_interrupt,
"keyboard/mouse/MIDI", atari_keyboard_interrupt); IRQ_TYPE_SLOW, "keyboard/mouse/MIDI",
atari_keyboard_interrupt);
if (error)
return error;
atari_turnoff_irq(IRQ_MFP_ACIA); atari_turnoff_irq(IRQ_MFP_ACIA);
do { do {
......
...@@ -179,8 +179,9 @@ EXPORT_SYMBOL(stdma_islocked); ...@@ -179,8 +179,9 @@ EXPORT_SYMBOL(stdma_islocked);
void __init stdma_init(void) void __init stdma_init(void)
{ {
stdma_isr = NULL; stdma_isr = NULL;
request_irq(IRQ_MFP_FDC, stdma_int, IRQ_TYPE_SLOW | IRQF_SHARED, if (request_irq(IRQ_MFP_FDC, stdma_int, IRQ_TYPE_SLOW | IRQF_SHARED,
"ST-DMA: floppy/ACSI/IDE/Falcon-SCSI", stdma_int); "ST-DMA: floppy/ACSI/IDE/Falcon-SCSI", stdma_int))
pr_err("Couldn't register ST-DMA interrupt\n");
} }
......
...@@ -31,8 +31,9 @@ atari_sched_init(irq_handler_t timer_routine) ...@@ -31,8 +31,9 @@ atari_sched_init(irq_handler_t timer_routine)
/* start timer C, div = 1:100 */ /* start timer C, div = 1:100 */
mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60; mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x60;
/* install interrupt service routine for MFP Timer C */ /* install interrupt service routine for MFP Timer C */
request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW, if (request_irq(IRQ_MFP_TIMC, timer_routine, IRQ_TYPE_SLOW,
"timer", timer_routine); "timer", timer_routine))
pr_err("Couldn't register timer interrupt\n");
} }
/* ++andreas: gettimeoffset fixed to check for pending interrupt */ /* ++andreas: gettimeoffset fixed to check for pending interrupt */
......
...@@ -43,7 +43,6 @@ extern unsigned long bvme6000_gettimeoffset (void); ...@@ -43,7 +43,6 @@ extern unsigned long bvme6000_gettimeoffset (void);
extern int bvme6000_hwclk (int, struct rtc_time *); extern int bvme6000_hwclk (int, struct rtc_time *);
extern int bvme6000_set_clock_mmss (unsigned long); extern int bvme6000_set_clock_mmss (unsigned long);
extern void bvme6000_reset (void); extern void bvme6000_reset (void);
extern void bvme6000_waitbut(void);
void bvme6000_set_vectors (void); void bvme6000_set_vectors (void);
/* Save tick handler routine pointer, will point to do_timer() in /* Save tick handler routine pointer, will point to do_timer() in
......
...@@ -70,7 +70,8 @@ void __init hp300_sched_init(irq_handler_t vector) ...@@ -70,7 +70,8 @@ void __init hp300_sched_init(irq_handler_t vector)
asm volatile(" movpw %0,%1@(5)" : : "d" (INTVAL), "a" (CLOCKBASE)); asm volatile(" movpw %0,%1@(5)" : : "d" (INTVAL), "a" (CLOCKBASE));
request_irq(IRQ_AUTO_6, hp300_tick, IRQ_FLG_STD, "timer tick", vector); if (request_irq(IRQ_AUTO_6, hp300_tick, IRQ_FLG_STD, "timer tick", vector))
pr_err("Couldn't register timer interrupt\n");
out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */ out_8(CLOCKBASE + CLKCR2, 0x1); /* select CR1 */
out_8(CLOCKBASE + CLKCR1, 0x40); /* enable irq */ out_8(CLOCKBASE + CLKCR1, 0x40); /* enable irq */
......
...@@ -424,7 +424,7 @@ resume: ...@@ -424,7 +424,7 @@ resume:
.data .data
ALIGN ALIGN
sys_call_table: sys_call_table:
.long sys_ni_syscall /* 0 - old "setup()" system call*/ .long sys_restart_syscall /* 0 - old "setup()" system call, used for restarting */
.long sys_exit .long sys_exit
.long sys_fork .long sys_fork
.long sys_read .long sys_read
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/initrd.h> #include <linux/initrd.h>
#include <asm/bootinfo.h> #include <asm/bootinfo.h>
#include <asm/sections.h>
#include <asm/setup.h> #include <asm/setup.h>
#include <asm/fpu.h> #include <asm/fpu.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -62,7 +63,6 @@ EXPORT_SYMBOL(vme_brdtype); ...@@ -62,7 +63,6 @@ EXPORT_SYMBOL(vme_brdtype);
int m68k_is040or060; int m68k_is040or060;
EXPORT_SYMBOL(m68k_is040or060); EXPORT_SYMBOL(m68k_is040or060);
extern int end;
extern unsigned long availmem; extern unsigned long availmem;
int m68k_num_memory; int m68k_num_memory;
...@@ -215,11 +215,10 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record) ...@@ -215,11 +215,10 @@ static void __init m68k_parse_bootinfo(const struct bi_record *record)
void __init setup_arch(char **cmdline_p) void __init setup_arch(char **cmdline_p)
{ {
extern int _etext, _edata, _end;
int i; int i;
/* The bootinfo is located right after the kernel bss */ /* The bootinfo is located right after the kernel bss */
m68k_parse_bootinfo((const struct bi_record *)&_end); m68k_parse_bootinfo((const struct bi_record *)_end);
if (CPU_IS_040) if (CPU_IS_040)
m68k_is040or060 = 4; m68k_is040or060 = 4;
...@@ -252,9 +251,9 @@ void __init setup_arch(char **cmdline_p) ...@@ -252,9 +251,9 @@ void __init setup_arch(char **cmdline_p)
} }
init_mm.start_code = PAGE_OFFSET; init_mm.start_code = PAGE_OFFSET;
init_mm.end_code = (unsigned long) &_etext; init_mm.end_code = (unsigned long)_etext;
init_mm.end_data = (unsigned long) &_edata; init_mm.end_data = (unsigned long)_edata;
init_mm.brk = (unsigned long) &_end; init_mm.brk = (unsigned long)_end;
*cmdline_p = m68k_command_line; *cmdline_p = m68k_command_line;
memcpy(boot_command_line, *cmdline_p, CL_SIZE); memcpy(boot_command_line, *cmdline_p, CL_SIZE);
......
...@@ -326,6 +326,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *usc, void __u ...@@ -326,6 +326,9 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *usc, void __u
struct sigcontext context; struct sigcontext context;
int err; int err;
/* Always make any pending restarted system calls return -EINTR */
current_thread_info()->restart_block.fn = do_no_restart_syscall;
/* get previous context */ /* get previous context */
if (copy_from_user(&context, usc, sizeof(context))) if (copy_from_user(&context, usc, sizeof(context)))
goto badframe; goto badframe;
...@@ -411,6 +414,9 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw, ...@@ -411,6 +414,9 @@ rt_restore_ucontext(struct pt_regs *regs, struct switch_stack *sw,
unsigned long usp; unsigned long usp;
int err; int err;
/* Always make any pending restarted system calls return -EINTR */
current_thread_info()->restart_block.fn = do_no_restart_syscall;
err = __get_user(temp, &uc->uc_mcontext.version); err = __get_user(temp, &uc->uc_mcontext.version);
if (temp != MCONTEXT_VERSION) if (temp != MCONTEXT_VERSION)
goto badframe; goto badframe;
...@@ -937,6 +943,15 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler) ...@@ -937,6 +943,15 @@ handle_restart(struct pt_regs *regs, struct k_sigaction *ka, int has_handler)
regs->d0 = -EINTR; regs->d0 = -EINTR;
break; break;
case -ERESTART_RESTARTBLOCK:
if (!has_handler) {
regs->d0 = __NR_restart_syscall;
regs->pc -= 2;
break;
}
regs->d0 = -EINTR;
break;
case -ERESTARTSYS: case -ERESTARTSYS:
if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) { if (has_handler && !(ka->sa.sa_flags & SA_RESTART)) {
regs->d0 = -EINTR; regs->d0 = -EINTR;
......
...@@ -33,6 +33,7 @@ SECTIONS ...@@ -33,6 +33,7 @@ SECTIONS
} :data } :data
/* End of data goes *here* so that freeing init code works properly. */ /* End of data goes *here* so that freeing init code works properly. */
_edata = .; _edata = .;
NOTES
/* will be freed after init */ /* will be freed after init */
. = ALIGN(PAGE_SIZE); /* Init code and data */ . = ALIGN(PAGE_SIZE); /* Init code and data */
......
...@@ -92,7 +92,8 @@ static irqreturn_t baboon_irq(int irq, void *dev_id) ...@@ -92,7 +92,8 @@ static irqreturn_t baboon_irq(int irq, void *dev_id)
void __init baboon_register_interrupts(void) void __init baboon_register_interrupts(void)
{ {
baboon_disabled = 0; baboon_disabled = 0;
request_irq(IRQ_NUBUS_C, baboon_irq, 0, "baboon", (void *)baboon); if (request_irq(IRQ_NUBUS_C, baboon_irq, 0, "baboon", (void *)baboon))
pr_err("Couldn't register baboon interrupt\n");
} }
/* /*
......
...@@ -47,13 +47,6 @@ ...@@ -47,13 +47,6 @@
struct mac_booter_data mac_bi_data; struct mac_booter_data mac_bi_data;
/* New m68k bootinfo stuff and videobase */
extern int m68k_num_memory;
extern struct mem_info m68k_memory[NUM_MEMINFO];
extern struct mem_info m68k_ramdisk;
/* The phys. video addr. - might be bogus on some machines */ /* The phys. video addr. - might be bogus on some machines */
static unsigned long mac_orig_videoaddr; static unsigned long mac_orig_videoaddr;
...@@ -61,7 +54,6 @@ static unsigned long mac_orig_videoaddr; ...@@ -61,7 +54,6 @@ static unsigned long mac_orig_videoaddr;
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 void iop_preinit(void); extern void iop_preinit(void);
extern void iop_init(void); extern void iop_init(void);
extern void via_init(void); extern void via_init(void);
...@@ -805,10 +797,6 @@ static void __init mac_identify(void) ...@@ -805,10 +797,6 @@ static void __init mac_identify(void)
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
printk("Ramdisk: addr 0x%lx size 0x%lx\n",
m68k_ramdisk.addr, m68k_ramdisk.size);
#endif
iop_init(); iop_init();
via_init(); via_init();
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <asm/macints.h> #include <asm/macints.h>
extern unsigned long mac_videobase; extern unsigned long mac_videobase;
extern unsigned long mac_videodepth;
extern unsigned long mac_rowbytes; extern unsigned long mac_rowbytes;
extern void mac_serial_print(const char *); extern void mac_serial_print(const char *);
......
...@@ -305,14 +305,16 @@ void __init iop_register_interrupts(void) ...@@ -305,14 +305,16 @@ void __init iop_register_interrupts(void)
{ {
if (iop_ism_present) { if (iop_ism_present) {
if (oss_present) { if (oss_present) {
request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq, if (request_irq(OSS_IRQLEV_IOPISM, iop_ism_irq,
IRQ_FLG_LOCK, "ISM IOP", IRQ_FLG_LOCK, "ISM IOP",
(void *) IOP_NUM_ISM); (void *) IOP_NUM_ISM))
pr_err("Couldn't register ISM IOP interrupt\n");
oss_irq_enable(IRQ_MAC_ADB); oss_irq_enable(IRQ_MAC_ADB);
} else { } else {
request_irq(IRQ_VIA2_0, iop_ism_irq, if (request_irq(IRQ_VIA2_0, iop_ism_irq,
IRQ_FLG_LOCK|IRQ_FLG_FAST, "ISM IOP", IRQ_FLG_LOCK|IRQ_FLG_FAST, "ISM IOP",
(void *) IOP_NUM_ISM); (void *) IOP_NUM_ISM))
pr_err("Couldn't register ISM IOP interrupt\n");
} }
if (!iop_alive(iop_base[IOP_NUM_ISM])) { if (!iop_alive(iop_base[IOP_NUM_ISM])) {
printk("IOP: oh my god, they killed the ISM IOP!\n"); printk("IOP: oh my god, they killed the ISM IOP!\n");
......
...@@ -134,6 +134,7 @@ ...@@ -134,6 +134,7 @@
#include <asm/errno.h> #include <asm/errno.h>
#include <asm/macints.h> #include <asm/macints.h>
#include <asm/irq_regs.h> #include <asm/irq_regs.h>
#include <asm/mac_oss.h>
#define DEBUG_SPURIOUS #define DEBUG_SPURIOUS
#define SHUTUP_SONIC #define SHUTUP_SONIC
...@@ -146,7 +147,6 @@ static int scc_mask; ...@@ -146,7 +147,6 @@ static int scc_mask;
* VIA/RBV hooks * VIA/RBV hooks
*/ */
extern void via_init(void);
extern void via_register_interrupts(void); extern void via_register_interrupts(void);
extern void via_irq_enable(int); extern void via_irq_enable(int);
extern void via_irq_disable(int); extern void via_irq_disable(int);
...@@ -157,9 +157,6 @@ extern int via_irq_pending(int); ...@@ -157,9 +157,6 @@ extern int via_irq_pending(int);
* OSS hooks * OSS hooks
*/ */
extern int oss_present;
extern void oss_init(void);
extern void oss_register_interrupts(void); extern void oss_register_interrupts(void);
extern void oss_irq_enable(int); extern void oss_irq_enable(int);
extern void oss_irq_disable(int); extern void oss_irq_disable(int);
...@@ -170,9 +167,6 @@ extern int oss_irq_pending(int); ...@@ -170,9 +167,6 @@ extern int oss_irq_pending(int);
* PSC hooks * PSC hooks
*/ */
extern int psc_present;
extern void psc_init(void);
extern void psc_register_interrupts(void); extern void psc_register_interrupts(void);
extern void psc_irq_enable(int); extern void psc_irq_enable(int);
extern void psc_irq_disable(int); extern void psc_irq_disable(int);
...@@ -191,12 +185,10 @@ extern void iop_register_interrupts(void); ...@@ -191,12 +185,10 @@ extern void iop_register_interrupts(void);
extern int baboon_present; extern int baboon_present;
extern void baboon_init(void);
extern void baboon_register_interrupts(void); extern void baboon_register_interrupts(void);
extern void baboon_irq_enable(int); extern void baboon_irq_enable(int);
extern void baboon_irq_disable(int); extern void baboon_irq_disable(int);
extern void baboon_irq_clear(int); extern void baboon_irq_clear(int);
extern int baboon_irq_pending(int);
/* /*
* SCC interrupt routines * SCC interrupt routines
...@@ -258,8 +250,9 @@ void __init mac_init_IRQ(void) ...@@ -258,8 +250,9 @@ void __init mac_init_IRQ(void)
if (baboon_present) if (baboon_present)
baboon_register_interrupts(); baboon_register_interrupts();
iop_register_interrupts(); iop_register_interrupts();
request_irq(IRQ_AUTO_7, mac_nmi_handler, 0, "NMI", if (request_irq(IRQ_AUTO_7, mac_nmi_handler, 0, "NMI",
mac_nmi_handler); mac_nmi_handler))
pr_err("Couldn't register NMI\n");
#ifdef DEBUG_MACINTS #ifdef DEBUG_MACINTS
printk("mac_init_IRQ(): Done!\n"); printk("mac_init_IRQ(): Done!\n");
#endif #endif
......
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#define RTC_OFFSET 2082844800 #define RTC_OFFSET 2082844800
extern struct mac_booter_data mac_bi_data;
static void (*rom_reset)(void); static void (*rom_reset)(void);
#ifdef CONFIG_ADB_CUDA #ifdef CONFIG_ADB_CUDA
......
...@@ -66,16 +66,21 @@ void __init oss_init(void) ...@@ -66,16 +66,21 @@ void __init oss_init(void)
void __init oss_register_interrupts(void) void __init oss_register_interrupts(void)
{ {
request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK, if (request_irq(OSS_IRQLEV_SCSI, oss_irq, IRQ_FLG_LOCK,
"scsi", (void *) oss); "scsi", (void *) oss))
request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK, pr_err("Couldn't register %s interrupt\n", "scsi");
"scc", mac_scc_dispatch); if (request_irq(OSS_IRQLEV_IOPSCC, mac_scc_dispatch, IRQ_FLG_LOCK,
request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK, "scc", mac_scc_dispatch))
"nubus", (void *) oss); pr_err("Couldn't register %s interrupt\n", "scc");
request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK, if (request_irq(OSS_IRQLEV_NUBUS, oss_nubus_irq, IRQ_FLG_LOCK,
"sound", (void *) oss); "nubus", (void *) oss))
request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK, pr_err("Couldn't register %s interrupt\n", "nubus");
"via1", (void *) via1); if (request_irq(OSS_IRQLEV_SOUND, oss_irq, IRQ_FLG_LOCK,
"sound", (void *) oss))
pr_err("Couldn't register %s interrupt\n", "sound");
if (request_irq(OSS_IRQLEV_VIA1, via1_irq, IRQ_FLG_LOCK,
"via1", (void *) via1))
pr_err("Couldn't register %s interrupt\n", "via1");
} }
/* /*
......
...@@ -117,10 +117,14 @@ void __init psc_init(void) ...@@ -117,10 +117,14 @@ void __init psc_init(void)
void __init psc_register_interrupts(void) void __init psc_register_interrupts(void)
{ {
request_irq(IRQ_AUTO_3, psc_irq, 0, "psc3", (void *) 0x30); if (request_irq(IRQ_AUTO_3, psc_irq, 0, "psc3", (void *) 0x30))
request_irq(IRQ_AUTO_4, psc_irq, 0, "psc4", (void *) 0x40); pr_err("Couldn't register psc%d interrupt\n", 3);
request_irq(IRQ_AUTO_5, psc_irq, 0, "psc5", (void *) 0x50); if (request_irq(IRQ_AUTO_4, psc_irq, 0, "psc4", (void *) 0x40))
request_irq(IRQ_AUTO_6, psc_irq, 0, "psc6", (void *) 0x60); pr_err("Couldn't register psc%d interrupt\n", 4);
if (request_irq(IRQ_AUTO_5, psc_irq, 0, "psc5", (void *) 0x50))
pr_err("Couldn't register psc%d interrupt\n", 5);
if (request_irq(IRQ_AUTO_6, psc_irq, 0, "psc6", (void *) 0x60))
pr_err("Couldn't register psc%d interrupt\n", 6);
} }
/* /*
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <asm/macints.h> #include <asm/macints.h>
#include <asm/mac_via.h> #include <asm/mac_via.h>
#include <asm/mac_psc.h> #include <asm/mac_psc.h>
#include <asm/mac_oss.h>
volatile __u8 *via1, *via2; volatile __u8 *via1, *via2;
int rbv_present; int rbv_present;
...@@ -84,7 +85,6 @@ void via_irq_disable(int irq); ...@@ -84,7 +85,6 @@ void via_irq_disable(int irq);
void via_irq_clear(int irq); void via_irq_clear(int irq);
extern irqreturn_t mac_scc_dispatch(int, void *); extern irqreturn_t mac_scc_dispatch(int, void *);
extern int oss_present;
/* /*
* Initialize the VIAs * Initialize the VIAs
...@@ -283,7 +283,8 @@ void __init via_init_clock(irq_handler_t func) ...@@ -283,7 +283,8 @@ void __init via_init_clock(irq_handler_t func)
via1[vT1CL] = MAC_CLOCK_LOW; via1[vT1CL] = MAC_CLOCK_LOW;
via1[vT1CH] = MAC_CLOCK_HIGH; via1[vT1CH] = MAC_CLOCK_HIGH;
request_irq(IRQ_MAC_TIMER_1, func, IRQ_FLG_LOCK, "timer", func); if (request_irq(IRQ_MAC_TIMER_1, func, IRQ_FLG_LOCK, "timer", func))
pr_err("Couldn't register %s interrupt\n", "timer");
} }
/* /*
...@@ -293,25 +294,31 @@ void __init via_init_clock(irq_handler_t func) ...@@ -293,25 +294,31 @@ void __init via_init_clock(irq_handler_t func)
void __init via_register_interrupts(void) void __init via_register_interrupts(void)
{ {
if (via_alt_mapping) { if (via_alt_mapping) {
request_irq(IRQ_AUTO_1, via1_irq, if (request_irq(IRQ_AUTO_1, via1_irq,
IRQ_FLG_LOCK|IRQ_FLG_FAST, "software", IRQ_FLG_LOCK|IRQ_FLG_FAST, "software",
(void *) via1); (void *) via1))
request_irq(IRQ_AUTO_6, via1_irq, pr_err("Couldn't register %s interrupt\n", "software");
if (request_irq(IRQ_AUTO_6, via1_irq,
IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
(void *) via1); (void *) via1))
pr_err("Couldn't register %s interrupt\n", "via1");
} else { } else {
request_irq(IRQ_AUTO_1, via1_irq, if (request_irq(IRQ_AUTO_1, via1_irq,
IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1", IRQ_FLG_LOCK|IRQ_FLG_FAST, "via1",
(void *) via1); (void *) via1))
pr_err("Couldn't register %s interrupt\n", "via1");
} }
request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, if (request_irq(IRQ_AUTO_2, via2_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST,
"via2", (void *) via2); "via2", (void *) via2))
pr_err("Couldn't register %s interrupt\n", "via2");
if (!psc_present) { if (!psc_present) {
request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK, if (request_irq(IRQ_AUTO_4, mac_scc_dispatch, IRQ_FLG_LOCK,
"scc", mac_scc_dispatch); "scc", mac_scc_dispatch))
pr_err("Couldn't register %s interrupt\n", "scc");
} }
request_irq(IRQ_MAC_NUBUS, via_nubus_irq, IRQ_FLG_LOCK|IRQ_FLG_FAST, if (request_irq(IRQ_MAC_NUBUS, via_nubus_irq,
"nubus", (void *) via2); IRQ_FLG_LOCK|IRQ_FLG_FAST, "nubus", (void *) via2))
pr_err("Couldn't register %s interrupt\n", "nubus");
} }
/* /*
......
...@@ -24,7 +24,6 @@ static const struct fp_ext fp_one = ...@@ -24,7 +24,6 @@ static const struct fp_ext fp_one =
extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src); extern struct fp_ext *fp_fadd(struct fp_ext *dest, const struct fp_ext *src);
extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *src); extern struct fp_ext *fp_fdiv(struct fp_ext *dest, const struct fp_ext *src);
extern struct fp_ext *fp_fmul(struct fp_ext *dest, const struct fp_ext *src);
struct fp_ext * struct fp_ext *
fp_fsqrt(struct fp_ext *dest, struct fp_ext *src) fp_fsqrt(struct fp_ext *dest, struct fp_ext *src)
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#ifdef CONFIG_ATARI #ifdef CONFIG_ATARI
#include <asm/atari_stram.h> #include <asm/atari_stram.h>
#endif #endif
#include <asm/sections.h>
#include <asm/tlb.h> #include <asm/tlb.h>
DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
...@@ -73,9 +74,6 @@ extern void init_pointer_table(unsigned long ptable); ...@@ -73,9 +74,6 @@ extern void init_pointer_table(unsigned long ptable);
/* References to section boundaries */ /* References to section boundaries */
extern char _text[], _etext[];
extern char __init_begin[], __init_end[];
extern pmd_t *zero_pgtable; extern pmd_t *zero_pgtable;
void __init mem_init(void) void __init mem_init(void)
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#ifdef CONFIG_ATARI #ifdef CONFIG_ATARI
#include <asm/atari_stram.h> #include <asm/atari_stram.h>
#endif #endif
#include <asm/sections.h>
#undef DEBUG #undef DEBUG
...@@ -301,14 +302,12 @@ void __init paging_init(void) ...@@ -301,14 +302,12 @@ void __init paging_init(void)
} }
} }
extern char __init_begin, __init_end;
void free_initmem(void) void free_initmem(void)
{ {
unsigned long addr; unsigned long addr;
addr = (unsigned long)&__init_begin; addr = (unsigned long)__init_begin;
for (; addr < (unsigned long)&__init_end; addr += PAGE_SIZE) { for (; addr < (unsigned long)__init_end; addr += PAGE_SIZE) {
virt_to_page(addr)->flags &= ~(1 << PG_reserved); virt_to_page(addr)->flags &= ~(1 << PG_reserved);
init_page_count(virt_to_page(addr)); init_page_count(virt_to_page(addr));
free_page(addr); free_page(addr);
......
...@@ -42,7 +42,6 @@ extern unsigned long mvme147_gettimeoffset (void); ...@@ -42,7 +42,6 @@ extern unsigned long mvme147_gettimeoffset (void);
extern int mvme147_hwclk (int, struct rtc_time *); extern int mvme147_hwclk (int, struct rtc_time *);
extern int mvme147_set_clock_mmss (unsigned long); extern int mvme147_set_clock_mmss (unsigned long);
extern void mvme147_reset (void); extern void mvme147_reset (void);
extern void mvme147_waitbut(void);
static int bcd2int (unsigned char b); static int bcd2int (unsigned char b);
...@@ -115,8 +114,9 @@ static irqreturn_t mvme147_timer_int (int irq, void *dev_id) ...@@ -115,8 +114,9 @@ static irqreturn_t mvme147_timer_int (int irq, void *dev_id)
void mvme147_sched_init (irq_handler_t timer_routine) void mvme147_sched_init (irq_handler_t timer_routine)
{ {
tick_handler = timer_routine; tick_handler = timer_routine;
request_irq (PCC_IRQ_TIMER1, mvme147_timer_int, if (request_irq(PCC_IRQ_TIMER1, mvme147_timer_int, IRQ_FLG_REPLACE,
IRQ_FLG_REPLACE, "timer 1", NULL); "timer 1", NULL))
pr_err("Couldn't register timer interrupt\n");
/* Init the clock with a value */ /* Init the clock with a value */
/* our clock goes off every 6.25us */ /* our clock goes off every 6.25us */
......
...@@ -48,7 +48,6 @@ extern unsigned long mvme16x_gettimeoffset (void); ...@@ -48,7 +48,6 @@ extern unsigned long mvme16x_gettimeoffset (void);
extern int mvme16x_hwclk (int, struct rtc_time *); extern int mvme16x_hwclk (int, struct rtc_time *);
extern int mvme16x_set_clock_mmss (unsigned long); extern int mvme16x_set_clock_mmss (unsigned long);
extern void mvme16x_reset (void); extern void mvme16x_reset (void);
extern void mvme16x_waitbut(void);
int bcd2int (unsigned char b); int bcd2int (unsigned char b);
......
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/q40_master.h> #include <asm/q40_master.h>
extern irqreturn_t q40_process_int(int level, struct pt_regs *regs);
extern void q40_init_IRQ(void); extern void q40_init_IRQ(void);
static void q40_get_model(char *model); static void q40_get_model(char *model);
extern void q40_sched_init(irq_handler_t handler); extern void q40_sched_init(irq_handler_t handler);
...@@ -47,8 +46,6 @@ static unsigned int q40_get_ss(void); ...@@ -47,8 +46,6 @@ static unsigned int q40_get_ss(void);
static int q40_set_clock_mmss(unsigned long); static int q40_set_clock_mmss(unsigned long);
static int q40_get_rtc_pll(struct rtc_pll_info *pll); static int q40_get_rtc_pll(struct rtc_pll_info *pll);
static int q40_set_rtc_pll(struct rtc_pll_info *pll); static int q40_set_rtc_pll(struct rtc_pll_info *pll);
extern void q40_waitbut(void);
void q40_set_vectors(void);
extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/); extern void q40_mksound(unsigned int /*freq*/, unsigned int /*ticks*/);
......
...@@ -27,23 +27,21 @@ ...@@ -27,23 +27,21 @@
#include <asm/sun3mmu.h> #include <asm/sun3mmu.h>
#include <asm/rtc.h> #include <asm/rtc.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/idprom.h>
#include <asm/intersil.h> #include <asm/intersil.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/sections.h>
#include <asm/segment.h> #include <asm/segment.h>
#include <asm/sun3ints.h> #include <asm/sun3ints.h>
extern char _text, _end;
char sun3_reserved_pmeg[SUN3_PMEGS_NUM]; char sun3_reserved_pmeg[SUN3_PMEGS_NUM];
extern unsigned long sun3_gettimeoffset(void); extern unsigned long sun3_gettimeoffset(void);
static void sun3_sched_init(irq_handler_t handler); static void sun3_sched_init(irq_handler_t handler);
extern void sun3_get_model (char* model); extern void sun3_get_model (char* model);
extern void idprom_init (void);
extern int sun3_hwclk(int set, struct rtc_time *t); extern int sun3_hwclk(int set, struct rtc_time *t);
volatile char* clock_va; volatile char* clock_va;
extern volatile unsigned char* sun3_intreg;
extern unsigned long availmem; extern unsigned long availmem;
unsigned long num_pages; unsigned long num_pages;
...@@ -149,7 +147,7 @@ void __init config_sun3(void) ...@@ -149,7 +147,7 @@ void __init config_sun3(void)
mach_halt = sun3_halt; mach_halt = sun3_halt;
mach_get_hardware_list = sun3_get_hardware_list; mach_get_hardware_list = sun3_get_hardware_list;
memory_start = ((((int)&_end) + 0x2000) & ~0x1fff); memory_start = ((((unsigned long)_end) + 0x2000) & ~0x1fff);
// PROM seems to want the last couple of physical pages. --m // PROM seems to want the last couple of physical pages. --m
memory_end = *(romvec->pv_sun3mem) + PAGE_OFFSET - 2*PAGE_SIZE; memory_end = *(romvec->pv_sun3mem) + PAGE_OFFSET - 2*PAGE_SIZE;
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/dvma.h> #include <asm/dvma.h>
extern void prom_reboot (char *) __attribute__ ((__noreturn__));
#undef DEBUG_MMU_EMU #undef DEBUG_MMU_EMU
#define DEBUG_PROM_MAPS #define DEBUG_PROM_MAPS
......
...@@ -105,7 +105,10 @@ void __init sun3_init_IRQ(void) ...@@ -105,7 +105,10 @@ void __init sun3_init_IRQ(void)
m68k_setup_irq_controller(&sun3_irq_controller, IRQ_AUTO_1, 7); m68k_setup_irq_controller(&sun3_irq_controller, IRQ_AUTO_1, 7);
m68k_setup_user_interrupt(VEC_USER, 128, NULL); m68k_setup_user_interrupt(VEC_USER, 128, NULL);
request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL); if (request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL))
request_irq(IRQ_AUTO_7, sun3_int7, 0, "int7", NULL); pr_err("Couldn't register %s interrupt\n", "int5");
request_irq(IRQ_USER+127, sun3_vec255, 0, "vec255", NULL); if (request_irq(IRQ_AUTO_7, sun3_int7, 0, "int7", NULL))
pr_err("Couldn't register %s interrupt\n", "int7");
if (request_irq(IRQ_USER+127, sun3_vec255, 0, "vec255", NULL))
pr_err("Couldn't register %s interrupt\n", "vec255");
} }
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "time.h" #include "time.h"
volatile char *clock_va; volatile char *clock_va;
extern volatile unsigned char *sun3_intreg;
extern void sun3_get_model(char *model); extern void sun3_get_model(char *model);
......
...@@ -156,7 +156,7 @@ static volatile int fdc_busy = -1; ...@@ -156,7 +156,7 @@ static volatile int fdc_busy = -1;
static volatile int fdc_nested; static volatile int fdc_nested;
static DECLARE_WAIT_QUEUE_HEAD(fdc_wait); static DECLARE_WAIT_QUEUE_HEAD(fdc_wait);
static DECLARE_WAIT_QUEUE_HEAD(motor_wait); static DECLARE_COMPLETION(motor_on_completion);
static volatile int selected = -1; /* currently selected drive */ static volatile int selected = -1; /* currently selected drive */
...@@ -184,8 +184,7 @@ static unsigned char mfmencode[16]={ ...@@ -184,8 +184,7 @@ static unsigned char mfmencode[16]={
static unsigned char mfmdecode[128]; static unsigned char mfmdecode[128];
/* floppy internal millisecond timer stuff */ /* floppy internal millisecond timer stuff */
static volatile int ms_busy = -1; static DECLARE_COMPLETION(ms_wait_completion);
static DECLARE_WAIT_QUEUE_HEAD(ms_wait);
#define MS_TICKS ((amiga_eclock+50)/1000) #define MS_TICKS ((amiga_eclock+50)/1000)
/* /*
...@@ -211,8 +210,7 @@ static int fd_device[4] = { 0, 0, 0, 0 }; ...@@ -211,8 +210,7 @@ static int fd_device[4] = { 0, 0, 0, 0 };
static irqreturn_t ms_isr(int irq, void *dummy) static irqreturn_t ms_isr(int irq, void *dummy)
{ {
ms_busy = -1; complete(&ms_wait_completion);
wake_up(&ms_wait);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
...@@ -220,19 +218,17 @@ static irqreturn_t ms_isr(int irq, void *dummy) ...@@ -220,19 +218,17 @@ static irqreturn_t ms_isr(int irq, void *dummy)
A more generic routine would do a schedule a la timer.device */ A more generic routine would do a schedule a la timer.device */
static void ms_delay(int ms) static void ms_delay(int ms)
{ {
unsigned long flags;
int ticks; int ticks;
static DEFINE_MUTEX(mutex);
if (ms > 0) { if (ms > 0) {
local_irq_save(flags); mutex_lock(&mutex);
while (ms_busy == 0)
sleep_on(&ms_wait);
ms_busy = 0;
local_irq_restore(flags);
ticks = MS_TICKS*ms-1; ticks = MS_TICKS*ms-1;
ciaa.tblo=ticks%256; ciaa.tblo=ticks%256;
ciaa.tbhi=ticks/256; ciaa.tbhi=ticks/256;
ciaa.crb=0x19; /*count eclock, force load, one-shoot, start */ ciaa.crb=0x19; /*count eclock, force load, one-shoot, start */
sleep_on(&ms_wait); wait_for_completion(&ms_wait_completion);
mutex_unlock(&mutex);
} }
} }
...@@ -254,8 +250,7 @@ static void get_fdc(int drive) ...@@ -254,8 +250,7 @@ static void get_fdc(int drive)
printk("get_fdc: drive %d fdc_busy %d fdc_nested %d\n",drive,fdc_busy,fdc_nested); printk("get_fdc: drive %d fdc_busy %d fdc_nested %d\n",drive,fdc_busy,fdc_nested);
#endif #endif
local_irq_save(flags); local_irq_save(flags);
while (!try_fdc(drive)) wait_event(fdc_wait, try_fdc(drive));
sleep_on(&fdc_wait);
fdc_busy = drive; fdc_busy = drive;
fdc_nested++; fdc_nested++;
local_irq_restore(flags); local_irq_restore(flags);
...@@ -330,7 +325,7 @@ static void fd_deselect (int drive) ...@@ -330,7 +325,7 @@ static void fd_deselect (int drive)
static void motor_on_callback(unsigned long nr) static void motor_on_callback(unsigned long nr)
{ {
if (!(ciaa.pra & DSKRDY) || --on_attempts == 0) { if (!(ciaa.pra & DSKRDY) || --on_attempts == 0) {
wake_up (&motor_wait); complete_all(&motor_on_completion);
} else { } else {
motor_on_timer.expires = jiffies + HZ/10; motor_on_timer.expires = jiffies + HZ/10;
add_timer(&motor_on_timer); add_timer(&motor_on_timer);
...@@ -347,11 +342,12 @@ static int fd_motor_on(int nr) ...@@ -347,11 +342,12 @@ static int fd_motor_on(int nr)
unit[nr].motor = 1; unit[nr].motor = 1;
fd_select(nr); fd_select(nr);
INIT_COMPLETION(motor_on_completion);
motor_on_timer.data = nr; motor_on_timer.data = nr;
mod_timer(&motor_on_timer, jiffies + HZ/2); mod_timer(&motor_on_timer, jiffies + HZ/2);
on_attempts = 10; on_attempts = 10;
sleep_on (&motor_wait); wait_for_completion(&motor_on_completion);
fd_deselect(nr); fd_deselect(nr);
} }
...@@ -582,8 +578,7 @@ static void raw_read(int drive) ...@@ -582,8 +578,7 @@ static void raw_read(int drive)
{ {
drive&=3; drive&=3;
get_fdc(drive); get_fdc(drive);
while (block_flag) wait_event(wait_fd_block, !block_flag);
sleep_on(&wait_fd_block);
fd_select(drive); fd_select(drive);
/* setup adkcon bits correctly */ /* setup adkcon bits correctly */
custom.adkcon = ADK_MSBSYNC; custom.adkcon = ADK_MSBSYNC;
...@@ -598,8 +593,7 @@ static void raw_read(int drive) ...@@ -598,8 +593,7 @@ static void raw_read(int drive)
block_flag = 1; block_flag = 1;
while (block_flag) wait_event(wait_fd_block, !block_flag);
sleep_on (&wait_fd_block);
custom.dsklen = 0; custom.dsklen = 0;
fd_deselect(drive); fd_deselect(drive);
...@@ -616,8 +610,7 @@ static int raw_write(int drive) ...@@ -616,8 +610,7 @@ static int raw_write(int drive)
rel_fdc(); rel_fdc();
return 0; return 0;
} }
while (block_flag) wait_event(wait_fd_block, !block_flag);
sleep_on(&wait_fd_block);
fd_select(drive); fd_select(drive);
/* clear adkcon bits */ /* clear adkcon bits */
custom.adkcon = ADK_PRECOMP1|ADK_PRECOMP0|ADK_WORDSYNC|ADK_MSBSYNC; custom.adkcon = ADK_PRECOMP1|ADK_PRECOMP0|ADK_WORDSYNC|ADK_MSBSYNC;
...@@ -1294,8 +1287,7 @@ static int non_int_flush_track (unsigned long nr) ...@@ -1294,8 +1287,7 @@ static int non_int_flush_track (unsigned long nr)
writepending = 0; writepending = 0;
return 0; return 0;
} }
while (block_flag == 2) wait_event(wait_fd_block, block_flag != 2);
sleep_on (&wait_fd_block);
} }
else { else {
local_irq_restore(flags); local_irq_restore(flags);
......
...@@ -1963,6 +1963,7 @@ static int __init rs_init(void) ...@@ -1963,6 +1963,7 @@ static int __init rs_init(void)
{ {
unsigned long flags; unsigned long flags;
struct serial_state * state; struct serial_state * state;
int error;
if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL)) if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL))
return -ENODEV; return -ENODEV;
...@@ -1975,8 +1976,11 @@ static int __init rs_init(void) ...@@ -1975,8 +1976,11 @@ static int __init rs_init(void)
* We request SERDAT and SERPER only, because the serial registers are * We request SERDAT and SERPER only, because the serial registers are
* too spreaded over the custom register space * too spreaded over the custom register space
*/ */
if (!request_mem_region(CUSTOM_PHYSADDR+0x30, 4, "amiserial [Paula]")) if (!request_mem_region(CUSTOM_PHYSADDR+0x30, 4,
return -EBUSY; "amiserial [Paula]")) {
error = -EBUSY;
goto fail_put_tty_driver;
}
IRQ_ports = NULL; IRQ_ports = NULL;
...@@ -1997,8 +2001,9 @@ static int __init rs_init(void) ...@@ -1997,8 +2001,9 @@ static int __init rs_init(void)
serial_driver->flags = TTY_DRIVER_REAL_RAW; serial_driver->flags = TTY_DRIVER_REAL_RAW;
tty_set_operations(serial_driver, &serial_ops); tty_set_operations(serial_driver, &serial_ops);
if (tty_register_driver(serial_driver)) error = tty_register_driver(serial_driver);
panic("Couldn't register serial driver\n"); if (error)
goto fail_release_mem_region;
state = rs_table; state = rs_table;
state->magic = SSTATE_MAGIC; state->magic = SSTATE_MAGIC;
...@@ -2024,8 +2029,14 @@ static int __init rs_init(void) ...@@ -2024,8 +2029,14 @@ static int __init rs_init(void)
local_irq_save(flags); local_irq_save(flags);
/* set ISRs, and then disable the rx interrupts */ /* set ISRs, and then disable the rx interrupts */
request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state); error = request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state);
request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED, "serial RX", state); if (error)
goto fail_unregister;
error = request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED,
"serial RX", state);
if (error)
goto fail_free_irq;
/* turn off Rx and Tx interrupts */ /* turn off Rx and Tx interrupts */
custom.intena = IF_RBF | IF_TBE; custom.intena = IF_RBF | IF_TBE;
...@@ -2045,6 +2056,16 @@ static int __init rs_init(void) ...@@ -2045,6 +2056,16 @@ static int __init rs_init(void)
ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */ ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
return 0; return 0;
fail_free_irq:
free_irq(IRQ_AMIGA_TBE, state);
fail_unregister:
tty_unregister_driver(serial_driver);
fail_release_mem_region:
release_mem_region(CUSTOM_PHYSADDR+0x30, 4);
fail_put_tty_driver:
put_tty_driver(serial_driver);
return error;
} }
static __exit void rs_exit(void) static __exit void rs_exit(void)
...@@ -2064,6 +2085,9 @@ static __exit void rs_exit(void) ...@@ -2064,6 +2085,9 @@ static __exit void rs_exit(void)
kfree(info); kfree(info);
} }
free_irq(IRQ_AMIGA_TBE, rs_table);
free_irq(IRQ_AMIGA_RBF, rs_table);
release_mem_region(CUSTOM_PHYSADDR+0x30, 4); release_mem_region(CUSTOM_PHYSADDR+0x30, 4);
} }
......
...@@ -718,6 +718,7 @@ static int __init a2232board_init(void) ...@@ -718,6 +718,7 @@ static int __init a2232board_init(void)
u_char *from; u_char *from;
volatile u_char *to; volatile u_char *to;
volatile struct a2232memory *mem; volatile struct a2232memory *mem;
int error, i;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
return -ENODEV; /* This driver is not SMP aware. Is there an SMP ZorroII-bus-machine? */ return -ENODEV; /* This driver is not SMP aware. Is there an SMP ZorroII-bus-machine? */
...@@ -797,8 +798,15 @@ static int __init a2232board_init(void) ...@@ -797,8 +798,15 @@ static int __init a2232board_init(void)
*/ */
if (a2232_init_drivers()) return -ENODEV; // maybe we should use a different -Exxx? if (a2232_init_drivers()) return -ENODEV; // maybe we should use a different -Exxx?
request_irq(IRQ_AMIGA_VERTB, a2232_vbl_inter, 0, "A2232 serial VBL", a2232_driver_ID); error = request_irq(IRQ_AMIGA_VERTB, a2232_vbl_inter, 0,
return 0; "A2232 serial VBL", a2232_driver_ID);
if (error) {
for (i = 0; i < nr_a2232; i++)
zorro_release_device(zd_a2232[i]);
tty_unregister_driver(a2232_driver);
put_tty_driver(a2232_driver);
}
return error;
} }
static void __exit a2232board_exit(void) static void __exit a2232board_exit(void)
......
...@@ -198,6 +198,7 @@ static void scc_init_portstructs(void) ...@@ -198,6 +198,7 @@ static void scc_init_portstructs(void)
static int mvme147_scc_init(void) static int mvme147_scc_init(void)
{ {
struct scc_port *port; struct scc_port *port;
int error;
printk(KERN_INFO "SCC: MVME147 Serial Driver\n"); printk(KERN_INFO "SCC: MVME147 Serial Driver\n");
/* Init channel A */ /* Init channel A */
...@@ -207,14 +208,23 @@ static int mvme147_scc_init(void) ...@@ -207,14 +208,23 @@ static int mvme147_scc_init(void)
port->datap = port->ctrlp + 1; port->datap = port->ctrlp + 1;
port->port_a = &scc_ports[0]; port->port_a = &scc_ports[0];
port->port_b = &scc_ports[1]; port->port_b = &scc_ports[1];
request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, error = request_irq(MVME147_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED,
"SCC-A TX", port); "SCC-A TX", port);
request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, if (error)
goto fail;
error = request_irq(MVME147_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED,
"SCC-A status", port); "SCC-A status", port);
request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, if (error)
goto fail_free_a_tx;
error = request_irq(MVME147_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED,
"SCC-A RX", port); "SCC-A RX", port);
request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, if (error)
"SCC-A special cond", port); goto fail_free_a_stat;
error = request_irq(MVME147_IRQ_SCCA_SPCOND, scc_spcond_int,
IRQF_DISABLED, "SCC-A special cond", port);
if (error)
goto fail_free_a_rx;
{ {
SCC_ACCESS_INIT(port); SCC_ACCESS_INIT(port);
...@@ -234,14 +244,23 @@ static int mvme147_scc_init(void) ...@@ -234,14 +244,23 @@ static int mvme147_scc_init(void)
port->datap = port->ctrlp + 1; port->datap = port->ctrlp + 1;
port->port_a = &scc_ports[0]; port->port_a = &scc_ports[0];
port->port_b = &scc_ports[1]; port->port_b = &scc_ports[1];
request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, error = request_irq(MVME147_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED,
"SCC-B TX", port); "SCC-B TX", port);
request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, if (error)
goto fail_free_a_spcond;
error = request_irq(MVME147_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED,
"SCC-B status", port); "SCC-B status", port);
request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, if (error)
goto fail_free_b_tx;
error = request_irq(MVME147_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED,
"SCC-B RX", port); "SCC-B RX", port);
request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, if (error)
"SCC-B special cond", port); goto fail_free_b_stat;
error = request_irq(MVME147_IRQ_SCCB_SPCOND, scc_spcond_int,
IRQF_DISABLED, "SCC-B special cond", port);
if (error)
goto fail_free_b_rx;
{ {
SCC_ACCESS_INIT(port); SCC_ACCESS_INIT(port);
...@@ -257,6 +276,23 @@ static int mvme147_scc_init(void) ...@@ -257,6 +276,23 @@ static int mvme147_scc_init(void)
scc_init_drivers(); scc_init_drivers();
return 0; return 0;
fail_free_b_rx:
free_irq(MVME147_IRQ_SCCB_RX, port);
fail_free_b_stat:
free_irq(MVME147_IRQ_SCCB_STAT, port);
fail_free_b_tx:
free_irq(MVME147_IRQ_SCCB_TX, port);
fail_free_a_spcond:
free_irq(MVME147_IRQ_SCCA_SPCOND, port);
fail_free_a_rx:
free_irq(MVME147_IRQ_SCCA_RX, port);
fail_free_a_stat:
free_irq(MVME147_IRQ_SCCA_STAT, port);
fail_free_a_tx:
free_irq(MVME147_IRQ_SCCA_TX, port);
fail:
return error;
} }
#endif #endif
...@@ -265,6 +301,7 @@ static int mvme147_scc_init(void) ...@@ -265,6 +301,7 @@ static int mvme147_scc_init(void)
static int mvme162_scc_init(void) static int mvme162_scc_init(void)
{ {
struct scc_port *port; struct scc_port *port;
int error;
if (!(mvme16x_config & MVME16x_CONFIG_GOT_SCCA)) if (!(mvme16x_config & MVME16x_CONFIG_GOT_SCCA))
return (-ENODEV); return (-ENODEV);
...@@ -277,14 +314,23 @@ static int mvme162_scc_init(void) ...@@ -277,14 +314,23 @@ static int mvme162_scc_init(void)
port->datap = port->ctrlp + 2; port->datap = port->ctrlp + 2;
port->port_a = &scc_ports[0]; port->port_a = &scc_ports[0];
port->port_b = &scc_ports[1]; port->port_b = &scc_ports[1];
request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, error = request_irq(MVME162_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED,
"SCC-A TX", port); "SCC-A TX", port);
request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, if (error)
goto fail;
error = request_irq(MVME162_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED,
"SCC-A status", port); "SCC-A status", port);
request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, if (error)
goto fail_free_a_tx;
error = request_irq(MVME162_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED,
"SCC-A RX", port); "SCC-A RX", port);
request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, if (error)
"SCC-A special cond", port); goto fail_free_a_stat;
error = request_irq(MVME162_IRQ_SCCA_SPCOND, scc_spcond_int,
IRQF_DISABLED, "SCC-A special cond", port);
if (error)
goto fail_free_a_rx;
{ {
SCC_ACCESS_INIT(port); SCC_ACCESS_INIT(port);
...@@ -304,14 +350,22 @@ static int mvme162_scc_init(void) ...@@ -304,14 +350,22 @@ static int mvme162_scc_init(void)
port->datap = port->ctrlp + 2; port->datap = port->ctrlp + 2;
port->port_a = &scc_ports[0]; port->port_a = &scc_ports[0];
port->port_b = &scc_ports[1]; port->port_b = &scc_ports[1];
request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, error = request_irq(MVME162_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED,
"SCC-B TX", port); "SCC-B TX", port);
request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, if (error)
goto fail_free_a_spcond;
error = request_irq(MVME162_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED,
"SCC-B status", port); "SCC-B status", port);
request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, if (error)
goto fail_free_b_tx;
error = request_irq(MVME162_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED,
"SCC-B RX", port); "SCC-B RX", port);
request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, if (error)
"SCC-B special cond", port); goto fail_free_b_stat;
error = request_irq(MVME162_IRQ_SCCB_SPCOND, scc_spcond_int,
IRQF_DISABLED, "SCC-B special cond", port);
if (error)
goto fail_free_b_rx;
{ {
SCC_ACCESS_INIT(port); /* Either channel will do */ SCC_ACCESS_INIT(port); /* Either channel will do */
...@@ -328,6 +382,23 @@ static int mvme162_scc_init(void) ...@@ -328,6 +382,23 @@ static int mvme162_scc_init(void)
scc_init_drivers(); scc_init_drivers();
return 0; return 0;
fail_free_b_rx:
free_irq(MVME162_IRQ_SCCB_RX, port);
fail_free_b_stat:
free_irq(MVME162_IRQ_SCCB_STAT, port);
fail_free_b_tx:
free_irq(MVME162_IRQ_SCCB_TX, port);
fail_free_a_spcond:
free_irq(MVME162_IRQ_SCCA_SPCOND, port);
fail_free_a_rx:
free_irq(MVME162_IRQ_SCCA_RX, port);
fail_free_a_stat:
free_irq(MVME162_IRQ_SCCA_STAT, port);
fail_free_a_tx:
free_irq(MVME162_IRQ_SCCA_TX, port);
fail:
return error;
} }
#endif #endif
...@@ -336,6 +407,7 @@ static int mvme162_scc_init(void) ...@@ -336,6 +407,7 @@ static int mvme162_scc_init(void)
static int bvme6000_scc_init(void) static int bvme6000_scc_init(void)
{ {
struct scc_port *port; struct scc_port *port;
int error;
printk(KERN_INFO "SCC: BVME6000 Serial Driver\n"); printk(KERN_INFO "SCC: BVME6000 Serial Driver\n");
/* Init channel A */ /* Init channel A */
...@@ -345,14 +417,23 @@ static int bvme6000_scc_init(void) ...@@ -345,14 +417,23 @@ static int bvme6000_scc_init(void)
port->datap = port->ctrlp + 4; port->datap = port->ctrlp + 4;
port->port_a = &scc_ports[0]; port->port_a = &scc_ports[0];
port->port_b = &scc_ports[1]; port->port_b = &scc_ports[1];
request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED, error = request_irq(BVME_IRQ_SCCA_TX, scc_tx_int, IRQF_DISABLED,
"SCC-A TX", port); "SCC-A TX", port);
request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED, if (error)
goto fail;
error = request_irq(BVME_IRQ_SCCA_STAT, scc_stat_int, IRQF_DISABLED,
"SCC-A status", port); "SCC-A status", port);
request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED, if (error)
goto fail_free_a_tx;
error = request_irq(BVME_IRQ_SCCA_RX, scc_rx_int, IRQF_DISABLED,
"SCC-A RX", port); "SCC-A RX", port);
request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int, IRQF_DISABLED, if (error)
"SCC-A special cond", port); goto fail_free_a_stat;
error = request_irq(BVME_IRQ_SCCA_SPCOND, scc_spcond_int,
IRQF_DISABLED, "SCC-A special cond", port);
if (error)
goto fail_free_a_rx;
{ {
SCC_ACCESS_INIT(port); SCC_ACCESS_INIT(port);
...@@ -372,14 +453,22 @@ static int bvme6000_scc_init(void) ...@@ -372,14 +453,22 @@ static int bvme6000_scc_init(void)
port->datap = port->ctrlp + 4; port->datap = port->ctrlp + 4;
port->port_a = &scc_ports[0]; port->port_a = &scc_ports[0];
port->port_b = &scc_ports[1]; port->port_b = &scc_ports[1];
request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED, error = request_irq(BVME_IRQ_SCCB_TX, scc_tx_int, IRQF_DISABLED,
"SCC-B TX", port); "SCC-B TX", port);
request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED, if (error)
goto fail_free_a_spcond;
error = request_irq(BVME_IRQ_SCCB_STAT, scc_stat_int, IRQF_DISABLED,
"SCC-B status", port); "SCC-B status", port);
request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED, if (error)
goto fail_free_b_tx;
error = request_irq(BVME_IRQ_SCCB_RX, scc_rx_int, IRQF_DISABLED,
"SCC-B RX", port); "SCC-B RX", port);
request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int, IRQF_DISABLED, if (error)
"SCC-B special cond", port); goto fail_free_b_stat;
error = request_irq(BVME_IRQ_SCCB_SPCOND, scc_spcond_int,
IRQF_DISABLED, "SCC-B special cond", port);
if (error)
goto fail_free_b_rx;
{ {
SCC_ACCESS_INIT(port); /* Either channel will do */ SCC_ACCESS_INIT(port); /* Either channel will do */
...@@ -393,6 +482,23 @@ static int bvme6000_scc_init(void) ...@@ -393,6 +482,23 @@ static int bvme6000_scc_init(void)
scc_init_drivers(); scc_init_drivers();
return 0; return 0;
fail:
free_irq(BVME_IRQ_SCCA_STAT, port);
fail_free_a_tx:
free_irq(BVME_IRQ_SCCA_RX, port);
fail_free_a_stat:
free_irq(BVME_IRQ_SCCA_SPCOND, port);
fail_free_a_rx:
free_irq(BVME_IRQ_SCCB_TX, port);
fail_free_a_spcond:
free_irq(BVME_IRQ_SCCB_STAT, port);
fail_free_b_tx:
free_irq(BVME_IRQ_SCCB_RX, port);
fail_free_b_stat:
free_irq(BVME_IRQ_SCCB_SPCOND, port);
fail_free_b_rx:
return error;
} }
#endif #endif
......
...@@ -58,20 +58,25 @@ static ssize_t dio_show_resource(struct device *dev, struct device_attribute *at ...@@ -58,20 +58,25 @@ static ssize_t dio_show_resource(struct device *dev, struct device_attribute *at
struct dio_dev *d = to_dio_dev(dev); struct dio_dev *d = to_dio_dev(dev);
return sprintf(buf, "0x%08lx 0x%08lx 0x%08lx\n", return sprintf(buf, "0x%08lx 0x%08lx 0x%08lx\n",
dio_resource_start(d), dio_resource_end(d), (unsigned long)dio_resource_start(d),
(unsigned long)dio_resource_end(d),
dio_resource_flags(d)); dio_resource_flags(d));
} }
static DEVICE_ATTR(resource, S_IRUGO, dio_show_resource, NULL); static DEVICE_ATTR(resource, S_IRUGO, dio_show_resource, NULL);
void dio_create_sysfs_dev_files(struct dio_dev *d) int dio_create_sysfs_dev_files(struct dio_dev *d)
{ {
struct device *dev = &d->dev; struct device *dev = &d->dev;
int error;
/* current configuration's attributes */ /* current configuration's attributes */
device_create_file(dev, &dev_attr_id); if ((error = device_create_file(dev, &dev_attr_id)) ||
device_create_file(dev, &dev_attr_ipl); (error = device_create_file(dev, &dev_attr_ipl)) ||
device_create_file(dev, &dev_attr_secid); (error = device_create_file(dev, &dev_attr_secid)) ||
device_create_file(dev, &dev_attr_name); (error = device_create_file(dev, &dev_attr_name)) ||
device_create_file(dev, &dev_attr_resource); (error = device_create_file(dev, &dev_attr_resource)))
return error;
return 0;
} }
...@@ -173,6 +173,7 @@ static int __init dio_init(void) ...@@ -173,6 +173,7 @@ static int __init dio_init(void)
mm_segment_t fs; mm_segment_t fs;
int i; int i;
struct dio_dev *dev; struct dio_dev *dev;
int error;
if (!MACH_IS_HP300) if (!MACH_IS_HP300)
return 0; return 0;
...@@ -182,7 +183,11 @@ static int __init dio_init(void) ...@@ -182,7 +183,11 @@ static int __init dio_init(void)
/* Initialize the DIO bus */ /* Initialize the DIO bus */
INIT_LIST_HEAD(&dio_bus.devices); INIT_LIST_HEAD(&dio_bus.devices);
strcpy(dio_bus.dev.bus_id, "dio"); strcpy(dio_bus.dev.bus_id, "dio");
device_register(&dio_bus.dev); error = device_register(&dio_bus.dev);
if (error) {
pr_err("DIO: Error registering dio_bus\n");
return error;
}
/* Request all resources */ /* Request all resources */
dio_bus.num_resources = (hp300_model == HP_320 ? 1 : 2); dio_bus.num_resources = (hp300_model == HP_320 ? 1 : 2);
...@@ -252,8 +257,15 @@ static int __init dio_init(void) ...@@ -252,8 +257,15 @@ static int __init dio_init(void)
if (scode >= DIOII_SCBASE) if (scode >= DIOII_SCBASE)
iounmap(va); iounmap(va);
device_register(&dev->dev); error = device_register(&dev->dev);
dio_create_sysfs_dev_files(dev); if (error) {
pr_err("DIO: Error registering device %s\n",
dev->name);
continue;
}
error = dio_create_sysfs_dev_files(dev);
if (error)
dev_err(&dev->dev, "Error creating sysfs files\n");
} }
return 0; return 0;
} }
......
...@@ -28,7 +28,7 @@ obj-$(CONFIG_FB_DDC) += fb_ddc.o ...@@ -28,7 +28,7 @@ obj-$(CONFIG_FB_DDC) += fb_ddc.o
obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o obj-$(CONFIG_FB_DEFERRED_IO) += fb_defio.o
# Hardware specific drivers go first # Hardware specific drivers go first
obj-$(CONFIG_FB_AMIGA) += amifb.o c2p.o obj-$(CONFIG_FB_AMIGA) += amifb.o c2p_planar.o
obj-$(CONFIG_FB_ARC) += arcfb.o obj-$(CONFIG_FB_ARC) += arcfb.o
obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o obj-$(CONFIG_FB_CLPS711X) += clps711xfb.o
obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o obj-$(CONFIG_FB_CYBER2000) += cyber2000fb.o
...@@ -72,7 +72,7 @@ obj-$(CONFIG_FB_TCX) += tcx.o sbuslib.o ...@@ -72,7 +72,7 @@ obj-$(CONFIG_FB_TCX) += tcx.o sbuslib.o
obj-$(CONFIG_FB_LEO) += leo.o sbuslib.o obj-$(CONFIG_FB_LEO) += leo.o sbuslib.o
obj-$(CONFIG_FB_SGIVW) += sgivwfb.o obj-$(CONFIG_FB_SGIVW) += sgivwfb.o
obj-$(CONFIG_FB_ACORN) += acornfb.o obj-$(CONFIG_FB_ACORN) += acornfb.o
obj-$(CONFIG_FB_ATARI) += atafb.o c2p.o atafb_mfb.o \ obj-$(CONFIG_FB_ATARI) += atafb.o c2p_iplan2.o atafb_mfb.o \
atafb_iplan2p2.o atafb_iplan2p4.o atafb_iplan2p8.o atafb_iplan2p2.o atafb_iplan2p4.o atafb_iplan2p8.o
obj-$(CONFIG_FB_MAC) += macfb.o obj-$(CONFIG_FB_MAC) += macfb.o
obj-$(CONFIG_FB_HECUBA) += hecubafb.o obj-$(CONFIG_FB_HECUBA) += hecubafb.o
......
...@@ -2159,9 +2159,9 @@ static void amifb_imageblit(struct fb_info *info, const struct fb_image *image) ...@@ -2159,9 +2159,9 @@ static void amifb_imageblit(struct fb_info *info, const struct fb_image *image)
src += pitch; src += pitch;
} }
} else { } else {
c2p(info->screen_base, image->data, dx, dy, width, height, c2p_planar(info->screen_base, image->data, dx, dy, width,
par->next_line, par->next_plane, image->width, height, par->next_line, par->next_plane,
info->var.bits_per_pixel); image->width, info->var.bits_per_pixel);
} }
} }
......
...@@ -122,7 +122,6 @@ static struct atafb_par { ...@@ -122,7 +122,6 @@ static struct atafb_par {
void *screen_base; void *screen_base;
int yres_virtual; int yres_virtual;
u_long next_line; u_long next_line;
u_long next_plane;
#if defined ATAFB_TT || defined ATAFB_STE #if defined ATAFB_TT || defined ATAFB_STE
union { union {
struct { struct {
...@@ -149,6 +148,7 @@ static struct atafb_par { ...@@ -149,6 +148,7 @@ static struct atafb_par {
short mono; short mono;
short ste_mode; short ste_mode;
short bpp; short bpp;
u32 pseudo_palette[16];
} falcon; } falcon;
#endif #endif
/* Nothing needed for external mode */ /* Nothing needed for external mode */
...@@ -614,7 +614,7 @@ static int tt_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par) ...@@ -614,7 +614,7 @@ static int tt_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par)
fix->xpanstep = 0; fix->xpanstep = 0;
fix->ypanstep = 1; fix->ypanstep = 1;
fix->ywrapstep = 0; fix->ywrapstep = 0;
fix->line_length = 0; fix->line_length = par->next_line;
fix->accel = FB_ACCEL_ATARIBLITT; fix->accel = FB_ACCEL_ATARIBLITT;
return 0; return 0;
} }
...@@ -691,6 +691,7 @@ static int tt_decode_var(struct fb_var_screeninfo *var, struct atafb_par *par) ...@@ -691,6 +691,7 @@ static int tt_decode_var(struct fb_var_screeninfo *var, struct atafb_par *par)
return -EINVAL; return -EINVAL;
par->yres_virtual = yres_virtual; par->yres_virtual = yres_virtual;
par->screen_base = screen_base + var->yoffset * linelen; par->screen_base = screen_base + var->yoffset * linelen;
par->next_line = linelen;
return 0; return 0;
} }
...@@ -884,10 +885,6 @@ static int vdl_prescale[4][3] = { ...@@ -884,10 +885,6 @@ static int vdl_prescale[4][3] = {
/* Default hsync timing [mon_type] in picoseconds */ /* Default hsync timing [mon_type] in picoseconds */
static long h_syncs[4] = { 3000000, 4875000, 4000000, 4875000 }; static long h_syncs[4] = { 3000000, 4875000, 4000000, 4875000 };
#ifdef FBCON_HAS_CFB16
static u16 fbcon_cfb16_cmap[16];
#endif
static inline int hxx_prescale(struct falcon_hw *hw) static inline int hxx_prescale(struct falcon_hw *hw)
{ {
return hw->ste_mode ? 16 return hw->ste_mode ? 16
...@@ -918,7 +915,7 @@ static int falcon_encode_fix(struct fb_fix_screeninfo *fix, ...@@ -918,7 +915,7 @@ static int falcon_encode_fix(struct fb_fix_screeninfo *fix,
fix->visual = FB_VISUAL_TRUECOLOR; fix->visual = FB_VISUAL_TRUECOLOR;
fix->xpanstep = 2; fix->xpanstep = 2;
} }
fix->line_length = 0; fix->line_length = par->next_line;
fix->accel = FB_ACCEL_ATARIBLITT; fix->accel = FB_ACCEL_ATARIBLITT;
return 0; return 0;
} }
...@@ -1394,14 +1391,7 @@ static int falcon_decode_var(struct fb_var_screeninfo *var, ...@@ -1394,14 +1391,7 @@ static int falcon_decode_var(struct fb_var_screeninfo *var,
par->screen_base = screen_base + var->yoffset * linelen; par->screen_base = screen_base + var->yoffset * linelen;
par->hw.falcon.xoffset = 0; par->hw.falcon.xoffset = 0;
// FIXME!!! sort of works, no crash
//par->next_line = linelen;
//par->next_plane = yres_virtual * linelen;
par->next_line = linelen; par->next_line = linelen;
par->next_plane = 2;
// crashes
//par->next_plane = linelen;
//par->next_line = yres_virtual * linelen;
return 0; return 0;
} }
...@@ -1735,10 +1725,10 @@ static int falcon_setcolreg(unsigned int regno, unsigned int red, ...@@ -1735,10 +1725,10 @@ static int falcon_setcolreg(unsigned int regno, unsigned int red,
(((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) | (((red & 0xe000) >> 13) | ((red & 0x1000) >> 12) << 8) |
(((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) | (((green & 0xe000) >> 13) | ((green & 0x1000) >> 12) << 4) |
((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12); ((blue & 0xe000) >> 13) | ((blue & 0x1000) >> 12);
#ifdef FBCON_HAS_CFB16 #ifdef ATAFB_FALCON
fbcon_cfb16_cmap[regno] = ((red & 0xf800) | ((u32 *)info->pseudo_palette)[regno] = ((red & 0xf800) |
((green & 0xfc00) >> 5) | ((green & 0xfc00) >> 5) |
((blue & 0xf800) >> 11)); ((blue & 0xf800) >> 11));
#endif #endif
} }
return 0; return 0;
...@@ -1852,7 +1842,7 @@ static int stste_encode_fix(struct fb_fix_screeninfo *fix, ...@@ -1852,7 +1842,7 @@ static int stste_encode_fix(struct fb_fix_screeninfo *fix,
fix->ypanstep = 0; fix->ypanstep = 0;
} }
fix->ywrapstep = 0; fix->ywrapstep = 0;
fix->line_length = 0; fix->line_length = par->next_line;
fix->accel = FB_ACCEL_ATARIBLITT; fix->accel = FB_ACCEL_ATARIBLITT;
return 0; return 0;
} }
...@@ -1910,6 +1900,7 @@ static int stste_decode_var(struct fb_var_screeninfo *var, ...@@ -1910,6 +1900,7 @@ static int stste_decode_var(struct fb_var_screeninfo *var,
return -EINVAL; return -EINVAL;
par->yres_virtual = yres_virtual; par->yres_virtual = yres_virtual;
par->screen_base = screen_base + var->yoffset * linelen; par->screen_base = screen_base + var->yoffset * linelen;
par->next_line = linelen;
return 0; return 0;
} }
...@@ -2169,7 +2160,7 @@ static int ext_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par) ...@@ -2169,7 +2160,7 @@ static int ext_encode_fix(struct fb_fix_screeninfo *fix, struct atafb_par *par)
fix->xpanstep = 0; fix->xpanstep = 0;
fix->ypanstep = 0; fix->ypanstep = 0;
fix->ywrapstep = 0; fix->ywrapstep = 0;
fix->line_length = 0; fix->line_length = par->next_line;
return 0; return 0;
} }
...@@ -2184,6 +2175,8 @@ static int ext_decode_var(struct fb_var_screeninfo *var, struct atafb_par *par) ...@@ -2184,6 +2175,8 @@ static int ext_decode_var(struct fb_var_screeninfo *var, struct atafb_par *par)
var->xoffset > 0 || var->xoffset > 0 ||
var->yoffset > 0) var->yoffset > 0)
return -EINVAL; return -EINVAL;
par->next_line = external_xres_virtual * external_depth / 8;
return 0; return 0;
} }
...@@ -2443,42 +2436,6 @@ static void atafb_set_disp(struct fb_info *info) ...@@ -2443,42 +2436,6 @@ static void atafb_set_disp(struct fb_info *info)
atafb_get_fix(&info->fix, info); atafb_get_fix(&info->fix, info);
info->screen_base = (void *)info->fix.smem_start; info->screen_base = (void *)info->fix.smem_start;
switch (info->fix.type) {
case FB_TYPE_INTERLEAVED_PLANES:
switch (info->var.bits_per_pixel) {
case 2:
// display->dispsw = &fbcon_iplan2p2;
break;
case 4:
// display->dispsw = &fbcon_iplan2p4;
break;
case 8:
// display->dispsw = &fbcon_iplan2p8;
break;
}
break;
case FB_TYPE_PACKED_PIXELS:
switch (info->var.bits_per_pixel) {
#ifdef FBCON_HAS_MFB
case 1:
// display->dispsw = &fbcon_mfb;
break;
#endif
#ifdef FBCON_HAS_CFB8
case 8:
// display->dispsw = &fbcon_cfb8;
break;
#endif
#ifdef FBCON_HAS_CFB16
case 16:
// display->dispsw = &fbcon_cfb16;
// display->dispsw_data = fbcon_cfb16_cmap;
break;
#endif
}
break;
}
} }
static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue, static int atafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
...@@ -2549,6 +2506,13 @@ static void atafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) ...@@ -2549,6 +2506,13 @@ static void atafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
if (!rect->width || !rect->height) if (!rect->width || !rect->height)
return; return;
#ifdef ATAFB_FALCON
if (info->var.bits_per_pixel == 16) {
cfb_fillrect(info, rect);
return;
}
#endif
/* /*
* We could use hardware clipping but on many cards you get around * We could use hardware clipping but on many cards you get around
* hardware clipping by writing to framebuffer directly. * hardware clipping by writing to framebuffer directly.
...@@ -2583,6 +2547,13 @@ static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area) ...@@ -2583,6 +2547,13 @@ static void atafb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
u32 dx, dy, sx, sy, width, height; u32 dx, dy, sx, sy, width, height;
int rev_copy = 0; int rev_copy = 0;
#ifdef ATAFB_FALCON
if (info->var.bits_per_pixel == 16) {
cfb_copyarea(info, area);
return;
}
#endif
/* clip the destination */ /* clip the destination */
x2 = area->dx + area->width; x2 = area->dx + area->width;
y2 = area->dy + area->height; y2 = area->dy + area->height;
...@@ -2632,6 +2603,13 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image) ...@@ -2632,6 +2603,13 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image)
const char *src; const char *src;
u32 dx, dy, width, height, pitch; u32 dx, dy, width, height, pitch;
#ifdef ATAFB_FALCON
if (info->var.bits_per_pixel == 16) {
cfb_imageblit(info, image);
return;
}
#endif
/* /*
* We could use hardware clipping but on many cards you get around * We could use hardware clipping but on many cards you get around
* hardware clipping by writing to framebuffer directly like we are * hardware clipping by writing to framebuffer directly like we are
...@@ -2676,10 +2654,9 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image) ...@@ -2676,10 +2654,9 @@ static void atafb_imageblit(struct fb_info *info, const struct fb_image *image)
src += pitch; src += pitch;
} }
} else { } else {
// only used for logo; broken c2p_iplan2(info->screen_base, image->data, dx, dy, width,
c2p(info->screen_base, image->data, dx, dy, width, height, height, par->next_line, image->width,
par->next_line, par->next_plane, image->width, info->var.bits_per_pixel);
info->var.bits_per_pixel);
} }
} }
...@@ -3098,8 +3075,7 @@ int __init atafb_setup(char *options) ...@@ -3098,8 +3075,7 @@ int __init atafb_setup(char *options)
int __init atafb_init(void) int __init atafb_init(void)
{ {
int pad; int pad, detected_mode, error;
int detected_mode;
unsigned int defmode = 0; unsigned int defmode = 0;
unsigned long mem_req; unsigned long mem_req;
...@@ -3139,8 +3115,12 @@ int __init atafb_init(void) ...@@ -3139,8 +3115,12 @@ int __init atafb_init(void)
printk("atafb_init: initializing Falcon hw\n"); printk("atafb_init: initializing Falcon hw\n");
fbhw = &falcon_switch; fbhw = &falcon_switch;
atafb_ops.fb_setcolreg = &falcon_setcolreg; atafb_ops.fb_setcolreg = &falcon_setcolreg;
request_irq(IRQ_AUTO_4, falcon_vbl_switcher, IRQ_TYPE_PRIO, error = request_irq(IRQ_AUTO_4, falcon_vbl_switcher,
"framebuffer/modeswitch", falcon_vbl_switcher); IRQ_TYPE_PRIO,
"framebuffer/modeswitch",
falcon_vbl_switcher);
if (error)
return error;
defmode = DEFMODE_F30; defmode = DEFMODE_F30;
break; break;
} }
...@@ -3225,6 +3205,10 @@ int __init atafb_init(void) ...@@ -3225,6 +3205,10 @@ int __init atafb_init(void)
// tries to read from HW which may not be initialized yet // tries to read from HW which may not be initialized yet
// so set sane var first, then call atafb_set_par // so set sane var first, then call atafb_set_par
atafb_get_var(&fb_info.var, &fb_info); atafb_get_var(&fb_info.var, &fb_info);
#ifdef ATAFB_FALCON
fb_info.pseudo_palette = current_par.hw.falcon.pseudo_palette;
#endif
fb_info.flags = FBINFO_FLAG_DEFAULT; fb_info.flags = FBINFO_FLAG_DEFAULT;
if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, atafb_modedb, if (!fb_find_mode(&fb_info.var, &fb_info, mode_option, atafb_modedb,
......
/*
* Fast C2P (Chunky-to-Planar) Conversion
*
* Copyright (C) 2003 Geert Uytterhoeven
*
* NOTES:
* - This code was inspired by Scout's C2P tutorial
* - It assumes to run on a big endian system
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#include <linux/module.h>
#include <linux/string.h>
#include "c2p.h"
/*
* Basic transpose step
*/
#define _transp(d, i1, i2, shift, mask) \
do { \
u32 t = (d[i1] ^ (d[i2] >> shift)) & mask; \
d[i1] ^= t; \
d[i2] ^= t << shift; \
} while (0)
static inline u32 get_mask(int n)
{
switch (n) {
case 1:
return 0x55555555;
break;
case 2:
return 0x33333333;
break;
case 4:
return 0x0f0f0f0f;
break;
case 8:
return 0x00ff00ff;
break;
case 16:
return 0x0000ffff;
break;
}
return 0;
}
#define transp_nx1(d, n) \
do { \
u32 mask = get_mask(n); \
/* First block */ \
_transp(d, 0, 1, n, mask); \
/* Second block */ \
_transp(d, 2, 3, n, mask); \
/* Third block */ \
_transp(d, 4, 5, n, mask); \
/* Fourth block */ \
_transp(d, 6, 7, n, mask); \
} while (0)
#define transp_nx2(d, n) \
do { \
u32 mask = get_mask(n); \
/* First block */ \
_transp(d, 0, 2, n, mask); \
_transp(d, 1, 3, n, mask); \
/* Second block */ \
_transp(d, 4, 6, n, mask); \
_transp(d, 5, 7, n, mask); \
} while (0)
#define transp_nx4(d, n) \
do { \
u32 mask = get_mask(n); \
_transp(d, 0, 4, n, mask); \
_transp(d, 1, 5, n, mask); \
_transp(d, 2, 6, n, mask); \
_transp(d, 3, 7, n, mask); \
} while (0)
#define transp(d, n, m) transp_nx ## m(d, n)
/*
* Perform a full C2P step on 32 8-bit pixels, stored in 8 32-bit words
* containing
* - 32 8-bit chunky pixels on input
* - permuted planar data on output
*/
static void c2p_8bpp(u32 d[8])
{
transp(d, 16, 4);
transp(d, 8, 2);
transp(d, 4, 1);
transp(d, 2, 4);
transp(d, 1, 2);
}
/*
* Array containing the permution indices of the planar data after c2p
*/
static const int perm_c2p_8bpp[8] = { 7, 5, 3, 1, 6, 4, 2, 0 };
/*
* Compose two values, using a bitmask as decision value
* This is equivalent to (a & mask) | (b & ~mask)
*/
static inline unsigned long comp(unsigned long a, unsigned long b,
unsigned long mask)
{
return ((a ^ b) & mask) ^ b;
}
/*
* Store a full block of planar data after c2p conversion
*/
static inline void store_planar(char *dst, u32 dst_inc, u32 bpp, u32 d[8])
{
int i;
for (i = 0; i < bpp; i++, dst += dst_inc)
*(u32 *)dst = d[perm_c2p_8bpp[i]];
}
/*
* Store a partial block of planar data after c2p conversion
*/
static inline void store_planar_masked(char *dst, u32 dst_inc, u32 bpp,
u32 d[8], u32 mask)
{
int i;
for (i = 0; i < bpp; i++, dst += dst_inc)
*(u32 *)dst = comp(d[perm_c2p_8bpp[i]], *(u32 *)dst, mask);
}
/*
* c2p - Copy 8-bit chunky image data to a planar frame buffer
* @dst: Starting address of the planar frame buffer
* @dx: Horizontal destination offset (in pixels)
* @dy: Vertical destination offset (in pixels)
* @width: Image width (in pixels)
* @height: Image height (in pixels)
* @dst_nextline: Frame buffer offset to the next line (in bytes)
* @dst_nextplane: Frame buffer offset to the next plane (in bytes)
* @src_nextline: Image offset to the next line (in bytes)
* @bpp: Bits per pixel of the planar frame buffer (1-8)
*/
void c2p(u8 *dst, const u8 *src, u32 dx, u32 dy, u32 width, u32 height,
u32 dst_nextline, u32 dst_nextplane, u32 src_nextline, u32 bpp)
{
int dst_idx;
u32 d[8], first, last, w;
const u8 *c;
u8 *p;
dst += dy*dst_nextline+(dx & ~31);
dst_idx = dx % 32;
first = ~0UL >> dst_idx;
last = ~(~0UL >> ((dst_idx+width) % 32));
while (height--) {
c = src;
p = dst;
w = width;
if (dst_idx+width <= 32) {
/* Single destination word */
first &= last;
memset(d, 0, sizeof(d));
memcpy((u8 *)d+dst_idx, c, width);
c += width;
c2p_8bpp(d);
store_planar_masked(p, dst_nextplane, bpp, d, first);
p += 4;
} else {
/* Multiple destination words */
w = width;
/* Leading bits */
if (dst_idx) {
w = 32 - dst_idx;
memset(d, 0, dst_idx);
memcpy((u8 *)d+dst_idx, c, w);
c += w;
c2p_8bpp(d);
store_planar_masked(p, dst_nextplane, bpp, d, first);
p += 4;
w = width-w;
}
/* Main chunk */
while (w >= 32) {
memcpy(d, c, 32);
c += 32;
c2p_8bpp(d);
store_planar(p, dst_nextplane, bpp, d);
p += 4;
w -= 32;
}
/* Trailing bits */
w %= 32;
if (w > 0) {
memcpy(d, c, w);
memset((u8 *)d+w, 0, 32-w);
c2p_8bpp(d);
store_planar_masked(p, dst_nextplane, bpp, d, last);
}
}
src += src_nextline;
dst += dst_nextline;
}
}
EXPORT_SYMBOL_GPL(c2p);
MODULE_LICENSE("GPL");
/* /*
* Fast C2P (Chunky-to-Planar) Conversion * Fast C2P (Chunky-to-Planar) Conversion
* *
* Copyright (C) 2003 Geert Uytterhoeven * Copyright (C) 2003-2008 Geert Uytterhoeven
* *
* This file is subject to the terms and conditions of the GNU General Public * This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive * License. See the file COPYING in the main directory of this archive
...@@ -10,7 +10,10 @@ ...@@ -10,7 +10,10 @@
#include <linux/types.h> #include <linux/types.h>
extern void c2p(u8 *dst, const u8 *src, u32 dx, u32 dy, u32 width, u32 height, extern void c2p_planar(void *dst, const void *src, u32 dx, u32 dy, u32 width,
u32 dst_nextline, u32 dst_nextplane, u32 src_nextline, u32 height, u32 dst_nextline, u32 dst_nextplane,
u32 bpp); u32 src_nextline, u32 bpp);
extern void c2p_iplan2(void *dst, const void *src, u32 dx, u32 dy, u32 width,
u32 height, u32 dst_nextline, u32 src_nextline,
u32 bpp);
/*
* Fast C2P (Chunky-to-Planar) Conversion
*
* Copyright (C) 2003-2008 Geert Uytterhoeven
*
* NOTES:
* - This code was inspired by Scout's C2P tutorial
* - It assumes to run on a big endian system
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
/*
* Basic transpose step
*/
static inline void _transp(u32 d[], unsigned int i1, unsigned int i2,
unsigned int shift, u32 mask)
{
u32 t = (d[i1] ^ (d[i2] >> shift)) & mask;
d[i1] ^= t;
d[i2] ^= t << shift;
}
extern void c2p_unsupported(void);
static inline u32 get_mask(unsigned int n)
{
switch (n) {
case 1:
return 0x55555555;
case 2:
return 0x33333333;
case 4:
return 0x0f0f0f0f;
case 8:
return 0x00ff00ff;
case 16:
return 0x0000ffff;
}
c2p_unsupported();
return 0;
}
/*
* Transpose operations on 8 32-bit words
*/
static inline void transp8(u32 d[], unsigned int n, unsigned int m)
{
u32 mask = get_mask(n);
switch (m) {
case 1:
/* First n x 1 block */
_transp(d, 0, 1, n, mask);
/* Second n x 1 block */
_transp(d, 2, 3, n, mask);
/* Third n x 1 block */
_transp(d, 4, 5, n, mask);
/* Fourth n x 1 block */
_transp(d, 6, 7, n, mask);
return;
case 2:
/* First n x 2 block */
_transp(d, 0, 2, n, mask);
_transp(d, 1, 3, n, mask);
/* Second n x 2 block */
_transp(d, 4, 6, n, mask);
_transp(d, 5, 7, n, mask);
return;
case 4:
/* Single n x 4 block */
_transp(d, 0, 4, n, mask);
_transp(d, 1, 5, n, mask);
_transp(d, 2, 6, n, mask);
_transp(d, 3, 7, n, mask);
return;
}
c2p_unsupported();
}
/*
* Transpose operations on 4 32-bit words
*/
static inline void transp4(u32 d[], unsigned int n, unsigned int m)
{
u32 mask = get_mask(n);
switch (m) {
case 1:
/* First n x 1 block */
_transp(d, 0, 1, n, mask);
/* Second n x 1 block */
_transp(d, 2, 3, n, mask);
return;
case 2:
/* Single n x 2 block */
_transp(d, 0, 2, n, mask);
_transp(d, 1, 3, n, mask);
return;
}
c2p_unsupported();
}
/*
* Transpose operations on 4 32-bit words (reverse order)
*/
static inline void transp4x(u32 d[], unsigned int n, unsigned int m)
{
u32 mask = get_mask(n);
switch (m) {
case 2:
/* Single n x 2 block */
_transp(d, 2, 0, n, mask);
_transp(d, 3, 1, n, mask);
return;
}
c2p_unsupported();
}
/*
* Compose two values, using a bitmask as decision value
* This is equivalent to (a & mask) | (b & ~mask)
*/
static inline u32 comp(u32 a, u32 b, u32 mask)
{
return ((a ^ b) & mask) ^ b;
}
/*
* Fast C2P (Chunky-to-Planar) Conversion
*
* Copyright (C) 2003-2008 Geert Uytterhoeven
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#include <linux/module.h>
#include <linux/string.h>
#include <asm/unaligned.h>
#include "c2p.h"
#include "c2p_core.h"
/*
* Perform a full C2P step on 16 8-bit pixels, stored in 4 32-bit words
* containing
* - 16 8-bit chunky pixels on input
* - permutated planar data (2 planes per 32-bit word) on output
*/
static void c2p_16x8(u32 d[4])
{
transp4(d, 8, 2);
transp4(d, 1, 2);
transp4x(d, 16, 2);
transp4x(d, 2, 2);
transp4(d, 4, 1);
}
/*
* Array containing the permutation indices of the planar data after c2p
*/
static const int perm_c2p_16x8[4] = { 1, 3, 0, 2 };
/*
* Store a full block of iplan2 data after c2p conversion
*/
static inline void store_iplan2(void *dst, u32 bpp, u32 d[4])
{
int i;
for (i = 0; i < bpp/2; i++, dst += 4)
put_unaligned_be32(d[perm_c2p_16x8[i]], dst);
}
/*
* Store a partial block of iplan2 data after c2p conversion
*/
static inline void store_iplan2_masked(void *dst, u32 bpp, u32 d[4], u32 mask)
{
int i;
for (i = 0; i < bpp/2; i++, dst += 4)
put_unaligned_be32(comp(d[perm_c2p_16x8[i]],
get_unaligned_be32(dst), mask),
dst);
}
/*
* c2p_iplan2 - Copy 8-bit chunky image data to an interleaved planar
* frame buffer with 2 bytes of interleave
* @dst: Starting address of the planar frame buffer
* @dx: Horizontal destination offset (in pixels)
* @dy: Vertical destination offset (in pixels)
* @width: Image width (in pixels)
* @height: Image height (in pixels)
* @dst_nextline: Frame buffer offset to the next line (in bytes)
* @src_nextline: Image offset to the next line (in bytes)
* @bpp: Bits per pixel of the planar frame buffer (2, 4, or 8)
*/
void c2p_iplan2(void *dst, const void *src, u32 dx, u32 dy, u32 width,
u32 height, u32 dst_nextline, u32 src_nextline, u32 bpp)
{
union {
u8 pixels[16];
u32 words[4];
} d;
u32 dst_idx, first, last, w;
const u8 *c;
void *p;
dst += dy*dst_nextline+(dx & ~15)*bpp;
dst_idx = dx % 16;
first = 0xffffU >> dst_idx;
first |= first << 16;
last = 0xffffU ^ (0xffffU >> ((dst_idx+width) % 16));
last |= last << 16;
while (height--) {
c = src;
p = dst;
w = width;
if (dst_idx+width <= 16) {
/* Single destination word */
first &= last;
memset(d.pixels, 0, sizeof(d));
memcpy(d.pixels+dst_idx, c, width);
c += width;
c2p_16x8(d.words);
store_iplan2_masked(p, bpp, d.words, first);
p += bpp*2;
} else {
/* Multiple destination words */
w = width;
/* Leading bits */
if (dst_idx) {
w = 16 - dst_idx;
memset(d.pixels, 0, dst_idx);
memcpy(d.pixels+dst_idx, c, w);
c += w;
c2p_16x8(d.words);
store_iplan2_masked(p, bpp, d.words, first);
p += bpp*2;
w = width-w;
}
/* Main chunk */
while (w >= 16) {
memcpy(d.pixels, c, 16);
c += 16;
c2p_16x8(d.words);
store_iplan2(p, bpp, d.words);
p += bpp*2;
w -= 16;
}
/* Trailing bits */
w %= 16;
if (w > 0) {
memcpy(d.pixels, c, w);
memset(d.pixels+w, 0, 16-w);
c2p_16x8(d.words);
store_iplan2_masked(p, bpp, d.words, last);
}
}
src += src_nextline;
dst += dst_nextline;
}
}
EXPORT_SYMBOL_GPL(c2p_iplan2);
MODULE_LICENSE("GPL");
/*
* Fast C2P (Chunky-to-Planar) Conversion
*
* Copyright (C) 2003-2008 Geert Uytterhoeven
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive
* for more details.
*/
#include <linux/module.h>
#include <linux/string.h>
#include <asm/unaligned.h>
#include "c2p.h"
#include "c2p_core.h"
/*
* Perform a full C2P step on 32 8-bit pixels, stored in 8 32-bit words
* containing
* - 32 8-bit chunky pixels on input
* - permutated planar data (1 plane per 32-bit word) on output
*/
static void c2p_32x8(u32 d[8])
{
transp8(d, 16, 4);
transp8(d, 8, 2);
transp8(d, 4, 1);
transp8(d, 2, 4);
transp8(d, 1, 2);
}
/*
* Array containing the permutation indices of the planar data after c2p
*/
static const int perm_c2p_32x8[8] = { 7, 5, 3, 1, 6, 4, 2, 0 };
/*
* Store a full block of planar data after c2p conversion
*/
static inline void store_planar(void *dst, u32 dst_inc, u32 bpp, u32 d[8])
{
int i;
for (i = 0; i < bpp; i++, dst += dst_inc)
put_unaligned_be32(d[perm_c2p_32x8[i]], dst);
}
/*
* Store a partial block of planar data after c2p conversion
*/
static inline void store_planar_masked(void *dst, u32 dst_inc, u32 bpp,
u32 d[8], u32 mask)
{
int i;
for (i = 0; i < bpp; i++, dst += dst_inc)
put_unaligned_be32(comp(d[perm_c2p_32x8[i]],
get_unaligned_be32(dst), mask),
dst);
}
/*
* c2p_planar - Copy 8-bit chunky image data to a planar frame buffer
* @dst: Starting address of the planar frame buffer
* @dx: Horizontal destination offset (in pixels)
* @dy: Vertical destination offset (in pixels)
* @width: Image width (in pixels)
* @height: Image height (in pixels)
* @dst_nextline: Frame buffer offset to the next line (in bytes)
* @dst_nextplane: Frame buffer offset to the next plane (in bytes)
* @src_nextline: Image offset to the next line (in bytes)
* @bpp: Bits per pixel of the planar frame buffer (1-8)
*/
void c2p_planar(void *dst, const void *src, u32 dx, u32 dy, u32 width,
u32 height, u32 dst_nextline, u32 dst_nextplane,
u32 src_nextline, u32 bpp)
{
union {
u8 pixels[32];
u32 words[8];
} d;
u32 dst_idx, first, last, w;
const u8 *c;
void *p;
dst += dy*dst_nextline+(dx & ~31);
dst_idx = dx % 32;
first = 0xffffffffU >> dst_idx;
last = ~(0xffffffffU >> ((dst_idx+width) % 32));
while (height--) {
c = src;
p = dst;
w = width;
if (dst_idx+width <= 32) {
/* Single destination word */
first &= last;
memset(d.pixels, 0, sizeof(d));
memcpy(d.pixels+dst_idx, c, width);
c += width;
c2p_32x8(d.words);
store_planar_masked(p, dst_nextplane, bpp, d.words,
first);
p += 4;
} else {
/* Multiple destination words */
w = width;
/* Leading bits */
if (dst_idx) {
w = 32 - dst_idx;
memset(d.pixels, 0, dst_idx);
memcpy(d.pixels+dst_idx, c, w);
c += w;
c2p_32x8(d.words);
store_planar_masked(p, dst_nextplane, bpp,
d.words, first);
p += 4;
w = width-w;
}
/* Main chunk */
while (w >= 32) {
memcpy(d.pixels, c, 32);
c += 32;
c2p_32x8(d.words);
store_planar(p, dst_nextplane, bpp, d.words);
p += 4;
w -= 32;
}
/* Trailing bits */
w %= 32;
if (w > 0) {
memcpy(d.pixels, c, w);
memset(d.pixels+w, 0, 32-w);
c2p_32x8(d.words);
store_planar_masked(p, dst_nextplane, bpp,
d.words, last);
}
}
src += src_nextline;
dst += dst_nextline;
}
}
EXPORT_SYMBOL_GPL(c2p_planar);
MODULE_LICENSE("GPL");
...@@ -78,13 +78,6 @@ ...@@ -78,13 +78,6 @@
#include <asm/fb.h> #include <asm/fb.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/system.h> #include <asm/system.h>
#ifdef CONFIG_ATARI
#include <asm/atariints.h>
#endif
#if defined(__mc68000__)
#include <asm/machdep.h>
#include <asm/setup.h>
#endif
#include "fbcon.h" #include "fbcon.h"
...@@ -155,9 +148,6 @@ static int fbcon_set_origin(struct vc_data *); ...@@ -155,9 +148,6 @@ static int fbcon_set_origin(struct vc_data *);
#define CURSOR_DRAW_DELAY (1) #define CURSOR_DRAW_DELAY (1)
/* # VBL ints between cursor state changes */
#define ATARI_CURSOR_BLINK_RATE (42)
static int vbl_cursor_cnt; static int vbl_cursor_cnt;
static int fbcon_cursor_noblink; static int fbcon_cursor_noblink;
...@@ -403,20 +393,6 @@ static void fb_flashcursor(struct work_struct *work) ...@@ -403,20 +393,6 @@ static void fb_flashcursor(struct work_struct *work)
release_console_sem(); release_console_sem();
} }
#ifdef CONFIG_ATARI
static int cursor_blink_rate;
static irqreturn_t fb_vbl_handler(int irq, void *dev_id)
{
struct fb_info *info = dev_id;
if (vbl_cursor_cnt && --vbl_cursor_cnt == 0) {
schedule_work(&info->queue);
vbl_cursor_cnt = cursor_blink_rate;
}
return IRQ_HANDLED;
}
#endif
static void cursor_timer_handler(unsigned long dev_addr) static void cursor_timer_handler(unsigned long dev_addr)
{ {
struct fb_info *info = (struct fb_info *) dev_addr; struct fb_info *info = (struct fb_info *) dev_addr;
...@@ -1017,15 +993,6 @@ static const char *fbcon_startup(void) ...@@ -1017,15 +993,6 @@ static const char *fbcon_startup(void)
info->var.yres, info->var.yres,
info->var.bits_per_pixel); info->var.bits_per_pixel);
#ifdef CONFIG_ATARI
if (MACH_IS_ATARI) {
cursor_blink_rate = ATARI_CURSOR_BLINK_RATE;
(void)request_irq(IRQ_AUTO_4, fb_vbl_handler,
IRQ_TYPE_PRIO, "framebuffer vbl",
info);
}
#endif /* CONFIG_ATARI */
fbcon_add_cursor_timer(info); fbcon_add_cursor_timer(info);
fbcon_has_exited = 0; fbcon_has_exited = 0;
return display_desc; return display_desc;
...@@ -3454,11 +3421,6 @@ static void fbcon_exit(void) ...@@ -3454,11 +3421,6 @@ static void fbcon_exit(void)
if (fbcon_has_exited) if (fbcon_has_exited)
return; return;
#ifdef CONFIG_ATARI
if (MACH_IS_ATARI)
free_irq(IRQ_AUTO_4, fb_vbl_handler);
#endif
kfree((void *)softback_buf); kfree((void *)softback_buf);
softback_buf = 0UL; softback_buf = 0UL;
......
devlist.h
gen-devlist
...@@ -77,17 +77,21 @@ static struct bin_attribute zorro_config_attr = { ...@@ -77,17 +77,21 @@ static struct bin_attribute zorro_config_attr = {
.read = zorro_read_config, .read = zorro_read_config,
}; };
void zorro_create_sysfs_dev_files(struct zorro_dev *z) int zorro_create_sysfs_dev_files(struct zorro_dev *z)
{ {
struct device *dev = &z->dev; struct device *dev = &z->dev;
int error;
/* current configuration's attributes */ /* current configuration's attributes */
device_create_file(dev, &dev_attr_id); if ((error = device_create_file(dev, &dev_attr_id)) ||
device_create_file(dev, &dev_attr_type); (error = device_create_file(dev, &dev_attr_type)) ||
device_create_file(dev, &dev_attr_serial); (error = device_create_file(dev, &dev_attr_serial)) ||
device_create_file(dev, &dev_attr_slotaddr); (error = device_create_file(dev, &dev_attr_slotaddr)) ||
device_create_file(dev, &dev_attr_slotsize); (error = device_create_file(dev, &dev_attr_slotsize)) ||
device_create_file(dev, &dev_attr_resource); (error = device_create_file(dev, &dev_attr_resource)) ||
sysfs_create_bin_file(&dev->kobj, &zorro_config_attr); (error = sysfs_create_bin_file(&dev->kobj, &zorro_config_attr)))
return error;
return 0;
} }
...@@ -130,6 +130,7 @@ static int __init zorro_init(void) ...@@ -130,6 +130,7 @@ static int __init zorro_init(void)
{ {
struct zorro_dev *z; struct zorro_dev *z;
unsigned int i; unsigned int i;
int error;
if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO)) if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(ZORRO))
return 0; return 0;
...@@ -140,7 +141,11 @@ static int __init zorro_init(void) ...@@ -140,7 +141,11 @@ static int __init zorro_init(void)
/* Initialize the Zorro bus */ /* Initialize the Zorro bus */
INIT_LIST_HEAD(&zorro_bus.devices); INIT_LIST_HEAD(&zorro_bus.devices);
strcpy(zorro_bus.dev.bus_id, "zorro"); strcpy(zorro_bus.dev.bus_id, "zorro");
device_register(&zorro_bus.dev); error = device_register(&zorro_bus.dev);
if (error) {
pr_err("Zorro: Error registering zorro_bus\n");
return error;
}
/* Request the resources */ /* Request the resources */
zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2; zorro_bus.num_resources = AMIGAHW_PRESENT(ZORRO3) ? 4 : 2;
...@@ -160,15 +165,19 @@ static int __init zorro_init(void) ...@@ -160,15 +165,19 @@ static int __init zorro_init(void)
zorro_name_device(z); zorro_name_device(z);
z->resource.name = z->name; z->resource.name = z->name;
if (request_resource(zorro_find_parent_resource(z), &z->resource)) if (request_resource(zorro_find_parent_resource(z), &z->resource))
printk(KERN_ERR "Zorro: Address space collision on device %s " pr_err("Zorro: Address space collision on device %s %pR\n",
"[%lx:%lx]\n", z->name, &z->resource);
z->name, (unsigned long)zorro_resource_start(z),
(unsigned long)zorro_resource_end(z));
sprintf(z->dev.bus_id, "%02x", i); sprintf(z->dev.bus_id, "%02x", i);
z->dev.parent = &zorro_bus.dev; z->dev.parent = &zorro_bus.dev;
z->dev.bus = &zorro_bus_type; z->dev.bus = &zorro_bus_type;
device_register(&z->dev); error = device_register(&z->dev);
zorro_create_sysfs_dev_files(z); if (error) {
pr_err("Zorro: Error registering device %s\n", z->name);
continue;
}
error = zorro_create_sysfs_dev_files(z);
if (error)
dev_err(&z->dev, "Error creating sysfs files\n");
} }
/* Mark all available Zorro II memory */ /* Mark all available Zorro II memory */
......
extern void zorro_name_device(struct zorro_dev *z); extern void zorro_name_device(struct zorro_dev *z);
extern void zorro_create_sysfs_dev_files(struct zorro_dev *z); extern int zorro_create_sysfs_dev_files(struct zorro_dev *z);
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* This file contains the system call numbers. * This file contains the system call numbers.
*/ */
#define __NR_restart_syscall 0
#define __NR_exit 1 #define __NR_exit 1
#define __NR_fork 2 #define __NR_fork 2
#define __NR_read 3 #define __NR_read 3
...@@ -359,9 +360,6 @@ ...@@ -359,9 +360,6 @@
#define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGACTION
/* whitelist for checksyscalls */
#define __IGNORE_restart_syscall
/* /*
* "Conditional" syscalls * "Conditional" syscalls
* *
......
...@@ -241,7 +241,7 @@ struct dio_driver { ...@@ -241,7 +241,7 @@ struct dio_driver {
extern int dio_find(int deviceid); extern int dio_find(int deviceid);
extern unsigned long dio_scodetophysaddr(int scode); extern unsigned long dio_scodetophysaddr(int scode);
extern void dio_create_sysfs_dev_files(struct dio_dev *); extern int dio_create_sysfs_dev_files(struct dio_dev *);
/* New-style probing */ /* New-style probing */
extern int dio_register_driver(struct dio_driver *); extern int dio_register_driver(struct dio_driver *);
......
...@@ -851,8 +851,9 @@ static int __init AtaIrqInit(void) ...@@ -851,8 +851,9 @@ static int __init AtaIrqInit(void)
mfp.tim_dt_a = 1; /* Cause interrupt after first event. */ mfp.tim_dt_a = 1; /* Cause interrupt after first event. */
mfp.tim_ct_a = 8; /* Turn on event counting. */ mfp.tim_ct_a = 8; /* Turn on event counting. */
/* Register interrupt handler. */ /* Register interrupt handler. */
request_irq(IRQ_MFP_TIMA, AtaInterrupt, IRQ_TYPE_SLOW, "DMA sound", if (request_irq(IRQ_MFP_TIMA, AtaInterrupt, IRQ_TYPE_SLOW, "DMA sound",
AtaInterrupt); AtaInterrupt))
return 0;
mfp.int_en_a |= 0x20; /* Turn interrupt on. */ mfp.int_en_a |= 0x20; /* Turn interrupt on. */
mfp.int_mk_a |= 0x20; mfp.int_mk_a |= 0x20;
return 1; return 1;
......
...@@ -371,8 +371,9 @@ static void Q40Free(void *ptr, unsigned int size) ...@@ -371,8 +371,9 @@ static void Q40Free(void *ptr, unsigned int size)
static int __init Q40IrqInit(void) static int __init Q40IrqInit(void)
{ {
/* Register interrupt handler. */ /* Register interrupt handler. */
request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0, if (request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0,
"DMA sound", Q40Interrupt); "DMA sound", Q40Interrupt))
return 0;
return(1); return(1);
} }
...@@ -401,6 +402,7 @@ static void Q40PlayNextFrame(int index) ...@@ -401,6 +402,7 @@ static void Q40PlayNextFrame(int index)
u_char *start; u_char *start;
u_long size; u_long size;
u_char speed; u_char speed;
int error;
/* used by Q40Play() if all doubts whether there really is something /* used by Q40Play() if all doubts whether there really is something
* to be played are already wiped out. * to be played are already wiped out.
...@@ -419,11 +421,13 @@ static void Q40PlayNextFrame(int index) ...@@ -419,11 +421,13 @@ static void Q40PlayNextFrame(int index)
master_outb( 0,SAMPLE_ENABLE_REG); master_outb( 0,SAMPLE_ENABLE_REG);
free_irq(Q40_IRQ_SAMPLE, Q40Interrupt); free_irq(Q40_IRQ_SAMPLE, Q40Interrupt);
if (dmasound.soft.stereo) if (dmasound.soft.stereo)
request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0, error = request_irq(Q40_IRQ_SAMPLE, Q40StereoInterrupt, 0,
"Q40 sound", Q40Interrupt); "Q40 sound", Q40Interrupt);
else else
request_irq(Q40_IRQ_SAMPLE, Q40MonoInterrupt, 0, error = request_irq(Q40_IRQ_SAMPLE, Q40MonoInterrupt, 0,
"Q40 sound", Q40Interrupt); "Q40 sound", Q40Interrupt);
if (error && printk_ratelimit())
pr_err("Couldn't register sound interrupt\n");
master_outb( speed, SAMPLE_RATE_REG); master_outb( speed, SAMPLE_RATE_REG);
master_outb( 1,SAMPLE_CLEAR_REG); master_outb( 1,SAMPLE_CLEAR_REG);
......
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