summaryrefslogtreecommitdiffstats
path: root/include/asm-m68k
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-m68k')
-rw-r--r--include/asm-m68k/amigahw.h1
-rw-r--r--include/asm-m68k/amigamouse.h26
-rw-r--r--include/asm-m68k/amihdreg.h31
-rw-r--r--include/asm-m68k/apollohw.h71
-rw-r--r--include/asm-m68k/atari_SCCserial.h4
-rw-r--r--include/asm-m68k/atari_rootsec.h34
-rw-r--r--include/asm-m68k/atari_stram.h17
-rw-r--r--include/asm-m68k/atarihdreg.h24
-rw-r--r--include/asm-m68k/atarihw.h49
-rw-r--r--include/asm-m68k/bitops.h96
-rw-r--r--include/asm-m68k/bootinfo.h138
-rw-r--r--include/asm-m68k/bugs.h4
-rw-r--r--include/asm-m68k/elf.h18
-rw-r--r--include/asm-m68k/entry.h13
-rw-r--r--include/asm-m68k/font.h35
-rw-r--r--include/asm-m68k/hardirq.h1
-rw-r--r--include/asm-m68k/ide.h103
-rw-r--r--include/asm-m68k/init.h19
-rw-r--r--include/asm-m68k/io.h29
-rw-r--r--include/asm-m68k/ioctls.h2
-rw-r--r--include/asm-m68k/keyboard.h11
-rw-r--r--include/asm-m68k/mac_asc.h27
-rw-r--r--include/asm-m68k/mac_mouse.h23
-rw-r--r--include/asm-m68k/machdep.h8
-rw-r--r--include/asm-m68k/machw.h108
-rw-r--r--include/asm-m68k/macintosh.h139
-rw-r--r--include/asm-m68k/macints.h160
-rw-r--r--include/asm-m68k/mvme16xhw.h118
-rw-r--r--include/asm-m68k/pgtable.h23
-rw-r--r--include/asm-m68k/processor.h22
-rw-r--r--include/asm-m68k/ptrace.h6
-rw-r--r--include/asm-m68k/segment.h30
-rw-r--r--include/asm-m68k/serial.h113
-rw-r--r--include/asm-m68k/setup.h68
-rw-r--r--include/asm-m68k/siginfo.h195
-rw-r--r--include/asm-m68k/signal.h135
-rw-r--r--include/asm-m68k/socket.h6
-rw-r--r--include/asm-m68k/softirq.h10
-rw-r--r--include/asm-m68k/system.h9
-rw-r--r--include/asm-m68k/types.h2
-rw-r--r--include/asm-m68k/ucontext.h32
-rw-r--r--include/asm-m68k/unistd.h18
42 files changed, 1577 insertions, 401 deletions
diff --git a/include/asm-m68k/amigahw.h b/include/asm-m68k/amigahw.h
index a7b6c8609..caaa8d0de 100644
--- a/include/asm-m68k/amigahw.h
+++ b/include/asm-m68k/amigahw.h
@@ -103,6 +103,7 @@ struct amiga_hw_present {
AMIGAHW_DECLARE(ALICE_PAL); /* PAL Alice (8374) */
AMIGAHW_DECLARE(ALICE_NTSC); /* NTSC Alice (8374) */
AMIGAHW_DECLARE(MAGIC_REKICK); /* A3000 Magic Hard Rekick */
+ AMIGAHW_DECLARE(PCMCIA); /* PCMCIA Slot */
AMIGAHW_DECLARE(ZORRO); /* Zorro AutoConfig */
AMIGAHW_DECLARE(ZORRO3); /* Zorro III */
};
diff --git a/include/asm-m68k/amigamouse.h b/include/asm-m68k/amigamouse.h
deleted file mode 100644
index 7f90cff41..000000000
--- a/include/asm-m68k/amigamouse.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef _ASMm68k_AMIGAMOUSE_H
-#define _ASMm68k_AMIGAMOUSE_H
-
-/*
- * linux/include/asm-m68k/amigamouse.h: header file for Amiga Mouse driver
- * by Michael Rausch
- */
-
-/*
-#define MSE_INT_OFF() outb(MSE_DISABLE_INTERRUPTS, MSE_CONTROL_PORT)
-#define MSE_INT_ON() outb(MSE_ENABLE_INTERRUPTS, MSE_CONTROL_PORT)
-*/
-
-struct mouse_status {
- unsigned char buttons;
- unsigned char latch_buttons;
- int dx;
- int dy;
- int present;
- int ready;
- int active;
- struct wait_queue *wait;
- struct fasync_struct *fasyncptr;
-};
-
-#endif
diff --git a/include/asm-m68k/amihdreg.h b/include/asm-m68k/amihdreg.h
deleted file mode 100644
index 8e5a0d34d..000000000
--- a/include/asm-m68k/amihdreg.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef _LINUX_AMIHDREG_H
-#define _LINUX_AMIHDREG_H
-
-/*
- * This file contains some defines for the Amiga IDE hd controller.
- * Various sources. Check out some definitions (see comments with
- * a ques).
- */
-
-#define IDE_DISABLE_IRQ 0x02
-#define IDE_ENABLE_IRQ 0x00
-
-/* Bases of the hard drive controller */
-#define HD_BASE_A4000 0xdd2020
-#define HD_BASE_A1200 0xda0000
-
-/* Offsets from one of the above bases */
-#define AMI_HD_ERROR (0x06) /* see err-bits */
-#define AMI_HD_NSECTOR (0x0a) /* nr of sectors to read/write */
-#define AMI_HD_SECTOR (0x0e) /* starting sector */
-#define AMI_HD_LCYL (0x12) /* starting cylinder */
-#define AMI_HD_HCYL (0x16) /* high byte of starting cyl */
-#define AMI_HD_SELECT (0x1a) /* 101dhhhh , d=drive, hhhh=head */
-#define AMI_HD_STATUS (0x1e) /* see status-bits */
-#define AMI_HD_CMD (0x101a)
-
-/* These are at different offsets from the base */
-#define HD_A4000_IRQ (0xdd3020) /* MSB = 1, Harddisk is source of interrupt */
-#define HD_A1200_IRQ (0xda9000) /* MSB = 1, Harddisk is source of interrupt */
-
-#endif
diff --git a/include/asm-m68k/apollohw.h b/include/asm-m68k/apollohw.h
new file mode 100644
index 000000000..54177aa3d
--- /dev/null
+++ b/include/asm-m68k/apollohw.h
@@ -0,0 +1,71 @@
+/* apollohw.h : some structures to access apollo HW */
+
+#ifndef _ASMm68k_APOLLOHW_H_
+#define _ASMm68k_APOLLOHW_H_
+
+
+/*
+ see scn2681 data sheet for more info.
+ member names are read_write.
+*/
+
+#define DECLARE_2681_FIELD(x) unsigned char x; unsigned char dummy##x
+
+struct SCN2681 {
+
+ DECLARE_2681_FIELD(mra);
+ DECLARE_2681_FIELD(sra_csra);
+ DECLARE_2681_FIELD(BRGtest_cra);
+ DECLARE_2681_FIELD(rhra_thra);
+ DECLARE_2681_FIELD(ipcr_acr);
+ DECLARE_2681_FIELD(isr_imr);
+ DECLARE_2681_FIELD(ctu_ctur);
+ DECLARE_2681_FIELD(ctl_ctlr);
+ DECLARE_2681_FIELD(mrb);
+ DECLARE_2681_FIELD(srb_csrb);
+ DECLARE_2681_FIELD(tst_crb);
+ DECLARE_2681_FIELD(rhrb_thrb);
+ DECLARE_2681_FIELD(reserved);
+ DECLARE_2681_FIELD(ip_opcr);
+ DECLARE_2681_FIELD(startCnt_setOutBit);
+ DECLARE_2681_FIELD(stopCnt_resetOutBit);
+
+};
+
+#if 0
+struct mc146818 {
+
+ unsigned int second1:4, second2:4, alarm_second1:4, alarm_second2:4,
+ minute1:4, minute2:4, alarm_minute1:4, alarm_minute2:4;
+ unsigned int hours1:4, hours2:4, alarm_hours1:4, alarm_hours2:4,
+ day_of_week1:4, day_of_week2:4, day_of_month1:4, day_of_month2:4;
+ unsigned int month1:4, month2:4, year1:4, year2:4, :16;
+
+};
+#endif
+
+struct mc146818 {
+ unsigned char second, alarm_second;
+ unsigned char minute, alarm_minute;
+ unsigned char hours, alarm_hours;
+ unsigned char day_of_week, day_of_month;
+ unsigned char month, year;
+};
+
+#define IO_BASE 0x80000000
+
+#define SIO01_PHYSADDR 0x10400
+#define SIO23_PHYSADDR 0x10500
+#define RTC_PHYSADDR 0x10900
+#define PICA 0x11000
+#define PICB 0x11100
+#define sio01 ((*(volatile struct SCN2681 *)(IO_BASE + SIO01_PHYSADDR)))
+#define sio23 ((*(volatile struct SCN2681 *)(IO_BASE + SIO01_PHYSADDR)))
+#define rtc (((volatile struct mc146818 *)(IO_BASE + RTC_PHYSADDR)))
+
+#define inb(addr) (*((volatile unsigned char *)(addr)))
+#define outb(val,addr) (*((volatile unsigned char *)(addr)) = (val))
+#define inw(addr) (*((volatile unsigned short *)(addr)))
+#define outw(val,addr) (*((volatile unsigned short *)(addr)) = (val))
+
+#endif
diff --git a/include/asm-m68k/atari_SCCserial.h b/include/asm-m68k/atari_SCCserial.h
index fc08d4009..0ab7c15d0 100644
--- a/include/asm-m68k/atari_SCCserial.h
+++ b/include/asm-m68k/atari_SCCserial.h
@@ -28,6 +28,10 @@
#define SCC_BAUD_BASE_NONE 0 /* for not connected or unused
* clock sources */
+#define SCC_BAUD_BASE_MVME_PCLK 781250 /* 12.5 MHz */
+#define SCC_BAUD_BASE_BVM 460800 /* 7.3728 MHz */
+#define SCC_BAUD_BASE_MVME 625000 /* 10.000 MHz */
+
/* The SCC configuration structure */
struct atari_SCCserial {
diff --git a/include/asm-m68k/atari_rootsec.h b/include/asm-m68k/atari_rootsec.h
deleted file mode 100644
index 2e6390f1d..000000000
--- a/include/asm-m68k/atari_rootsec.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#ifndef _LINUX_ATARI_ROOTSEC_H
-#define _LINUX_ATARI_ROOTSEC_H
-
-/*
- * linux/include/linux/atari_rootsec.h
- * definitions for Atari Rootsector layout
- * by Andreas Schwab (schwab@ls5.informatik.uni-dortmund.de)
- *
- * modified for ICD/Supra partitioning scheme restricted to at most 12
- * partitions
- * by Guenther Kelleter (guenther@pool.informatik.rwth-aachen.de)
- */
-
-struct partition_info
-{
- u_char flg; /* bit 0: active; bit 7: bootable */
- char id[3]; /* "GEM", "BGM", "XGM", or other */
- u_long st; /* start of partition */
- u_long siz; /* length of partition */
-};
-
-struct rootsector
-{
- char unused[0x156]; /* room for boot code */
- struct partition_info icdpart[8]; /* info for ICD-partitions 5..12 */
- char unused2[0xc];
- u_long hd_siz; /* size of disk in blocks */
- struct partition_info part[4];
- u_long bsl_st; /* start of bad sector list */
- u_long bsl_cnt; /* length of bad sector list */
- u_short checksum; /* checksum for bootable disks */
-} __attribute__((__packed__));
-
-#endif /* _LINUX_ATARI_ROOTSEC_H */
diff --git a/include/asm-m68k/atari_stram.h b/include/asm-m68k/atari_stram.h
new file mode 100644
index 000000000..31d620b67
--- /dev/null
+++ b/include/asm-m68k/atari_stram.h
@@ -0,0 +1,17 @@
+#ifndef _M68K_ATARI_STRAM_H
+#define _M68K_ATARI_STRAM_H
+
+/*
+ * Functions for Atari ST-RAM management
+ */
+
+/* public interface */
+void *atari_stram_alloc( long size, unsigned long *start_mem,
+ const char *owner );
+void atari_stram_free( void *);
+
+/* functions called internally by other parts of the kernel */
+void atari_stram_init( void);
+void atari_stram_reserve_pages( unsigned long start_mem );
+
+#endif /*_M68K_ATARI_STRAM_H */
diff --git a/include/asm-m68k/atarihdreg.h b/include/asm-m68k/atarihdreg.h
deleted file mode 100644
index bf0846001..000000000
--- a/include/asm-m68k/atarihdreg.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifndef _LINUX_ATAHDREG_H
-#define _LINUX_ATAHDREG_H
-
-/*
- * This file contains some defines for the Falcon IDE hd controller.
- * Various sources. Check out some definitions (see comments with
- * a ques).
- */
-
-#define ATA_HD_BASE 0xfff00000
-
-#define ATA_HD_DATA 0x00 /* _CTL when writing */
-#define ATA_HD_ERROR 0x05 /* see err-bits */
-#define ATA_HD_NSECTOR 0x09 /* nr of sectors to read/write */
-#define ATA_HD_SECTOR 0x0d /* starting sector */
-#define ATA_HD_LCYL 0x11 /* starting cylinder */
-#define ATA_HD_HCYL 0x15 /* high byte of starting cyl */
-#define ATA_HD_CURRENT 0x19 /* 101dhhhh , d=drive, hhhh=head */
-#define ATA_HD_STATUS 0x1d /* see status-bits */
-
-#define ATA_HD_CMD 0x39
-#define ATA_HD_ALTSTATUS 0x39 /* same as HD_STATUS but doesn't clear irq */
-
-#endif /* _LINUX_ATAHDREG_H */
diff --git a/include/asm-m68k/atarihw.h b/include/asm-m68k/atarihw.h
index 5b137e769..8937fc2d1 100644
--- a/include/asm-m68k/atarihw.h
+++ b/include/asm-m68k/atarihw.h
@@ -21,15 +21,38 @@
#define _LINUX_ATARIHW_H_
#include <linux/types.h>
+#include <asm/bootinfo.h>
extern u_long atari_mch_cookie;
-
-/* mch_cookie values (upper word) */
-#define ATARI_MCH_ST 0
-#define ATARI_MCH_STE 1
-#define ATARI_MCH_TT 2
-#define ATARI_MCH_FALCON 3
-
+extern u_long atari_mch_type;
+extern u_long atari_switches;
+extern int atari_rtc_year_offset;
+extern int atari_dont_touch_floppy_select;
+
+/* convenience macros for testing machine type */
+#define MACH_IS_ST ((atari_mch_cookie >> 16) == ATARI_MCH_ST)
+#define MACH_IS_STE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \
+ (atari_mch_cookie & 0xffff) == 0)
+#define MACH_IS_MSTE ((atari_mch_cookie >> 16) == ATARI_MCH_STE && \
+ (atari_mch_cookie & 0xffff) == 0x10)
+#define MACH_IS_TT ((atari_mch_cookie >> 16) == ATARI_MCH_TT)
+#define MACH_IS_FALCON ((atari_mch_cookie >> 16) == ATARI_MCH_FALCON)
+#define MACH_IS_MEDUSA (atari_mch_type == ATARI_MACH_MEDUSA)
+#define MACH_IS_HADES (atari_mch_type == ATARI_MACH_HADES)
+#define MACH_IS_AB40 (atari_mch_type == ATARI_MACH_AB40)
+
+/* values for atari_switches */
+#define ATARI_SWITCH_IKBD 0x01
+#define ATARI_SWITCH_MIDI 0x02
+#define ATARI_SWITCH_SND6 0x04
+#define ATARI_SWITCH_SND7 0x08
+#define ATARI_SWITCH_OVSC_SHIFT 16
+#define ATARI_SWITCH_OVSC_IKBD (ATARI_SWITCH_IKBD << ATARI_SWITCH_OVSC_SHIFT)
+#define ATARI_SWITCH_OVSC_MIDI (ATARI_SWITCH_MIDI << ATARI_SWITCH_OVSC_SHIFT)
+#define ATARI_SWITCH_OVSC_SND6 (ATARI_SWITCH_SND6 << ATARI_SWITCH_OVSC_SHIFT)
+#define ATARI_SWITCH_OVSC_SND7 (ATARI_SWITCH_SND7 << ATARI_SWITCH_OVSC_SHIFT)
+#define ATARI_SWITCH_OVSC_MASK 0xffff0000
+
/*
* Define several Hardware-Chips for indication so that for the ATARI we do
* no longer decide whether it is a Falcon or other machine . It's just
@@ -92,14 +115,6 @@ extern struct atari_hw_present atari_hw_present;
#define MFPDELAY() \
__asm__ __volatile__ ( "tstb %0" : : "m" (mfp.par_dt_reg) : "cc" );
-/* Memory used for screen ram and stdma buffers */
-void atari_stram_init (void);
-void *atari_stram_alloc (long size, unsigned long *start_mem );
-void atari_stram_free (void *);
-
-extern int is_medusa;
-extern int is_hades;
-
/* Do cache push/invalidate for DMA read/write. This function obeys the
* snooping on some machines (Medusa) and processors: The Medusa itself can
* snoop, but only the '040 can source data from its cache to DMA writes i.e.,
@@ -116,11 +131,11 @@ static inline void dma_cache_maintenance( unsigned long paddr,
{
if (writeflag) {
- if (!is_medusa || CPU_IS_060)
+ if (!MACH_IS_MEDUSA || CPU_IS_060)
cache_push( paddr, len );
}
else {
- if (!is_medusa)
+ if (!MACH_IS_MEDUSA)
cache_clear( paddr, len );
}
}
diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h
index c43c1ed2e..b2a335a7d 100644
--- a/include/asm-m68k/bitops.h
+++ b/include/asm-m68k/bitops.h
@@ -14,7 +14,23 @@
* They use the standard big-endian m680x0 bit ordering.
*/
-extern __inline__ int test_and_set_bit(int nr,void * vaddr)
+#define test_and_set_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_test_and_set_bit(nr, vaddr) : \
+ __generic_test_and_set_bit(nr, vaddr))
+
+extern __inline__ int __constant_test_and_set_bit(int nr,void * vaddr)
+{
+ char retval;
+
+ __asm__ __volatile__ ("bset %1,%2; sne %0"
+ : "=d" (retval)
+ : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+
+ return retval;
+}
+
+extern __inline__ int __generic_test_and_set_bit(int nr,void * vaddr)
{
char retval;
@@ -24,13 +40,40 @@ extern __inline__ int test_and_set_bit(int nr,void * vaddr)
return retval;
}
-extern __inline__ void set_bit(int nr, void * vaddr)
+#define set_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_set_bit(nr, vaddr) : \
+ __generic_set_bit(nr, vaddr))
+
+extern __inline__ void __constant_set_bit(int nr, void * vaddr)
+{
+ __asm__ __volatile__ ("bset %0,%1"
+ : : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+}
+
+extern __inline__ void __generic_set_bit(int nr, void * vaddr)
{
__asm__ __volatile__ ("bfset %1@{%0:#1}"
: : "d" (nr^31), "a" (vaddr));
}
-extern __inline__ int test_and_clear_bit(int nr, void * vaddr)
+#define test_and_clear_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_test_and_clear_bit(nr, vaddr) : \
+ __generic_test_and_clear_bit(nr, vaddr))
+
+extern __inline__ int __constant_test_and_clear_bit(int nr, void * vaddr)
+{
+ char retval;
+
+ __asm__ __volatile__ ("bclr %1,%2; sne %0"
+ : "=d" (retval)
+ : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+
+ return retval;
+}
+
+extern __inline__ int __generic_test_and_clear_bit(int nr, void * vaddr)
{
char retval;
@@ -40,13 +83,40 @@ extern __inline__ int test_and_clear_bit(int nr, void * vaddr)
return retval;
}
-extern __inline__ void clear_bit(int nr, void * vaddr)
+#define clear_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_clear_bit(nr, vaddr) : \
+ __generic_clear_bit(nr, vaddr))
+
+extern __inline__ void __constant_clear_bit(int nr, void * vaddr)
+{
+ __asm__ __volatile__ ("bclr %0,%1"
+ : : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+}
+
+extern __inline__ void __generic_clear_bit(int nr, void * vaddr)
{
__asm__ __volatile__ ("bfclr %1@{%0:#1}"
: : "d" (nr^31), "a" (vaddr));
}
-extern __inline__ int test_and_change_bit(int nr, void * vaddr)
+#define test_and_change_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_test_and_change_bit(nr, vaddr) : \
+ __generic_test_and_change_bit(nr, vaddr))
+
+extern __inline__ int __constant_test_and_change_bit(int nr, void * vaddr)
+{
+ char retval;
+
+ __asm__ __volatile__ ("bchg %1,%2; sne %0"
+ : "=d" (retval)
+ : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+
+ return retval;
+}
+
+extern __inline__ int __generic_test_and_change_bit(int nr, void * vaddr)
{
char retval;
@@ -56,7 +126,18 @@ extern __inline__ int test_and_change_bit(int nr, void * vaddr)
return retval;
}
-extern __inline__ void change_bit(int nr, void * vaddr)
+#define change_bit(nr,vaddr) \
+ (__builtin_constant_p(nr) ? \
+ __constant_change_bit(nr, vaddr) : \
+ __generic_change_bit(nr, vaddr))
+
+extern __inline__ void __constant_change_bit(int nr, void * vaddr)
+{
+ __asm__ __volatile__ ("bchg %0,%1"
+ : : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+}
+
+extern __inline__ void __generic_change_bit(int nr, void * vaddr)
{
__asm__ __volatile__ ("bfchg %1@{%0:#1}"
: : "d" (nr^31), "a" (vaddr));
@@ -257,7 +338,4 @@ ext2_find_next_zero_bit (const void *vaddr, unsigned size, unsigned offset)
return (p - addr) * 32 + res;
}
-
-/* Byte swapping (swab16 and swab32) is now in asm/byteorder.h . */
-
#endif /* _M68K_BITOPS_H */
diff --git a/include/asm-m68k/bootinfo.h b/include/asm-m68k/bootinfo.h
index 5c1f215a9..279f82a16 100644
--- a/include/asm-m68k/bootinfo.h
+++ b/include/asm-m68k/bootinfo.h
@@ -93,7 +93,73 @@ BIR_data = BIR_size+2
*/
#define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */
+#define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (u_long) */
+ /* (values are ATARI_MACH_* defines */
+/* mch_cookie values (upper word) */
+#define ATARI_MCH_ST 0
+#define ATARI_MCH_STE 1
+#define ATARI_MCH_TT 2
+#define ATARI_MCH_FALCON 3
+
+/* mch_type values */
+#define ATARI_MACH_NORMAL 0 /* no special machine type */
+#define ATARI_MACH_MEDUSA 1 /* Medusa 040 */
+#define ATARI_MACH_HADES 2 /* Hades 040 or 060 */
+#define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */
+
+ /*
+ * Macintosh-specific tags
+ */
+
+#define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */
+#define BI_MAC_VADDR 0x8001 /* Mac video base address */
+#define BI_MAC_VDEPTH 0x8002 /* Mac video depth */
+#define BI_MAC_VROW 0x8003 /* Mac video rowbytes */
+#define BI_MAC_VDIM 0x8004 /* Mac video dimensions */
+#define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */
+#define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */
+#define BI_MAC_BTIME 0x8007 /* Mac boot time */
+#define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */
+#define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */
+#define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */
+
+ /*
+ * Mac: compatibility with old booter data format (temporarily)
+ */
+
+#ifndef __ASSEMBLY__
+
+struct mac_booter_data
+{
+ unsigned long videoaddr;
+ unsigned long videorow;
+ unsigned long videodepth;
+ unsigned long dimensions;
+ unsigned long args;
+ unsigned long boottime;
+ unsigned long gmtbias;
+ unsigned long bootver;
+ unsigned long videological;
+ unsigned long sccbase;
+ unsigned long id;
+ unsigned long memsize;
+ unsigned long serialmf;
+ unsigned long serialhsk;
+ unsigned long serialgpi;
+ unsigned long printmf;
+ unsigned long printhsk;
+ unsigned long printgpi;
+ unsigned long cpuid;
+ unsigned long rombase;
+ unsigned long adbdelay;
+ unsigned long timedbra;
+};
+
+extern struct mac_booter_data
+ mac_bi_data;
+
+#endif
/*
* Stuff for bootinfo interface versioning
@@ -129,7 +195,9 @@ struct bootversion {
#endif /* __ASSEMBLY__ */
#define AMIGA_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
-#define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
+#define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 1 )
+#define MAC_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
+#define MVME16x_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
#ifdef BOOTINFO_COMPAT_1_0
@@ -140,6 +208,7 @@ struct bootversion {
#define COMPAT_AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
#define COMPAT_ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
+#define COMPAT_MAC_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
#include <linux/zorro.h>
@@ -162,6 +231,67 @@ struct compat_bi_Atari {
unsigned long mch_cookie;
};
+#ifndef __ASSEMBLY__
+
+#define MACHW_DECLARE(name) unsigned name : 1
+#define MACHW_SET(name) (boot_info.bi_mac.hw_present.name = 1)
+#define MACHW_PRESENT(name) (boot_info.bi_mac.hw_present.name)
+
+struct compat_bi_Macintosh
+{
+ unsigned long videoaddr;
+ unsigned long videorow;
+ unsigned long videodepth;
+ unsigned long dimensions;
+ unsigned long args;
+ unsigned long boottime;
+ unsigned long gmtbias;
+ unsigned long bootver;
+ unsigned long videological;
+ unsigned long sccbase;
+ unsigned long id;
+ unsigned long memsize;
+ unsigned long serialmf;
+ unsigned long serialhsk;
+ unsigned long serialgpi;
+ unsigned long printmf;
+ unsigned long printhsk;
+ unsigned long printgpi;
+ unsigned long cpuid;
+ unsigned long rombase;
+ unsigned long adbdelay;
+ unsigned long timedbra;
+ struct {
+ /* video hardware */
+ /* sound hardware */
+ /* disk storage interfaces */
+ MACHW_DECLARE(MAC_SCSI); /* Directly mapped NCR5380 */
+ MACHW_DECLARE(IDE); /* IDE Interface */
+ /* other I/O hardware */
+ MACHW_DECLARE(SCC); /* Serial Communications Contr. */
+ /* DMA */
+ MACHW_DECLARE(SCSI_DMA); /* DMA for the NCR5380 */
+ /* real time clocks */
+ MACHW_DECLARE(RTC_CLK); /* clock chip */
+ /* supporting hardware */
+ MACHW_DECLARE(VIA1); /* Versatile Interface Ad. 1 */
+ MACHW_DECLARE(VIA2); /* Versatile Interface Ad. 2 */
+ MACHW_DECLARE(RBV); /* Versatile Interface Ad. 2+ */
+ /* NUBUS */
+ MACHW_DECLARE(NUBUS); /* NUBUS */
+ } hw_present;
+};
+#else
+
+#define BI_videoaddr BI_un
+#define BI_videorow BI_videoaddr+4
+#define BI_videodepth BI_videorow+4
+#define BI_dimensions BI_videodepth+4
+#define BI_args BI_dimensions+4
+#define BI_cpuid BI_args+56
+
+#endif
+
struct compat_mem_info {
unsigned long addr;
unsigned long size;
@@ -200,13 +330,15 @@ struct compat_bootinfo {
unsigned long ramdisk_addr;
char command_line[COMPAT_CL_SIZE];
union {
- struct compat_bi_Amiga bi_ami;
- struct compat_bi_Atari bi_ata;
+ struct compat_bi_Amiga bi_ami;
+ struct compat_bi_Atari bi_ata;
+ struct compat_bi_Macintosh bi_mac;
} bi_un;
};
#define bi_amiga bi_un.bi_ami
#define bi_atari bi_un.bi_ata
+#define bi_mac bi_un.bi_mac
#endif /* BOOTINFO_COMPAT_1_0 */
diff --git a/include/asm-m68k/bugs.h b/include/asm-m68k/bugs.h
index 5f382dac3..d01935592 100644
--- a/include/asm-m68k/bugs.h
+++ b/include/asm-m68k/bugs.h
@@ -11,6 +11,4 @@
* void check_bugs(void);
*/
-static void check_bugs(void)
-{
-}
+extern void check_bugs(void); /* in arch/m68k/kernel/setup.c */
diff --git a/include/asm-m68k/elf.h b/include/asm-m68k/elf.h
index 0925126ad..70a0c8087 100644
--- a/include/asm-m68k/elf.h
+++ b/include/asm-m68k/elf.h
@@ -40,7 +40,7 @@ typedef struct user_m68kfp_struct elf_fpregset_t;
the loader. We need to make sure that it is out of the way of the program
that it will "exec", and that there is sufficient room for the brk. */
-#define ELF_ET_DYN_BASE (2 * TASK_SIZE / 3)
+#define ELF_ET_DYN_BASE 0xD0000000UL
#define ELF_CORE_COPY_REGS(pr_reg, regs) \
/* Bleech. */ \
@@ -68,4 +68,20 @@ typedef struct user_m68kfp_struct elf_fpregset_t;
pr_reg[13] = sw->a6; \
}
+/* This yields a mask that user programs can use to figure out what
+ instruction set this cpu supports. */
+
+#define ELF_HWCAP (0)
+
+/* This yields a string that ld.so will use to load implementation
+ specific libraries for optimization. This is more specific in
+ intent than poking at uname or /proc/cpuinfo. */
+
+#define ELF_PLATFORM (NULL)
+
+#ifdef __KERNEL__
+#define SET_PERSONALITY(ex, ibcs2) \
+ current->personality = (ibcs2 ? PER_SVR4 : PER_LINUX)
+#endif
+
#endif
diff --git a/include/asm-m68k/entry.h b/include/asm-m68k/entry.h
index 6f907936a..2c3182696 100644
--- a/include/asm-m68k/entry.h
+++ b/include/asm-m68k/entry.h
@@ -40,12 +40,11 @@
/*
* these are offsets into the task-struct
*/
-LTASK_STATE = 0
-LTASK_COUNTER = 4
-LTASK_PRIORITY = 8
-LTASK_SIGNAL = 12
-LTASK_BLOCKED = 16
-LTASK_FLAGS = 20
+LTASK_STATE = 0
+LTASK_FLAGS = 4
+LTASK_SIGPENDING = 8
+LTASK_ADDRLIMIT = 12
+LTASK_EXECDOMAIN = 16
LTSS_KSP = 0
LTSS_USP = 4
@@ -55,7 +54,7 @@ LTSS_CRP = 12
LTSS_FPCTXT = 24
/* the following macro is used when enabling interrupts */
-#if defined(MACH_ATARI_ONLY)
+#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES)
/* block out HSYNC on the atari */
#define ALLOWINT 0xfbff
#define MAX_NOINT_IPL 3
diff --git a/include/asm-m68k/font.h b/include/asm-m68k/font.h
deleted file mode 100644
index 926e7194c..000000000
--- a/include/asm-m68k/font.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * asm-m68k/font.h -- `Soft' font definitions
- *
- * Created 1995 by 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.
- */
-
-#ifndef _ASM_M68K_FONT_H_
-#define _ASM_M68K_FONT_H_
-
-#include <linux/types.h>
-
-
- /*
- * Find a font with a specific name
- */
-
-extern int findsoftfont(char *name, int *width, int *height, u_char *data[]);
-
-
- /*
- * Get the default font for a specific screen size
- */
-
-extern void getdefaultfont(int xres, int yres, char *name[], int *width,
- int *height, u_char *data[]);
-
-
-/* Max. length for the name of a predefined font */
-#define MAX_FONT_NAME 32
-
-#endif /* _ASM_M68K_FONT_H_ */
diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h
index ab3ca802e..76968803b 100644
--- a/include/asm-m68k/hardirq.h
+++ b/include/asm-m68k/hardirq.h
@@ -4,7 +4,6 @@
#include <linux/tasks.h>
extern unsigned int local_irq_count[NR_CPUS];
-#define in_interrupt() (local_irq_count[smp_processor_id()] != 0)
#define hardirq_trylock(cpu) (++local_irq_count[cpu], (cpu) == 0)
#define hardirq_endlock(cpu) (--local_irq_count[cpu])
diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h
index 2567392cd..bf155740f 100644
--- a/include/asm-m68k/ide.h
+++ b/include/asm-m68k/ide.h
@@ -33,28 +33,18 @@
#include <linux/config.h>
-#ifdef CONFIG_AMIGA
-#include <asm/amigahw.h>
-#include <asm/amihdreg.h>
-#include <asm/amigaints.h>
-#endif /* CONFIG_AMIGA */
-
-#ifdef CONFIG_ATARI
-#include <linux/interrupt.h> /* intr_count */
-#include <asm/atarihw.h>
-#include <asm/atarihdreg.h>
-#include <asm/atariints.h>
-#include <asm/atari_stdma.h>
-#endif /* CONFIG_ATARI */
-
#include <asm/setup.h>
#include <asm/io.h>
#include <asm/irq.h>
+#ifdef CONFIG_ATARI
+#include <asm/atari_stdma.h>
+#endif
+
typedef unsigned char * ide_ioreg_t;
#ifndef MAX_HWIFS
-#define MAX_HWIFS 1
+#define MAX_HWIFS 4 /* same as the other archs */
#endif
static __inline int ide_default_irq (ide_ioreg_t base)
@@ -62,68 +52,12 @@ static __inline int ide_default_irq (ide_ioreg_t base)
return 0;
}
-static __inline__ ide_ioreg_t ide_default_io_base (int index)
-{
- if (index)
- return NULL;
-#ifdef CONFIG_AMIGA
- if (MACH_IS_AMIGA) {
- if (AMIGAHW_PRESENT(A4000_IDE)) {
- printk("Gayle IDE interface (A%d style)\n", 4000);
- return ((ide_ioreg_t)ZTWO_VADDR(HD_BASE_A4000));
- }
- if (AMIGAHW_PRESENT(A1200_IDE)) {
- printk("Gayle IDE interface (A%d style)\n", 1200);
- return ((ide_ioreg_t)ZTWO_VADDR(HD_BASE_A1200));
- }
- }
-#endif /* CONFIG_AMIGA */
-#ifdef CONFIG_ATARI
- if (MACH_IS_ATARI) {
- if (ATARIHW_PRESENT(IDE)) {
- printk("Falcon IDE interface\n");
- return ((ide_ioreg_t) ATA_HD_BASE);
- }
- }
-#endif /* CONFIG_ATARI */
- return NULL;
-}
-
+/*
+ * Can we do this in a generic manner??
+ */
static __inline__ void ide_init_hwif_ports (ide_ioreg_t *p, ide_ioreg_t base, int *irq)
{
- *p++ = base;
-#ifdef CONFIG_AMIGA
- if (MACH_IS_AMIGA) {
- *p++ = base + AMI_HD_ERROR;
- *p++ = base + AMI_HD_NSECTOR;
- *p++ = base + AMI_HD_SECTOR;
- *p++ = base + AMI_HD_LCYL;
- *p++ = base + AMI_HD_HCYL;
- *p++ = base + AMI_HD_SELECT;
- *p++ = base + AMI_HD_STATUS;
- *p++ = base + AMI_HD_CMD;
- if (AMIGAHW_PRESENT(A4000_IDE))
- *p++ = (ide_ioreg_t) ZTWO_VADDR(HD_A4000_IRQ);
- else if (AMIGAHW_PRESENT(A1200_IDE))
- *p++ = (ide_ioreg_t) ZTWO_VADDR(HD_A1200_IRQ);
- if (irq != NULL)
- *irq = IRQ_AMIGA_PORTS;
- }
-#endif /* CONFIG_AMIGA */
-#ifdef CONFIG_ATARI
- if (MACH_IS_ATARI) {
- *p++ = base + ATA_HD_ERROR;
- *p++ = base + ATA_HD_NSECTOR;
- *p++ = base + ATA_HD_SECTOR;
- *p++ = base + ATA_HD_LCYL;
- *p++ = base + ATA_HD_HCYL;
- *p++ = base + ATA_HD_CURRENT;
- *p++ = base + ATA_HD_STATUS;
- *p++ = base + ATA_HD_CMD;
- if (irq != NULL)
- *irq = IRQ_MFP_IDE;
- }
-#endif /* CONFIG_ATARI */
+ printk("ide_init_hwif_ports: must not be called\n");
}
typedef union {
@@ -363,23 +297,6 @@ static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent
#endif /* CONFIG_ATARI */
-static __inline__ int ide_ack_intr (ide_ioreg_t status_port, ide_ioreg_t irq_port)
-{
-#ifdef CONFIG_AMIGA
- if (MACH_IS_AMIGA) {
- unsigned char ch;
- ch = inb(irq_port);
- if (!(ch & 0x80))
- return(0);
- if (AMIGAHW_PRESENT(A1200_IDE)) {
- (void) inb(status_port);
- outb(0x7c | (ch & 0x03), irq_port);
- }
- }
-#endif /* CONFIG_AMIGA */
- return(1);
-}
-
#define T_CHAR (0x0000) /* char: don't touch */
#define T_SHORT (0x4000) /* short: 12 -> 21 */
#define T_INT (0x8000) /* int: 1234 -> 4321 */
@@ -489,6 +406,8 @@ static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *,
#endif /* CONFIG_ATARI */
}
+#define ide_ack_intr(hwif) (hwif)->ack_intr((hwif))
+
/*
* On the Atari, we sometimes can't enable interrupts:
*/
diff --git a/include/asm-m68k/init.h b/include/asm-m68k/init.h
index 93a323fd6..9d366561a 100644
--- a/include/asm-m68k/init.h
+++ b/include/asm-m68k/init.h
@@ -1,6 +1,10 @@
#ifndef _M68K_INIT_H
#define _M68K_INIT_H
+#include <linux/config.h>
+
+#ifndef CONFIG_KGDB
+
#define __init __attribute__ ((__section__ (".text.init")))
#define __initdata __attribute__ ((__section__ (".data.init")))
#define __initfunc(__arginit) \
@@ -11,4 +15,19 @@
#define __FINIT .previous
#define __INITDATA .section ".data.init",#alloc,#write
+#else
+
+/* gdb doesn't like it all if the code for one source file isn't together in
+ * the executable, so we must avoid the .init sections :-( */
+
+#define __init
+#define __initdata
+#define __initfunc(__arginit) __arginit
+/* For assembly routines */
+#define __INIT
+#define __FINIT
+#define __INITDATA
+
+#endif /* CONFIG_KGDB */
+
#endif
diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h
index a9d65f743..8cee601e6 100644
--- a/include/asm-m68k/io.h
+++ b/include/asm-m68k/io.h
@@ -3,15 +3,30 @@
#ifdef __KERNEL__
+#include <linux/config.h> /* CONFIG_ATARI, CONFIG_HADES */
+#include <asm/byteorder.h>
+
+#ifdef CONFIG_ATARI
+#include <asm/atarihw.h>
+
+#define SLOW_DOWN_IO do { if (MACH_IS_ATARI) MFPDELAY(); } while (0)
+#endif
+
/*
* readX/writeX() are used to access memory mapped devices. On some
* architectures the memory mapped IO stuff needs to be accessed
* differently. On the m68k architecture, we just read/write the
* memory location directly.
*/
-#define readb(addr) (*(volatile unsigned char *) (addr))
-#define readw(addr) (*(volatile unsigned short *) (addr))
-#define readl(addr) (*(volatile unsigned int *) (addr))
+/* ++roman: The assignments to temp. vars avoid that gcc sometimes generates
+ * two accesses to memory, which may be undesireable for some devices.
+ */
+#define readb(addr) \
+ ({ unsigned char __v = (*(volatile unsigned char *) (addr)); __v; })
+#define readw(addr) \
+ ({ unsigned short __v = (*(volatile unsigned short *) (addr)); __v; })
+#define readl(addr) \
+ ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; })
#define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b))
#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b))
@@ -44,10 +59,16 @@ extern inline void * phys_to_virt(unsigned long address)
}
/*
- * IO bus memory addresses are 1:1 with the physical address
+ * IO bus memory addresses are 1:1 with the physical address,
+ * except on the PCI bus of the Hades.
*/
+#ifdef CONFIG_HADES
+#define virt_to_bus(a) (virt_to_phys(a) + (MACH_IS_HADES ? 0x80000000 : 0))
+#define bus_to_virt(a) (phys_to_virt((a) - (MACH_IS_HADES ? 0x80000000 : 0)))
+#else
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt
+#endif
#endif /* __KERNEL__ */
diff --git a/include/asm-m68k/ioctls.h b/include/asm-m68k/ioctls.h
index fa91491f6..213bd58df 100644
--- a/include/asm-m68k/ioctls.h
+++ b/include/asm-m68k/ioctls.h
@@ -47,6 +47,8 @@
#define TIOCSBRK 0x5427 /* BSD compatibility */
#define TIOCCBRK 0x5428 /* BSD compatibility */
#define TIOCGSID 0x5429 /* Return the session ID of FD */
+#define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */
+#define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */
#define FIONCLEX 0x5450 /* these numbers need to be adjusted. */
#define FIOCLEX 0x5451
diff --git a/include/asm-m68k/keyboard.h b/include/asm-m68k/keyboard.h
index e4c602263..cb013200b 100644
--- a/include/asm-m68k/keyboard.h
+++ b/include/asm-m68k/keyboard.h
@@ -8,6 +8,7 @@
* This file contains the m68k architecture specific keyboard definitions
*/
+#include <linux/config.h> /* CONFIG_MAGIC_SYSRQ */
#ifndef __M68K_KEYBOARD_H
#define __M68K_KEYBOARD_H
@@ -49,8 +50,16 @@ static __inline__ void kbd_leds(unsigned char leds)
mach_kbd_leds(leds);
}
+#ifdef CONFIG_MAGIC_SYSRQ
+#define kbd_is_sysrq(keycode) ((keycode) == mach_sysrq_key && \
+ (up_flag || \
+ (shift_state & mach_sysrq_shift_mask) == \
+ mach_sysrq_shift_state))
+#define kbd_sysrq_xlate mach_sysrq_xlate
+#endif
+
#define kbd_init_hw mach_keyb_init
#endif /* __KERNEL__ */
-#endif /* __ASMm68k_KEYBOARD_H */
+#endif /* __M68K_KEYBOARD_H */
diff --git a/include/asm-m68k/mac_asc.h b/include/asm-m68k/mac_asc.h
new file mode 100644
index 000000000..a36aa5a27
--- /dev/null
+++ b/include/asm-m68k/mac_asc.h
@@ -0,0 +1,27 @@
+/*
+ * Apple Sound Chip
+ */
+
+#ifndef __ASM_MAC_ASC_H
+#define __ASM_MAC_ASC_H
+
+/*
+ * ASC offsets and controls
+ */
+
+#define ASC_BUF_BASE 0x00 /* RAM buffer offset */
+#define ASC_BUF_SIZE 0x800
+
+#define ASC_CONTROL 0x800
+#define ASC_CONTROL_OFF 0x00
+#define ASC_FREQ(chan,byte) ((0x810)+((chan)<<3)+(byte))
+#define ASC_ENABLE 0x801
+#define ASC_ENABLE_SAMPLE 0x02
+#define ASC_MODE 0x802
+#define ASC_MODE_SAMPLE 0x02
+
+#define ASC_VOLUME 0x806
+#define ASC_CHAN 0x807 /* ??? */
+
+
+#endif
diff --git a/include/asm-m68k/mac_mouse.h b/include/asm-m68k/mac_mouse.h
new file mode 100644
index 000000000..228c14d0d
--- /dev/null
+++ b/include/asm-m68k/mac_mouse.h
@@ -0,0 +1,23 @@
+#ifndef _ASM_MAC_MOUSE_H
+#define _ASM_MAC_MOUSE_H
+
+/*
+ * linux/include/asm-m68k/mac_mouse.h
+ * header file for Macintosh ADB mouse driver
+ * 27-10-97 Michael Schmitz
+ * copied from:
+ * header file for Atari Mouse driver
+ * by Robert de Vries (robert@and.nl) on 19Jul93
+ */
+
+struct mouse_status {
+ char buttons;
+ short dx;
+ short dy;
+ int ready;
+ int active;
+ struct wait_queue *wait;
+ struct fasync_struct *fasyncptr;
+};
+
+#endif
diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h
index c6a4b8b33..b5be7c65d 100644
--- a/include/asm-m68k/machdep.h
+++ b/include/asm-m68k/machdep.h
@@ -30,13 +30,15 @@ extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour,
extern int (*mach_hwclk)(int, struct hwclk_time*);
extern int (*mach_set_clock_mmss)(unsigned long);
extern void (*mach_reset)( void );
-extern int (*mach_floppy_init) (void);
extern unsigned long (*mach_hd_init) (unsigned long, unsigned long);
extern void (*mach_hd_setup)(char *, int *);
-extern struct fb_info *(*mach_fb_init)(long *);
extern long mach_max_dma_address;
-extern void (*mach_video_setup)(char *, int *);
extern void (*mach_floppy_setup)(char *, int *);
extern void (*mach_floppy_eject)(void);
+extern void (*mach_heartbeat) (int);
+extern int mach_sysrq_key;
+extern int mach_sysrq_shift_state;
+extern int mach_sysrq_shift_mask;
+extern char *mach_sysrq_xlate;
#endif /* _M68K_MACHDEP_H */
diff --git a/include/asm-m68k/machw.h b/include/asm-m68k/machw.h
new file mode 100644
index 000000000..4012d8111
--- /dev/null
+++ b/include/asm-m68k/machw.h
@@ -0,0 +1,108 @@
+/*
+** linux/machw.h -- This header defines some macros and pointers for
+** the various Macintosh custom hardware registers.
+**
+** Copyright 1997 by Michael Schmitz
+**
+** 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.
+**
+*/
+
+#ifndef _ASM_MACHW_H_
+#define _ASM_MACHW_H_
+
+#include <linux/types.h>
+
+/* Mac SCSI Controller 5380 */
+
+#define MAC_5380_BAS (0x50F10000) /* This is definitely wrong!! */
+struct MAC_5380 {
+ u_char scsi_data;
+ u_char char_dummy1;
+ u_char scsi_icr;
+ u_char char_dummy2;
+ u_char scsi_mode;
+ u_char char_dummy3;
+ u_char scsi_tcr;
+ u_char char_dummy4;
+ u_char scsi_idstat;
+ u_char char_dummy5;
+ u_char scsi_dmastat;
+ u_char char_dummy6;
+ u_char scsi_targrcv;
+ u_char char_dummy7;
+ u_char scsi_inircv;
+};
+#define mac_scsi ((*(volatile struct MAC_5380 *)MAC_5380_BAS))
+
+/*
+** SCC Z8530
+*/
+
+#define MAC_SCC_BAS (0x50F04000)
+struct MAC_SCC
+ {
+ u_char cha_a_ctrl;
+ u_char char_dummy1;
+ u_char cha_a_data;
+ u_char char_dummy2;
+ u_char cha_b_ctrl;
+ u_char char_dummy3;
+ u_char cha_b_data;
+ };
+# define mac_scc ((*(volatile struct SCC*)MAC_SCC_BAS))
+
+/*
+** VIA 6522
+*/
+
+#define VIA1_BAS (0x50F00000)
+#define VIA2_BAS (0x50F02000)
+#define VIA2_BAS_IIci (0x50F26000)
+struct VIA
+ {
+ u_char buf_b;
+ u_char dummy1[0x199];
+ u_char buf_a;
+ u_char dummy2[0x199];
+ u_char dir_b;
+ u_char dummy3[0x199];
+ u_char dir_a;
+ u_char dummy4[0x199];
+ u_char timer1_cl;
+ u_char dummy5[0x199];
+ u_char timer1_ch;
+ u_char dummy6[0x199];
+ u_char timer1_ll;
+ u_char dummy7[0x199];
+ u_char timer1_lh;
+ u_char dummy8[0x199];
+ u_char timer2_cl;
+ u_char dummy9[0x199];
+ u_char timer2_ch;
+ u_char dummy10[0x199];
+ u_char sr;
+ u_char dummy11[0x199];
+ u_char acr;
+ u_char dummy12[0x199];
+ u_char pcr;
+ u_char dummy13[0x199];
+ u_char int_fl;
+ u_char dummy14[0x199];
+ u_char int_en;
+ u_char dummy15[0x199];
+ u_char anr;
+ u_char dummy16[0x199];
+ };
+
+# define via_1 ((*(volatile struct VIA *)VIA1_BAS))
+# define via_2 ((*(volatile struct VIA *)VIA2_BAS))
+# define via1_regp ((volatile unsigned char *)VIA1_BAS)
+
+# define via2_regp ((volatile unsigned char *)VIA2_BAS)
+# define via2_ci_regp ((volatile unsigned char *)VIA2_BAS_IIci)
+# define rbv_regp ((volatile unsigned char *)VIA2_BAS_IIci)
+
+#endif /* linux/machw.h */
diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h
new file mode 100644
index 000000000..f40ff86c5
--- /dev/null
+++ b/include/asm-m68k/macintosh.h
@@ -0,0 +1,139 @@
+#ifndef __ASM_MACINTOSH_H
+#define __ASM_MACINTOSH_H
+
+/*
+ * Apple Macintoshisms
+ */
+
+extern void mac_reset(void);
+extern void mac_init_IRQ(void);
+extern int mac_request_irq (unsigned int, void (*)(int, void *,
+ struct pt_regs *),
+ unsigned long, const char *, void *);
+extern void mac_free_irq(unsigned int, void *);
+extern void mac_enable_irq(unsigned int);
+extern void mac_disable_irq(unsigned int);
+extern int mac_get_irq_list(char *);
+#if 0
+extern void mac_default_handler(int irq);
+#endif
+extern void mac_identify(void);
+extern void mac_report_hardware(void);
+extern void mac_debugging_penguin(int);
+extern void mac_boom(int);
+extern void mac_video_setup(char *,int *);
+
+/*
+ * Floppy driver magic hook - probably shouldnt be here
+ */
+
+extern void via1_set_head(int);
+
+extern void parse_booter(char *ptr);
+extern void print_booter(char *ptr);
+
+/*
+ * Macintosh Table
+ */
+
+struct mac_model *macintosh_config;
+
+
+struct mac_model
+{
+ short ident;
+ char *name;
+ char adb_type;
+ char via_type;
+ char scsi_type;
+ char ide_type;
+ char scc_type;
+ char ether_type;
+ char nubus_type;
+};
+
+#define MAC_ADB_NONE 0
+#define MAC_ADB_II 1
+#define MAC_ADB_IISI 2
+#define MAC_ADB_CUDA 3
+
+#define MAC_VIA_II 1
+#define MAC_VIA_IIci 2
+#define MAC_VIA_QUADRA 3
+
+#define MAC_SCSI_NONE 0
+#define MAC_SCSI_OLD 1
+#define MAC_SCSI_QUADRA 2
+#define MAC_SCSI_QUADRA2 3
+#define MAC_SCSI_QUADRA3 4
+
+#define MAC_IDE_NONE 0
+#define MAC_IDE_QUADRA 1
+#define MAC_IDE_PB 2
+
+#define MAC_SCC_II 1
+#define MAC_SCC_QUADRA 2
+#define MAC_SCC_QUADRA2 3
+
+#define MAC_ETHER_NONE 0
+#define MAC_ETHER_SONIC 1
+
+#define MAC_NO_NUBUS 0
+#define MAC_NUBUS 1
+
+/*
+ * Gestalt numbers
+ */
+
+#define MAC_MODEL_II 6
+#define MAC_MODEL_IIX 7
+#define MAC_MODEL_IICX 8
+#define MAC_MODEL_SE30 9
+#define MAC_MODEL_IICI 11
+#define MAC_MODEL_IIFX 13 /* And well numbered it is too */
+#define MAC_MODEL_IISI 18
+#define MAC_MODEL_Q900 20
+#define MAC_MODEL_PB170 25
+#define MAC_MODEL_Q700 22
+#define MAC_MODEL_CLII 23
+#define MAC_MODEL_PB140 25
+#define MAC_MODEL_Q950 26
+#define MAC_MODEL_LCIII 27 /* aka: P450 */
+#define MAC_MODEL_PB210 29
+#define MAC_MODEL_C650 30
+#define MAC_MODEL_PB230 32
+#define MAC_MODEL_PB180 33
+#define MAC_MODEL_PB160 34
+#define MAC_MODEL_Q800 35
+#define MAC_MODEL_Q650 36
+#define MAC_MODEL_LCII 37 /* aka: P400/405/410/430 */
+#define MAC_MODEL_PB250 38
+#define MAC_MODEL_IIVI 44
+#define MAC_MODEL_IIVX 48
+#define MAC_MODEL_CCL 49
+#define MAC_MODEL_PB165C 50
+#define MAC_MODEL_C610 52
+#define MAC_MODEL_Q610 53
+#define MAC_MODEL_PB145 54
+#define MAC_MODEL_P520 56 /* aka: LC520 */
+#define MAC_MODEL_C660 60
+#define MAC_MODEL_P460 62 /* aka: LCIII+, P466/7 */
+#define MAC_MODEL_PB180C 71
+#define MAC_MODEL_PB520 72
+#define MAC_MODEL_PB270C 77
+#define MAC_MODEL_Q840 78
+#define MAC_MODEL_P550 80
+#define MAC_MODEL_PB165 84
+#define MAC_MODEL_PB190 85
+#define MAC_MODEL_TV 88
+#define MAC_MODEL_P475 89 /* aka: LC475, P476 */
+#define MAC_MODEL_P575 92 /* aka: LC575/580, P577/578/508 */
+#define MAC_MODEL_Q605 94
+#define MAC_MODEL_Q630 98 /* aka: LC630, P630/631/636/640 */
+#define MAC_MODEL_PB280 102
+#define MAC_MODEL_PB280C 103
+#define MAC_MODEL_PB150 115
+
+extern struct mac_model *macintosh_config;
+
+#endif
diff --git a/include/asm-m68k/macints.h b/include/asm-m68k/macints.h
new file mode 100644
index 000000000..b2522f78d
--- /dev/null
+++ b/include/asm-m68k/macints.h
@@ -0,0 +1,160 @@
+/*
+** macints.h -- Macintosh Linux interrupt handling structs and prototypes
+**
+** Copyright 1997 by Michael Schmitz
+**
+** 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.
+**
+*/
+
+#ifndef _ASM_MACINTS_H_
+#define _ASM_MACINTS_H_
+
+#include <asm/irq.h>
+
+/*
+** Macintosh Interrupt sources.
+**
+** Note: these are all routed via the generic VIA interrupt routine!
+**
+*/
+
+#define SRC_VIA1 0
+#define SRC_VIA2 1
+
+#define VIA1_SOURCE_BASE 8
+#define VIA2_SOURCE_BASE 16
+#define RBF_SOURCE_BASE 24
+#define MAC_SCC_SOURCE_BASE 32
+#define NUBUS_SOURCE_BASE 40
+#define NUBUS_MAX_SOURCES 8
+
+/* FIXME: sources not contigous ... */
+#define NUM_MAC_SOURCES (NUBUS_SOURCE_BASE+NUBUS_MAX_SOURCES-VIA1_SOURCE_BASE)
+
+#define IRQ_SRC_MASK (VIA1_SOURCE_BASE|VIA2_SOURCE_BASE|MAC_SCC_SOURCE_BASE)
+#define IRQ_IDX_MASK 7
+
+/*
+ * quick hack to adapt old MACHSPEC-aware source
+ */
+#define IRQ_IDX(irq) (irq)
+
+#if 0
+/* convert vector number to int source number */
+#define IRQ_VECTOR_TO_SOURCE(v) (v)
+
+/* convert irq_handler index to vector number */
+#define IRQ_SOURCE_TO_VECTOR(i) (i)
+#endif
+
+/* interrupt service types */
+#define IRQ_TYPE_SLOW 0
+#define IRQ_TYPE_FAST 1
+#define IRQ_TYPE_PRIO 2
+
+#define IRQ_SPURIOUS (0)
+
+/* auto-vector interrupts */
+#define IRQ_AUTO_1 (1)
+#define IRQ_AUTO_2 (2)
+#define IRQ_AUTO_3 (3)
+#define IRQ_AUTO_4 (4)
+#define IRQ_AUTO_5 (5)
+#define IRQ_AUTO_6 (6)
+#define IRQ_AUTO_7 (7)
+
+/* VIA1 interrupts */
+#define IRQ_VIA1_0 (8) /* one second int. */
+#define IRQ_VIA1_1 (9) /* VBlank int. */
+#define IRQ_MAC_VBL IRQ_VIA1_1
+#define IRQ_VIA1_2 (10) /* ADB SR shifts complete */
+#define IRQ_MAC_ADB IRQ_VIA1_2
+#define IRQ_MAC_ADB_SR IRQ_VIA1_2
+#define IRQ_VIA1_3 (11) /* ADB SR CB2 ?? */
+#define IRQ_MAC_ADB_SD IRQ_VIA1_3
+#define IRQ_VIA1_4 (12) /* ADB SR ext. clock pulse */
+#define IRQ_MAC_ADB_CL IRQ_VIA1_4
+#define IRQ_VIA1_5 (13)
+#define IRQ_MAC_TIMER_2 IRQ_VIA1_5
+#define IRQ_VIA1_6 (14)
+#define IRQ_MAC_TIMER_1 IRQ_VIA1_6
+#define IRQ_VIA1_7 (15)
+
+/* VIA2 interrupts */
+#define IRQ_VIA2_0 (16)
+#define IRQ_MAC_SCSIDRQ IRQ_VIA2_0
+#define IRQ_VIA2_1 (17)
+#define IRQ_MAC_NUBUS IRQ_VIA2_1
+#define IRQ_VIA2_2 (18)
+#define IRQ_VIA2_3 (19)
+#define IRQ_MAC_SCSI IRQ_VIA2_3
+#define IRQ_VIA2_4 (20)
+#define IRQ_VIA2_5 (21)
+#define IRQ_VIA2_6 (22)
+#define IRQ_VIA2_7 (23)
+
+/* RBV interrupts */
+#define IRQ_RBV_0 (24)
+#define IRQ_RBV_1 (25)
+#define IRQ_RBV_2 (26)
+#define IRQ_RBV_3 (27)
+#define IRQ_RBV_4 (28)
+#define IRQ_RBV_5 (29)
+#define IRQ_RBV_6 (30)
+#define IRQ_RBV_7 (31)
+
+#define IRQ_SCC (32)
+#define IRQ_SCCB (32)
+#define IRQ_SCCA (33)
+#if 0 /* FIXME: are there multiple interrupt conditions on the SCC ?? */
+/* SCC interrupts */
+#define IRQ_SCCB_TX (32)
+#define IRQ_SCCB_STAT (33)
+#define IRQ_SCCB_RX (34)
+#define IRQ_SCCB_SPCOND (35)
+#define IRQ_SCCA_TX (36)
+#define IRQ_SCCA_STAT (37)
+#define IRQ_SCCA_RX (38)
+#define IRQ_SCCA_SPCOND (39)
+#endif
+
+#define IRQ_NUBUS_1 (40)
+
+#define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */
+#define INT_TICKS 246 /* to make sched_time = 99.902... HZ */
+
+
+#define VIA_ENABLE 0
+#define VIA_PENDING 1
+#define VIA_SERVICE 2
+#define VIA_MASK 3
+
+/*
+ * Utility functions for setting/clearing bits in the interrupt registers of
+ * the VIA.
+ */
+
+void mac_enable_irq( unsigned irq );
+void mac_disable_irq( unsigned irq );
+void mac_turnon_irq( unsigned irq );
+void mac_turnoff_irq( unsigned irq );
+void mac_clear_pending_irq( unsigned irq );
+int mac_irq_pending( unsigned irq );
+int nubus_request_irq(int slot, void (*handler)(int,void *,struct pt_regs *));
+int nubus_free_irq(int slot);
+
+unsigned long mac_register_nubus_int( void );
+void mac_unregister_nubus_int( unsigned long );
+
+extern void mac_default_handler(int irq, void *dev_id, struct pt_regs *regs);
+extern void via1_irq(int irq, void *dev_id, struct pt_regs *regs);
+extern void via2_irq(int irq, void *dev_id, struct pt_regs *regs);
+extern void rbv_irq(int irq, void *dev_id, struct pt_regs *regs);
+extern void mac_bang(int irq, void *dev_id, struct pt_regs *regs);
+
+extern void mac_SCC_handler(int irq, void *dev_id, struct pt_regs *regs);
+
+#endif /* asm/macints.h */
diff --git a/include/asm-m68k/mvme16xhw.h b/include/asm-m68k/mvme16xhw.h
new file mode 100644
index 000000000..dbcee2672
--- /dev/null
+++ b/include/asm-m68k/mvme16xhw.h
@@ -0,0 +1,118 @@
+#ifndef _M68K_MVME16xHW_H_
+#define _M68K_MVME16xHW_H_
+
+#include <asm/irq.h>
+
+/* Board ID data structure - pointer to this retrieved from Bug by head.S */
+
+/* Note, bytes 12 and 13 are board no in BCD (0162,0166,0167,0177,etc) */
+
+extern long mvme_bdid_ptr;
+
+typedef struct {
+ char bdid[4];
+ u_char rev, mth, day, yr;
+ u_short size, reserved;
+ u_short brdno;
+ char brdsuffix[2];
+ u_long options;
+ u_short clun, dlun, ctype, dnum;
+ u_long option2;
+} t_bdid, *p_bdid;
+
+
+typedef struct {
+ u_char ack_icr,
+ flt_icr,
+ sel_icr,
+ pe_icr,
+ bsy_icr,
+ spare1,
+ isr,
+ cr,
+ spare2,
+ spare3,
+ spare4,
+ data;
+} lpr_ctrl;
+
+#define LPR_REGS ((volatile lpr_ctrl *)0xfff42030)
+
+#define I596_BASE 0xfff46000
+
+#define SCC_A_ADDR 0xfff45005
+#define SCC_B_ADDR 0xfff45001
+
+#define IRQ_MVME162_TYPE_PRIO 0
+
+#define IRQ_MVME167_PRN 0x54
+#define IRQ_MVME16x_I596 0x57
+#define IRQ_MVME16x_SCSI 0x55
+#define IRQ_MVME16x_FLY 0x7f
+#define IRQ_MVME167_SER_ERR 0x5c
+#define IRQ_MVME167_SER_MODEM 0x5d
+#define IRQ_MVME167_SER_TX 0x5e
+#define IRQ_MVME167_SER_RX 0x5f
+#define IRQ_MVME16x_TIMER 0x59
+
+/* SCC interrupts, for MVME162 */
+#define IRQ_MVME162_SCC_BASE 0x40
+#define IRQ_MVME162_SCCB_TX 0x40
+#define IRQ_MVME162_SCCB_STAT 0x42
+#define IRQ_MVME162_SCCB_RX 0x44
+#define IRQ_MVME162_SCCB_SPCOND 0x46
+#define IRQ_MVME162_SCCA_TX 0x48
+#define IRQ_MVME162_SCCA_STAT 0x4a
+#define IRQ_MVME162_SCCA_RX 0x4c
+#define IRQ_MVME162_SCCA_SPCOND 0x4e
+
+/* MVME162 version register */
+
+#define MVME162_VERSION_REG 0xfff4202e
+
+extern unsigned short mvme16x_config;
+
+/* Lower 8 bits must match the revision register in the MC2 chip */
+
+#define MVME16x_CONFIG_SPEED_32 0x0001
+#define MVME16x_CONFIG_NO_VMECHIP2 0x0002
+#define MVME16x_CONFIG_NO_SCSICHIP 0x0004
+#define MVME16x_CONFIG_NO_ETHERNET 0x0008
+#define MVME16x_CONFIG_GOT_FPU 0x0010
+
+#define MVME16x_CONFIG_GOT_LP 0x0100
+#define MVME16x_CONFIG_GOT_CD2401 0x0200
+#define MVME16x_CONFIG_GOT_SCCA 0x0400
+#define MVME16x_CONFIG_GOT_SCCB 0x0800
+
+/* Specials for the ethernet driver */
+
+#define CA() (((struct i596_reg *)dev->base_addr)->ca = 1)
+
+#define MPU_PORT(c,x) \
+ ((struct i596_reg *)(dev->base_addr))->porthi = ((c) | (u32)(x)) & 0xffff; \
+ ((struct i596_reg *)(dev->base_addr))->portlo = ((c) | (u32)(x)) >> 16
+
+#define SCP_SYSBUS 0x00000054
+
+#define WSWAPrfd(x) ((struct i596_rfd *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPrbd(x) ((struct i596_rbd *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPiscp(x) ((struct i596_iscp *)(((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPscb(x) ((struct i596_scb *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPcmd(x) ((struct i596_cmd *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPtbd(x) ((struct i596_tbd *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+#define WSWAPchar(x) ((char *) (((u32)(x)<<16) | ((((u32)(x)))>>16)))
+
+/*
+ * The MPU_PORT command allows direct access to the 82596. With PORT access
+ * the following commands are available (p5-18). The 32-bit port command
+ * must be word-swapped with the most significant word written first.
+ */
+#define PORT_RESET 0x00 /* reset 82596 */
+#define PORT_SELFTEST 0x01 /* selftest */
+#define PORT_ALTSCP 0x02 /* alternate SCB address */
+#define PORT_ALTDUMP 0x03 /* Alternate DUMP address */
+
+#define ISCP_BUSY 0x00010000
+
+#endif /* _M68K_MVME16xHW_H_ */
diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h
index ef2246585..d20bc6144 100644
--- a/include/asm-m68k/pgtable.h
+++ b/include/asm-m68k/pgtable.h
@@ -26,7 +26,7 @@ do { \
asm __volatile__ ("nop\n\t" \
".chip 68040\n\t" \
"cinva %%ic\n\t" \
- ".chip 68k"); \
+ ".chip 68k" : ); \
else { \
unsigned long _tmp; \
asm __volatile__ ("movec %%cacr,%0\n\t" \
@@ -136,9 +136,12 @@ extern inline void flush_page_to_ram (unsigned long address)
}
/* Push n pages at kernel virtual address and clear the icache */
-extern inline void flush_pages_to_ram (unsigned long address, int n)
+extern inline void flush_icache_range (unsigned long address,
+ unsigned long endaddr)
{
if (CPU_IS_040_OR_060) {
+ short n = (endaddr - address + PAGE_SIZE - 1) / PAGE_SIZE;
+
while (n--) {
__asm__ __volatile__ ("nop\n\t"
".chip 68040\n\t"
@@ -159,7 +162,6 @@ extern inline void flush_pages_to_ram (unsigned long address, int n)
}
}
-#define flush_icache_range(start, end) do { } while (0)
/*
* flush all user-space atc entries.
@@ -223,7 +225,7 @@ static inline void flush_tlb_range(struct mm_struct *mm,
extern inline void flush_tlb_kernel_page(unsigned long addr)
{
if (CPU_IS_040_OR_060) {
- unsigned long old_fs = get_fs();
+ mm_segment_t old_fs = get_fs();
set_fs(KERNEL_DS);
__asm__ __volatile__(".chip 68040\n\t"
"pflush (%0)\n\t"
@@ -298,6 +300,8 @@ typedef pte_table pte_tablepage[PTE_TABLES_PER_PAGE];
#define _PAGE_RONLY 0x004
#define _PAGE_ACCESSED 0x008
#define _PAGE_DIRTY 0x010
+#define _PAGE_SUPER 0x080 /* 68040 supervisor only */
+#define _PAGE_FAKE_SUPER 0x200 /* fake supervisor only on 680[23]0 */
#define _PAGE_GLOBAL040 0x400 /* 68040 global bit, used for kva descs */
#define _PAGE_COW 0x800 /* implemented in software */
#define _PAGE_NOCACHE030 0x040 /* 68030 no-cache mode */
@@ -440,7 +444,7 @@ extern inline unsigned long pgd_page(pgd_t pgd)
{ return PTOV(pgd_val(pgd) & _TABLE_MASK); }
extern inline int pte_none(pte_t pte) { return !pte_val(pte); }
-extern inline int pte_present(pte_t pte) { return pte_val(pte) & _PAGE_PRESENT; }
+extern inline int pte_present(pte_t pte) { return pte_val(pte) & (_PAGE_PRESENT | _PAGE_FAKE_SUPER); }
extern inline void pte_clear(pte_t *ptep) { pte_val(*ptep) = 0; }
extern inline int pmd_none2(pmd_t *pmd) { return !pmd_val(*pmd); }
@@ -728,12 +732,15 @@ extern inline pgd_t * pgd_alloc(void)
int mm_end_of_chunk (unsigned long addr, int len);
/*
- * Map some physical address range into the kernel address space. The
- * code is copied and adapted from map_chunk().
+ * Map some physical address range into the kernel address space.
*/
extern unsigned long kernel_map(unsigned long paddr, unsigned long size,
int nocacheflag, unsigned long *memavailp );
/*
+ * Unmap a region alloced by kernel_map().
+ */
+extern void kernel_unmap( unsigned long addr );
+/*
* Change the cache mode of some kernel address range.
*/
extern void kernel_set_cachemode( unsigned long address, unsigned long size,
@@ -758,6 +765,8 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma,
* I don't know what is going on here, but since these were changed,
* swapping hasn't been working on the 68040.
*/
+/* With the new handling of PAGE_NONE the old definitions definitely
+ don't work any more. */
#define SWP_TYPE(entry) (((entry) >> 2) & 0x7f)
#if 0
diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h
index 9ec6df6e8..6d04e36d0 100644
--- a/include/asm-m68k/processor.h
+++ b/include/asm-m68k/processor.h
@@ -48,7 +48,7 @@ struct thread_struct {
#define INIT_TSS { \
sizeof(init_stack) + (unsigned long) init_stack, 0, \
- PS_S, KERNEL_DS, \
+ PS_S, __KERNEL_DS, \
{0, 0}, 0, {0,}, {0, 0, 0}, {0,}, \
}
@@ -58,13 +58,6 @@ struct thread_struct {
static inline void start_thread(struct pt_regs * regs, unsigned long pc,
unsigned long usp)
{
- unsigned long nilstate = 0;
-
- /* clear floating point state */
- __asm__ __volatile__ (".chip 68k/68881\n\t"
- "frestore %0@\n\t"
- ".chip 68k" : : "a" (&nilstate));
-
/* reads from user space */
set_fs(USER_DS);
@@ -74,7 +67,16 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc,
}
/* Free all resources held by a thread. */
-extern void release_thread(struct task_struct *);
+static inline void release_thread(struct task_struct *dead_task)
+{
+}
+
+/*
+ * Free current thread data structures etc..
+ */
+static inline void exit_thread(void)
+{
+}
/*
* Return saved PC of a blocked thread.
@@ -94,7 +96,7 @@ extern inline unsigned long thread_saved_pc(struct thread_struct *t)
/* Allocation and freeing of basic task resources. */
#define alloc_task_struct() \
- ((struct task_struct *) __get_free_pages(GFP_KERNEL,1,0))
+ ((struct task_struct *) __get_free_pages(GFP_KERNEL,1))
#define free_task_struct(p) free_pages((unsigned long)(p),1)
#define init_task (init_task_union.task)
diff --git a/include/asm-m68k/ptrace.h b/include/asm-m68k/ptrace.h
index e0c9d0ac2..f62c54ea2 100644
--- a/include/asm-m68k/ptrace.h
+++ b/include/asm-m68k/ptrace.h
@@ -58,6 +58,12 @@ struct switch_stack {
unsigned long retpc;
};
+/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
+#define PTRACE_GETREGS 12
+#define PTRACE_SETREGS 13
+#define PTRACE_GETFPREGS 14
+#define PTRACE_SETFPREGS 15
+
#ifdef __KERNEL__
#ifndef PS_S
diff --git a/include/asm-m68k/segment.h b/include/asm-m68k/segment.h
index 5fe0c033f..7b0b2d312 100644
--- a/include/asm-m68k/segment.h
+++ b/include/asm-m68k/segment.h
@@ -4,44 +4,54 @@
/* define constants */
/* Address spaces (FC0-FC2) */
#define USER_DATA (1)
-#ifndef USER_DS
-#define USER_DS (USER_DATA)
+#ifndef __USER_DS
+#define __USER_DS (USER_DATA)
#endif
#define USER_PROGRAM (2)
#define SUPER_DATA (5)
-#ifndef KERNEL_DS
-#define KERNEL_DS (SUPER_DATA)
+#ifndef __KERNEL_DS
+#define __KERNEL_DS (SUPER_DATA)
#endif
#define SUPER_PROGRAM (6)
#define CPU_SPACE (7)
#ifndef __ASSEMBLY__
+typedef struct {
+ unsigned long seg;
+} mm_segment_t;
+
+#define MAKE_MM_SEG(s) ((mm_segment_t) { (s) })
+#define USER_DS MAKE_MM_SEG(__USER_DS)
+#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS)
+
/*
* Get/set the SFC/DFC registers for MOVES instructions
*/
-static inline unsigned long get_fs(void)
+static inline mm_segment_t get_fs(void)
{
- unsigned long _v;
- __asm__ ("movec %/dfc,%0":"=r" (_v):);
+ mm_segment_t _v;
+ __asm__ ("movec %/dfc,%0":"=r" (_v.seg):);
return _v;
}
-static inline unsigned long get_ds(void)
+static inline mm_segment_t get_ds(void)
{
/* return the supervisor data space code */
return KERNEL_DS;
}
-static inline void set_fs(unsigned long val)
+static inline void set_fs(mm_segment_t val)
{
__asm__ __volatile__ ("movec %0,%/sfc\n\t"
"movec %0,%/dfc\n\t"
- : /* no outputs */ : "r" (val) : "memory");
+ : /* no outputs */ : "r" (val.seg) : "memory");
}
+#define segment_eq(a,b) ((a).seg == (b).seg)
+
#endif /* __ASSEMBLY__ */
#endif /* _M68K_SEGMENT_H */
diff --git a/include/asm-m68k/serial.h b/include/asm-m68k/serial.h
index 607b408ec..bc30f6e56 100644
--- a/include/asm-m68k/serial.h
+++ b/include/asm-m68k/serial.h
@@ -32,6 +32,8 @@
#define SER_IOEXT 106 /* Amiga GVP IO-Extender (16c552) */
#define SER_MFC_III 107 /* Amiga BSC Multiface Card III (MC68681) */
#define SER_WHIPPET 108 /* Amiga Hisoft Whippet PCMCIA (16c550B) */
+#define SER_SCC_MVME 109 /* MVME162/MVME172 ports */
+#define SER_SCC_MAC 110 /* Macintosh SCC channel */
struct serial_struct {
int type;
@@ -99,33 +101,33 @@ struct serial_struct {
*
*/
-struct async_struct;
+struct m68k_async_struct;
typedef struct {
- void (*init)( struct async_struct *info );
- void (*deinit)( struct async_struct *info, int leave_dtr );
- void (*enab_tx_int)( struct async_struct *info, int enab_flag );
- int (*check_custom_divisor)( struct async_struct *info, int baud_base,
+ void (*init)( struct m68k_async_struct *info );
+ void (*deinit)( struct m68k_async_struct *info, int leave_dtr );
+ void (*enab_tx_int)( struct m68k_async_struct *info, int enab_flag );
+ int (*check_custom_divisor)( struct m68k_async_struct *info, int baud_base,
int divisor );
- void (*change_speed)( struct async_struct *info );
- void (*throttle)( struct async_struct *info, int status );
- void (*set_break)( struct async_struct *info, int break_flag );
- void (*get_serial_info)( struct async_struct *info,
+ void (*change_speed)( struct m68k_async_struct *info );
+ void (*throttle)( struct m68k_async_struct *info, int status );
+ void (*set_break)( struct m68k_async_struct *info, int break_flag );
+ void (*get_serial_info)( struct m68k_async_struct *info,
struct serial_struct *retinfo );
- unsigned int (*get_modem_info)( struct async_struct *info );
- int (*set_modem_info)( struct async_struct *info, int new_dtr,
+ unsigned int (*get_modem_info)( struct m68k_async_struct *info );
+ int (*set_modem_info)( struct m68k_async_struct *info, int new_dtr,
int new_rts );
int (*ioctl)( struct tty_struct *tty, struct file *file,
- struct async_struct *info, unsigned int cmd,
+ struct m68k_async_struct *info, unsigned int cmd,
unsigned long arg );
- void (*stop_receive)( struct async_struct *info );
- int (*trans_empty)( struct async_struct *info );
- int (*check_open)( struct async_struct *info, struct tty_struct *tty,
+ void (*stop_receive)( struct m68k_async_struct *info );
+ int (*trans_empty)( struct m68k_async_struct *info );
+ int (*check_open)( struct m68k_async_struct *info, struct tty_struct *tty,
struct file *file );
} SERIALSWITCH;
/*
- * Definitions for async_struct (and serial_struct) flags field
+ * Definitions for m68k_async_struct (and serial_struct) flags field
*/
#define ASYNC_HUP_NOTIFY 0x0001 /* Notify getty on hangups and closes
on the callout port */
@@ -191,16 +193,18 @@ struct serial_icounter_struct {
#include <linux/termios.h>
#include <linux/tqueue.h>
-/*
- * Counters of the input lines (CTS, DSR, RI, CD) interrupts
- */
-struct async_icount {
- __u32 cts, dsr, rng, dcd, tx, rx;
- __u32 frame, parity, overrun, brk;
- __u32 buf_overrun;
+#include <linux/config.h> /* for Mac SCC extensions */
+
+#ifdef CONFIG_MAC
+#define NUM_ZSREGS 16
+struct mac_zschannel {
+ volatile unsigned char *control;
+ volatile unsigned char *data;
};
+struct m68k_async_private;
+#endif
-struct async_struct {
+struct m68k_async_struct {
int magic;
int baud_base;
int port;
@@ -233,15 +237,14 @@ struct async_struct {
int xmit_tail;
int xmit_cnt;
struct tq_struct tqueue;
- struct tq_struct tqueue_hangup;
struct termios normal_termios;
struct termios callout_termios;
struct wait_queue *open_wait;
struct wait_queue *close_wait;
struct wait_queue *delta_msr_wait;
struct async_icount icount; /* kernel counters for the 4 input interrupts */
- struct async_struct *next_port; /* For the linked list */
- struct async_struct *prev_port;
+ struct m68k_async_struct *next_port; /* For the linked list */
+ struct m68k_async_struct *prev_port;
void *board_base; /* board-base address for use with
boards carrying several UART's,
like some Amiga boards. */
@@ -254,8 +257,41 @@ struct async_struct {
interrupt, instead of checking
IRQ-registers on all UART's */
SERIALSWITCH *sw; /* functions to manage this port */
+#ifdef CONFIG_MAC
+ struct m68k_async_private *private;
+#endif
};
+#ifdef CONFIG_MAC
+struct m68k_async_private {
+ struct m68k_async_info *zs_next; /* For IRQ servicing chain */
+ struct mac_zschannel *zs_channel; /* Channel registers */
+ struct mac_zschannel *zs_chan_a; /* A side registers */
+ unsigned char read_reg_zero;
+
+ char soft_carrier; /* Use soft carrier on this */
+ char break_abort; /* console, process brk/abrt */
+ char kgdb_channel; /* Kgdb running on this channel */
+ char is_cons; /* Is this our console. */
+ unsigned char tx_active; /* character being xmitted */
+ unsigned char tx_stopped; /* output is suspended */
+
+ /* We need to know the current clock divisor
+ * to read the bps rate the chip has currently
+ * loaded.
+ */
+ unsigned char clk_divisor; /* May be 1, 16, 32, or 64 */
+ int zs_baud;
+
+ /* Current write register values */
+ unsigned char curregs[NUM_ZSREGS];
+
+ /* Values we need to set next opportunity */
+ unsigned char pendregs[NUM_ZSREGS];
+
+ char change_needed;
+};
+#endif
#define SERIAL_MAGIC 0x5301
/*
@@ -275,7 +311,7 @@ struct async_struct {
/* Export to allow PCMCIA to use this - Dave Hinds */
extern int register_serial(struct serial_struct *req);
extern void unregister_serial(int line);
-extern struct async_struct rs_table[];
+extern struct m68k_async_struct rs_table[];
extern task_queue tq_serial;
@@ -283,14 +319,14 @@ extern task_queue tq_serial;
* This routine is used by the interrupt handler to schedule
* processing in the software interrupt portion of the driver.
*/
-static __inline__ void rs_sched_event(struct async_struct *info, int event)
+static __inline__ void rs_sched_event(struct m68k_async_struct *info, int event)
{
info->event |= 1 << event;
queue_task(&info->tqueue, &tq_serial);
mark_bh(SERIAL_BH);
}
-static __inline__ void rs_receive_char( struct async_struct *info,
+static __inline__ void rs_receive_char( struct m68k_async_struct *info,
int ch, int err )
{
struct tty_struct *tty = info->tty;
@@ -305,10 +341,10 @@ static __inline__ void rs_receive_char( struct async_struct *info,
*tty->flip.flag_buf_ptr++ = err;
*tty->flip.char_buf_ptr++ = ch;
info->icount.rx++;
- queue_task(&tty->flip.tqueue, &tq_timer);
+ tty_flip_buffer_push(tty);
}
-static __inline__ int rs_get_tx_char( struct async_struct *info )
+static __inline__ int rs_get_tx_char( struct m68k_async_struct *info )
{
unsigned char ch;
@@ -330,14 +366,14 @@ static __inline__ int rs_get_tx_char( struct async_struct *info )
return( ch );
}
-static __inline__ int rs_no_more_tx( struct async_struct *info )
+static __inline__ int rs_no_more_tx( struct m68k_async_struct *info )
{
return( info->xmit_cnt <= 0 ||
info->tty->stopped ||
info->tty->hw_stopped );
}
-static __inline__ void rs_dcd_changed( struct async_struct *info, int dcd )
+static __inline__ void rs_dcd_changed( struct m68k_async_struct *info, int dcd )
{
/* update input line counter */
@@ -356,7 +392,8 @@ static __inline__ void rs_dcd_changed( struct async_struct *info, int dcd )
#ifdef SERIAL_DEBUG_OPEN
printk("scheduling hangup...");
#endif
- queue_task(&info->tqueue_hangup, &tq_scheduler);
+ if (info->tty)
+ tty_hangup(info->tty);
}
}
}
@@ -365,13 +402,13 @@ static __inline__ void rs_dcd_changed( struct async_struct *info, int dcd )
void rs_stop( struct tty_struct *tty );
void rs_start( struct tty_struct *tty );
-static __inline__ void rs_check_cts( struct async_struct *info, int cts )
+static __inline__ void rs_check_cts( struct m68k_async_struct *info, int cts )
{
/* update input line counter */
info->icount.cts++;
wake_up_interruptible(&info->delta_msr_wait);
- if ((info->flags & ASYNC_CTS_FLOW) && info->tty)
+ if ((info->flags & ASYNC_CTS_FLOW) && info->tty) {
if (info->tty->hw_stopped) {
if (cts) {
#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
@@ -388,7 +425,7 @@ static __inline__ void rs_check_cts( struct async_struct *info, int cts )
rs_stop( info->tty );
}
}
-
+ }
}
diff --git a/include/asm-m68k/setup.h b/include/asm-m68k/setup.h
index c95bdfc01..0255ca97f 100644
--- a/include/asm-m68k/setup.h
+++ b/include/asm-m68k/setup.h
@@ -30,12 +30,14 @@
* Linux/m68k Architectures
*/
-#define MACH_AMIGA 1
-#define MACH_ATARI 2
-#define MACH_MAC 3
-#define MACH_APOLLO 4
-#define MACH_SUN3 5
-/* MVME 166/167/162/147?? */
+#define MACH_AMIGA 1
+#define MACH_ATARI 2
+#define MACH_MAC 3
+#define MACH_APOLLO 4
+#define MACH_SUN3 5
+#define MACH_MVME147 6
+#define MACH_MVME16x 7
+#define MACH_BVME6000 8
#ifdef __KERNEL__
@@ -45,7 +47,8 @@ extern u_long m68k_machtype;
#if !defined(CONFIG_AMIGA)
# define MACH_IS_AMIGA (0)
-#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC)
+#elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
+ || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)
# define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA)
#else
# define MACH_AMIGA_ONLY
@@ -55,7 +58,8 @@ extern u_long m68k_machtype;
#if !defined(CONFIG_ATARI)
# define MACH_IS_ATARI (0)
-#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC)
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
+ || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)
# define MACH_IS_ATARI (m68k_machtype == MACH_ATARI)
#else
# define MACH_ATARI_ONLY
@@ -63,18 +67,56 @@ extern u_long m68k_machtype;
# define MACH_TYPE (MACH_ATARI)
#endif
-#if defined(CONFIG_MAC)
-# error Currently no Mac support!
+#if !defined(CONFIG_MAC)
+# define MACH_IS_MAC (0)
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO)
+# define MACH_IS_MAC (m68k_machtype == MACH_MAC)
+#else
+# define CONFIG_MAC_ONLY
+# define MACH_IS_MAC (1)
+# define MACH_TYPE (MACH_MAC)
#endif
#if defined(CONFIG_SUN3)
# error Currently no Sun-3 support!
+#else
+#define MACH_IS_SUN3 (0)
+#endif
+
+#if !defined (CONFIG_APOLLO)
+# define MACH_IS_APOLLO (0)
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
+ || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)
+# define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO)
+#else
+# define CONFIG_APOLLO_ONLY
+# define MACH_IS_APOLLO (1)
+# define MACH_TYPE (MACH_APOLLO)
#endif
-#if defined(CONFIG_APOLLO)
-# error Currently no Apollo support!
+#if !defined (CONFIG_MVME16x)
+# define MACH_IS_MVME16x (0)
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
+ || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000)
+# define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x)
+#else
+# define CONFIG_MVME16x_ONLY
+# define MACH_IS_MVME16x (1)
+# define MACH_TYPE (MACH_MVME16x)
#endif
+#if !defined (CONFIG_BVME6000)
+# define MACH_IS_BVME6000 (0)
+#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
+ || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x)
+# define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000)
+#else
+# define CONFIG_BVME6000_ONLY
+# define MACH_IS_BVME6000 (1)
+# define MACH_TYPE (MACH_BVME6000)
+#endif
+
+
#ifndef MACH_TYPE
# define MACH_TYPE (m68k_machtype)
#endif
@@ -89,7 +131,7 @@ extern u_long m68k_machtype;
*
* CPU_68020 == MMU_68851
* CPU_68030 == MMU_68030
- * CPU_68040 == FPU_68040 == MMU_68040
+ * CPU_68040 == FPU_68040 == MMU_68040 (not strictly, think of 68LC040!)
* CPU_68060 == FPU_68060 == MMU_68060
*/
diff --git a/include/asm-m68k/siginfo.h b/include/asm-m68k/siginfo.h
new file mode 100644
index 000000000..e53589ef9
--- /dev/null
+++ b/include/asm-m68k/siginfo.h
@@ -0,0 +1,195 @@
+#ifndef _M68K_SIGINFO_H
+#define _M68K_SIGINFO_H
+
+#include <linux/types.h>
+
+/* This is copied from asm-alpha/siginfo.h. */
+
+typedef union sigval {
+ int sival_int;
+ void *sival_ptr;
+} sigval_t;
+
+#define SI_MAX_SIZE 128
+#define SI_PAD_SIZE ((SI_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct siginfo {
+ int si_signo;
+ int si_errno;
+ int si_code;
+
+ union {
+ int _pad[SI_PAD_SIZE];
+
+ /* kill() */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ } _kill;
+
+ /* POSIX.1b timers */
+ struct {
+ unsigned int _timer1;
+ unsigned int _timer2;
+ } _timer;
+
+ /* POSIX.1b signals */
+ struct {
+ pid_t _pid; /* sender's pid */
+ uid_t _uid; /* sender's uid */
+ sigval_t _sigval;
+ } _rt;
+
+ /* SIGCHLD */
+ struct {
+ pid_t _pid; /* which child */
+ int _status; /* exit code */
+ clock_t _utime;
+ clock_t _stime;
+ } _sigchld;
+
+ /* SIGILL, SIGFPE, SIGSEGV, SIGBUS */
+ struct {
+ void *_addr; /* faulting insn/memory ref. */
+ } _sigfault;
+
+ /* SIGPOLL */
+ struct {
+ int _band; /* POLL_IN, POLL_OUT, POLL_MSG */
+ int _fd;
+ } _sigpoll;
+ } _sifields;
+} siginfo_t;
+
+/*
+ * How these fields are to be accessed.
+ */
+#define si_pid _sifields._kill._pid
+#define si_uid _sifields._kill._uid
+#define si_status _sifields._sigchld._status
+#define si_utime _sifields._sigchld._utime
+#define si_stime _sifields._sigchld._stime
+#define si_value _sifields._rt._sigval
+#define si_int _sifields._rt._sigval.sival_int
+#define si_ptr _sifields._rt._sigval.sival_ptr
+#define si_addr _sifields._sigfault._addr
+#define si_band _sifields._sigpoll._band
+#define si_fd _sifields._sigpoll._fd
+
+/*
+ * si_code values
+ * Digital reserves positive values for kernel-generated signals.
+ */
+#define SI_USER 0 /* sent by kill, sigsend, raise */
+#define SI_KERNEL 0x80 /* sent by the kernel from somewhere */
+#define SI_QUEUE -1 /* sent by sigqueue */
+#define SI_TIMER -2 /* sent by timer expiration */
+#define SI_MESGQ -3 /* sent by real time mesq state change */
+#define SI_ASYNCIO -4 /* sent by AIO completion */
+
+#define SI_FROMUSER(siptr) ((siptr)->si_code <= 0)
+#define SI_FROMKERNEL(siptr) ((siptr)->si_code > 0)
+
+/*
+ * SIGILL si_codes
+ */
+#define ILL_ILLOPC 1 /* illegal opcode */
+#define ILL_ILLOPN 2 /* illegal operand */
+#define ILL_ILLADR 3 /* illegal addressing mode */
+#define ILL_ILLTRP 4 /* illegal trap */
+#define ILL_PRVOPC 5 /* privileged opcode */
+#define ILL_PRVREG 6 /* privileged register */
+#define ILL_COPROC 7 /* coprocessor error */
+#define ILL_BADSTK 8 /* internal stack error */
+#define NSIGILL 8
+
+/*
+ * SIGFPE si_codes
+ */
+#define FPE_INTDIV 1 /* integer divide by zero */
+#define FPE_INTOVF 2 /* integer overflow */
+#define FPE_FLTDIV 3 /* floating point divide by zero */
+#define FPE_FLTOVF 4 /* floating point overflow */
+#define FPE_FLTUND 5 /* floating point underflow */
+#define FPE_FLTRES 6 /* floating point inexact result */
+#define FPE_FLTINV 7 /* floating point invalid operation */
+#define FPE_FLTSUB 8 /* subscript out of range */
+#define NSIGFPE 8
+
+/*
+ * SIGSEGV si_codes
+ */
+#define SEGV_MAPERR 1 /* address not mapped to object */
+#define SEGV_ACCERR 2 /* invalid permissions for mapped object */
+#define NSIGSEGV 2
+
+/*
+ * SIGBUS si_codes
+ */
+#define BUS_ADRALN 1 /* invalid address alignment */
+#define BUS_ADRERR 2 /* non-existant physical address */
+#define BUS_OBJERR 3 /* object specific hardware error */
+#define NSIGBUS 3
+
+/*
+ * SIGTRAP si_codes
+ */
+#define TRAP_BRKPT 1 /* process breakpoint */
+#define TRAP_TRACE 2 /* process trace trap */
+#define NSIGTRAP 2
+
+/*
+ * SIGCHLD si_codes
+ */
+#define CLD_EXITED 1 /* child has exited */
+#define CLD_KILLED 2 /* child was killed */
+#define CLD_DUMPED 3 /* child terminated abnormally */
+#define CLD_TRAPPED 4 /* traced child has trapped */
+#define CLD_STOPPED 5 /* child has stopped */
+#define CLD_CONTINUED 6 /* stopped child has continued */
+#define NSIGCHLD 6
+
+/*
+ * SIGPOLL si_codes
+ */
+#define POLL_IN 1 /* data input available */
+#define POLL_OUT 2 /* output buffers available */
+#define POLL_MSG 3 /* input message available */
+#define POLL_ERR 4 /* i/o error */
+#define POLL_PRI 5 /* high priority input available */
+#define POLL_HUP 6 /* device disconnected */
+#define NSIGPOLL 6
+
+/*
+ * sigevent definitions
+ *
+ * It seems likely that SIGEV_THREAD will have to be handled from
+ * userspace, libpthread transmuting it to SIGEV_SIGNAL, which the
+ * thread manager then catches and does the appropriate nonsense.
+ * However, everything is written out here so as to not get lost.
+ */
+#define SIGEV_SIGNAL 0 /* notify via signal */
+#define SIGEV_NONE 1 /* other notification: meaningless */
+#define SIGEV_THREAD 2 /* deliver via thread creation */
+
+#define SIGEV_MAX_SIZE 64
+#define SIGEV_PAD_SIZE ((SIGEV_MAX_SIZE/sizeof(int)) - 3)
+
+typedef struct sigevent {
+ sigval_t sigev_value;
+ int sigev_signo;
+ int sigev_notify;
+ union {
+ int _pad[SIGEV_PAD_SIZE];
+
+ struct {
+ void (*_function)(sigval_t);
+ void *_attribute; /* really pthread_attr_t */
+ } _sigev_thread;
+ } _sigev_un;
+} sigevent_t;
+
+#define sigev_notify_function _sigev_un._sigev_thread._function
+#define sigev_notify_attributes _sigev_un._sigev_thread._attribute
+
+#endif
diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h
index 1069ccc55..1f3466aff 100644
--- a/include/asm-m68k/signal.h
+++ b/include/asm-m68k/signal.h
@@ -1,10 +1,32 @@
#ifndef _M68K_SIGNAL_H
#define _M68K_SIGNAL_H
-typedef unsigned long sigset_t; /* at least 32 bits */
+#include <linux/types.h>
-#define _NSIG 32
-#define NSIG _NSIG
+/* Avoid too many header ordering problems. */
+struct siginfo;
+
+#ifdef __KERNEL__
+/* Most things should be clean enough to redefine this at will, if care
+ is taken to make libc match. */
+
+#define _NSIG 64
+#define _NSIG_BPW 32
+#define _NSIG_WORDS (_NSIG / _NSIG_BPW)
+
+typedef unsigned long old_sigset_t; /* at least 32 bits */
+
+typedef struct {
+ unsigned long sig[_NSIG_WORDS];
+} sigset_t;
+
+#else
+/* Here we must cater to libcs that poke about in kernel headers. */
+
+#define NSIG 32
+typedef unsigned long sigset_t;
+
+#endif /* __KERNEL__ */
#define SIGHUP 1
#define SIGINT 2
@@ -43,22 +65,36 @@ typedef unsigned long sigset_t; /* at least 32 bits */
#define SIGPWR 30
#define SIGUNUSED 31
+/* These should not be considered constants from userland. */
+#define SIGRTMIN 32
+#define SIGRTMAX (_NSIG-1)
+
/*
- * sa_flags values: SA_STACK is not currently supported, but will allow the
- * usage of signal stacks by using the (now obsolete) sa_restorer field in
- * the sigaction structure as a stack pointer. This is now possible due to
- * the changes in signal handling. LBT 010493.
+ * SA_FLAGS values:
+ *
+ * SA_ONSTACK is not currently supported, but will allow sigaltstack(2).
+ * (++roman: SA_ONSTACK is supported on m68k)
* SA_INTERRUPT is a no-op, but left due to historical reasons. Use the
* SA_RESTART flag to get restarting signals (which were the default long ago)
- * SA_SHIRQ flag is for shared interrupt support on PCI and EISA.
+ * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop.
+ * SA_RESETHAND clears the handler when the signal is delivered.
+ * SA_NOCLDWAIT flag on SIGCHLD to inhibit zombies.
+ * SA_NODEFER prevents the current signal from being masked in the handler.
+ *
+ * SA_ONESHOT and SA_NOMASK are the historical Linux names for the Single
+ * Unix names RESETHAND and NODEFER respectively.
*/
-#define SA_NOCLDSTOP 1
-#define SA_SHIRQ 0x04000000
-#define SA_STACK 0x08000000
+#define SA_NOCLDSTOP 0x00000001
+#define SA_NOCLDWAIT 0x00000002 /* not supported yet */
+#define SA_SIGINFO 0x00000004
+#define SA_ONSTACK 0x08000000
#define SA_RESTART 0x10000000
-#define SA_INTERRUPT 0x20000000
-#define SA_NOMASK 0x40000000
-#define SA_ONESHOT 0x80000000
+#define SA_NODEFER 0x40000000
+#define SA_RESETHAND 0x80000000
+
+#define SA_NOMASK SA_NODEFER
+#define SA_ONESHOT SA_RESETHAND
+#define SA_INTERRUPT 0x20000000 /* dummy -- ignored */
#ifdef __KERNEL__
/*
@@ -66,9 +102,11 @@ typedef unsigned long sigset_t; /* at least 32 bits */
* irq handling routines.
*
* SA_INTERRUPT is also used by the irq handling routines.
+ * SA_SHIRQ is for shared interrupt support on PCI and EISA.
*/
-#define SA_PROBE SA_ONESHOT
-#define SA_SAMPLE_RANDOM SA_RESTART
+#define SA_PROBE SA_ONESHOT
+#define SA_SAMPLE_RANDOM SA_RESTART
+#define SA_SHIRQ 0x04000000
#endif
#define SIG_BLOCK 0 /* for blocking signals */
@@ -82,15 +120,78 @@ typedef void (*__sighandler_t)(int);
#define SIG_IGN ((__sighandler_t)1) /* ignore signal */
#define SIG_ERR ((__sighandler_t)-1) /* error return from signal */
+#ifdef __KERNEL__
+struct old_sigaction {
+ __sighandler_t sa_handler;
+ old_sigset_t sa_mask;
+ unsigned long sa_flags;
+ void (*sa_restorer)(void);
+};
+
+struct k_sigaction {
+ struct sigaction sa;
+};
+#else
+/* Here we must cater to libcs that poke about in kernel headers. */
+
struct sigaction {
__sighandler_t sa_handler;
sigset_t sa_mask;
unsigned long sa_flags;
void (*sa_restorer)(void);
};
+#endif /* __KERNEL__ */
+
+typedef struct sigaltstack {
+ void *ss_sp;
+ int ss_flags;
+ size_t ss_size;
+} stack_t;
#ifdef __KERNEL__
#include <asm/sigcontext.h>
-#endif
+
+#define __HAVE_ARCH_SIG_BITOPS
+
+extern __inline__ void sigaddset(sigset_t *set, int _sig)
+{
+ __asm__("bfset %0{%1,#1}" : "=m" (*set) : "id" ((_sig - 1) ^ 31)
+ : "cc");
+}
+
+extern __inline__ void sigdelset(sigset_t *set, int _sig)
+{
+ __asm__("bfclr %0{%1,#1}" : "=m"(*set) : "id"((_sig - 1) ^ 31)
+ : "cc");
+}
+
+extern __inline__ int __const_sigismember(sigset_t *set, int _sig)
+{
+ unsigned long sig = _sig - 1;
+ return 1 & (set->sig[sig / _NSIG_BPW] >> (sig % _NSIG_BPW));
+}
+
+extern __inline__ int __gen_sigismember(sigset_t *set, int _sig)
+{
+ char ret;
+ __asm__("bftst %1{%2,#1}\n\t sne %0"
+ : "=rm"(ret) : "m"(*set), "id"((_sig-1) ^ 31) : "cc");
+ return ret;
+}
+
+#define sigismember(set,sig) \
+ (__builtin_constant_p(sig) ? \
+ __const_sigismember(set,sig) : \
+ __gen_sigismember(set,sig))
+
+#define sigmask(sig) (1UL << ((sig) - 1))
+
+extern __inline__ int sigfindinword(unsigned long word)
+{
+ __asm__("bfffo %1{#0,#0},%0" : "=d"(word) : "d"(word & -word) : "cc");
+ return word ^ 31;
+}
+
+#endif /* __KERNEL__ */
#endif /* _M68K_SIGNAL_H */
diff --git a/include/asm-m68k/socket.h b/include/asm-m68k/socket.h
index 22aa27cc7..cc27f2e32 100644
--- a/include/asm-m68k/socket.h
+++ b/include/asm-m68k/socket.h
@@ -33,4 +33,10 @@
#define SO_SECURITY_ENCRYPTION_TRANSPORT 23
#define SO_SECURITY_ENCRYPTION_NETWORK 24
+#define SO_BINDTODEVICE 25
+
+/* Socket filtering */
+#define SO_ATTACH_FILTER 26
+#define SO_DETACH_FILTER 27
+
#endif /* _ASM_SOCKET_H */
diff --git a/include/asm-m68k/softirq.h b/include/asm-m68k/softirq.h
index 1cc0cbb81..bed386d44 100644
--- a/include/asm-m68k/softirq.h
+++ b/include/asm-m68k/softirq.h
@@ -44,22 +44,22 @@ extern inline void remove_bh(int nr)
bh_mask &= ~(1 << nr);
}
-extern int __m68k_bh_counter;
+extern unsigned int local_bh_count[NR_CPUS];
extern inline void start_bh_atomic(void)
{
- __m68k_bh_counter++;
+ local_bh_count[smp_processor_id()]++;
barrier();
}
extern inline void end_bh_atomic(void)
{
barrier();
- __m68k_bh_counter--;
+ local_bh_count[smp_processor_id()]--;
}
/* These are for the irq's testing the lock */
-#define softirq_trylock() (__m68k_bh_counter ? 0 : (__m68k_bh_counter=1))
-#define softirq_endlock() (__m68k_bh_counter = 0)
+#define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1))
+#define softirq_endlock(cpu) (local_bh_count[cpu] = 0)
#endif
diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h
index fd2eb8991..729f7b34b 100644
--- a/include/asm-m68k/system.h
+++ b/include/asm-m68k/system.h
@@ -8,15 +8,12 @@
extern inline unsigned long rdusp(void) {
unsigned long usp;
- __asm__ __volatile__("movec %/usp,%0"
- : "=d" (usp));
+ __asm__ __volatile__("move %/usp,%0" : "=a" (usp));
return usp;
}
extern inline void wrusp(unsigned long usp) {
- __asm__ __volatile__("movec %0,%/usp"
- :
- : "d" (usp));
+ __asm__ __volatile__("move %0,%/usp" : : "a" (usp));
}
/*
@@ -63,7 +60,7 @@ asmlinkage void resume(void);
struct __xchg_dummy { unsigned long a[100]; };
#define __xg(x) ((volatile struct __xchg_dummy *)(x))
-#if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) && !defined(CONFIG_MAC)
+#if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) && !defined(CONFIG_MAC) && !defined(CONFIG_HADES)
/* block out HSYNC on the atari */
#define __sti() __asm__ __volatile__ ("andiw #0xfbff,%/sr": : : "memory")
#else /* portable version */
diff --git a/include/asm-m68k/types.h b/include/asm-m68k/types.h
index 945edb982..b0ece7bda 100644
--- a/include/asm-m68k/types.h
+++ b/include/asm-m68k/types.h
@@ -47,6 +47,8 @@ typedef unsigned int u32;
typedef signed long long s64;
typedef unsigned long long u64;
+#define BITS_PER_LONG 32
+
#endif /* __KERNEL__ */
#endif /* _M68K_TYPES_H */
diff --git a/include/asm-m68k/ucontext.h b/include/asm-m68k/ucontext.h
new file mode 100644
index 000000000..fb6d732ad
--- /dev/null
+++ b/include/asm-m68k/ucontext.h
@@ -0,0 +1,32 @@
+#ifndef _M68K_UCONTEXT_H
+#define _M68K_UCONTEXT_H
+
+typedef int greg_t;
+#define NGREG 18
+typedef greg_t gregset_t[NGREG];
+
+typedef struct fpregset {
+ int f_pcr;
+ int f_psr;
+ int f_fpiaddr;
+ int f_fpregs[8][3];
+} fpregset_t;
+
+struct mcontext {
+ int version;
+ gregset_t gregs;
+ fpregset_t fpregs;
+};
+
+#define MCONTEXT_VERSION 2
+
+struct ucontext {
+ unsigned long uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ struct mcontext uc_mcontext;
+ unsigned long uc_filler[80];
+ sigset_t uc_sigmask; /* mask last for extensibility */
+};
+
+#endif
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index 0f0ac9976..7c5226b95 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -174,9 +174,19 @@
#define __NR_query_module 167
#define __NR_poll 168
#define __NR_nfsservctl 169
-#define __NR_prctl 170
-#define __NR_pread 171
-#define __NR_pwrite 172
+#define __NR_setresgid 170
+#define __NR_getresgid 171
+#define __NR_prctl 172
+#define __NR_rt_sigreturn 173
+#define __NR_rt_sigaction 174
+#define __NR_rt_sigprocmask 175
+#define __NR_rt_sigpending 176
+#define __NR_rt_sigtimedwait 177
+#define __NR_rt_sigqueueinfo 178
+#define __NR_rt_sigsuspend 179
+#define __NR_pread 180
+#define __NR_pwrite 181
+#define __NR_lchown 182
/* user-visible error numbers are in the range -1 - -122: see
<asm-m68k/errno.h> */
@@ -319,7 +329,7 @@ static inline pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long f
{
register long retval __asm__ ("d0") = __NR_clone;
register long clone_arg __asm__ ("d1") = flags | CLONE_VM;
- unsigned long fs;
+ mm_segment_t fs;
fs = get_fs();
set_fs (KERNEL_DS);