diff options
Diffstat (limited to 'include/asm-m68k')
44 files changed, 1720 insertions, 1315 deletions
diff --git a/include/asm-m68k/amigahw.h b/include/asm-m68k/amigahw.h index f8268fa7d..a7b6c8609 100644 --- a/include/asm-m68k/amigahw.h +++ b/include/asm-m68k/amigahw.h @@ -13,8 +13,101 @@ ** Created: 9/24/92 by Greg Harp */ -#ifndef _ASMm68k_AMIGAHW_H_ -#define _ASMm68k_AMIGAHW_H_ +#ifndef _M68K_AMIGAHW_H +#define _M68K_AMIGAHW_H + + /* + * Different Amiga models + */ + +extern u_long amiga_model; + +#define AMI_UNKNOWN (0) +#define AMI_500 (1) +#define AMI_500PLUS (2) +#define AMI_600 (3) +#define AMI_1000 (4) +#define AMI_1200 (5) +#define AMI_2000 (6) +#define AMI_2500 (7) +#define AMI_3000 (8) +#define AMI_3000T (9) +#define AMI_3000PLUS (10) +#define AMI_4000 (11) +#define AMI_4000T (12) +#define AMI_CDTV (13) +#define AMI_CD32 (14) +#define AMI_DRACO (15) + + + /* + * Chipsets + */ + +extern u_long amiga_chipset; + +#define CS_STONEAGE (0) +#define CS_OCS (1) +#define CS_ECS (2) +#define CS_AGA (3) + + + /* + * Miscellaneous + */ + +extern u_long amiga_eclock; /* 700 kHz E Peripheral Clock */ +extern u_long amiga_masterclock; /* 28 MHz Master Clock */ +extern u_long amiga_colorclock; /* 3.5 MHz Color Clock */ +extern u_long amiga_chip_size; /* Chip RAM Size (bytes) */ +extern u_char amiga_vblank; /* VBLANK Frequency */ +extern u_char amiga_psfreq; /* Power Supply Frequency */ + + +#define AMIGAHW_DECLARE(name) unsigned name : 1 +#define AMIGAHW_SET(name) (amiga_hw_present.name = 1) +#define AMIGAHW_PRESENT(name) (amiga_hw_present.name) + +struct amiga_hw_present { + /* video hardware */ + AMIGAHW_DECLARE(AMI_VIDEO); /* Amiga Video */ + AMIGAHW_DECLARE(AMI_BLITTER); /* Amiga Blitter */ + AMIGAHW_DECLARE(AMBER_FF); /* Amber Flicker Fixer */ + /* sound hardware */ + AMIGAHW_DECLARE(AMI_AUDIO); /* Amiga Audio */ + /* disk storage interfaces */ + AMIGAHW_DECLARE(AMI_FLOPPY); /* Amiga Floppy */ + AMIGAHW_DECLARE(A3000_SCSI); /* SCSI (wd33c93, A3000 alike) */ + AMIGAHW_DECLARE(A4000_SCSI); /* SCSI (ncr53c710, A4000T alike) */ + AMIGAHW_DECLARE(A1200_IDE); /* IDE (A1200 alike) */ + AMIGAHW_DECLARE(A4000_IDE); /* IDE (A4000 alike) */ + AMIGAHW_DECLARE(CD_ROM); /* CD ROM drive */ + /* other I/O hardware */ + AMIGAHW_DECLARE(AMI_KEYBOARD); /* Amiga Keyboard */ + AMIGAHW_DECLARE(AMI_MOUSE); /* Amiga Mouse */ + AMIGAHW_DECLARE(AMI_SERIAL); /* Amiga Serial */ + AMIGAHW_DECLARE(AMI_PARALLEL); /* Amiga Parallel */ + /* real time clocks */ + AMIGAHW_DECLARE(A2000_CLK); /* Hardware Clock (A2000 alike) */ + AMIGAHW_DECLARE(A3000_CLK); /* Hardware Clock (A3000 alike) */ + /* supporting hardware */ + AMIGAHW_DECLARE(CHIP_RAM); /* Chip RAM */ + AMIGAHW_DECLARE(PAULA); /* Paula (8364) */ + AMIGAHW_DECLARE(DENISE); /* Denise (8362) */ + AMIGAHW_DECLARE(DENISE_HR); /* Denise (8373) */ + AMIGAHW_DECLARE(LISA); /* Lisa (8375) */ + AMIGAHW_DECLARE(AGNUS_PAL); /* Normal/Fat PAL Agnus (8367/8371) */ + AMIGAHW_DECLARE(AGNUS_NTSC); /* Normal/Fat NTSC Agnus (8361/8370) */ + AMIGAHW_DECLARE(AGNUS_HR_PAL); /* Fat Hires PAL Agnus (8372) */ + AMIGAHW_DECLARE(AGNUS_HR_NTSC); /* Fat Hires NTSC Agnus (8372) */ + AMIGAHW_DECLARE(ALICE_PAL); /* PAL Alice (8374) */ + AMIGAHW_DECLARE(ALICE_NTSC); /* NTSC Alice (8374) */ + AMIGAHW_DECLARE(MAGIC_REKICK); /* A3000 Magic Hard Rekick */ + AMIGAHW_DECLARE(ZORRO); /* Zorro AutoConfig */ + AMIGAHW_DECLARE(ZORRO3); /* Zorro III */ +}; + +extern struct amiga_hw_present amiga_hw_present; struct CUSTOM { u_short bltddat; @@ -172,15 +265,9 @@ struct CIA { u_char crb; char pade[0xff]; }; -#if 1 #define zTwoBase (0x80000000) #define ZTWO_PADDR(x) (((unsigned long)(x))-zTwoBase) #define ZTWO_VADDR(x) (((unsigned long)(x))+zTwoBase) -#else -#define zTwoBase 0 -#define ZTWO_PADDR(x) (x) -#define ZTWO_VADDR(x) (x) -#endif #define CUSTOM_PHYSADDR (0xdff000) #define custom ((*(volatile struct CUSTOM *)(zTwoBase+CUSTOM_PHYSADDR))) @@ -244,4 +331,4 @@ struct tod2000 { #define TOD2000_HOUR1_PM (1<<2) #define TOD_2000 ((struct tod2000 *)(zTwoBase+0xDC0000)) -#endif /* asm-m68k/amigahw.h */ +#endif /* __ASMm68k_AMIGAHW_H */ diff --git a/include/asm-m68k/amigaints.h b/include/asm-m68k/amigaints.h index 0c225ee7c..53ce7e674 100644 --- a/include/asm-m68k/amigaints.h +++ b/include/asm-m68k/amigaints.h @@ -18,53 +18,65 @@ ** */ -#define AMI_IRQS (24) +#define AUTO_IRQS (8) #define AMI_STD_IRQS (14) #define CIA_IRQS (5) +#define AMI_IRQS (32) /* AUTO_IRQS+AMI_STD_IRQS+2*CIA_IRQS */ /* vertical blanking interrupt */ -#define IRQ_AMIGA_VERTB (IRQ_MACHSPEC | 0) +#define IRQ_AMIGA_VERTB 0 /* copper interrupt */ -#define IRQ_AMIGA_COPPER (IRQ_MACHSPEC | 1) +#define IRQ_AMIGA_COPPER 1 /* Audio interrupts */ -#define IRQ_AMIGA_AUD0 (IRQ_MACHSPEC | 2) -#define IRQ_AMIGA_AUD1 (IRQ_MACHSPEC | 3) -#define IRQ_AMIGA_AUD2 (IRQ_MACHSPEC | 4) -#define IRQ_AMIGA_AUD3 (IRQ_MACHSPEC | 5) +#define IRQ_AMIGA_AUD0 2 +#define IRQ_AMIGA_AUD1 3 +#define IRQ_AMIGA_AUD2 4 +#define IRQ_AMIGA_AUD3 5 /* Blitter done interrupt */ -#define IRQ_AMIGA_BLIT (IRQ_MACHSPEC | 6) +#define IRQ_AMIGA_BLIT 6 /* floppy disk interrupts */ -#define IRQ_AMIGA_DSKSYN (IRQ_MACHSPEC | 7) -#define IRQ_AMIGA_DSKBLK (IRQ_MACHSPEC | 8) +#define IRQ_AMIGA_DSKSYN 7 +#define IRQ_AMIGA_DSKBLK 8 /* builtin serial port interrupts */ -#define IRQ_AMIGA_RBF (IRQ_MACHSPEC | 9) -#define IRQ_AMIGA_TBE (IRQ_MACHSPEC | 10) +#define IRQ_AMIGA_RBF 9 +#define IRQ_AMIGA_TBE 10 /* software interrupts */ -#define IRQ_AMIGA_SOFT (IRQ_MACHSPEC | 11) +#define IRQ_AMIGA_SOFT 11 /* interrupts from external hardware */ -#define IRQ_AMIGA_PORTS (IRQ_MACHSPEC | 12) -#define IRQ_AMIGA_EXTER (IRQ_MACHSPEC | 13) +#define IRQ_AMIGA_PORTS 12 +#define IRQ_AMIGA_EXTER 13 /* CIA interrupt sources */ -#define IRQ_AMIGA_CIAA (IRQ_MACHSPEC | 14) -#define IRQ_AMIGA_CIAA_TA (IRQ_MACHSPEC | 14) -#define IRQ_AMIGA_CIAA_TB (IRQ_MACHSPEC | 15) -#define IRQ_AMIGA_CIAA_ALRM (IRQ_MACHSPEC | 16) -#define IRQ_AMIGA_CIAA_SP (IRQ_MACHSPEC | 17) -#define IRQ_AMIGA_CIAA_FLG (IRQ_MACHSPEC | 18) -#define IRQ_AMIGA_CIAB (IRQ_MACHSPEC | 19) -#define IRQ_AMIGA_CIAB_TA (IRQ_MACHSPEC | 19) -#define IRQ_AMIGA_CIAB_TB (IRQ_MACHSPEC | 20) -#define IRQ_AMIGA_CIAB_ALRM (IRQ_MACHSPEC | 21) -#define IRQ_AMIGA_CIAB_SP (IRQ_MACHSPEC | 22) -#define IRQ_AMIGA_CIAB_FLG (IRQ_MACHSPEC | 23) +#define IRQ_AMIGA_CIAA 14 +#define IRQ_AMIGA_CIAA_TA 14 +#define IRQ_AMIGA_CIAA_TB 15 +#define IRQ_AMIGA_CIAA_ALRM 16 +#define IRQ_AMIGA_CIAA_SP 17 +#define IRQ_AMIGA_CIAA_FLG 18 +#define IRQ_AMIGA_CIAB 19 +#define IRQ_AMIGA_CIAB_TA 19 +#define IRQ_AMIGA_CIAB_TB 20 +#define IRQ_AMIGA_CIAB_ALRM 21 +#define IRQ_AMIGA_CIAB_SP 22 +#define IRQ_AMIGA_CIAB_FLG 23 + +/* auto-vector interrupts */ +#define IRQ_AMIGA_AUTO 24 +#define IRQ_AMIGA_AUTO_0 24 /* This is just a dummy */ +#define IRQ_AMIGA_AUTO_1 25 +#define IRQ_AMIGA_AUTO_2 26 +#define IRQ_AMIGA_AUTO_3 27 +#define IRQ_AMIGA_AUTO_4 28 +#define IRQ_AMIGA_AUTO_5 29 +#define IRQ_AMIGA_AUTO_6 30 +#define IRQ_AMIGA_AUTO_7 31 #define IRQ_FLOPPY IRQ_AMIGA_DSKBLK diff --git a/include/asm-m68k/amigatypes.h b/include/asm-m68k/amigatypes.h deleted file mode 100644 index 21a80d9dc..000000000 --- a/include/asm-m68k/amigatypes.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -** linux/amigatypes.h -- Types used in Amiga Linux kernel source -** -** Copyright 1992 by Greg Harp -** -** 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. -** -** Created 09/29/92 by Greg Harp -** -** Moved all Zorro definitions to asm/zorro.h which is where they -** really belong - 24/11/95 Jes Sorensen -*/ - -#ifndef _LINUX_AMIGATYPES_H_ -#define _LINUX_AMIGATYPES_H_ - -#ifdef __KERNEL__ /* only if compiling the kernel */ -#include <linux/types.h> -#endif - -/* - * Different models of Amiga - */ -#define AMI_UNKNOWN (0) -#define AMI_500 (1) -#define AMI_500PLUS (2) -#define AMI_600 (3) -#define AMI_1000 (4) -#define AMI_1200 (5) -#define AMI_2000 (6) -#define AMI_2500 (7) -#define AMI_3000 (8) -#define AMI_3000T (9) -#define AMI_3000PLUS (10) -#define AMI_4000 (11) -#define AMI_4000T (12) -#define AMI_CDTV (13) -#define AMI_CD32 (14) -#define AMI_DRACO (15) - -/* - * chipsets - */ -#define CS_STONEAGE (0) -#define CS_OCS (1) -#define CS_ECS (2) -#define CS_AGA (3) - -/* - * Amiga clocks - */ - -extern u_long amiga_masterclock; /* 28 MHz */ -extern u_long amiga_colorclock; /* 3.5 MHz */ -#define amiga_eclock boot_info.bi_amiga.eclock /* 700 kHz */ - -#endif /* asm-m68k/amigatypes.h */ diff --git a/include/asm-m68k/atarihw.h b/include/asm-m68k/atarihw.h index 3fccb4775..5b137e769 100644 --- a/include/asm-m68k/atarihw.h +++ b/include/asm-m68k/atarihw.h @@ -22,6 +22,69 @@ #include <linux/types.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 + +/* + * 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 + * important what hardware the machine uses + */ + +/* ++roman 08/08/95: rewritten from ORing constants to a C bitfield */ + +#define ATARIHW_DECLARE(name) unsigned name : 1 +#define ATARIHW_SET(name) (atari_hw_present.name = 1) +#define ATARIHW_PRESENT(name) (atari_hw_present.name) + +struct atari_hw_present { + /* video hardware */ + ATARIHW_DECLARE(STND_SHIFTER); /* ST-Shifter - no base low ! */ + ATARIHW_DECLARE(EXTD_SHIFTER); /* STe-Shifter - 24 bit address */ + ATARIHW_DECLARE(TT_SHIFTER); /* TT-Shifter */ + ATARIHW_DECLARE(VIDEL_SHIFTER); /* Falcon-Shifter */ + /* sound hardware */ + ATARIHW_DECLARE(YM_2149); /* Yamaha YM 2149 */ + ATARIHW_DECLARE(PCM_8BIT); /* PCM-Sound in STe-ATARI */ + ATARIHW_DECLARE(CODEC); /* CODEC Sound (Falcon) */ + /* disk storage interfaces */ + ATARIHW_DECLARE(TT_SCSI); /* Directly mapped NCR5380 */ + ATARIHW_DECLARE(ST_SCSI); /* NCR5380 via ST-DMA (Falcon) */ + ATARIHW_DECLARE(ACSI); /* Standard ACSI like in STs */ + ATARIHW_DECLARE(IDE); /* IDE Interface */ + ATARIHW_DECLARE(FDCSPEED); /* 8/16 MHz switch for FDC */ + /* other I/O hardware */ + ATARIHW_DECLARE(ST_MFP); /* The ST-MFP (there should be no Atari + without it... but who knows?) */ + ATARIHW_DECLARE(TT_MFP); /* 2nd MFP */ + ATARIHW_DECLARE(SCC); /* Serial Communications Contr. */ + ATARIHW_DECLARE(ST_ESCC); /* SCC Z83230 in an ST */ + ATARIHW_DECLARE(ANALOG_JOY); /* Paddle Interface for STe + and Falcon */ + ATARIHW_DECLARE(MICROWIRE); /* Microwire Interface */ + /* DMA */ + ATARIHW_DECLARE(STND_DMA); /* 24 Bit limited ST-DMA */ + ATARIHW_DECLARE(EXTD_DMA); /* 32 Bit ST-DMA */ + ATARIHW_DECLARE(SCSI_DMA); /* DMA for the NCR5380 */ + ATARIHW_DECLARE(SCC_DMA); /* DMA for the SCC */ + /* real time clocks */ + ATARIHW_DECLARE(TT_CLK); /* TT compatible clock chip */ + ATARIHW_DECLARE(MSTE_CLK); /* Mega ST(E) clock chip */ + /* supporting hardware */ + ATARIHW_DECLARE(SCU); /* System Control Unit */ + ATARIHW_DECLARE(BLITTER); /* Blitter */ + ATARIHW_DECLARE(VME); /* VME Bus */ + ATARIHW_DECLARE(DSP56K); /* DSP56k processor in Falcon */ +}; + +extern struct atari_hw_present atari_hw_present; + + /* Reading the MFP port register gives a machine independent delay, since the * MFP always has a 8 MHz clock. This avoids problems with the varying length * of nops on various machines. Somebody claimed that the tstb takes 600 ns. @@ -35,6 +98,7 @@ 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 @@ -294,8 +358,8 @@ struct CODEC { u_char tracks; u_char input_source; -#define CODEC_SOURCE_MATRIX 1 -#define CODEC_SOURCE_ADC 2 +#define CODEC_SOURCE_ADC 1 +#define CODEC_SOURCE_MATRIX 2 u_char adc_source; #define ADC_SOURCE_RIGHT_PSG 1 #define ADC_SOURCE_LEFT_PSG 2 @@ -611,17 +675,28 @@ struct TT_DMASND { }; # define tt_dmasnd ((*(volatile struct TT_DMASND *)TT_DMASND_BAS)) -#define DMASND_CTRL_OFF 0x00 -#define DMASND_CTRL_ON 0x01 -#define DMASND_CTRL_REPEAT 0x02 -#define DMASND_MODE_MONO 0x80 -#define DMASND_MODE_STEREO 0x00 -#define DMASND_MODE_8BIT 0x00 -#define DMASND_MODE_16BIT 0x40 /* Falcon only */ -#define DMASND_MODE_6KHZ 0x00 /* Falcon: mute */ -#define DMASND_MODE_12KHZ 0x01 -#define DMASND_MODE_25KHZ 0x02 -#define DMASND_MODE_50KHZ 0x03 +#define DMASND_MFP_INT_REPLAY 0x01 +#define DMASND_MFP_INT_RECORD 0x02 +#define DMASND_TIMERA_INT_REPLAY 0x04 +#define DMASND_TIMERA_INT_RECORD 0x08 + +#define DMASND_CTRL_OFF 0x00 +#define DMASND_CTRL_ON 0x01 +#define DMASND_CTRL_REPEAT 0x02 +#define DMASND_CTRL_RECORD_ON 0x10 +#define DMASND_CTRL_RECORD_OFF 0x00 +#define DMASND_CTRL_RECORD_REPEAT 0x20 +#define DMASND_CTRL_SELECT_REPLAY 0x00 +#define DMASND_CTRL_SELECT_RECORD 0x80 +#define DMASND_MODE_MONO 0x80 +#define DMASND_MODE_STEREO 0x00 +#define DMASND_MODE_8BIT 0x00 +#define DMASND_MODE_16BIT 0x40 /* Falcon only */ +#define DMASND_MODE_6KHZ 0x00 /* Falcon: mute */ +#define DMASND_MODE_12KHZ 0x01 +#define DMASND_MODE_25KHZ 0x02 +#define DMASND_MODE_50KHZ 0x03 + #define DMASNDSetBase(bufstart) \ do { \ diff --git a/include/asm-m68k/atariints.h b/include/asm-m68k/atariints.h index e2bb42b4c..c151f55a9 100644 --- a/include/asm-m68k/atariints.h +++ b/include/asm-m68k/atariints.h @@ -26,11 +26,11 @@ ** */ -#define STMFP_SOURCE_BASE 8 -#define TTMFP_SOURCE_BASE 24 -#define SCC_SOURCE_BASE 40 -#define VME_SOURCE_BASE 56 -#define VME_MAX_SOURCES 16 +#define STMFP_SOURCE_BASE 8 +#define TTMFP_SOURCE_BASE 24 +#define SCC_SOURCE_BASE 40 +#define VME_SOURCE_BASE 56 +#define VME_MAX_SOURCES 16 #define NUM_ATARI_SOURCES (VME_SOURCE_BASE+VME_MAX_SOURCES-STMFP_SOURCE_BASE) @@ -45,65 +45,65 @@ #define IRQ_TYPE_FAST 1 #define IRQ_TYPE_PRIO 2 -#define IRQ_SPURIOUS (IRQ_MACHSPEC | 0) +#define IRQ_SPURIOUS (0) /* auto-vector interrupts */ -#define IRQ_AUTO_1 (IRQ_MACHSPEC | 1) -#define IRQ_AUTO_2 (IRQ_MACHSPEC | 2) -#define IRQ_AUTO_3 (IRQ_MACHSPEC | 3) -#define IRQ_AUTO_4 (IRQ_MACHSPEC | 4) -#define IRQ_AUTO_5 (IRQ_MACHSPEC | 5) -#define IRQ_AUTO_6 (IRQ_MACHSPEC | 6) -#define IRQ_AUTO_7 (IRQ_MACHSPEC | 7) +#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) /* ST-MFP interrupts */ -#define IRQ_MFP_BUSY (IRQ_MACHSPEC | 8) -#define IRQ_MFP_DCD (IRQ_MACHSPEC | 9) -#define IRQ_MFP_CTS (IRQ_MACHSPEC | 10) -#define IRQ_MFP_GPU (IRQ_MACHSPEC | 11) -#define IRQ_MFP_TIMD (IRQ_MACHSPEC | 12) -#define IRQ_MFP_TIMC (IRQ_MACHSPEC | 13) -#define IRQ_MFP_ACIA (IRQ_MACHSPEC | 14) -#define IRQ_MFP_FDC (IRQ_MACHSPEC | 15) +#define IRQ_MFP_BUSY (8) +#define IRQ_MFP_DCD (9) +#define IRQ_MFP_CTS (10) +#define IRQ_MFP_GPU (11) +#define IRQ_MFP_TIMD (12) +#define IRQ_MFP_TIMC (13) +#define IRQ_MFP_ACIA (14) +#define IRQ_MFP_FDC (15) #define IRQ_MFP_ACSI IRQ_MFP_FDC #define IRQ_MFP_FSCSI IRQ_MFP_FDC #define IRQ_MFP_IDE IRQ_MFP_FDC -#define IRQ_MFP_TIMB (IRQ_MACHSPEC | 16) -#define IRQ_MFP_SERERR (IRQ_MACHSPEC | 17) -#define IRQ_MFP_SEREMPT (IRQ_MACHSPEC | 18) -#define IRQ_MFP_RECERR (IRQ_MACHSPEC | 19) -#define IRQ_MFP_RECFULL (IRQ_MACHSPEC | 20) -#define IRQ_MFP_TIMA (IRQ_MACHSPEC | 21) -#define IRQ_MFP_RI (IRQ_MACHSPEC | 22) -#define IRQ_MFP_MMD (IRQ_MACHSPEC | 23) +#define IRQ_MFP_TIMB (16) +#define IRQ_MFP_SERERR (17) +#define IRQ_MFP_SEREMPT (18) +#define IRQ_MFP_RECERR (19) +#define IRQ_MFP_RECFULL (20) +#define IRQ_MFP_TIMA (21) +#define IRQ_MFP_RI (22) +#define IRQ_MFP_MMD (23) /* TT-MFP interrupts */ -#define IRQ_TT_MFP_IO0 (IRQ_MACHSPEC | 24) -#define IRQ_TT_MFP_IO1 (IRQ_MACHSPEC | 25) -#define IRQ_TT_MFP_SCC (IRQ_MACHSPEC | 26) -#define IRQ_TT_MFP_RI (IRQ_MACHSPEC | 27) -#define IRQ_TT_MFP_TIMD (IRQ_MACHSPEC | 28) -#define IRQ_TT_MFP_TIMC (IRQ_MACHSPEC | 29) -#define IRQ_TT_MFP_DRVRDY (IRQ_MACHSPEC | 30) -#define IRQ_TT_MFP_SCSIDMA (IRQ_MACHSPEC | 31) -#define IRQ_TT_MFP_TIMB (IRQ_MACHSPEC | 32) -#define IRQ_TT_MFP_SERERR (IRQ_MACHSPEC | 33) -#define IRQ_TT_MFP_SEREMPT (IRQ_MACHSPEC | 34) -#define IRQ_TT_MFP_RECERR (IRQ_MACHSPEC | 35) -#define IRQ_TT_MFP_RECFULL (IRQ_MACHSPEC | 36) -#define IRQ_TT_MFP_TIMA (IRQ_MACHSPEC | 37) -#define IRQ_TT_MFP_RTC (IRQ_MACHSPEC | 38) -#define IRQ_TT_MFP_SCSI (IRQ_MACHSPEC | 39) +#define IRQ_TT_MFP_IO0 (24) +#define IRQ_TT_MFP_IO1 (25) +#define IRQ_TT_MFP_SCC (26) +#define IRQ_TT_MFP_RI (27) +#define IRQ_TT_MFP_TIMD (28) +#define IRQ_TT_MFP_TIMC (29) +#define IRQ_TT_MFP_DRVRDY (30) +#define IRQ_TT_MFP_SCSIDMA (31) +#define IRQ_TT_MFP_TIMB (32) +#define IRQ_TT_MFP_SERERR (33) +#define IRQ_TT_MFP_SEREMPT (34) +#define IRQ_TT_MFP_RECERR (35) +#define IRQ_TT_MFP_RECFULL (36) +#define IRQ_TT_MFP_TIMA (37) +#define IRQ_TT_MFP_RTC (38) +#define IRQ_TT_MFP_SCSI (39) /* SCC interrupts */ -#define IRQ_SCCB_TX (IRQ_MACHSPEC | 40) -#define IRQ_SCCB_STAT (IRQ_MACHSPEC | 42) -#define IRQ_SCCB_RX (IRQ_MACHSPEC | 44) -#define IRQ_SCCB_SPCOND (IRQ_MACHSPEC | 46) -#define IRQ_SCCA_TX (IRQ_MACHSPEC | 48) -#define IRQ_SCCA_STAT (IRQ_MACHSPEC | 50) -#define IRQ_SCCA_RX (IRQ_MACHSPEC | 52) -#define IRQ_SCCA_SPCOND (IRQ_MACHSPEC | 54) +#define IRQ_SCCB_TX (40) +#define IRQ_SCCB_STAT (42) +#define IRQ_SCCB_RX (44) +#define IRQ_SCCB_SPCOND (46) +#define IRQ_SCCA_TX (48) +#define IRQ_SCCA_STAT (50) +#define IRQ_SCCA_RX (52) +#define IRQ_SCCA_SPCOND (54) #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */ @@ -164,7 +164,6 @@ static inline void clear_mfp_bit( unsigned irq, int type ) static inline void atari_enable_irq( unsigned irq ) { - irq &= ~IRQ_MACHSPEC; if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return; set_mfp_bit( irq, MFP_MASK ); } @@ -172,7 +171,6 @@ static inline void atari_enable_irq( unsigned irq ) static inline void atari_disable_irq( unsigned irq ) { - irq &= ~IRQ_MACHSPEC; if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return; clear_mfp_bit( irq, MFP_MASK ); } @@ -185,7 +183,6 @@ static inline void atari_disable_irq( unsigned irq ) extern inline void atari_turnon_irq( unsigned irq ) { - irq &= ~IRQ_MACHSPEC; if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return; set_mfp_bit( irq, MFP_ENABLE ); } @@ -193,7 +190,6 @@ extern inline void atari_turnon_irq( unsigned irq ) extern inline void atari_turnoff_irq( unsigned irq ) { - irq &= ~IRQ_MACHSPEC; if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return; clear_mfp_bit( irq, MFP_ENABLE ); clear_mfp_bit( irq, MFP_PENDING ); @@ -202,7 +198,6 @@ extern inline void atari_turnoff_irq( unsigned irq ) extern inline void atari_clear_pending_irq( unsigned irq ) { - irq &= ~IRQ_MACHSPEC; if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return; clear_mfp_bit( irq, MFP_PENDING ); } @@ -210,7 +205,6 @@ extern inline void atari_clear_pending_irq( unsigned irq ) extern inline int atari_irq_pending( unsigned irq ) { - irq &= ~IRQ_MACHSPEC; if (irq < STMFP_SOURCE_BASE || irq >= SCC_SOURCE_BASE) return( 0 ); return( get_mfp_bit( irq, MFP_PENDING ) ); } diff --git a/include/asm-m68k/atomic.h b/include/asm-m68k/atomic.h index 8ea909203..b57cc9cb0 100644 --- a/include/asm-m68k/atomic.h +++ b/include/asm-m68k/atomic.h @@ -10,33 +10,43 @@ * We do not have SMP m68k systems, so we don't have to deal with that. */ -typedef int atomic_t; +typedef struct { int counter; } atomic_t; +#define ATOMIC_INIT { 0 } -static __inline__ void atomic_add(atomic_t i, atomic_t *v) +#define atomic_read(v) ((v)->counter) +#define atomic_set(v, i) (((v)->counter) = i) + +static __inline__ void atomic_add(int i, atomic_t *v) { __asm__ __volatile__("addl %1,%0" : : "m" (*v), "id" (i)); } -static __inline__ void atomic_sub(atomic_t i, atomic_t *v) +static __inline__ void atomic_sub(int i, atomic_t *v) { __asm__ __volatile__("subl %1,%0" : : "m" (*v), "id" (i)); } -static __inline__ void atomic_inc(atomic_t *v) +static __inline__ void atomic_inc(volatile atomic_t *v) { __asm__ __volatile__("addql #1,%0" : : "m" (*v)); } -static __inline__ void atomic_dec(atomic_t *v) +static __inline__ void atomic_dec(volatile atomic_t *v) { __asm__ __volatile__("subql #1,%0" : : "m" (*v)); } -static __inline__ int atomic_dec_and_test(atomic_t *v) +static __inline__ int atomic_dec_and_test(volatile atomic_t *v) { char c; __asm__ __volatile__("subql #1,%1; seq %0" : "=d" (c) : "m" (*v)); return c != 0; } +#define atomic_clear_mask(mask, v) \ + __asm__ __volatile__("andl %1,%0" : : "m" (*v), "id" (~(mask))) + +#define atomic_set_mask(mask, v) \ + __asm__ __volatile__("orl %1,%0" : : "m" (*v), "id" (mask)); + #endif /* __ARCH_M68K_ATOMIC __ */ diff --git a/include/asm-m68k/bootinfo.h b/include/asm-m68k/bootinfo.h new file mode 100644 index 000000000..5c1f215a9 --- /dev/null +++ b/include/asm-m68k/bootinfo.h @@ -0,0 +1,214 @@ +/* +** asm/bootinfo.h -- Definition of the Linux/m68k boot information structure +** +** Copyright 1992 by Greg Harp +** +** 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. +** +** Created 09/29/92 by Greg Harp +** +** 5/2/94 Roman Hodek: +** Added bi_atari part of the machine dependent union bi_un; for now it +** contains just a model field to distinguish between TT and Falcon. +** 26/7/96 Roman Zippel: +** Renamed to setup.h; added some useful macros to allow gcc some +** optimizations if possible. +** 5/10/96 Geert Uytterhoeven: +** Redesign of the boot information structure; renamed to bootinfo.h again +** 27/11/96 Geert Uytterhoeven: +** Backwards compatibility with bootinfo interface version 1.0 +*/ + +#ifndef _M68K_BOOTINFO_H +#define _M68K_BOOTINFO_H + + + /* + * Bootinfo definitions + * + * This is an easily parsable and extendable structure containing all + * information to be passed from the bootstrap to the kernel. + * + * This way I hope to keep all future changes back/forewards compatible. + * Thus, keep your fingers crossed... + * + * This structure is copied right after the kernel bss by the bootstrap + * routine. + */ + +#ifndef __ASSEMBLY__ + +struct bi_record { + unsigned short tag; /* tag ID */ + unsigned short size; /* size of record (in bytes) */ + unsigned long data[0]; /* data */ +}; + +#else /* __ASSEMBLY__ */ + +BIR_tag = 0 +BIR_size = BIR_tag+2 +BIR_data = BIR_size+2 + +#endif /* __ASSEMBLY__ */ + + + /* + * Tag Definitions + * + * Machine independent tags start counting from 0x0000 + * Machine dependent tags start counting from 0x8000 + */ + +#define BI_LAST 0x0000 /* last record (sentinel) */ +#define BI_MACHTYPE 0x0001 /* machine type (u_long) */ +#define BI_CPUTYPE 0x0002 /* cpu type (u_long) */ +#define BI_FPUTYPE 0x0003 /* fpu type (u_long) */ +#define BI_MMUTYPE 0x0004 /* mmu type (u_long) */ +#define BI_MEMCHUNK 0x0005 /* memory chunk address and size */ + /* (struct mem_info) */ +#define BI_RAMDISK 0x0006 /* ramdisk address and size */ + /* (struct mem_info) */ +#define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */ + /* (string) */ + + /* + * Amiga-specific tags + */ + +#define BI_AMIGA_MODEL 0x8000 /* model (u_long) */ +#define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */ + /* (struct ConfigDev) */ +#define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (u_long) */ +#define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (u_char) */ +#define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (u_char) */ +#define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (u_long) */ +#define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (u_long) */ +#define BI_AMIGA_SERPER 0x8007 /* serial port period (u_short) */ + + /* + * Atari-specific tags + */ + +#define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */ + + + /* + * Stuff for bootinfo interface versioning + * + * At the start of kernel code, a 'struct bootversion' is located. + * bootstrap checks for a matching version of the interface before booting + * a kernel, to avoid user confusion if kernel and bootstrap don't work + * together :-) + * + * If incompatible changes are made to the bootinfo interface, the major + * number below should be stepped (and the minor reset to 0) for the + * appropriate machine. If a change is backward-compatible, the minor + * should be stepped. "Backwards-compatible" means that booting will work, + * but certain features may not. + */ + +#define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */ +#define MK_BI_VERSION(major,minor) (((major)<<16)+(minor)) +#define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff) +#define BI_VERSION_MINOR(v) ((v) & 0xffff) + +#ifndef __ASSEMBLY__ + +struct bootversion { + unsigned short branch; + unsigned long magic; + struct { + unsigned long machtype; + unsigned long version; + } machversions[0]; +}; + +#endif /* __ASSEMBLY__ */ + +#define AMIGA_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) +#define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) + + +#ifdef BOOTINFO_COMPAT_1_0 + + /* + * Backwards compatibility with bootinfo interface version 1.0 + */ + +#define COMPAT_AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) +#define COMPAT_ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) + +#include <linux/zorro.h> + +#define COMPAT_NUM_AUTO 16 + +struct compat_bi_Amiga { + int model; + int num_autocon; + struct ConfigDev autocon[COMPAT_NUM_AUTO]; + unsigned long chip_size; + unsigned char vblank; + unsigned char psfreq; + unsigned long eclock; + unsigned long chipset; + unsigned long hw_present; +}; + +struct compat_bi_Atari { + unsigned long hw_present; + unsigned long mch_cookie; +}; + +struct compat_mem_info { + unsigned long addr; + unsigned long size; +}; + +#define COMPAT_NUM_MEMINFO 4 + +#define COMPAT_CPUB_68020 0 +#define COMPAT_CPUB_68030 1 +#define COMPAT_CPUB_68040 2 +#define COMPAT_CPUB_68060 3 +#define COMPAT_FPUB_68881 5 +#define COMPAT_FPUB_68882 6 +#define COMPAT_FPUB_68040 7 +#define COMPAT_FPUB_68060 8 + +#define COMPAT_CPU_68020 (1<<COMPAT_CPUB_68020) +#define COMPAT_CPU_68030 (1<<COMPAT_CPUB_68030) +#define COMPAT_CPU_68040 (1<<COMPAT_CPUB_68040) +#define COMPAT_CPU_68060 (1<<COMPAT_CPUB_68060) +#define COMPAT_CPU_MASK (31) +#define COMPAT_FPU_68881 (1<<COMPAT_FPUB_68881) +#define COMPAT_FPU_68882 (1<<COMPAT_FPUB_68882) +#define COMPAT_FPU_68040 (1<<COMPAT_FPUB_68040) +#define COMPAT_FPU_68060 (1<<COMPAT_FPUB_68060) +#define COMPAT_FPU_MASK (0xfe0) + +#define COMPAT_CL_SIZE (256) + +struct compat_bootinfo { + unsigned long machtype; + unsigned long cputype; + struct compat_mem_info memory[COMPAT_NUM_MEMINFO]; + int num_memory; + unsigned long ramdisk_size; + unsigned long ramdisk_addr; + char command_line[COMPAT_CL_SIZE]; + union { + struct compat_bi_Amiga bi_ami; + struct compat_bi_Atari bi_ata; + } bi_un; +}; + +#define bi_amiga bi_un.bi_ami +#define bi_atari bi_un.bi_ata + +#endif /* BOOTINFO_COMPAT_1_0 */ + + +#endif /* _M68K_BOOTINFO_H */ diff --git a/include/asm-m68k/byteorder.h b/include/asm-m68k/byteorder.h index c6c9fc1e9..cbc560777 100644 --- a/include/asm-m68k/byteorder.h +++ b/include/asm-m68k/byteorder.h @@ -10,7 +10,6 @@ #endif #ifdef __KERNEL__ -#include <linux/config.h> #include <asm/types.h> /* @@ -19,15 +18,23 @@ */ #define le16_to_cpu(__val) __swab16(__val) -#define le32_to_cpu(__val) __swab32(__val) -#define cpu_to_le32(__val) __swab32(__val) #define cpu_to_le16(__val) __swab16(__val) +#define le32_to_cpu(x) \ +(__builtin_constant_p(x) ? __constant_swab32(x) : __swab32(x)) +#define cpu_to_le32(x) \ +(__builtin_constant_p(x) ? __constant_swab32(x) : __swab32(x)) extern __inline__ __u16 __swab16 (__u16 val) { return (val << 8) | (val >> 8); } +extern __inline__ __u32 __constant_swab32 (__u32 val) +{ + return (val << 24) | ((val << 8) & 0xff0000) | + ((val >> 8) & 0xff00) | (val >> 24); +} + extern __inline__ __u32 __swab32 (__u32 val) { __asm__ ("rolw #8,%0; swap %0; rolw #8,%0" : "=d" (val) : "0" (val)); diff --git a/include/asm-m68k/cache.h b/include/asm-m68k/cache.h new file mode 100644 index 000000000..1be543522 --- /dev/null +++ b/include/asm-m68k/cache.h @@ -0,0 +1,12 @@ +/* + * include/asm-m68k/cache.h + */ +#ifndef __ARCH_M68K_CACHE_H +#define __ARCH_M68K_CACHE_H + +/* bytes per L1 cache line */ +#define L1_CACHE_BYTES 16 + +#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1)) + +#endif diff --git a/include/asm-m68k/checksum.h b/include/asm-m68k/checksum.h index 6b4976567..64adc2a4e 100644 --- a/include/asm-m68k/checksum.h +++ b/include/asm-m68k/checksum.h @@ -35,6 +35,9 @@ unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum); unsigned int csum_partial_copy_fromuser(const char *src, char *dst, int len, int sum); +extern unsigned int +csum_partial_copy_from_user ( const char *src, char *dst, + int len, int sum, int *csum_err); /* * This is a version of ip_compute_csum() optimized for IP headers, @@ -110,4 +113,35 @@ ip_compute_csum(unsigned char * buff, int len) return csum_fold (csum_partial(buff, len, 0)); } +#define _HAVE_ARCH_IPV6_CSUM +static __inline__ unsigned short int +csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, + __u16 len, unsigned short proto, unsigned int sum) +{ + register unsigned long tmp; + __asm__("addl %2@,%0\n\t" + "movel %2@(4),%1\n\t" + "addxl %1,%0\n\t" + "movel %2@(8),%1\n\t" + "addxl %1,%0\n\t" + "movel %2@(12),%1\n\t" + "addxl %1,%0\n\t" + "movel %3@,%1\n\t" + "addxl %1,%0\n\t" + "movel %3@(4),%1\n\t" + "addxl %1,%0\n\t" + "movel %3@(8),%1\n\t" + "addxl %1,%0\n\t" + "movel %3@(12),%1\n\t" + "addxl %1,%0\n\t" + "addxl %4,%0\n\t" + "clrl %1\n\t" + "addxl %1,%0" + : "=&d" (sum), "=&d" (tmp) + : "a" (saddr), "a" (daddr), "d" ((__u32) len + proto), + "0" (sum)); + + return csum_fold(sum); +} + #endif /* _M68K_CHECKSUM_H */ diff --git a/include/asm-m68k/current.h b/include/asm-m68k/current.h new file mode 100644 index 000000000..9d542c79d --- /dev/null +++ b/include/asm-m68k/current.h @@ -0,0 +1,12 @@ +#ifndef _M68K_CURRENT_H +#define _M68K_CURRENT_H + +/* Some architectures may want to do something "clever" here since + * this is the most frequently accessed piece of data in the entire + * kernel. For an example, see the Sparc implementation where an + * entire register is hard locked to contain the value of current. + */ +extern struct task_struct *current_set[NR_CPUS]; +#define current (current_set[smp_processor_id()]) /* Current on this processor */ + +#endif /* !(_M68K_CURRENT_H) */ diff --git a/include/asm-m68k/dsp56k.h b/include/asm-m68k/dsp56k.h new file mode 100644 index 000000000..e035055bc --- /dev/null +++ b/include/asm-m68k/dsp56k.h @@ -0,0 +1,70 @@ +/* + * linux/include/asm-m68k/dsp56k.h - defines and declarations for + * DSP56k device driver + * + * Copyright (C) 1996,1997 Fredrik Noring, lars brinkhoff & Tomas Berndtsson + * + * 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. + */ + + +/* Used for uploading DSP binary code */ +struct dsp56k_upload { + int len; + char *bin; +}; + +/* For the DSP host flags */ +struct dsp56k_host_flags { + int dir; /* Bit field. 1 = write output bit, 0 = do nothing. + * 0x0000 means reading only, 0x0011 means + * writing the bits stored in `out' on HF0 and HF1. + * Note that HF2 and HF3 can only be read. + */ + int out; /* Bit field like above. */ + int status; /* Host register's current state is returned */ +}; + +/* ioctl command codes */ +#define DSP56K_UPLOAD 1 /* Upload DSP binary program */ +#define DSP56K_SET_TX_WSIZE 2 /* Host transmit word size (1-4) */ +#define DSP56K_SET_RX_WSIZE 3 /* Host receive word size (1-4) */ +#define DSP56K_HOST_FLAGS 4 /* Host flag registers */ +#define DSP56K_HOST_CMD 5 /* Trig Host Command (0-31) */ +/* + * linux/include/asm-m68k/dsp56k.h - defines and declarations for + * DSP56k device driver + * + * Copyright (C) 1996,1997 Fredrik Noring, lars brinkhoff & Tomas Berndtsson + * + * 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. + */ + + +/* Used for uploading DSP binary code */ +struct dsp56k_upload { + int len; + char *bin; +}; + +/* For the DSP host flags */ +struct dsp56k_host_flags { + int dir; /* Bit field. 1 = write output bit, 0 = do nothing. + * 0x0000 means reading only, 0x0011 means + * writing the bits stored in `out' on HF0 and HF1. + * Note that HF2 and HF3 can only be read. + */ + int out; /* Bit field like above. */ + int status; /* Host register's current state is returned */ +}; + +/* ioctl command codes */ +#define DSP56K_UPLOAD 1 /* Upload DSP binary program */ +#define DSP56K_SET_TX_WSIZE 2 /* Host transmit word size (1-4) */ +#define DSP56K_SET_RX_WSIZE 3 /* Host receive word size (1-4) */ +#define DSP56K_HOST_FLAGS 4 /* Host flag registers */ +#define DSP56K_HOST_CMD 5 /* Trig Host Command (0-31) */ diff --git a/include/asm-m68k/errno.h b/include/asm-m68k/errno.h index de8949f56..1ee6485ab 100644 --- a/include/asm-m68k/errno.h +++ b/include/asm-m68k/errno.h @@ -126,4 +126,7 @@ #define EREMOTEIO 121 /* Remote I/O error */ #define EDQUOT 122 /* Quota exceeded */ +#define ENOMEDIUM 123 /* No medium found */ +#define EMEDIUMTYPE 124 /* Wrong medium type */ + #endif /* _M68K_ERRNO_H */ diff --git a/include/asm-m68k/fpu.h b/include/asm-m68k/fpu.h new file mode 100644 index 000000000..fc47dac02 --- /dev/null +++ b/include/asm-m68k/fpu.h @@ -0,0 +1,40 @@ +#ifndef __M68K_FPU_H +#define __M68K_FPU_H + +#include <linux/config.h> + +/* + * MAX floating point unit state size (FSAVE/FRESTORE) + */ + +#if defined(CONFIG_M68020) || defined(CONFIG_M68030) +#define FPSTATESIZE (216/sizeof(unsigned char)) +#elif defined(CONFIG_M68040) +#define FPSTATESIZE (96/sizeof(unsigned char)) +#elif defined(CONFIG_M68060) +#define FPSTATESIZE (12/sizeof(unsigned char)) +#else +#define FPSTATESIZE error no_cpu_type_configured +#endif + +#endif /* __M68K_FPU_H */ +#ifndef __M68K_FPU_H +#define __M68K_FPU_H + +#include <linux/config.h> + +/* + * MAX floating point unit state size (FSAVE/FRESTORE) + */ + +#if defined(CONFIG_M68020) || defined(CONFIG_M68030) +#define FPSTATESIZE (216/sizeof(unsigned char)) +#elif defined(CONFIG_M68040) +#define FPSTATESIZE (96/sizeof(unsigned char)) +#elif defined(CONFIG_M68060) +#define FPSTATESIZE (12/sizeof(unsigned char)) +#else +#define FPSTATESIZE error no_cpu_type_configured +#endif + +#endif /* __M68K_FPU_H */ diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h new file mode 100644 index 000000000..e9d0136c3 --- /dev/null +++ b/include/asm-m68k/hardirq.h @@ -0,0 +1,26 @@ +#ifndef __M68K_HARDIRQ_H +#define __M68K_HARDIRQ_H + +extern unsigned int local_irq_count[NR_CPUS]; +#define in_interrupt() (local_irq_count[smp_processor_id()] != 0) + +#define hardirq_trylock(cpu) ((cpu)==0) /* always true */ +#define hardirq_endlock(cpu) do { } while (0) + +#define hardirq_enter(cpu) (local_irq_count[cpu]++) +#define hardirq_exit(cpu) (local_irq_count[cpu]--) + +#endif +#ifndef __M68K_HARDIRQ_H +#define __M68K_HARDIRQ_H + +extern unsigned int local_irq_count[NR_CPUS]; +#define in_interrupt() (local_irq_count[smp_processor_id()] != 0) + +#define hardirq_trylock(cpu) ((cpu)==0) /* always true */ +#define hardirq_endlock(cpu) do { } while (0) + +#define hardirq_enter(cpu) (local_irq_count[cpu]++) +#define hardirq_exit(cpu) (local_irq_count[cpu]--) + +#endif diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h index ab5aaf261..2567392cd 100644 --- a/include/asm-m68k/ide.h +++ b/include/asm-m68k/ide.h @@ -40,6 +40,7 @@ #endif /* CONFIG_AMIGA */ #ifdef CONFIG_ATARI +#include <linux/interrupt.h> /* intr_count */ #include <asm/atarihw.h> #include <asm/atarihdreg.h> #include <asm/atariints.h> @@ -362,7 +363,7 @@ 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 base_port, ide_ioreg_t irq_port) +static __inline__ int ide_ack_intr (ide_ioreg_t status_port, ide_ioreg_t irq_port) { #ifdef CONFIG_AMIGA if (MACH_IS_AMIGA) { @@ -371,7 +372,7 @@ static __inline__ int ide_ack_intr (ide_ioreg_t base_port, ide_ioreg_t irq_port) if (!(ch & 0x80)) return(0); if (AMIGAHW_PRESENT(A1200_IDE)) { - (void) inb(base_port); + (void) inb(status_port); outb(0x7c | (ch & 0x03), irq_port); } } @@ -479,7 +480,7 @@ static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, #ifdef CONFIG_ATARI if (MACH_IS_ATARI) { if (*ide_lock == 0) { - if (intr_count > 0) + if (in_interrupt() > 0) panic( "Falcon IDE hasn't ST-DMA lock in interrupt" ); stdma_lock(handler, data); *ide_lock = 1; @@ -506,12 +507,12 @@ static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, #if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) #define ide_sti() \ do { \ - if (!intr_count) sti(); \ + if (!in_interrupt()) sti(); \ } while(0) #elif defined(CONFIG_ATARI) -#define ide_sti() \ - do { \ - if (!MACH_IS_ATARI || !intr_count) sti(); \ +#define ide_sti() \ + do { \ + if (!MACH_IS_ATARI || !in_interrupt()) sti(); \ } while(0) #else /* !defined(CONFIG_ATARI) */ #define ide_sti() sti() diff --git a/include/asm-m68k/init.h b/include/asm-m68k/init.h new file mode 100644 index 000000000..42938ae89 --- /dev/null +++ b/include/asm-m68k/init.h @@ -0,0 +1,14 @@ +#ifndef _M68K_INIT_H +#define _M68K_INIT_H + +/* Throwing the initialization code and data out is not supported yet... */ + +#define __init +#define __initdata +#define __initfunc(__arginit) __arginit +/* For assembly routines */ +#define __INIT +#define __FINIT +#define __INITDATA + +#endif diff --git a/include/asm-m68k/ioctl.h b/include/asm-m68k/ioctl.h index 385aa8c7f..fd68914ab 100644 --- a/include/asm-m68k/ioctl.h +++ b/include/asm-m68k/ioctl.h @@ -1,4 +1,4 @@ -/* $Id: ioctl.h,v 1.1 1996/08/24 12:43:44 root Exp $ +/* $Id: ioctl.h,v 1.3 1997/04/16 15:10:07 jes Exp $ * * linux/ioctl.h for Linux by H.H. Bergman. */ diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index 7789be42f..46ad92062 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h @@ -1,9 +1,6 @@ #ifndef _M68K_IRQ_H_ #define _M68K_IRQ_H_ -extern void disable_irq(unsigned int); -extern void enable_irq(unsigned int); - #include <linux/config.h> /* @@ -54,10 +51,24 @@ extern void enable_irq(unsigned int); * Adding an interrupt service routine for a source with this bit * set indicates a special machine specific interrupt source. * The machine specific files define these sources. + * + * The IRQ_MACHSPEC bit is now gone - the only thing it did was to + * introduce unnecessary overhead. + * + * All interrupt handling is actually machine specific so it is better + * to use function pointers, as used by the Sparc port, and select the + * interrupt handling functions when initializing the kernel. This way + * we save some unnecessary overhead at run-time. + * 01/11/97 - Jes */ -#define IRQ_MACHSPEC (0x10000000L) -#define IRQ_IDX(irq) ((irq) & ~IRQ_MACHSPEC) +extern void (*enable_irq)(unsigned int); +extern void (*disable_irq)(unsigned int); + +extern int sys_request_irq(unsigned int, + void (*)(int, void *, struct pt_regs *), + unsigned long, const char *, void *); +extern void sys_free_irq(unsigned int, void *); /* * various flags for request_irq() diff --git a/include/asm-m68k/keyboard.h b/include/asm-m68k/keyboard.h new file mode 100644 index 000000000..6c8c0abff --- /dev/null +++ b/include/asm-m68k/keyboard.h @@ -0,0 +1,22 @@ +/* + * linux/include/asm-m68k/keyboard.h + * + * Created 3 Nov 1996 by Geert Uytterhoeven + */ + +/* + * This file contains the m68k architecture specific keyboard definitions + */ + +#ifndef __M68K_KEYBOARD_H +#define __M68K_KEYBOARD_H + +#ifdef __KERNEL__ + +#define TRANSLATE_SCANCODES 0 +#define USE_MACHDEP_ABSTRACTION 1 +#include <asm/machdep.h> + +#endif /* __KERNEL__ */ + +#endif /* __ASMm68k_KEYBOARD_H */ diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h index 68302fe60..c6a4b8b33 100644 --- a/include/asm-m68k/machdep.h +++ b/include/asm-m68k/machdep.h @@ -18,9 +18,9 @@ extern void (*mach_init_IRQ) (void); extern void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *); extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id); -extern int (*mach_free_irq) (unsigned int irq, void *dev_id); -extern void (*mach_enable_irq) (unsigned int irq); -extern void (*mach_disable_irq) (unsigned int irq); +extern void (*mach_free_irq) (unsigned int irq, void *dev_id); +extern void (*mach_get_model) (char *model); +extern int (*mach_get_hardware_list) (char *buffer); extern int (*mach_get_irq_list) (char *buf); extern void (*mach_process_int) (int irq, struct pt_regs *fp); /* machine dependent timer functions */ @@ -29,15 +29,12 @@ extern void (*mach_gettod)(int *year, int *mon, int *day, int *hour, int *min, int *sec); extern int (*mach_hwclk)(int, struct hwclk_time*); extern int (*mach_set_clock_mmss)(unsigned long); -extern void (*mach_mksound)( unsigned int count, unsigned int ticks ); 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 void (*waitbut)(void); extern struct fb_info *(*mach_fb_init)(long *); extern long mach_max_dma_address; -extern void (*mach_debug_init)(void); extern void (*mach_video_setup)(char *, int *); extern void (*mach_floppy_setup)(char *, int *); extern void (*mach_floppy_eject)(void); diff --git a/include/asm-m68k/mmu_context.h b/include/asm-m68k/mmu_context.h index c5def1604..853ce4b71 100644 --- a/include/asm-m68k/mmu_context.h +++ b/include/asm-m68k/mmu_context.h @@ -6,4 +6,7 @@ */ #define get_mmu_context(x) do { } while (0) +#define init_new_context(mm) do { } while(0) +#define destroy_context(mm) do { } while(0) + #endif diff --git a/include/asm-m68k/namei.h b/include/asm-m68k/namei.h new file mode 100644 index 000000000..516066f1a --- /dev/null +++ b/include/asm-m68k/namei.h @@ -0,0 +1,42 @@ +/* + * linux/include/asm-m68k/namei.h + * + * Included from linux/fs/namei.c + */ + +#ifndef __M68K_NAMEI_H +#define __M68K_NAMEI_H + +/* These dummy routines maybe changed to something useful + * for /usr/gnemul/ emulation stuff. + * Look at asm-sparc/namei.h for details. + */ + +#define translate_namei(pathname, base, follow_links, res_inode) \ + do { } while (0) + +#define translate_open_namei(pathname, flag, mode, res_inode, base) \ + do { } while (0) + +#endif +/* + * linux/include/asm-m68k/namei.h + * + * Included from linux/fs/namei.c + */ + +#ifndef __M68K_NAMEI_H +#define __M68K_NAMEI_H + +/* These dummy routines maybe changed to something useful + * for /usr/gnemul/ emulation stuff. + * Look at asm-sparc/namei.h for details. + */ + +#define translate_namei(pathname, base, follow_links, res_inode) \ + do { } while (0) + +#define translate_open_namei(pathname, flag, mode, res_inode, base) \ + do { } while (0) + +#endif diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h index 82dbe59c3..d8d0beafe 100644 --- a/include/asm-m68k/page.h +++ b/include/asm-m68k/page.h @@ -8,10 +8,58 @@ #ifdef __KERNEL__ +#include<linux/config.h> + #define STRICT_MM_TYPECHECKS +/* + * We don't need to check for alignment etc. + */ +#if defined(CONFIG_OPTIMIZE_040) || defined(CONFIG_OPTIMIZE_060) +static inline void copy_page(unsigned long to, unsigned long from) +{ + unsigned long tmp; + + __asm__ __volatile__("1:\t" + ".chip 68040\n\t" + "move16 %1@+,%0@+\n\t" + "move16 %1@+,%0@+\n\t" + ".chip 68k\n\t" + "dbra %2,1b\n\t" + : "=a" (to), "=a" (from), "=d" (tmp) + : "0" (to), "1" (from) , "2" (PAGE_SIZE / 32 - 1) + ); +} + +static inline void clear_page(unsigned long page) +{ + unsigned long data, sp, tmp; + + sp = page; + + data = 0; + + *((unsigned long *)(page))++ = 0; + *((unsigned long *)(page))++ = 0; + *((unsigned long *)(page))++ = 0; + *((unsigned long *)(page))++ = 0; + + __asm__ __volatile__("1:\t" + ".chip 68040\n\t" + "move16 %2@+,%0@+\n\t" + ".chip 68k\n\t" + "subqw #8,%2\n\t" + "subqw #8,%2\n\t" + "dbra %1,1b\n\t" + : "=a" (page), "=d" (tmp) + : "a" (sp), "0" (page), + "1" ((PAGE_SIZE - 16) / 16 - 1)); +} + +#else #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) #define copy_page(to,from) memcpy((void *)(to), (void *)(from), PAGE_SIZE) +#endif #ifdef STRICT_MM_TYPECHECKS /* diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h index 429a68938..cd5cef191 100644 --- a/include/asm-m68k/pgtable.h +++ b/include/asm-m68k/pgtable.h @@ -1,7 +1,7 @@ #ifndef _M68K_PGTABLE_H #define _M68K_PGTABLE_H -#include<asm/setup.h> +#include <asm/setup.h> #ifndef __ASSEMBLY__ @@ -10,25 +10,192 @@ * the m68k page table tree. */ +/* For virtual address to physical address conversion */ +extern unsigned long mm_vtop(unsigned long addr) __attribute__ ((const)); +extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const)); +#define VTOP(addr) (mm_vtop((unsigned long)(addr))) +#define PTOV(addr) (mm_ptov((unsigned long)(addr))) + +/* + * Cache handling functions + */ + +#define flush_icache() \ +do { \ + if (CPU_IS_040_OR_060) \ + asm __volatile__ ("nop\n\t" \ + ".chip 68040\n\t" \ + "cinva %%ic\n\t" \ + ".chip 68k"); \ + else { \ + unsigned long _tmp; \ + asm __volatile__ ("movec %%cacr,%0\n\t" \ + "orw %1,%0\n\t" \ + "movec %0,%%cacr" \ + : "=&d" (_tmp) \ + : "id" (FLUSH_I)); \ + } \ +} while (0) + +/* + * invalidate the cache for the specified memory range. + * It starts at the physical address specified for + * the given number of bytes. + */ +extern void cache_clear (unsigned long paddr, int len); +/* + * push any dirty cache in the specified memory range. + * It starts at the physical address specified for + * the given number of bytes. + */ +extern void cache_push (unsigned long paddr, int len); + +/* + * push and invalidate pages in the specified user virtual + * memory range. + */ +extern void cache_push_v (unsigned long vaddr, int len); + +/* cache code */ +#define FLUSH_I_AND_D (0x00000808) +#define FLUSH_I (0x00000008) + +/* This is needed whenever the virtual mapping of the current + process changes. */ +#define __flush_cache_all() \ + do { \ + if (CPU_IS_040_OR_060) \ + __asm__ __volatile__ ("nop\n\t" \ + ".chip 68040\n\t" \ + "cpusha %dc\n\t" \ + ".chip 68k"); \ + else { \ + unsigned long _tmp; \ + __asm__ __volatile__ ("movec %%cacr,%0\n\t" \ + "orw %1,%0\n\t" \ + "movec %0,%%cacr" \ + : "=&d" (_tmp) \ + : "di" (FLUSH_I_AND_D)); \ + } \ + } while (0) + +#define __flush_cache_030() \ + do { \ + if (CPU_IS_020_OR_030) { \ + unsigned long _tmp; \ + __asm__ __volatile__ ("movec %%cacr,%0\n\t" \ + "orw %1,%0\n\t" \ + "movec %0,%%cacr" \ + : "=&d" (_tmp) \ + : "di" (FLUSH_I_AND_D)); \ + } \ + } while (0) + +#define flush_cache_all() __flush_cache_all() + +extern inline void flush_cache_mm(struct mm_struct *mm) +{ +#if FLUSH_VIRTUAL_CACHE_040 + if (mm == current->mm) __flush_cache_all(); +#else + if (mm == current->mm) __flush_cache_030(); +#endif +} + +extern inline void flush_cache_range(struct mm_struct *mm, + unsigned long start, + unsigned long end) +{ + if (mm == current->mm){ +#if FLUSH_VIRTUAL_CACHE_040 + if (CPU_IS_040_OR_060) + cache_push_v(start, end-start); + else +#endif + __flush_cache_030(); + } +} + +extern inline void flush_cache_page(struct vm_area_struct *vma, + unsigned long vmaddr) +{ + if (vma->vm_mm == current->mm){ +#if FLUSH_VIRTUAL_CACHE_040 + if (CPU_IS_040_OR_060) + cache_push_v(vmaddr, PAGE_SIZE); + else +#endif + __flush_cache_030(); + } +} + +/* Push the page at kernel virtual address and clear the icache */ +extern inline void flush_page_to_ram (unsigned long address) +{ + if (CPU_IS_040_OR_060) { + __asm__ __volatile__ ("nop\n\t" + ".chip 68040\n\t" + "cpushp %%dc,(%0)\n\t" + "cinvp %%ic,(%0)\n\t" + ".chip 68k" + : : "a" (VTOP(address))); + } + else { + unsigned long _tmp; + __asm volatile ("movec %%cacr,%0\n\t" + "orw %1,%0\n\t" + "movec %0,%%cacr" + : "=&d" (_tmp) + : "di" (FLUSH_I)); + } +} + +/* Push n pages at kernel virtual address and clear the icache */ +extern inline void flush_pages_to_ram (unsigned long address, int n) +{ + if (CPU_IS_040_OR_060) { + while (n--) { + __asm__ __volatile__ ("nop\n\t" + ".chip 68040\n\t" + "cpushp %%dc,(%0)\n\t" + "cinvp %%ic,(%0)\n\t" + ".chip 68k" + : : "a" (VTOP(address))); + address += PAGE_SIZE; + } + } + else { + unsigned long _tmp; + __asm volatile ("movec %%cacr,%0\n\t" + "orw %1,%0\n\t" + "movec %0,%%cacr" + : "=&d" (_tmp) + : "di" (FLUSH_I)); + } +} + /* * flush all atc entries (user-space entries only for the 680[46]0). */ static inline void __flush_tlb(void) { if (CPU_IS_040_OR_060) - __asm__ __volatile__(".word 0xf510\n"::); /* pflushan */ + __asm__ __volatile__(".chip 68040\n\t" + "pflushan\n\t" + ".chip 68k"); else - __asm__ __volatile__("pflusha\n"::); + __asm__ __volatile__("pflusha"); } static inline void __flush_tlb_one(unsigned long addr) { if (CPU_IS_040_OR_060) { - register unsigned long a0 __asm__ ("a0") = addr; - __asm__ __volatile__(".word 0xf508" /* pflush (%a0) */ - : : "a" (a0)); + __asm__ __volatile__(".chip 68040\n\t" + "pflush (%0)\n\t" + ".chip 68k" + : : "a" (addr)); } else - __asm__ __volatile__("pflush #0,#0,(%0)" : : "a" (addr)); + __asm__ __volatile__("pflush #0,#4,(%0)" : : "a" (addr)); } #define flush_tlb() __flush_tlb() @@ -39,9 +206,11 @@ static inline void __flush_tlb_one(unsigned long addr) static inline void flush_tlb_all(void) { if (CPU_IS_040_OR_060) - __asm__ __volatile__(".word 0xf518\n"::); /* pflusha */ + __asm__ __volatile__(".chip 68040\n\t" + "pflusha\n\t" + ".chip 68k"); else - __asm__ __volatile__("pflusha\n"::); + __asm__ __volatile__("pflusha"); } static inline void flush_tlb_mm(struct mm_struct *mm) @@ -64,14 +233,27 @@ static inline void flush_tlb_range(struct mm_struct *mm, __flush_tlb(); } +extern inline void flush_tlb_kernel_page(unsigned long addr) +{ + if (CPU_IS_040_OR_060) { + unsigned long old_fs = get_fs(); + set_fs(KERNEL_DS); + __asm__ __volatile__(".chip 68040\n\t" + "pflush (%0)\n\t" + ".chip 68k" + : : "a" (addr)); + set_fs(old_fs); + } else + __asm__ __volatile__("pflush #4,#4,(%0)" : : "a" (addr)); +} + /* Certain architectures need to do special things when pte's * within a page table are directly modified. Thus, the following * hook is made available. */ -#define set_pte(pteptr, pteval) do{ \ - ((*(pteptr)) = (pteval)); \ - if (CPU_IS_060) \ - __asm__ __volatile__(".word 0xf518\n"::); /* pflusha */ \ +#define set_pte(pteptr, pteval) \ + do{ \ + *(pteptr) = (pteval); \ } while(0) @@ -152,9 +334,9 @@ typedef pte_table pte_tablepage[PTE_TABLES_PER_PAGE]; * and initialized in head.S */ extern int m68k_pgtable_cachemode; -#if defined(CONFIG_M68040_OR_M68060_ONLY) +#if defined(CPU_M68040_OR_M68060_ONLY) #define mm_cachebits _PAGE_CACHE040 -#elif defined(CONFIG_M68020_OR_M68030_ONLY) +#elif defined(CPU_M68020_OR_M68030_ONLY) #define mm_cachebits 0 #else extern unsigned long mm_cachebits; @@ -226,12 +408,6 @@ extern pte_t * __bad_pagetable(void); #define PAGE_PTR(address) \ ((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK) -/* For virtual address to physical address conversion */ -extern unsigned long mm_vtop(unsigned long addr) __attribute__ ((const)); -extern unsigned long mm_ptov(unsigned long addr) __attribute__ ((const)); -#define VTOP(addr) (mm_vtop((unsigned long)(addr))) -#define PTOV(addr) (mm_ptov((unsigned long)(addr))) - /* * Conversion functions: convert a page and protection to a page entry, * and a page entry and page directory to the page they refer to. @@ -334,18 +510,19 @@ extern inline void SET_PAGE_DIR(struct task_struct * tsk, pgd_t * pgdir) tsk->tss.crp[1] = VTOP(pgdir); if (tsk == current) { if (CPU_IS_040_OR_060) - __asm__ __volatile__ ("movel %0@,%/d0\n\t" - ".long 0x4e7b0806\n\t" - /* movec d0,urp */ - : : "a" (&tsk->tss.crp[1]) - : "d0"); - else - __asm__ __volatile__ ("movec %/cacr,%/d0\n\t" - "oriw #0x0808,%/d0\n\t" - "movec %/d0,%/cacr\n\t" - "pmove %0@,%/crp\n\t" - : : "a" (&tsk->tss.crp[0]) - : "d0"); + __asm__ __volatile__ (".chip 68040\n\t" + "movec %0,%%urp\n\t" + ".chip 68k" + : : "r" (tsk->tss.crp[1])); + else { + unsigned long tmp; + __asm__ __volatile__ ("movec %%cacr,%0\n\t" + "orw #0x0808,%0\n\t" + "movec %0,%%cacr\n\t" + "pmove %1,%%crp\n\t" + : "=d" (tmp) + : "m" (tsk->tss.crp[0])); + } } } @@ -384,19 +561,17 @@ extern inline pte_t * pte_offset(pmd_t * pmdp, unsigned long address) * if any. */ -extern inline void nocache_page (unsigned long vaddr) +/* Prior to calling these routines, the page should have been flushed + * from both the cache and ATC, or the CPU might not notice that the + * cache setting for the page has been changed. -jskov + */ +static inline void nocache_page (unsigned long vaddr) { if (CPU_IS_040_OR_060) { pgd_t *dir; pmd_t *pmdp; pte_t *ptep; - if(CPU_IS_060) - __asm__ __volatile__ ("movel %0,%/a0\n\t" - ".word 0xf470" - : : "g" (VTOP(vaddr)) - : "a0"); - dir = pgd_offset_k(vaddr); pmdp = pmd_offset(dir,vaddr); ptep = pte_offset(pmdp,vaddr); @@ -438,6 +613,8 @@ extern inline pte_t * pte_alloc(pmd_t * pmd, unsigned long address) if (pmd_none(*pmd)) { if (page) { memset((void *) page, 0, PAGE_SIZE); + flush_page_to_ram((unsigned long)page); + flush_tlb_kernel_page((unsigned long)page); nocache_page((unsigned long)page); pmd_set(pmd,page); return page + address; @@ -501,6 +678,7 @@ extern inline pte_t * pte_alloc_kernel(pmd_t * pmd, unsigned long address) pte_t * page = (pte_t *) get_free_page(GFP_KERNEL); if (pmd_none(*pmd)) { if (page) { + flush_tlb_kernel_page((unsigned long)page); nocache_page((unsigned long)page); pmd_set(pmd, page); return page + address; @@ -556,139 +734,6 @@ extern inline pgd_t * pgd_alloc(void) return (pgd_t *)get_pointer_table (); } -#define flush_icache() \ -do { \ - if (CPU_IS_040_OR_060) \ - asm __volatile__ ("nop; .word 0xf498 /* cinva %%ic */"); \ - else \ - asm __volatile__ ("movec %/cacr,%/d0;" \ - "oriw %0,%/d0;" \ - "movec %/d0,%/cacr" \ - : /* no outputs */ \ - : "i" (FLUSH_I) \ - : "d0"); \ -} while (0) - -/* - * invalidate the cache for the specified memory range. - * It starts at the physical address specified for - * the given number of bytes. - */ -extern void cache_clear (unsigned long paddr, int len); -/* - * push any dirty cache in the specified memory range. - * It starts at the physical address specified for - * the given number of bytes. - */ -extern void cache_push (unsigned long paddr, int len); - -/* - * push and invalidate pages in the specified user virtual - * memory range. - */ -extern void cache_push_v (unsigned long vaddr, int len); - -/* cache code */ -#define FLUSH_I_AND_D (0x00000808) -#define FLUSH_I (0x00000008) - -/* This is needed whenever the virtual mapping of the current - process changes. */ -#define __flush_cache_all() \ - do { \ - if (CPU_IS_040_OR_060) \ - __asm__ __volatile__ ("nop; .word 0xf478\n" ::); \ - else \ - __asm__ __volatile__ ("movec %%cacr,%%d0\n\t" \ - "orw %0,%%d0\n\t" \ - "movec %%d0,%%cacr" \ - : : "di" (FLUSH_I_AND_D) : "d0"); \ - } while (0) - -#define __flush_cache_030() \ - do { \ - if (CPU_IS_020_OR_030) \ - __asm__ __volatile__ ("movec %%cacr,%%d0\n\t" \ - "orw %0,%%d0\n\t" \ - "movec %%d0,%%cacr" \ - : : "di" (FLUSH_I_AND_D) : "d0"); \ - } while (0) - -#define flush_cache_all() __flush_cache_all() - -extern inline void flush_cache_mm(struct mm_struct *mm) -{ -#if FLUSH_VIRTUAL_CACHE_040 - if (mm == current->mm) __flush_cache_all(); -#else - if (mm == current->mm) __flush_cache_030(); -#endif -} - -extern inline void flush_cache_range(struct mm_struct *mm, - unsigned long start, - unsigned long end) -{ - if (mm == current->mm){ -#if FLUSH_VIRTUAL_CACHE_040 - if (CPU_IS_040_OR_060) - cache_push_v(start, end-start); - else -#endif - __flush_cache_030(); - } -} - -extern inline void flush_cache_page(struct vm_area_struct *vma, - unsigned long vmaddr) -{ - if (vma->vm_mm == current->mm){ -#if FLUSH_VIRTUAL_CACHE_040 - if (CPU_IS_040_OR_060) - cache_push_v(vmaddr, PAGE_SIZE); - else -#endif - __flush_cache_030(); - } -} - -/* Push the page at kernel virtual address and clear the icache */ -extern inline void flush_page_to_ram (unsigned long address) -{ - if (CPU_IS_040_OR_060) { - register unsigned long tmp __asm ("a0") = VTOP(address); - __asm__ __volatile__ ("nop\n\t" - ".word 0xf470 /* cpushp %%dc,(%0) */\n\t" - ".word 0xf490 /* cinvp %%ic,(%0) */" - : : "a" (tmp)); - } - else - __asm volatile ("movec %%cacr,%%d0\n\t" - "orw %0,%%d0\n\t" - "movec %%d0,%%cacr" - : : "di" (FLUSH_I) : "d0"); -} - -/* Push n pages at kernel virtual address and clear the icache */ -extern inline void flush_pages_to_ram (unsigned long address, int n) -{ - if (CPU_IS_040_OR_060) { - while (n--) { - register unsigned long tmp __asm ("a0") = VTOP(address); - __asm__ __volatile__ ("nop\n\t" - ".word 0xf470 /* cpushp %%dc,(%0) */\n\t" - ".word 0xf490 /* cinvp %%ic,(%0) */" - : : "a" (tmp)); - address += PAGE_SIZE; - } - } - else - __asm volatile ("movec %%cacr,%%d0\n\t" - "orw %0,%%d0\n\t" - "movec %%d0,%%cacr" - : : "di" (FLUSH_I) : "d0"); -} - /* * Check if the addr/len goes up to the end of a physical * memory chunk. Used for DMA functions. diff --git a/include/asm-m68k/poll.h b/include/asm-m68k/poll.h new file mode 100644 index 000000000..9b52915d0 --- /dev/null +++ b/include/asm-m68k/poll.h @@ -0,0 +1,42 @@ +#ifndef __m68k_POLL_H +#define __m68k_POLL_H + +#define POLLIN 1 +#define POLLPRI 2 +#define POLLOUT 4 +#define POLLERR 8 +#define POLLHUP 16 +#define POLLNVAL 32 +#define POLLRDNORM 64 +#define POLLWRNORM POLLOUT +#define POLLRDBAND 128 +#define POLLWRBAND 256 + +struct pollfd { + int fd; + short events; + short revents; +}; + +#endif +#ifndef __m68k_POLL_H +#define __m68k_POLL_H + +#define POLLIN 1 +#define POLLPRI 2 +#define POLLOUT 4 +#define POLLERR 8 +#define POLLHUP 16 +#define POLLNVAL 32 +#define POLLRDNORM 64 +#define POLLWRNORM POLLOUT +#define POLLRDBAND 128 +#define POLLWRBAND 256 + +struct pollfd { + int fd; + short events; + short revents; +}; + +#endif diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h index d228816af..7b6622e89 100644 --- a/include/asm-m68k/processor.h +++ b/include/asm-m68k/processor.h @@ -8,6 +8,7 @@ #define __ASM_M68K_PROCESSOR_H #include <asm/segment.h> +#include <asm/fpu.h> /* * User space process size: 3.75GB. This is hardcoded into a few places, @@ -15,15 +16,17 @@ */ #define TASK_SIZE (0xF0000000UL) +/* This decides where the kernel will search for a free chunk of vm + * space during mmap's. + */ +#define TASK_UNMAPPED_BASE 0xC0000000UL + /* * Bus types */ #define EISA_bus 0 #define MCA_bus 0 -/* MAX floating point unit state size (FSAVE/FRESTORE) */ -#define FPSTATESIZE (216/sizeof(unsigned char)) - /* * if you change this structure, you must change the code and offsets * in m68k/machasm.S @@ -49,9 +52,6 @@ struct thread_struct { {0, 0}, 0, {0,}, {0, 0, 0}, {0,}, \ } -#define alloc_kernel_stack() __get_free_page(GFP_KERNEL) -#define free_kernel_stack(page) free_page((page)) - /* * Do necessary setup to start up a newly executed thread. */ @@ -61,7 +61,9 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long nilstate = 0; /* clear floating point state */ - __asm__ __volatile__ ("frestore %0@" : : "a" (&nilstate)); + __asm__ __volatile__ (".chip 68k/68881\n\t" + "frestore %0@\n\t" + ".chip 68k" : : "a" (&nilstate)); /* reads from user space */ set_fs(USER_DS); @@ -71,14 +73,31 @@ static inline void start_thread(struct pt_regs * regs, unsigned long pc, wrusp(usp); } +/* Free all resources held by a thread. */ +extern void release_thread(struct task_struct *); + /* * Return saved PC of a blocked thread. */ extern inline unsigned long thread_saved_pc(struct thread_struct *t) { - return ((unsigned long *)((struct switch_stack *)t->ksp)->a6)[1]; + extern int sys_pause(void); + extern void schedule(void); + struct switch_stack *sw = (struct switch_stack *)t->ksp; + /* Check whether the thread is blocked in resume() */ + if (sw->retpc >= (unsigned long)schedule && + sw->retpc < (unsigned long)sys_pause) + return ((unsigned long *)sw->a6)[1]; + else + return sw->retpc; } +/* Allocation and freeing of basic task resources. */ +#define alloc_task_struct() kmalloc(sizeof(struct task_struct), GFP_KERNEL) +#define alloc_kernel_stack(p) __get_free_page(GFP_KERNEL) +#define free_task_struct(p) kfree(p) +#define free_kernel_stack(page) free_page((page)) + /* * Return_address is a replacement for __builtin_return_address(count) * which on certain architectures cannot reasonably be implemented in GCC diff --git a/include/asm-m68k/scatterlist.h b/include/asm-m68k/scatterlist.h new file mode 100644 index 000000000..885ca6146 --- /dev/null +++ b/include/asm-m68k/scatterlist.h @@ -0,0 +1,14 @@ +#ifndef _M68K_SCATTERLIST_H +#define _M68K_SCATTERLIST_H + +struct scatterlist { + char * address; /* Location data is to be transferred to */ + char * alt_address; /* Location of actual if address is a + * dma indirect buffer. NULL otherwise */ + unsigned int length; +}; + +/* This is bogus and should go away. */ +#define ISA_DMA_THRESHOLD (0x00ffffff) + +#endif /* !(_M68K_SCATTERLIST_H) */ diff --git a/include/asm-m68k/semaphore.h b/include/asm-m68k/semaphore.h index ef23201c3..c4e3068fa 100644 --- a/include/asm-m68k/semaphore.h +++ b/include/asm-m68k/semaphore.h @@ -2,6 +2,8 @@ #define _M68K_SEMAPHORE_H #include <linux/linkage.h> +#include <asm/system.h> +#include <asm/atomic.h> /* * SMP- and interrupt-safe semaphores.. @@ -12,20 +14,43 @@ */ struct semaphore { - int count; - int waiting; + atomic_t count; + atomic_t waking; struct wait_queue * wait; }; -#define MUTEX ((struct semaphore) { 1, 0, NULL }) -#define MUTEX_LOCKED ((struct semaphore) { 0, 0, NULL }) +#define MUTEX ((struct semaphore) { { 1 }, { 0 }, NULL }) +#define MUTEX_LOCKED ((struct semaphore) { { 0 }, { 0 }, NULL }) asmlinkage void __down_failed(void /* special register calling convention */); +asmlinkage int __down_failed_interruptible(void /* params in registers */); asmlinkage void __up_wakeup(void /* special register calling convention */); extern void __down(struct semaphore * sem); extern void __up(struct semaphore * sem); +#define sema_init(sem, val) atomic_set(&((sem)->count), val) + +static inline void wake_one_more(struct semaphore * sem) +{ + atomic_inc(&sem->waking); +} + +static inline int waking_non_zero(struct semaphore *sem) +{ + unsigned long flags; + int ret = 0; + + save_flags(flags); + cli(); + if (atomic_read(&sem->waking) > 0) { + atomic_dec(&sem->waking); + ret = 1; + } + restore_flags(flags); + return ret; +} + /* * This is ugly, but we want the default case to fall through. * "down_failed" is a special asm handler that calls the C @@ -37,15 +62,37 @@ extern inline void down(struct semaphore * sem) __asm__ __volatile__( "| atomic down operation\n\t" "lea %%pc@(1f),%%a0\n\t" - "subql #1,%0\n\t" + "subql #1,%0@\n\t" "jmi " SYMBOL_NAME_STR(__down_failed) "\n" "1:" : /* no outputs */ - : "m" (sem->count), "a" (sem1) + : "a" (sem1) : "%a0", "memory"); } /* + * This version waits in interruptible state so that the waiting + * process can be killed. The down_failed_interruptible routine + * returns negative for signalled and zero for semaphore acquired. + */ +extern inline int down_interruptible(struct semaphore * sem) +{ + register int ret __asm__ ("%d0"); + register struct semaphore *sem1 __asm__ ("%a1") = sem; + __asm__ __volatile__( + "| atomic interruptible down operation\n\t" + "lea %%pc@(1f),%%a0\n\t" + "subql #1,%1@\n\t" + "jmi " SYMBOL_NAME_STR(__down_failed_interruptible) "\n\t" + "clrl %0\n" + "1:" + : "=d" (ret) + : "a" (sem1) + : "%d0", "%a0", "memory"); + return ret; +} + +/* * Note! This is subtle. We jump to wake people up only if * the semaphore was negative (== somebody was waiting on it). * The default case (no contention) will result in NO diff --git a/include/asm-m68k/serial.h b/include/asm-m68k/serial.h index fecf48e55..7c873c341 100644 --- a/include/asm-m68k/serial.h +++ b/include/asm-m68k/serial.h @@ -20,6 +20,9 @@ #define PORT_16550 3 #define PORT_16550A 4 #define PORT_CIRRUS 5 +#define PORT_16650V2 7 +#define PORT_16750 8 + #define SER_SCC_NORM 100 /* standard SCC channel */ #define SER_SCC_DMA 101 /* SCC channel with DMA support */ #define SER_MFP_CTRL 102 /* standard MFP port with modem control signals */ @@ -130,7 +133,7 @@ typedef struct { #define ASYNC_SAK 0x0004 /* Secure Attention Key (Orange book) */ #define ASYNC_SPLIT_TERMIOS 0x0008 /* Separate termios for dialin/callout */ -#define ASYNC_SPD_MASK 0x0030 +#define ASYNC_SPD_MASK 0x1030 #define ASYNC_SPD_HI 0x0010 /* Use 56000 instead of 38400 bps */ #define ASYNC_SPD_VHI 0x0020 /* Use 115200 instead of 38400 bps */ @@ -142,8 +145,13 @@ typedef struct { #define ASYNC_PGRP_LOCKOUT 0x0200 /* Lock out cua opens based on pgrp */ #define ASYNC_CALLOUT_NOHUP 0x0400 /* Don't do hangups for cua device */ -#define ASYNC_FLAGS 0x0FFF /* Possible legal async flags */ -#define ASYNC_USR_MASK 0x0430 /* Legal flags that non-privileged +#define ASYNC_HARDPPS_CD 0x0800 /* Call hardpps when CD goes high */ + +#define ASYNC_SPD_SHI 0x1000 /* Use 230400 instead of 38400 bps */ +#define ASYNC_SPD_WARP 0x1010 /* Use 460800 instead of 38400 bps */ + +#define ASYNC_FLAGS 0x1FFF /* Possible legal async flags */ +#define ASYNC_USR_MASK 0x1430 /* Legal flags that non-privileged * users can set or reset */ /* Internal flags used only by drivers/char/m68kserial.c */ @@ -155,13 +163,18 @@ typedef struct { #define ASYNC_CTS_FLOW 0x04000000 /* Do CTS flow control */ #define ASYNC_CHECK_CD 0x02000000 /* i.e., CLOCAL */ +#define ASYNC_INTERNAL_FLAGS 0xFF000000 /* Internal flags */ + /* * Serial input interrupt line counters -- external structure * Four lines can interrupt: CTS, DSR, RI, DCD */ struct serial_icounter_struct { int cts, dsr, rng, dcd; - int reserved[16]; + int rx, tx; + int frame, overrun, parity, brk; + int buf_overrun; + int reserved[9]; }; @@ -182,7 +195,9 @@ struct serial_icounter_struct { * Counters of the input lines (CTS, DSR, RI, CD) interrupts */ struct async_icount { - __u32 cts, dsr, rng, dcd; + __u32 cts, dsr, rng, dcd, tx, rx; + __u32 frame, parity, overrun, brk; + __u32 buf_overrun; }; struct async_struct { @@ -271,7 +286,7 @@ extern task_queue tq_serial; static __inline__ void rs_sched_event(struct async_struct *info, int event) { info->event |= 1 << event; - queue_task_irq(&info->tqueue, &tq_serial); + queue_task(&info->tqueue, &tq_serial); mark_bh(SERIAL_BH); } @@ -289,7 +304,8 @@ static __inline__ void rs_receive_char( struct async_struct *info, } *tty->flip.flag_buf_ptr++ = err; *tty->flip.char_buf_ptr++ = ch; - queue_task_irq(&tty->flip.tqueue, &tq_timer); + info->icount.rx++; + queue_task(&tty->flip.tqueue, &tq_timer); } static __inline__ int rs_get_tx_char( struct async_struct *info ) @@ -298,6 +314,7 @@ static __inline__ int rs_get_tx_char( struct async_struct *info ) if (info->x_char) { ch = info->x_char; + info->icount.tx++; info->x_char = 0; return( ch ); } @@ -307,6 +324,7 @@ static __inline__ int rs_get_tx_char( struct async_struct *info ) ch = info->xmit_buf[info->xmit_tail++]; info->xmit_tail &= SERIAL_XMIT_SIZE - 1; + info->icount.tx++; if (--info->xmit_cnt < WAKEUP_CHARS) rs_sched_event(info, RS_EVENT_WRITE_WAKEUP); return( ch ); @@ -338,8 +356,7 @@ static __inline__ void rs_dcd_changed( struct async_struct *info, int dcd ) #ifdef SERIAL_DEBUG_OPEN printk("scheduling hangup..."); #endif - queue_task_irq(&info->tqueue_hangup, - &tq_scheduler); + queue_task(&info->tqueue_hangup, &tq_scheduler); } } } diff --git a/include/asm-m68k/setup.h b/include/asm-m68k/setup.h index 96f91963b..c95bdfc01 100644 --- a/include/asm-m68k/setup.h +++ b/include/asm-m68k/setup.h @@ -1,5 +1,5 @@ /* -** asm/setup.h -- Definition of the Linux/m68k boot information structure +** asm/setup.h -- Definition of the Linux/m68k setup information ** ** Copyright 1992 by Greg Harp ** @@ -15,218 +15,40 @@ ** 26/7/96 Roman Zippel: ** Renamed to setup.h; added some useful macros to allow gcc some ** optimizations if possible. +** 5/10/96 Geert Uytterhoeven: +** Redesign of the boot information structure; moved boot information +** structure to bootinfo.h */ #ifndef _M68K_SETUP_H #define _M68K_SETUP_H #include <linux/config.h> -#include <asm/zorro.h> -/* - * Amiga specific part of bootinfo structure. - */ - -#define NUM_AUTO 16 - -#ifndef __ASSEMBLY__ - -#define AMIGAHW_DECLARE(name) unsigned name : 1 -#define AMIGAHW_SET(name) (boot_info.bi_amiga.hw_present.name = 1) -#define AMIGAHW_PRESENT(name) (boot_info.bi_amiga.hw_present.name) - -struct bi_Amiga { - int model; /* Amiga Model (3000?) */ - int num_autocon; /* # of autoconfig devices found */ - struct ConfigDev autocon[NUM_AUTO]; /* up to 16 autoconfig devices */ -#ifdef HACKER_KERNEL - void (*exit_func)(void); /* addr of function to exit kernel */ - unsigned long chip_addr; /* start of chip memory (bytes) */ -#endif - unsigned long chip_size; /* size of chip memory (bytes) */ - unsigned char vblank; /* VBLANK frequency */ - unsigned char psfreq; /* power supply frequency */ - unsigned long eclock; /* EClock frequency */ - unsigned long chipset; /* native chipset present */ - struct { - /* video hardware */ - AMIGAHW_DECLARE(AMI_VIDEO); /* Amiga Video */ - AMIGAHW_DECLARE(AMI_BLITTER); /* Amiga Blitter */ - AMIGAHW_DECLARE(AMBER_FF); /* Amber Flicker Fixer */ - /* sound hardware */ - AMIGAHW_DECLARE(AMI_AUDIO); /* Amiga Audio */ - /* disk storage interfaces */ - AMIGAHW_DECLARE(AMI_FLOPPY); /* Amiga Floppy */ - AMIGAHW_DECLARE(A3000_SCSI); /* SCSI (wd33c93, A3000 alike) */ - AMIGAHW_DECLARE(A4000_SCSI); /* SCSI (ncr53c710, A4000T alike) */ - AMIGAHW_DECLARE(A1200_IDE); /* IDE (A1200 alike) */ - AMIGAHW_DECLARE(A4000_IDE); /* IDE (A4000 alike) */ - AMIGAHW_DECLARE(CD_ROM); /* CD ROM drive */ - /* other I/O hardware */ - AMIGAHW_DECLARE(AMI_KEYBOARD); /* Amiga Keyboard */ - AMIGAHW_DECLARE(AMI_MOUSE); /* Amiga Mouse */ - AMIGAHW_DECLARE(AMI_SERIAL); /* Amiga Serial */ - AMIGAHW_DECLARE(AMI_PARALLEL); /* Amiga Parallel */ - /* real time clocks */ - AMIGAHW_DECLARE(A2000_CLK); /* Hardware Clock (A2000 alike) */ - AMIGAHW_DECLARE(A3000_CLK); /* Hardware Clock (A3000 alike) */ - /* supporting hardware */ - AMIGAHW_DECLARE(CHIP_RAM); /* Chip RAM */ - AMIGAHW_DECLARE(PAULA); /* Paula (8364) */ - AMIGAHW_DECLARE(DENISE); /* Denise (8362) */ - AMIGAHW_DECLARE(DENISE_HR); /* Denise (8373) */ - AMIGAHW_DECLARE(LISA); /* Lisa (8375) */ - AMIGAHW_DECLARE(AGNUS_PAL); /* Normal/Fat PAL Agnus (8367/8371) */ - AMIGAHW_DECLARE(AGNUS_NTSC); /* Normal/Fat NTSC Agnus (8361/8370) */ - AMIGAHW_DECLARE(AGNUS_HR_PAL); /* Fat Hires PAL Agnus (8372) */ - AMIGAHW_DECLARE(AGNUS_HR_NTSC); /* Fat Hires NTSC Agnus (8372) */ - AMIGAHW_DECLARE(ALICE_PAL); /* PAL Alice (8374) */ - AMIGAHW_DECLARE(ALICE_NTSC); /* NTSC Alice (8374) */ - AMIGAHW_DECLARE(MAGIC_REKICK); /* A3000 Magic Hard Rekick */ - AMIGAHW_DECLARE(ZORRO); /* Zorro AutoConfig */ - } hw_present; -}; - -#else /* __ASSEMBLY__ */ - -BI_amiga_model = BI_un -BI_amiga_num_autcon = BI_amiga_model+4 -BI_amiga_autocon = BI_amiga_num_autcon+4 -#ifdef HACKER_KERNEL -BI_amiga_exit_func = BI_amiga_autocon+(CD_sizeof*NUM_AUTO) -BI_amiga_chip_addr = BI_amiga_exit_func+4 -BI_amiga_chip_size = BI_amiga_chip_addr+4 -#else -BI_amiga_chip_size = BI_amiga_autocon+(CD_sizeof*NUM_AUTO) -#endif -BI_amiga_vblank = BI_amiga_chip_size+4 -BI_amiga_psfreq = BI_amiga_vblank+1 -BI_amiga_eclock = BI_amiga_psfreq+1 -BI_amiga_chipset = BI_amiga_eclock+4 -BI_amiga_hw_present = BI_amiga_chipset+4 - -#endif /* __ASSEMBLY__ */ - -/* Atari specific part of bootinfo */ - -/* - * 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 - * important what hardware the machine uses - */ -/* ++roman 08/08/95: rewritten from ORing constants to a C bitfield */ - -#ifndef __ASSEMBLY__ - -#define ATARIHW_DECLARE(name) unsigned name : 1 -#define ATARIHW_SET(name) (boot_info.bi_atari.hw_present.name = 1) -#define ATARIHW_PRESENT(name) (boot_info.bi_atari.hw_present.name) - -struct bi_Atari { - struct { - /* video hardware */ - ATARIHW_DECLARE(STND_SHIFTER); /* ST-Shifter - no base low ! */ - ATARIHW_DECLARE(EXTD_SHIFTER); /* STe-Shifter - 24 bit address */ - ATARIHW_DECLARE(TT_SHIFTER); /* TT-Shifter */ - ATARIHW_DECLARE(VIDEL_SHIFTER); /* Falcon-Shifter */ - /* sound hardware */ - ATARIHW_DECLARE(YM_2149); /* Yamaha YM 2149 */ - ATARIHW_DECLARE(PCM_8BIT); /* PCM-Sound in STe-ATARI */ - ATARIHW_DECLARE(CODEC); /* CODEC Sound (Falcon) */ - /* disk storage interfaces */ - ATARIHW_DECLARE(TT_SCSI); /* Directly mapped NCR5380 */ - ATARIHW_DECLARE(ST_SCSI); /* NCR5380 via ST-DMA (Falcon) */ - ATARIHW_DECLARE(ACSI); /* Standard ACSI like in STs */ - ATARIHW_DECLARE(IDE); /* IDE Interface */ - ATARIHW_DECLARE(FDCSPEED); /* 8/16 MHz switch for FDC */ - /* other I/O hardware */ - ATARIHW_DECLARE(ST_MFP); /* The ST-MFP (there should - be no Atari without - it... but who knows?) */ - ATARIHW_DECLARE(TT_MFP); /* 2nd MFP */ - ATARIHW_DECLARE(SCC); /* Serial Communications Contr. */ - ATARIHW_DECLARE(ST_ESCC); /* SCC Z83230 in an ST */ - ATARIHW_DECLARE(ANALOG_JOY); /* Paddle Interface for STe - and Falcon */ - ATARIHW_DECLARE(MICROWIRE); /* Microwire Interface */ - /* DMA */ - ATARIHW_DECLARE(STND_DMA); /* 24 Bit limited ST-DMA */ - ATARIHW_DECLARE(EXTD_DMA); /* 32 Bit ST-DMA */ - ATARIHW_DECLARE(SCSI_DMA); /* DMA for the NCR5380 */ - ATARIHW_DECLARE(SCC_DMA); /* DMA for the SCC */ - /* real time clocks */ - ATARIHW_DECLARE(TT_CLK); /* TT compatible clock chip */ - ATARIHW_DECLARE(MSTE_CLK); /* Mega ST(E) clock chip */ - /* supporting hardware */ - ATARIHW_DECLARE(SCU); /* System Control Unit */ - ATARIHW_DECLARE(BLITTER); /* Blitter */ - ATARIHW_DECLARE(VME); /* VME Bus */ - } hw_present; - unsigned long mch_cookie; /* _MCH cookie from TOS */ -}; - -/* 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 - -struct mem_info { - unsigned long addr; /* physical address of memory chunk */ - unsigned long size; /* length of memory chunk (in bytes) */ -}; - -#else /* __ASSEMBLY__ */ - -MI_addr = 0 -MI_size = MI_addr+4 -MI_sizeof = MI_size+4 - -#endif /* __ASSEMBLY__ */ - -#define NUM_MEMINFO 4 + /* + * 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?? */ -/* - * CPU and FPU types - */ - -#define CPUB_68020 0 -#define CPUB_68030 1 -#define CPUB_68040 2 -#define CPUB_68060 3 -#define FPUB_68881 5 -#define FPUB_68882 6 -#define FPUB_68040 7 /* Internal FPU */ -#define FPUB_68060 8 /* Internal FPU */ - -#define CPU_68020 (1<<CPUB_68020) -#define CPU_68030 (1<<CPUB_68030) -#define CPU_68040 (1<<CPUB_68040) -#define CPU_68060 (1<<CPUB_68060) -#define CPU_MASK (31) -#define FPU_68881 (1<<FPUB_68881) -#define FPU_68882 (1<<FPUB_68882) -#define FPU_68040 (1<<FPUB_68040) /* Internal FPU */ -#define FPU_68060 (1<<FPUB_68060) /* Internal FPU */ -#define FPU_MASK (0xfe0) - -#define CL_SIZE (256) +#ifdef __KERNEL__ -/* - * machine type definitions - */ +#ifndef __ASSEMBLY__ +extern u_long m68k_machtype; +#endif /* !__ASSEMBLY__ */ #if !defined(CONFIG_AMIGA) # define MACH_IS_AMIGA (0) #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) -# define MACH_IS_AMIGA (boot_info.machtype == MACH_AMIGA) +# define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA) #else -# define CONFIG_AMIGA_ONLY +# define MACH_AMIGA_ONLY # define MACH_IS_AMIGA (1) # define MACH_TYPE (MACH_AMIGA) #endif @@ -234,9 +56,9 @@ MI_sizeof = MI_size+4 #if !defined(CONFIG_ATARI) # define MACH_IS_ATARI (0) #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) -# define MACH_IS_ATARI (boot_info.machtype == MACH_ATARI) +# define MACH_IS_ATARI (m68k_machtype == MACH_ATARI) #else -# define CONFIG_ATARI_ONLY +# define MACH_ATARI_ONLY # define MACH_IS_ATARI (1) # define MACH_TYPE (MACH_ATARI) #endif @@ -245,58 +67,127 @@ MI_sizeof = MI_size+4 # error Currently no Mac support! #endif +#if defined(CONFIG_SUN3) +# error Currently no Sun-3 support! +#endif + +#if defined(CONFIG_APOLLO) +# error Currently no Apollo support! +#endif + #ifndef MACH_TYPE -# define MACH_TYPE (boot_info.machtype) +# define MACH_TYPE (m68k_machtype) #endif -/* - * cpu type definitions - */ +#endif /* __KERNEL__ */ + + + /* + * CPU, FPU and MMU types + * + * Note: we may rely on the following equalities: + * + * CPU_68020 == MMU_68851 + * CPU_68030 == MMU_68030 + * CPU_68040 == FPU_68040 == MMU_68040 + * CPU_68060 == FPU_68060 == MMU_68060 + */ + +#define CPUB_68020 0 +#define CPUB_68030 1 +#define CPUB_68040 2 +#define CPUB_68060 3 + +#define CPU_68020 (1<<CPUB_68020) +#define CPU_68030 (1<<CPUB_68030) +#define CPU_68040 (1<<CPUB_68040) +#define CPU_68060 (1<<CPUB_68060) + +#define FPUB_68881 0 +#define FPUB_68882 1 +#define FPUB_68040 2 /* Internal FPU */ +#define FPUB_68060 3 /* Internal FPU */ +#define FPUB_SUNFPA 4 /* Sun-3 FPA */ + +#define FPU_68881 (1<<FPUB_68881) +#define FPU_68882 (1<<FPUB_68882) +#define FPU_68040 (1<<FPUB_68040) +#define FPU_68060 (1<<FPUB_68060) +#define FPU_SUNFPA (1<<FPUB_SUNFPA) + +#define MMUB_68851 0 +#define MMUB_68030 1 /* Internal MMU */ +#define MMUB_68040 2 /* Internal MMU */ +#define MMUB_68060 3 /* Internal MMU */ +#define MMUB_APOLLO 4 /* Custom Apollo */ +#define MMUB_SUN3 5 /* Custom Sun-3 */ + +#define MMU_68851 (1<<MMUB_68851) +#define MMU_68030 (1<<MMUB_68030) +#define MMU_68040 (1<<MMUB_68040) +#define MMU_68060 (1<<MMUB_68060) +#define MMU_SUN3 (1<<MMUB_SUN3) +#define MMU_APOLLO (1<<MMUB_APOLLO) + +#ifdef __KERNEL__ + +#ifndef __ASSEMBLY__ +extern u_long m68k_cputype; +extern u_long m68k_fputype; +extern u_long m68k_mmutype; /* Not really used yet */ + + /* + * m68k_is040or060 is != 0 for a '040 or higher; + * used numbers are 4 for 68040 and 6 for 68060. + */ + +extern int m68k_is040or060; +#endif /* !__ASSEMBLY__ */ #if !defined(CONFIG_M68020) # define CPU_IS_020 (0) #elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060) -# define CPU_IS_020 (boot_info.cputype & CPU_68020) +# define CPU_IS_020 (m68k_cputype & CPU_68020) #else -# define CONFIG_M68020_ONLY +# define CPU_M68020_ONLY # define CPU_IS_020 (1) #endif #if !defined(CONFIG_M68030) # define CPU_IS_030 (0) #elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060) -# define CPU_IS_030 (boot_info.cputype & CPU_68030) +# define CPU_IS_030 (m68k_cputype & CPU_68030) #else -# define CONFIG_M68030_ONLY +# define CPU_M68030_ONLY # define CPU_IS_030 (1) #endif #if !defined(CONFIG_M68040) # define CPU_IS_040 (0) #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060) -# define CPU_IS_040 (boot_info.cputype & CPU_68040) +# define CPU_IS_040 (m68k_cputype & CPU_68040) #else -# define CONFIG_M68040_ONLY +# define CPU_M68040_ONLY # define CPU_IS_040 (1) #endif #if !defined(CONFIG_M68060) # define CPU_IS_060 (0) #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040) -# define CPU_IS_060 (boot_info.cputype & CPU_68060) +# define CPU_IS_060 (m68k_cputype & CPU_68060) #else -# define CONFIG_M68060_ONLY +# define CPU_M68060_ONLY # define CPU_IS_060 (1) #endif #if !defined(CONFIG_M68020) && !defined(CONFIG_M68030) # define CPU_IS_020_OR_030 (0) #else -# define CONFIG_M68020_OR_M68030 +# define CPU_M68020_OR_M68030 # if defined(CONFIG_M68040) || defined(CONFIG_M68060) # define CPU_IS_020_OR_030 (!m68k_is040or060) # else -# define CONFIG_M68020_OR_M68030_ONLY +# define CPU_M68020_OR_M68030_ONLY # define CPU_IS_020_OR_030 (1) # endif #endif @@ -304,94 +195,40 @@ MI_sizeof = MI_size+4 #if !defined(CONFIG_M68040) && !defined(CONFIG_M68060) # define CPU_IS_040_OR_060 (0) #else -# define CONFIG_M68040_OR_M68060 +# define CPU_M68040_OR_M68060 # if defined(CONFIG_M68020) || defined(CONFIG_M68030) # define CPU_IS_040_OR_060 (m68k_is040or060) # else -# define CONFIG_M68040_OR_M68060_ONLY +# define CPU_M68040_OR_M68060_ONLY # define CPU_IS_040_OR_060 (1) # endif #endif -#define CPU_TYPE (boot_info.cputype) +#define CPU_TYPE (m68k_cputype) -#ifndef __ASSEMBLY__ -#ifdef __KERNEL__ - /* - * m68k_is040or060 is != 0 for a '040 or higher; - * used numbers are 4 for 68040 and 6 for 68060. - */ - -extern int m68k_is040or060; -#endif - -struct bootinfo { - unsigned long machtype; /* machine type */ - unsigned long cputype; /* system CPU & FPU */ - struct mem_info memory[NUM_MEMINFO]; /* memory description */ - int num_memory; /* # of memory blocks found */ - unsigned long ramdisk_size; /* ramdisk size in 1024 byte blocks */ - unsigned long ramdisk_addr; /* address of the ram disk in mem */ - char command_line[CL_SIZE]; /* kernel command line parameters */ - union { - struct bi_Amiga bi_ami; /* Amiga specific information */ - struct bi_Atari bi_ata; /* Atari specific information */ - } bi_un; -}; -#define bi_amiga bi_un.bi_ami -#define bi_atari bi_un.bi_ata -#define bi_mac bi_un.bi_mac +#endif /* __KERNEL__ */ -extern struct bootinfo - boot_info; -#else /* __ASSEMBLY__ */ + /* + * Miscellaneous + */ -BI_machtype = 0 -BI_cputype = BI_machtype+4 -BI_memory = BI_cputype+4 -BI_num_memory = BI_memory+(MI_sizeof*NUM_MEMINFO) -BI_ramdisk_size = BI_num_memory+4 -BI_ramdisk_addr = BI_ramdisk_size+4 -BI_command_line = BI_ramdisk_addr+4 -BI_un = BI_command_line+CL_SIZE - -#endif /* __ASSEMBLY__ */ - - -/* - * Stuff for bootinfo interface versioning - * - * At the start of kernel code, a 'struct bootversion' is located. bootstrap - * checks for a matching version of the interface before booting a kernel, to - * avoid user confusion if kernel and bootstrap don't work together :-) - * - * If incompatible changes are made to the bootinfo interface, the major - * number below should be stepped (and the minor reset to 0) for the - * appropriate machine. If a change is backward-compatible, the minor should - * be stepped. "Backwards-compatible" means that booting will work, but - * certain features may not. - */ - -#define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */ -#define MK_BI_VERSION(major,minor) (((major)<<16)+(minor)) -#define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff) -#define BI_VERSION_MINOR(v) ((v) & 0xffff) +#define NUM_MEMINFO (4) +#define CL_SIZE (256) #ifndef __ASSEMBLY__ -struct bootversion { - unsigned short branch; - unsigned long magic; - struct { - unsigned long machtype; - unsigned long version; - } machversions[0]; +struct mem_info { + unsigned long addr; /* physical address of memory chunk */ + unsigned long size; /* length of memory chunk (in bytes) */ }; -#endif /* __ASSEMBLY__ */ +#ifdef __KERNEL__ +extern int m68k_num_memory; /* # of memory blocks found */ +extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ +#endif /* __KERNEL__ */ + +#endif /* !__ASSEMBLY__ */ -#define AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) -#define ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) #endif /* _M68K_SETUP_H */ diff --git a/include/asm-m68k/sigcontext.h b/include/asm-m68k/sigcontext.h index a2d28c218..9c13b0951 100644 --- a/include/asm-m68k/sigcontext.h +++ b/include/asm-m68k/sigcontext.h @@ -1,6 +1,8 @@ #ifndef _ASM_M68k_SIGCONTEXT_H #define _ASM_M68k_SIGCONTEXT_H +#include<asm/fpu.h> + struct sigcontext { unsigned long sc_mask; /* old sigmask */ unsigned long sc_usp; /* old user stack pointer */ @@ -13,7 +15,7 @@ struct sigcontext { unsigned short sc_formatvec; unsigned long sc_fpregs[2*3]; /* room for two fp registers */ unsigned long sc_fpcntl[3]; - unsigned char sc_fpstate[216]; + unsigned char sc_fpstate[FPSTATESIZE]; }; #endif diff --git a/include/asm-m68k/smp_lock.h b/include/asm-m68k/smp_lock.h new file mode 100644 index 000000000..158de0988 --- /dev/null +++ b/include/asm-m68k/smp_lock.h @@ -0,0 +1,28 @@ +#ifndef __M68K_SMPLOCK_H +#define __M68K_SMPLOCK_H + +/* + * We don't do SMP so this is again one of these silly dummy files + * to keep the kernel source looking nice ;-(. + */ + +#define lock_kernel() do { } while(0) +#define unlock_kernel() do { } while(0) +#define release_kernel_lock(task, cpu, depth) ((depth) = 1) +#define reacquire_kernel_lock(task, cpu, depth) do { } while(0) + +#endif +#ifndef __M68K_SMPLOCK_H +#define __M68K_SMPLOCK_H + +/* + * We don't do SMP so this is again one of these silly dummy files + * to keep the kernel source looking nice ;-(. + */ + +#define lock_kernel() do { } while(0) +#define unlock_kernel() do { } while(0) +#define release_kernel_lock(task, cpu, depth) ((depth) = 1) +#define reaquire_kernel_lock(task, cpu, depth) do { } while(0) + +#endif diff --git a/include/asm-m68k/socket.h b/include/asm-m68k/socket.h index 529a3ffef..22aa27cc7 100644 --- a/include/asm-m68k/socket.h +++ b/include/asm-m68k/socket.h @@ -21,5 +21,16 @@ #define SO_LINGER 13 #define SO_BSDCOMPAT 14 /* To add :#define SO_REUSEPORT 15 */ +#define SO_PASSCRED 16 +#define SO_PEERCRED 17 +#define SO_RCVLOWAT 18 +#define SO_SNDLOWAT 19 +#define SO_RCVTIMEO 20 +#define SO_SNDTIMEO 21 + +/* Security levels - as per NRL IPv6 - don't actually do anything */ +#define SO_SECURITY_AUTHENTICATION 22 +#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 +#define SO_SECURITY_ENCRYPTION_NETWORK 24 #endif /* _ASM_SOCKET_H */ diff --git a/include/asm-m68k/softirq.h b/include/asm-m68k/softirq.h new file mode 100644 index 000000000..32f12c0d5 --- /dev/null +++ b/include/asm-m68k/softirq.h @@ -0,0 +1,118 @@ +#ifndef __M68K_SOFTIRQ_H +#define __M68K_SOFTIRQ_H + +/* + * Software interrupts.. no SMP here either. + */ +#define get_active_bhs() (bh_mask & bh_active) +#define clear_active_bhs(x) atomic_clear_mask((x),&bh_active) + +extern inline void init_bh(int nr, void (*routine)(void)) +{ + bh_base[nr] = routine; + bh_mask_count[nr] = 0; + bh_mask |= 1 << nr; +} + +extern inline void remove_bh(int nr) +{ + bh_base[nr] = NULL; + bh_mask &= ~(1 << nr); +} + +extern inline void mark_bh(int nr) +{ + set_bit(nr, &bh_active); +} + +/* + * These use a mask count to correctly handle + * nested disable/enable calls + */ +extern inline void disable_bh(int nr) +{ + bh_mask &= ~(1 << nr); + bh_mask_count[nr]++; +} + +extern inline void enable_bh(int nr) +{ + if (!--bh_mask_count[nr]) + bh_mask |= 1 << nr; +} + +extern int __m68k_bh_counter; + +extern inline void start_bh_atomic(void) +{ + __m68k_bh_counter++; + barrier(); +} + +extern inline void end_bh_atomic(void) +{ + barrier(); + __m68k_bh_counter--; +} + +/* 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) + +#endif +#ifndef __M68K_SOFTIRQ_H +#define __M68K_SOFTIRQ_H + +/* + * Software interrupts.. no SMP here either. + */ +#define get_active_bhs() (bh_mask & bh_active) +#define clear_active_bhs(x) atomic_clear_mask((x),&bh_active) + +extern inline void init_bh(int nr, void (*routine)(void)) +{ + bh_base[nr] = routine; + bh_mask_count[nr] = 0; + bh_mask |= 1 << nr; +} + +extern inline void mark_bh(int nr) +{ + set_bit(nr, &bh_active); +} + +/* + * These use a mask count to correctly handle + * nested disable/enable calls + */ +extern inline void disable_bh(int nr) +{ + bh_mask &= ~(1 << nr); + bh_mask_count[nr]++; +} + +extern inline void enable_bh(int nr) +{ + if (!--bh_mask_count[nr]) + bh_mask |= 1 << nr; +} + +extern int __m68k_bh_counter; + +extern inline void start_bh_atomic(void) +{ + __m68k_bh_counter++; + barrier(); +} + +extern inline void end_bh_atomic(void) +{ + barrier(); + __m68k_bh_counter--; +} + +/* 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) + +#endif diff --git a/include/asm-m68k/spinlock.h b/include/asm-m68k/spinlock.h new file mode 100644 index 000000000..cbae3d62d --- /dev/null +++ b/include/asm-m68k/spinlock.h @@ -0,0 +1,74 @@ +#ifndef __M68K_SPINLOCK_H +#define __M68K_SPINLOCK_H + +/* + * We don't do SMP on the m68k .... at least not yet. + */ + +typedef struct { } spinlock_t; +#define SPIN_LOCK_UNLOCKED { } + +#define spin_lock_init(lock) do { } while(0) +#define spin_lock(lock) do { } while(0) +#define spin_trylock(lock) do { } while(0) +#define spin_unlock_wait(lock) do { } while(0) +#define spin_unlock(lock) do { } while(0) +#define spin_lock_irq(lock) cli() +#define spin_unlock_irq(lock) sti() + +#define spin_lock_irqsave(lock, flags) \ + do { save_flags(flags); cli(); } while (0) +#define spin_unlock_irqrestore(lock, flags) \ + restore_flags(flags) + +/* + * Read-write spinlocks, allowing multiple readers + * but only one writer. + * + * NOTE! it is quite common to have readers in interrupts + * but no interrupt writers. For those circumstances we + * can "mix" irq-safe locks - any writer needs to get a + * irq-safe write-lock, but readers can get non-irqsafe + * read-locks. + */ +typedef struct { } rwlock_t; +#define RW_LOCK_UNLOCKED { } + +#define read_lock(lock) do { } while(0) +#define read_unlock(lock) do { } while(0) +#define write_lock(lock) do { } while(0) +#define write_unlock(lock) do { } while(0) +#define read_lock_irq(lock) cli() +#define read_unlock_irq(lock) sti() +#define write_lock_irq(lock) cli() +#define write_unlock_irq(lock) sti() + +#define read_lock_irqsave(lock, flags) save_and_cli(flags) +#define read_unlock_irqrestore(lock, flags) restore_flags(flags) +#define write_lock_irqsave(lock, flags) save_and_cli(flags) +#define write_unlock_irqrestore(lock, flags) restore_flags(flags) + +#endif +#ifndef __M68K_SPINLOCK_H +#define __M68K_SPINLOCK_H + +/* + * We don't do SMP on the m68k .... at least not yet. + */ + +typedef struct { } spinlock_t; +#define SPIN_LOCK_UNLOCKED { } + +#define spin_lock_init(lock) do { } while(0) +#define spin_lock(lock) do { } while(0) +#define spin_trylock(lock) do { } while(0) +#define spin_unlock(lock) do { } while(0) +#define spin_lock_irq(lock) cli() +#define spin_unlock_irq(lock) sti() + +#define spin_lock_irqsave(lock, flags) \ + do { save_flags(flags); cli(); } while (0) +#define spin_unlock_irqrestore(lock, flags) \ + restore_flags(flags) + +#endif diff --git a/include/asm-m68k/string.h b/include/asm-m68k/string.h index 57f83e3fc..796f6f16e 100644 --- a/include/asm-m68k/string.h +++ b/include/asm-m68k/string.h @@ -326,7 +326,9 @@ extern inline void * __memset_page(void * s,int c,size_t count) *((unsigned long *)(s))++ = data; __asm__ __volatile__("1:\t" + ".chip 68040\n\t" "move16 %2@+,%0@+\n\t" + ".chip 68k\n\t" "subqw #8,%2\n\t" "subqw #8,%2\n\t" "dbra %1,1b\n\t" @@ -390,8 +392,10 @@ extern inline void * __memcpy_page(void * to, const void * from, size_t count) return memcpy(to, from, count); __asm__ __volatile__("1:\t" + ".chip 68040\n\t" "move16 %1@+,%0@+\n\t" "move16 %1@+,%0@+\n\t" + ".chip 68k\n\t" "dbra %2,1b\n\t" : "=a" (to), "=a" (from), "=d" (tmp) : "0" (to), "1" (from) , "2" (count / 32 - 1) diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h index 58c8d3905..dc9024b73 100644 --- a/include/asm-m68k/system.h +++ b/include/asm-m68k/system.h @@ -65,21 +65,24 @@ struct __xchg_dummy { unsigned long a[100]; }; #if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) && !defined(CONFIG_MAC) /* block out HSYNC on the atari */ -#define sti() __asm__ __volatile__ ("andiw #0xfbff,%/sr": : : "memory") +#define __sti() __asm__ __volatile__ ("andiw #0xfbff,%/sr": : : "memory") #else /* portable version */ -#define sti() __asm__ __volatile__ ("andiw #0xf8ff,%/sr": : : "memory") +#define __sti() __asm__ __volatile__ ("andiw #0xf8ff,%/sr": : : "memory") #endif /* machine compilation types */ -#define cli() __asm__ __volatile__ ("oriw #0x0700,%/sr": : : "memory") +#define __cli() __asm__ __volatile__ ("oriw #0x0700,%/sr": : : "memory") #define nop() __asm__ __volatile__ ("nop"::) #define mb() __asm__ __volatile__ ("" : : :"memory") -#define save_flags(x) \ +#define __save_flags(x) \ __asm__ __volatile__("movew %/sr,%0":"=d" (x) : /* no input */ :"memory") -#define restore_flags(x) \ +#define __restore_flags(x) \ __asm__ __volatile__("movew %0,%/sr": /* no outputs */ :"d" (x) : "memory") -#define iret() __asm__ __volatile__ ("rte": : :"memory", "sp", "cc") +#define cli() __cli() +#define sti() __sti() +#define save_flags(x) __save_flags(x) +#define restore_flags(x) __restore_flags(x) #ifndef CONFIG_RMW_INSNS static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int size) diff --git a/include/asm-m68k/termbits.h b/include/asm-m68k/termbits.h index 78494acc0..0a3080a76 100644 --- a/include/asm-m68k/termbits.h +++ b/include/asm-m68k/termbits.h @@ -123,6 +123,7 @@ struct termios { #define B230400 0010003 #define B460800 0010004 #define CIBAUD 002003600000 /* input baud rate (not used) */ +#define CMSPAR 010000000000 /* mark or space (stick) parity */ #define CRTSCTS 020000000000 /* flow control */ /* c_lflag bits */ diff --git a/include/asm-m68k/termios.h b/include/asm-m68k/termios.h index 4bedde47f..3c022c3c8 100644 --- a/include/asm-m68k/termios.h +++ b/include/asm-m68k/termios.h @@ -53,37 +53,43 @@ struct termio { #define N_PPP 3 #define N_STRIP 4 #define N_AX25 5 +#define N_X25 6 /* X.25 async */ #ifdef __KERNEL__ /* * Translate a "termio" structure into a "termios". Ugh. */ -extern inline void trans_from_termio(struct termio * termio, - struct termios * termios) -{ -#define SET_LOW_BITS(x,y) ((x) = (0xffff0000 & (x)) | (y)) - SET_LOW_BITS(termios->c_iflag, termio->c_iflag); - SET_LOW_BITS(termios->c_oflag, termio->c_oflag); - SET_LOW_BITS(termios->c_cflag, termio->c_cflag); - SET_LOW_BITS(termios->c_lflag, termio->c_lflag); -#undef SET_LOW_BITS - memcpy(termios->c_cc, termio->c_cc, NCC); -} +#define user_termio_to_kernel_termios(termios, termio) \ +({ \ + unsigned short tmp; \ + get_user(tmp, &(termio)->c_iflag); \ + (termios)->c_iflag = (0xffff0000 & ((termios)->c_iflag)) | tmp; \ + get_user(tmp, &(termio)->c_oflag); \ + (termios)->c_oflag = (0xffff0000 & ((termios)->c_oflag)) | tmp; \ + get_user(tmp, &(termio)->c_cflag); \ + (termios)->c_cflag = (0xffff0000 & ((termios)->c_cflag)) | tmp; \ + get_user(tmp, &(termio)->c_lflag); \ + (termios)->c_lflag = (0xffff0000 & ((termios)->c_lflag)) | tmp; \ + get_user((termios)->c_line, &(termio)->c_line); \ + copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ +}) /* * Translate a "termios" structure into a "termio". Ugh. */ -extern inline void trans_to_termio(struct termios * termios, - struct termio * termio) -{ - termio->c_iflag = termios->c_iflag; - termio->c_oflag = termios->c_oflag; - termio->c_cflag = termios->c_cflag; - termio->c_lflag = termios->c_lflag; - termio->c_line = termios->c_line; - memcpy(termio->c_cc, termios->c_cc, NCC); -} +#define kernel_termios_to_user_termio(termio, termios) \ +({ \ + put_user((termios)->c_iflag, &(termio)->c_iflag); \ + put_user((termios)->c_oflag, &(termio)->c_oflag); \ + put_user((termios)->c_cflag, &(termio)->c_cflag); \ + put_user((termios)->c_lflag, &(termio)->c_lflag); \ + put_user((termios)->c_line, &(termio)->c_line); \ + copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ +}) + +#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios)) +#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios)) #endif /* __KERNEL__ */ diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h index 50ff178cd..864c49657 100644 --- a/include/asm-m68k/uaccess.h +++ b/include/asm-m68k/uaccess.h @@ -82,11 +82,12 @@ __asm__ __volatile__ \ " .even\n" \ "2: movel %3,%0\n" \ " jra 1b\n" \ + ".previous\n" \ ".section __ex_table,\"a\"\n" \ " .align 4\n" \ " .long 21b,2b\n" \ " .long 1b,2b\n" \ - ".text" \ + ".previous" \ : "=d"(err) \ : "m"(*(ptr)), "r"(x), "i"(-EFAULT), "0"(0)) @@ -125,10 +126,11 @@ __asm__ __volatile__ \ "3: movel %3,%0\n" \ " sub" #bwl " %1,%1\n" \ " jra 2b\n" \ + ".previous\n" \ ".section __ex_table,\"a\"\n" \ " .align 4\n" \ " .long 1b,3b\n" \ - ".text" \ + ".previous" \ : "=d"(err), reg(x) \ : "m"(*(ptr)), "i" (-EFAULT), "0"(0)) @@ -162,12 +164,13 @@ __generic_copy_from_user(void *to, const void *from, unsigned long n) " jra 6b\n" "9: addql #1,%2\n" " jra 6b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,7b\n" " .long 3b,8b\n" " .long 5b,9b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp) : "r"(n & 3), "0"(to), "1"(from), "2"(n/4) : "d0", "memory"); @@ -204,6 +207,7 @@ __generic_copy_to_user(void *to, const void *from, unsigned long n) " jra 5b\n" "8: addql #1,%2\n" " jra 5b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 22b,6b\n" @@ -212,7 +216,7 @@ __generic_copy_to_user(void *to, const void *from, unsigned long n) " .long 4b,7b\n" " .long 25b,8b\n" " .long 5b,8b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp) : "r"(n & 3), "0"(to), "1"(from), "2"(n / 4)); return n; @@ -229,12 +233,12 @@ __generic_copy_to_user(void *to, const void *from, unsigned long n) "11: lsll #2,%2\n" \ fixup "\n" \ " jra 12f\n" \ + ".previous\n" \ ".section __ex_table,\"a\"\n" \ " .align 4\n" \ " .long 10b,11b\n" \ - ".text\n" \ + ".previous\n" \ copy "\n" \ - ".text\n" \ "12:" \ : "=a"(to), "=a"(from), "=d"(n) \ : "0"(to), "1"(from), "2"(n/4) \ @@ -255,10 +259,11 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) " .even\n" "3: addql #1,%2\n" " jra 2b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,3b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -272,10 +277,11 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) " .even\n" "3: addql #2,%2\n" " jra 2b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,3b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -292,11 +298,12 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) "4: addql #2,%2\n" "5: addql #1,%2\n" " jra 3b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,4b\n" " .long 2b,5b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -310,10 +317,11 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) " .even\n" "3: addql #4,%2\n" " jra 2b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,3b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -330,11 +338,12 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) "4: addql #4,%2\n" "5: addql #4,%2\n" " jra 3b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,4b\n" " .long 2b,5b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -354,12 +363,13 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) "6: addql #4,%2\n" "7: addql #4,%2\n" " jra 4b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,5b\n" " .long 2b,6b\n" " .long 3b,7b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -382,13 +392,14 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) "8: addql #4,%2\n" "9: addql #4,%2\n" " jra 5b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,6b\n" " .long 2b,7b\n" " .long 3b,8b\n" " .long 4b,9b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -406,7 +417,8 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) "2: movesb (%1)+,%%d0\n" " moveb %%d0,(%0)+\n" ".section __ex_table,\"a\"\n" - " .long 2b,1b"); + " .long 2b,1b\n" + ".previous"); break; case 2: __copy_from_user_big(to, from, n, @@ -416,12 +428,13 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) "2: movesw (%1)+,%%d0\n" " movew %%d0,(%0)+\n" ".section __ex_table,\"a\"\n" - " .long 2b,1b"); + " .long 2b,1b\n" + ".previous"); break; case 3: __copy_from_user_big(to, from, n, /* fixup */ - "1: addql #2,%2" + "1: addql #2,%2\n" "2: addql #1,%2", /* copy */ "3: movesw (%1)+,%%d0\n" @@ -430,7 +443,8 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) " moveb %%d0,(%0)+\n" ".section __ex_table,\"a\"\n" " .long 3b,1b\n" - " .long 4b,2b"); + " .long 4b,2b\n" + ".previous"); break; } break; @@ -449,13 +463,13 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) "12: lsll #2,%2\n" \ fixup "\n" \ " jra 13f\n" \ + ".previous\n" \ ".section __ex_table,\"a\"\n" \ " .align 4\n" \ " .long 31b,12b\n" \ " .long 11b,12b\n" \ - ".text\n" \ + ".previous\n" \ copy "\n" \ - ".text\n" \ "13:" \ : "=a"(to), "=a"(from), "=d"(n) \ : "0"(to), "1"(from), "2"(n/4) \ @@ -476,11 +490,12 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) " .even\n" "2: addql #1,%2\n" " jra 1b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n " " .long 21b,2b\n" " .long 1b,2b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -494,11 +509,12 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) " .even\n" "2: addql #2,%2\n" " jra 1b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 21b,2b\n" " .long 1b,2b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -515,13 +531,14 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) "3: addql #2,%2\n" "4: addql #1,%2\n" " jra 2b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 21b,3b\n" " .long 1b,3b\n" " .long 22b,4b\n" " .long 2b,4b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -535,11 +552,12 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) " .even\n" "2: addql #4,%2\n" " jra 1b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 21b,2b\n" " .long 1b,2b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -556,13 +574,14 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) "3: addql #4,%2\n" "4: addql #4,%2\n" " jra 2b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 21b,3b\n" " .long 1b,3b\n" " .long 22b,4b\n" " .long 2b,4b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -582,6 +601,7 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) "5: addql #4,%2\n" "6: addql #4,%2\n" " jra 3b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 21b,4b\n" @@ -590,7 +610,7 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) " .long 2b,5b\n" " .long 23b,6b\n" " .long 3b,6b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -613,6 +633,7 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) "7: addql #4,%2\n" "8: addql #4,%2\n" " jra 4b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 21b,5b\n" @@ -623,7 +644,7 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) " .long 3b,7b\n" " .long 24b,8b\n" " .long 4b,8b\n" - ".text" + ".previous" : "=a"(to), "=a"(from), "=d"(n) : "0"(to), "1"(from), "2"(0) : "d0", "memory"); @@ -643,7 +664,8 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) "2:" ".section __ex_table,\"a\"\n" " .long 22b,1b\n" - " .long 2b,1b"); + " .long 2b,1b\n" + ".previous"); break; case 2: __copy_to_user_big(to, from, n, @@ -655,12 +677,13 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) "2:" ".section __ex_table,\"a\"\n" " .long 22b,1b\n" - " .long 2b,1b"); + " .long 2b,1b\n" + ".previous"); break; case 3: __copy_to_user_big(to, from, n, /* fixup */ - "1: addql #2,%2" + "1: addql #2,%2\n" "2: addql #1,%2", /* copy */ " movew (%1)+,%%d0\n" @@ -672,7 +695,8 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) " .long 23b,1b\n" " .long 3b,1b\n" " .long 24b,2b\n" - " .long 4b,2b"); + " .long 4b,2b\n" + ".previous"); break; } break; @@ -690,6 +714,9 @@ __constant_copy_to_user(void *to, const void *from, unsigned long n) __constant_copy_to_user(to, from, n) : \ __generic_copy_to_user(to, from, n)) +#define __copy_from_user(to, from, n) copy_from_user(to, from, n) +#define __copy_to_user(to, from, n) copy_to_user(to, from, n) + /* * Copy a null terminated string from userspace. */ @@ -711,11 +738,12 @@ strncpy_from_user(char *dst, const char *src, long count) " .even\n" "4: movel %4,%0\n" " jra 3b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,4b\n" " .long 12b,4b\n" - ".text" + ".previous" : "=d"(res), "=a"(dst), "=a"(src), "=d"(count) : "i"(-EFAULT), "0"(count), "1"(dst), "2"(src), "3"(count) : "d0", "memory"); @@ -729,26 +757,26 @@ strncpy_from_user(char *dst, const char *src, long count) */ static inline long strlen_user(const char * src) { - long res = (long) src; + long res = -(long) src; __asm__ __volatile__ ("1: movesb (%1)+,%%d0\n" "12:tstb %%d0\n" " jne 1b\n" - " subl %1,%0\n" - " negl %0\n" + " addl %1,%0\n" "2:\n" ".section .fixup,\"ax\"\n" " .even\n" "3: moveq %2,%0\n" " jra 2b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,3b\n" " .long 12b,3b\n" - ".text" + ".previous" : "=d"(res), "=a"(src) : "i"(0), "0"(res), "1"(src) - : "d0", "memory"); + : "d0"); return res; } @@ -782,6 +810,7 @@ clear_user(void *to, unsigned long n) " jra 5b\n" "8: addql #1,%1\n" " jra 5b\n" + ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" " .long 1b,6b\n" @@ -790,7 +819,7 @@ clear_user(void *to, unsigned long n) " .long 4b,7b\n" " .long 25b,8b\n" " .long 5b,8b\n" - ".text" + ".previous" : "=a"(to), "=d"(n) : "r"(n & 3), "r"(0), "0"(to), "1"(n/4)); return n; diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h index b55f296a7..c526da9ef 100644 --- a/include/asm-m68k/unistd.h +++ b/include/asm-m68k/unistd.h @@ -171,6 +171,9 @@ #define __NR_mremap 163 #define __NR_setresuid 164 #define __NR_getresuid 165 +#define __NR_query_module 167 +#define __NR_poll 168 +#define __NR_nfsservctl 169 /* user-visible error numbers are in the range -1 - -122: see <asm-m68k/errno.h> */ @@ -178,7 +181,10 @@ #define __syscall_return(type, res) \ do { \ if ((unsigned long)(res) >= (unsigned long)(-125)) { \ - errno = -(res); \ + /* avoid using res which is declared to be in register d0; \ + errno might expand to a function call and clobber it. */ \ + int __err = -(res); \ + errno = __err; \ res = -1; \ } \ return (type) (res); \ diff --git a/include/asm-m68k/user.h b/include/asm-m68k/user.h index 126e23548..7ba0f8f1e 100644 --- a/include/asm-m68k/user.h +++ b/include/asm-m68k/user.h @@ -2,7 +2,7 @@ #define _M68K_USER_H #include <asm/page.h> -#include <linux/ptrace.h> + /* Core file format: The core file is written in such a way that gdb can understand it and provide useful information to the user (under linux we use the 'trad-core' bfd). There are quite a number of @@ -74,7 +74,8 @@ struct user{ esp register. */ long int signal; /* Signal that caused the core dump. */ int reserved; /* No longer used */ - struct pt_regs * u_ar0; /* Used by gdb to help find the values for */ + struct user_regs_struct *u_ar0; + /* Used by gdb to help find the values for */ /* the registers. */ struct user_m68kfp_struct* u_fpstate; /* Math Co-processor pointer. */ unsigned long magic; /* To uniquely identify a core file */ diff --git a/include/asm-m68k/zorro.h b/include/asm-m68k/zorro.h deleted file mode 100644 index adfc4617c..000000000 --- a/include/asm-m68k/zorro.h +++ /dev/null @@ -1,574 +0,0 @@ -/* - * asm-m68k/zorro.h -- Amiga AutoConfig (Zorro) Expansion Device Definitions - * - * Copyright (C) 1995 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_ZORRO_H_ -#define _ASM_M68K_ZORRO_H_ - -#ifndef __ASSEMBLY__ - -#include <linux/config.h> -#include <asm/amigatypes.h> - - -/* - * Defined Board Manufacturers - * - * Please update arch/m68k/amiga/zorro.c if you make changes here - * Many IDs were obtained from ExpName/Identify ((C) Richard Körber) - * and by looking at the NetBSD-Amiga kernel sources - */ - -#define MANUF_PACIFIC (0x00D3) /* Pacific Peripherals */ -#define PROD_SE_2000_A500 (0x00) /* SE 2000 A500 */ -#define PROD_PACIFIC_HD (0x0A) /* HD Controller */ - -#define MANUF_KUPKE (0x00DD) /* Kupke */ -#define PROD_GOLEM_BOX_2 (0x00) /* Golem RAM Box 2MB */ - -#define MANUF_MEMPHIS (0x0100) /* Memphis */ -#define PROD_STORMBRINGER (0x00) /* Stormbringer */ - -#define MANUF_COMMODORE2 (0x0201) /* Commodore Braunschweig */ -#define PROD_A2088 (0x01) /* CBM A2088 XT Bridgeboard */ -#define PROD_A2286 (0x02) /* CBM A2286 AT Bridgeboard */ -#define PROD_A4091_2 (0x54) /* CBM A4091 SCSI Controller */ -#define PROD_A2386SX (0x67) /* CBM A2386-SX Bridgeboard */ - -#define MANUF_COMMODORE (0x0202) /* Commodore West Chester */ -#define PROD_A2090A (0x01) /* CBM A2090/A2090A HD Controller */ -#define PROD_A590 (0x02) /* CBM A590 SCSI Controller */ -#define PROD_A2091 (0x03) /* CBM A2091 SCSI Controller */ -#define PROD_A2090B (0x04) /* CBM A2090B 2090 Autoboot Card */ -#define PROD_ARCNET (0x09) /* CBM A2060 Arcnet Card */ -#define PROD_CBMRAM (0x0A) /* CBM A2052/58.RAM | 590/2091.RAM */ -#define PROD_A560RAM (0x20) /* CBM A560 Memory Module */ -#define PROD_A2232PROTO (0x45) /* CBM A2232 Serial Prototype */ -#define PROD_A2232 (0x46) /* CBM A2232 Serial Production */ -#define PROD_A2620 (0x50) /* CBM A2620 68020/RAM Card */ -#define PROD_A2630 (0x51) /* CBM A2630 68030/RAM Card */ -#define PROD_A4091 (0x54) /* CBM A4091 SCSI Controller */ -#define PROD_A2065_2 (0x5A) /* A2065 Ethernet Card */ -#define PROD_ROMULATOR (0x60) /* CBM Romulator Card */ -#define PROD_A3000TESTFIX (0x61) /* CBM A3000 Test Fixture */ -#define PROD_A2386SX_2 (0x67) /* A2386-SX Bridgeboard */ -#define PROD_A2065 (0x70) /* CBM A2065 Ethernet Card */ - -#define MANUF_COMMODORE3 (0x0203) /* Commodore West Chester */ -#define PROD_A2090A_CM (0x03) /* A2090A Combitec/MacroSystem */ - -#define MANUF_KCS (0x02FF) /* Kolff Computer Supplies */ -#define PROD_POWER_BOARD (0x00) /* KCS Power PC Board */ - -#define MANUF_CARDCO (0x03EC) /* Cardco */ -#define PROD_KRONOS_2000_SCSI (0x04) /* Kronos 2000 SCSI Controller */ -#define PROD_A1000_SCSI (0x0C) /* A1000 SCSI Controller */ -#define PROD_ESCORT_SCSI (0x0E) /* Escort SCSI Controller */ -#define PROD_CC_A2410 (0xF5) /* Cardco A2410 Hires Graphics Card */ - -#define MANUF_A_SQUARED (0x03ED) /* A-Squared */ -#define PROD_LIVE_2000 (0x01) /* Live! 2000 */ - -#define MANUF_COMSPEC (0x03EE) /* ComSpec Communications */ -#define PROD_AX2000 (0x01) /* AX2000 */ - -#define MANUF_ANAKIN (0x03F1) /* Anakin */ -#define PROD_EASYL (0x01) /* Easyl Tablet */ - -#define MANUF_MICROBOTICS (0x03F2) /* MicroBotics */ -#define PROD_STARBOARD_II (0x00) /* StarBoard II */ -#define PROD_STARDRIVE (0x02) /* StarDrive */ -#define PROD_8_UP_A (0x03) /* 8-Up (Rev A) */ -#define PROD_8_UP_Z (0x04) /* 8-Up (Rev Z) */ -#define PROD_VXL_RAM (0x44) /* VXL RAM */ -#define PROD_VXL_30 (0x45) /* VXL-30 Turbo Board */ -#define PROD_MBX_1200 (0x81) /* MBX 1200 */ -#define PROD_HARDFRAME_2000 (0x9E) /* Hardframe 2000 */ -#define PROD_MBX_1200_2 (0xC1) /* MBX 1200 */ - -#define MANUF_ACCESS (0x03F4) /* Access Associates */ - -#define MANUF_EXPANSION_TECH (0x03F6) /* Expansion Technologies */ - -#define MANUF_ASDG (0x03FF) /* ASDG */ -#define PROD_ASDG_MEMORY (0x01) /* Memory Expansion */ -#define PROD_ASDG_MEMORY_2 (0x02) /* Memory Expansion */ -#define PROD_LAN_ROVER (0xFE) /* Lan Rover Ethernet */ -#define PROD_TWIN_X (0xFF) /* Twin-X Serial Card */ - -#define MANUF_IMTRONICS (0x0404) /* Imtronics */ -#define PROD_HURRICANE_2800 (0x39) /* Hurricane 2800 68030 */ -#define PROD_HURRICANE_2800_2 (0x57) /* Hurricane 2800 68030 */ - -#define MANUF_UNIV_OF_LOWELL (0x0406) /* University of Lowell */ -#define PROD_A2410 (0x00) /* CBM A2410 Hires Graphics Card */ - -#define MANUF_AMERISTAR (0x041D) /* Ameristar */ -#define PROD_AMERISTAR2065 (0x01) /* A2065 Ethernet Card */ -#define PROD_A560 (0x09) /* Arcnet Card */ -#define PROD_A4066 (0x0A) /* A4066 Ethernet Card */ - -#define MANUF_SUPRA (0x0420) /* Supra */ -#define PROD_SUPRADRIVE_4x4 (0x01) /* SupraDrive 4x4 SCSI Controller */ -#define PROD_SUPRA_2000 (0x03) /* 2000 DMA HD */ -#define PROD_SUPRA_500 (0x05) /* 500 HD/RAM */ -#define PROD_SUPRA_500RX (0x09) /* 500RX/2000 RAM */ -#define PROD_SUPRA_500RX_2 (0x0A) /* 500RX/2000 RAM */ -#define PROD_SUPRA_2400ZI (0x0B) /* 2400zi Modem */ -#define PROD_WORDSYNC (0x0C) /* Supra Wordsync SCSI Controller */ -#define PROD_WORDSYNC_II (0x0D) /* Supra Wordsync II SCSI Controller */ -#define PROD_SUPRA_2400ZIPLUS (0x10) /* 2400zi+ Modem */ - -#define MANUF_CSA (0x0422) /* CSA */ -#define PROD_MAGNUM (0x11) /* Magnum 40 SCSI Controller */ -#define PROD_12GAUGE (0x15) /* 12 Gauge SCSI Controller */ - -#define MANUF_GVP3 (0x06E1) /* Great Valley Products */ -#define PROD_IMPACT (0x08) /* Impact SCSI/Memory */ - -#define MANUF_BYTEBOX (0x07DA) /* ByteBox */ -#define PROD_BYTEBOX_A500 (0x00) /* A500 */ - -#define MANUF_HACKER (0x07DB) /* Test only: no product definitions */ - -#define MANUF_POWER_COMPUTING (0x07DC) /* Power Computing (DKB) */ -#define PROD_DKB_3128 (0x0E) /* DKB 3128 RAM */ -#define PROD_VIPER_II_COBRA (0x12) /* Viper II Turbo Board (DKB Cobra) */ - -#define MANUF_GVP (0x07E1) /* Great Valley Products */ -#define PROD_IMPACT_I_4K (0x01) /* Impact Series-I SCSI 4K */ -#define PROD_IMPACT_I_16K_2 (0x02) /* Impact Series-I SCSI 16K/2 */ -#define PROD_IMPACT_I_16K_3 (0x03) /* Impact Series-I SCSI 16K/3 */ -#define PROD_IMPACT_3001_IDE (0x08) /* Impact 3001 IDE */ -#define PROD_IMPACT_3001_RAM (0x09) /* Impact 3001 RAM */ -#define PROD_GVPIISCSI (0x0B) /* GVP Series II SCSI Controller */ -#define PROD_GVPIISCSI_2 (0x09) /* evidence that the driver works - for this product code also */ -#define PROD_GVPIIRAM (0x0A) /* GVP Series II RAM */ -#define PROD_GVP (0x0B) /* This code is used by a wide range of - GVP products - use the epc to - identify it correctly */ -#define PROD_GVP_A2000_030 (0x0D) /* GVP A2000 68030 Turbo Board */ -#define PROD_IMPACT_3001_IDE_2 (0x0D) /* Impact 3001 IDE */ -#define PROD_GFORCE_040_SCSI (0x16) /* GForce 040 with SCSI (new) */ -#define PROD_GVPIV_24 (0x20) /* GVP IV-24 Graphics Board */ -#define PROD_GFORCE_040 (0xFF) /* GForce 040 Turbo Board */ -/* #define PROD_GVPIO_EXT (0xFF)*/ /* GVP I/O Extender */ - -#define MANUF_SYNERGY (0x07E5) /* Synergy */ - -#define MANUF_XETEC (0x07E6) /* Xetec */ -#define PROD_FASTCARD_SCSI (0x01) /* FastCard SCSI Controller */ -#define PROD_FASTCARD_RAM (0x02) /* FastCard RAM */ - -#define MANUF_PPI (0x07EA) /* Progressive Peripherals Inc. */ -#define PROD_MERCURY (0x00) /* Mercury Turbo Board */ -#define PROD_PPS_A3000_040 (0x01) /* PP&S A3000 68040 Turbo Board */ -#define PROD_PPS_A2000_040 (0x69) /* PP&S A2000 68040 Turbo Board */ -#define PROD_ZEUS (0x96) /* Zeus SCSI Controller */ -#define PROD_PPS_A500_040 (0xBB) /* PP&S A500 68040 Turbo Board */ - -#define MANUF_XEBEC (0x07EC) /* Xebec */ - -#define MANUF_SPIRIT (0x07F2) /* Spirit */ -#define PROD_HDA_506 (0x04) /* HDA 506 Harddisk */ -#define PROD_OCTABYTE_RAM (0x06) /* OctaByte RAM */ - -#define MANUF_BSC (0x07FE) /* BSC */ -#define PROD_ALF_3_SCSI (0x03) /* BSC ALF 3 SCSI Controller */ - -#define MANUF_BSC3 (0x0801) /* BSC */ -#define PROD_ALF_2_SCSI (0x01) /* ALF 2 SCSI Controller */ -#define PROD_ALF_3_SCSI_2 (0x03) /* ALF 3 SCSI Controller */ - -#define MANUF_C_LTD (0x0802) /* C Ltd. */ -#define PROD_KRONOS_SCSI (0x04) /* Kronos SCSI Controller */ -#define PROD_A1000_SCSI_2 (0x0C) /* A1000 SCSI Controller */ - -#define MANUF_JOCHHEIM (0x0804) /* Jochheim */ -#define PROD_JOCHHEIM_RAM (0x01) /* Jochheim RAM */ - -#define MANUF_CHECKPOINT (0x0807) /* Checkpoint Technologies */ -#define PROD_SERIAL_SOLUTION (0x00) /* Serial Solution */ - -#define MANUF_ICD (0x0817) /* ICD */ -#define PROD_ADVANTAGE_2000 (0x01) /* Advantage 2000 SCSI Controller */ - -#define MANUF_KUPKE2 (0x0819) /* Kupke */ -#define PROD_KUPKE_SCSI_II (0x02) /* Golem SCSI-II Controller */ -#define PROD_GOLEM_BOX (0x03) /* Golem Box */ -#define PROD_KUPKE_SCSI_AT (0x05) /* SCSI/AT Controller */ - -#define MANUF_HARDITAL (0x0820) /* Hardital Synthesis */ -#define PROD_TQM (0x14) /* TQM 68030+68882 Turbo Board */ - -#define MANUF_BSC2 (0x082C) /* BSC */ -#define PROD_OKTAGON_SCSI (0x05) /* BSC Oktagon 2008 SCSI Controller */ -#define PROD_TANDEM (0x06) /* BSC Tandem AT-2008/508 IDE */ -#define PROD_OKTAGON_RAM (0x08) /* BSC Oktagon 2008 RAM */ -#define PROD_MULTIFACE_I (0x10) /* Alfa Data MultiFace I */ -#define PROD_MULTIFACE_II (0x11) /* Alfa Data MultiFace II */ -#define PROD_MULTIFACE_III (0x12) /* Alfa Data MultiFace III */ -#define PROD_ISDN_MASTERCARD (0x40) /* BSC ISDN MasterCard */ -#define PROD_ISDN_MASTERCARD_2 (0x41) /* BSC ISDN MasterCard II */ - -#define MANUF_ADV_SYS_SOFT (0x0836) /* Advanced Systems & Software */ -#define PROD_NEXUS_SCSI (0x01) /* Nexus SCSI Controller */ -#define PROD_NEXUS_RAM (0x08) /* Nexus RAM */ - -#define MANUF_IMPULSE (0x0838) /* Impulse */ -#define PROD_FIRECRACKER_24 (0x00) /* FireCracker 24 */ - -#define MANUF_IVS (0x0840) /* IVS */ -#define PROD_GRANDSLAM (0x04) /* GrandSlam RAM */ -#define PROD_IVS_OVERDRIVE (0x10) /* OverDrive HD */ -#define PROD_TRUMPCARD_CLASSIC (0x30) /* Trumpcard Classic SCSI Controller */ -#define PROD_TRUMPCARD_PRO (0x34) /* Trumpcard Pro SCSI Controller */ -#define PROD_META_4 (0x40) /* Meta-4 RAM */ -#define PROD_VECTOR (0xF3) /* Vector SCSI Controller */ - -#define MANUF_VECTOR (0x0841) /* Vector */ -#define PROD_CONNECTION (0xE3) /* Connection Serial IO */ - -#define MANUF_XPERT_PRODEV (0x0845) /* XPert/ProDev */ -#define PROD_VISIONA_RAM (0x01) /* Visiona Graphics Board */ -#define PROD_VISIONA_REG (0x02) -#define PROD_MERLIN_RAM (0x03) /* Merlin Graphics Board */ -#define PROD_MERLIN_REG (0x04) - -#define MANUF_HYDRA_SYSTEMS (0x0849) /* Hydra Systems */ -#define PROD_AMIGANET (0x01) /* Amiganet Board */ - -#define MANUF_SUNRIZE (0x084F) /* Sunrize Industries */ -#define PROD_AD516 (0x02) /* AD516 Audio */ - -#define MANUF_TRICERATOPS (0x0850) /* Triceratops */ -#define PROD_TRICERATOPS (0x01) /* Triceratops Multi I/O Board */ - -#define MANUF_APPLIED_MAGIC (0x0851) /* Applied Magic Inc */ -#define PROD_DMI_RESOLVER (0x01) /* DMI Resolver Graphics Board */ -#define PROD_DIGITAL_BCASTER (0x06) /* Digital Broadcaster */ - -#define MANUF_GFX_BASE (0x085E) /* GFX-Base */ -#define PROD_GDA_1_RAM (0x00) /* GDA-1 Graphics Board */ -#define PROD_GDA_1_REG (0x01) - -#define MANUF_ROCTEC (0x0860) /* RocTec */ -#define PROD_RH_800C (0x01) /* RH 800C Hard Disk Controller */ -#define PROD_RH_800C_RAM (0x01) /* RH 800C RAM */ - -#define MANUF_HELFRICH1 (0x0861) /* Helfrich */ -#define PROD_RAINBOW3 (0x21) /* Rainbow3 Graphics Board */ - -#define MANUF_SW_RESULT_ENTS (0x0866) /* Software Result Enterprises */ -#define PROD_GG2PLUS (0x01) /* GG2+ Bus Converter */ - -#define MANUF_MASOBOSHI (0x086D) /* Masoboshi */ -#define PROD_MASTER_CARD_RAM (0x03) /* Master Card RAM */ -#define PROD_MASTER_CARD_SCSI (0x04) /* Master Card SCSI Controller */ -#define PROD_MVD_819 (0x07) /* MVD 819 */ - -#define MANUF_DELACOMP (0x0873) /* DelaComp */ -#define PROD_DELACOMP_RAM_2000 (0x01) /* RAM Expansion 2000 */ - -#define MANUF_VILLAGE_TRONIC (0x0877) /* Village Tronic */ -#define PROD_DOMINO_RAM (0x01) /* Domino Graphics Board (RAM) */ -#define PROD_DOMINO_REG (0x02) /* Domino Graphics Board (REG) */ -#define PROD_PICASSO_II_RAM (0x0B) /* Picasso II Graphics Board */ -#define PROD_PICASSO_II_REG (0x0C) -#define PROD_PICASSO_II_REG_2 (0x0D) -#define PROD_ARIADNE (0xC9) /* Ariadne Ethernet */ - -#define MANUF_UTILITIES_ULTD (0x087B) /* Utilities Unlimited */ -#define PROD_EMPLANT_DELUXE (0x15) /* Emplant Deluxe SCSI Controller */ -#define PROD_EMPLANT_DELUXE2 (0x20) /* Emplant Deluxe SCSI Controller */ - -#define MANUF_AMITRIX (0x0880) /* Amitrix */ -#define PROD_AMITRIX_MULTI_IO (0x01) /* Multi-IO */ -#define PROD_AMITRIX_CD_RAM (0x02) /* CD-RAM Memory */ - -#define MANUF_MTEC (0x0890) /* MTEC Germany */ -#define PROD_MTEC_68030 (0x03) /* 68030 Turbo Board */ -#define PROD_MTEC_T1230 (0x20) /* A1200 T68030/42 RTC Turbo Board */ -#define PROD_MTEC_RAM (0x22) /* MTEC 8MB RAM */ - -#define MANUF_GVP2 (0x0891) /* Great Valley Products */ -#define PROD_SPECTRUM_RAM (0x01) /* EGS 28/24 Spectrum Graphics Board */ -#define PROD_SPECTRUM_REG (0x02) - -#define MANUF_HELFRICH2 (0x0893) /* Helfrich */ -#define PROD_PICCOLO_RAM (0x05) /* Piccolo Graphics Board */ -#define PROD_PICCOLO_REG (0x06) -#define PROD_PEGGY_PLUS (0x07) /* PeggyPlus MPEG Decoder Board */ -#define PROD_VIDEOCRUNCHER (0x08) /* VideoCruncher */ -#define PROD_SD64_RAM (0x0A) /* SD64 Graphics Board */ -#define PROD_SD64_REG (0x0B) - -#define MANUF_MACROSYSTEMS (0x089B) /* MacroSystems USA */ -#define PROD_WARP_ENGINE (0x13) /* Warp Engine 40xx SCSI Controller */ - -#define MANUF_ELBOX (0x089E) /* ElBox Computer */ -#define PROD_ELBOX_1200 (0x06) /* Elbox 1200/4 RAM */ - -#define MANUF_HARMS_PROF (0x0A00) /* Harms Professional */ -#define PROD_HARMS_030_PLUS (0x10) /* 030 plus */ -#define PROD_3500_TURBO (0xD0) /* 3500 Turbo board */ - -#define MANUF_MICRONIK (0x0A50) /* Micronik */ -#define PROD_RCA_120 (0x0A) /* RCA 120 RAM */ - -#define MANUF_IMTRONICS2 (0x1028) /* Imtronics */ -#define PROD_HURRICANE_2800_3 (0x39) /* Hurricane 2800 68030 */ -#define PROD_HURRICANE_2800_4 (0x57) /* Hurricane 2800 68030 */ - -#define MANUF_KUPKE3 (0x1248) /* Kupke */ -#define PROD_GOLEM_3000 (0x01) /* Golem HD 3000 */ - -#define MANUF_INFORMATION (0x157C) /* Information */ -#define PROD_ISDN_ENGINE_I (0x64) /* ISDN Engine I */ - -#define MANUF_VORTEX (0x2017) /* Vortex */ -#define PROD_GOLDEN_GATE_386SX (0x07) /* Golden Gate 80386SX Board */ -#define PROD_GOLDEN_GATE_RAM (0x08) /* Golden Gate RAM */ -#define PROD_GOLDEN_GATE_486 (0x09) /* Golden Gate 80486 Board */ - -#define MANUF_DATAFLYER (0x2062) /* DataFlyer */ -#define PROD_DATAFLYER_4000SXS (0x01) /* DataFlyer 4000SX SCSI Controller */ -#define PROD_DATAFLYER_4000SXR (0x02) /* DataFlyer 4000SX RAM */ - -#define MANUF_READYSOFT (0x2100) /* ReadySoft */ -#define PROD_AMAX (0x01) /* AMax II/IV */ - -#define MANUF_PHASE5 (0x2140) /* Phase5 */ -#define PROD_BLIZZARD_RAM (0x01) /* Blizzard RAM */ -#define PROD_BLIZZARD (0x02) /* Blizzard */ -#define PROD_BLIZZARD_1220_IV (0x06) /* Blizzard 1220-IV Turbo Board */ -#define PROD_FASTLANE_RAM (0x0A) /* FastLane RAM */ -#define PROD_FASTLANE_SCSI (0x0B) /* FastLane/Blizzard 1230-II SCSI/CyberSCSI */ -#define PROD_CYBERSTORM_SCSI (0x0C) /* Blizzard 1220/CyberStorm */ -#define PROD_BLIZZARD_1230_III (0x0D) /* Blizzard 1230-III Turbo Board */ -#define PROD_BLIZZARD_1230_IV (0x11) /* Blizzard 1230-IV/1260 Turbo Board */ -#define PROD_BLIZZARD_2060SCSI (0x18) /* Blizzard 2060 SCSI Controller */ -#define PROD_CYBERSTORM_II (0x19) /* CyberStorm Mk II */ -#define PROD_CYBERVISION (0x22) /* CyberVision64 Graphics Board */ - -#define MANUF_DPS (0x2169) /* DPS */ -#define PROD_DPS_PAR (0x01) /* Personal Animation Recorder */ - -#define MANUF_APOLLO2 (0x2200) /* Apollo */ -#define PROD_A620 (0x00) /* A620 68020 Accelerator */ - -#define MANUF_APOLLO (0x2222) /* Apollo */ -#define PROD_AT_APOLLO (0x22) /* AT-Apollo */ -#define PROD_APOLLO_TURBO (0x23) /* Apollo Turbo Board */ - -#define MANUF_UWE_GERLACH (0x3FF7) /* Uwe Gerlach */ -#define PROD_UG_RAM_ROM (0xd4) /* RAM/ROM */ - -#define MANUF_MACROSYSTEMS2 (0x4754) /* MacroSystems Germany */ -#define PROD_MAESTRO (0x03) /* Maestro */ -#define PROD_VLAB (0x04) /* VLab */ -#define PROD_MAESTRO_PRO (0x05) /* Maestro Pro */ -#define PROD_RETINA_Z2 (0x06) /* Retina Z2 Graphics Board */ -#define PROD_MULTI_EVOLUTION (0x08) /* MultiEvolution */ -#define PROD_TOCCATA (0x0C) /* Toccata Sound Board */ -#define PROD_RETINA_Z3 (0x10) /* Retina Z3 Graphics Board */ -#define PROD_VLAB_MOTION (0x12) /* VLab Motion */ -#define PROD_FALCON_040 (0xFD) /* Falcon '040 Turbo Board */ - -#define MANUF_COMBITEC (0x6766) /* Combitec */ - -#define MANUF_SKI (0x8000) /* SKI Peripherals */ -#define PROD_SKI_SCSI_SERIAL (0x80) /* SCSI / Dual Serial */ - -#define MANUF_CAMERON (0xAA01) /* Cameron */ -#define PROD_CAMERON_SCANNER (0x10) /* Scanner Interface */ - -#define MANUF_REIS_WARE (0xAA11) /* Reis-Ware */ -#define PROD_RW_HANDYSCANNER (0x11) /* Handyscanner */ - - -/* Illegal Manufacturer IDs. These do NOT appear in arch/m68k/amiga/zorro.c! */ - -#define MANUF_HACKER_INC (0x07DB) /* Hacker Inc. */ -#define PROD_HACKER_SCSI (0x01) /* Hacker Inc. SCSI Controller */ - -#define MANUF_RES_MNGT_FORCE (0x07DB) /* Resource Management Force */ -#define PROD_QUICKNET (0x02) /* QuickNet Ethernet */ - -#define MANUF_VECTOR2 (0x07DB) /* Vector */ -#define PROD_CONNECTION_2 (0xE0) /* Vector Connection */ -#define PROD_CONNECTION_3 (0xE1) /* Vector Connection */ -#define PROD_CONNECTION_4 (0xE2) /* Vector Connection */ -#define PROD_CONNECTION_5 (0xE3) /* Vector Connection */ - - -/* - * GVP's identifies most of their product through the 'extended - * product code' (epc). The epc has to be and'ed with the GVP_PRODMASK - * before the identification. - */ - -#define GVP_PRODMASK (0xf8) -#define GVP_SCSICLKMASK (0x01) - -enum GVP_ident { - GVP_GFORCE_040 = 0x20, - GVP_GFORCE_040_SCSI = 0x30, - GVP_A1291_SCSI = 0x40, - GVP_COMBO_R4 = 0x60, - GVP_COMBO_R4_SCSI = 0x70, - GVP_PHONEPAK = 0x78, - GVP_IOEXT = 0x98, - GVP_GFORCE_030 = 0xa0, - GVP_GFORCE_030_SCSI = 0xb0, - GVP_A530 = 0xc0, - GVP_A530_SCSI = 0xd0, - GVP_COMBO_R3 = 0xe0, - GVP_COMBO_R3_SCSI = 0xf0, - GVP_SERIESII = 0xf8, -}; - -enum GVP_flags { - GVP_IO = 0x01, - GVP_ACCEL = 0x02, - GVP_SCSI = 0x04, - GVP_24BITDMA = 0x08, - GVP_25BITDMA = 0x10, - GVP_NOBANK = 0x20, - GVP_14MHZ = 0x40, -}; - - -struct Node { - struct Node *ln_Succ; /* Pointer to next (successor) */ - struct Node *ln_Pred; /* Pointer to previous (predecessor) */ - u_char ln_Type; - char ln_Pri; /* Priority, for sorting */ - char *ln_Name; /* ID string, null terminated */ -}; - -struct ExpansionRom { - /* -First 16 bytes of the expansion ROM */ - u_char er_Type; /* Board type, size and flags */ - u_char er_Product; /* Product number, assigned by manufacturer */ - u_char er_Flags; /* Flags */ - u_char er_Reserved03; /* Must be zero ($ff inverted) */ - u_short er_Manufacturer; /* Unique ID,ASSIGNED BY COMMODORE-AMIGA! */ - u_long er_SerialNumber; /* Available for use by manufacturer */ - u_short er_InitDiagVec; /* Offset to optional "DiagArea" structure */ - u_char er_Reserved0c; - u_char er_Reserved0d; - u_char er_Reserved0e; - u_char er_Reserved0f; -}; - -/* er_Type board type bits */ -#define ERT_TYPEMASK 0xc0 -#define ERT_ZORROII 0xc0 -#define ERT_ZORROIII 0x80 - -/* other bits defined in er_Type */ -#define ERTB_MEMLIST 5 /* Link RAM into free memory list */ -#define ERTF_MEMLIST (1<<5) - -struct ConfigDev { - struct Node cd_Node; - u_char cd_Flags; /* (read/write) */ - u_char cd_Pad; /* reserved */ - struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */ - void *cd_BoardAddr; /* where in memory the board was placed */ - u_long cd_BoardSize; /* size of board in bytes */ - u_short cd_SlotAddr; /* which slot number (PRIVATE) */ - u_short cd_SlotSize; /* number of slots (PRIVATE) */ - void *cd_Driver; /* pointer to node of driver */ - struct ConfigDev *cd_NextCD; /* linked list of drivers to config */ - u_long cd_Unused[4]; /* for whatever the driver wants */ -}; - -#else /* __ASSEMBLY__ */ - -LN_Succ = 0 -LN_Pred = LN_Succ+4 -LN_Type = LN_Pred+4 -LN_Pri = LN_Type+1 -LN_Name = LN_Pri+1 -LN_sizeof = LN_Name+4 - -ER_Type = 0 -ER_Product = ER_Type+1 -ER_Flags = ER_Product+1 -ER_Reserved03 = ER_Flags+1 -ER_Manufacturer = ER_Reserved03+1 -ER_SerialNumber = ER_Manufacturer+2 -ER_InitDiagVec = ER_SerialNumber+4 -ER_Reserved0c = ER_InitDiagVec+2 -ER_Reserved0d = ER_Reserved0c+1 -ER_Reserved0e = ER_Reserved0d+1 -ER_Reserved0f = ER_Reserved0e+1 -ER_sizeof = ER_Reserved0f+1 - -CD_Node = 0 -CD_Flags = CD_Node+LN_sizeof -CD_Pad = CD_Flags+1 -CD_Rom = CD_Pad+1 -CD_BoardAddr = CD_Rom+ER_sizeof -CD_BoardSize = CD_BoardAddr+4 -CD_SlotAddr = CD_BoardSize+4 -CD_SlotSize = CD_SlotAddr+2 -CD_Driver = CD_SlotSize+2 -CD_NextCD = CD_Driver+4 -CD_Unused = CD_NextCD+4 -CD_sizeof = CD_Unused+(4*4) - -#endif /* __ASSEMBLY__ */ - -#ifndef __ASSEMBLY__ - -/* - * Zorro Functions - */ - -extern int zorro_find(int manuf, int prod, int part, int index); -extern struct ConfigDev *zorro_get_board(int key); -extern void zorro_config_board(int key, int part); -extern void zorro_unconfig_board(int key, int part); - - -/* - * Bitmask indicating portions of available Zorro II RAM that are unused - * by the system. Every bit represents a 64K chunk, for a maximum of 8MB - * (128 chunks, physical 0x00200000-0x009fffff). - * - * If you want to use (= allocate) portions of this RAM, you should clear - * the corresponding bits. - */ - -extern u_long zorro_unused_z2ram[4]; - -#define Z2RAM_START (0x00200000) -#define Z2RAM_END (0x00a00000) -#define Z2RAM_SIZE (0x00800000) -#define Z2RAM_CHUNKSIZE (0x00010000) -#define Z2RAM_CHUNKMASK (0x0000ffff) -#define Z2RAM_CHUNKSHIFT (16) - - -/* - * Verbose Board Identification - */ - -#ifdef CONFIG_ZORRO -extern void zorro_identify(void); -extern int zorro_get_list(char *buffer); -#endif CONFIG_ZORRO - -#endif /* __ASSEMBLY__ */ - -#endif /* _ASM_M68K_ZORRO_H_ */ |