diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-08-25 09:12:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-08-25 09:12:35 +0000 |
commit | c7fc24dc4420057f103afe8fc64524ebc25c5d37 (patch) | |
tree | 3682407a599b8f9f03fc096298134cafba1c9b2f /include/asm-m68k | |
parent | 1d793fade8b063fde3cf275bf1a5c2d381292cd9 (diff) |
o Merge with Linux 2.1.116.
o New Newport console code.
o New G364 console code.
Diffstat (limited to 'include/asm-m68k')
46 files changed, 1279 insertions, 579 deletions
diff --git a/include/asm-m68k/adb.h b/include/asm-m68k/adb.h new file mode 100644 index 000000000..9176b5518 --- /dev/null +++ b/include/asm-m68k/adb.h @@ -0,0 +1,75 @@ +/* + * Definitions for talking to ADB and CUDA. The CUDA is a microcontroller + * which controls the ADB, system power, RTC, and various other things on + * later Macintoshes + * + * Copyright (C) 1996 Paul Mackerras. + */ + +/* First byte sent to or received from CUDA */ +#define ADB_PACKET 0 +#define CUDA_PACKET 1 +#define ERROR_PACKET 2 +#define TIMER_PACKET 3 +#define POWER_PACKET 4 +#define MACIIC_PACKET 5 + +/* ADB commands (2nd byte) */ +#define ADB_BUSRESET 0 +#define ADB_FLUSH(id) (1 + ((id) << 4)) +#define ADB_WRITEREG(id, reg) (8 + (reg) + ((id) << 4)) +#define ADB_READREG(id, reg) (0xc + (reg) + ((id) << 4)) + +/* ADB default device IDs (upper 4 bits of 2nd byte) */ +#define ADB_DONGLE 1 /* "software execution control" devices */ +#define ADB_KEYBOARD 2 +#define ADB_MOUSE 3 +#define ADB_TABLET 4 +#define ADB_MODEM 5 +#define ADB_MISC 7 /* maybe a monitor */ + +/* CUDA commands (2nd byte) */ +#define CUDA_WARM_START 0 +#define CUDA_AUTOPOLL 1 +#define CUDA_GET_6805_ADDR 2 +#define CUDA_GET_TIME 3 +#define CUDA_GET_PRAM 7 +#define CUDA_SET_6805_ADDR 8 +#define CUDA_SET_TIME 9 +#define CUDA_POWERDOWN 0xa +#define CUDA_POWERUP_TIME 0xb +#define CUDA_SET_PRAM 0xc +#define CUDA_MS_RESET 0xd +#define CUDA_SEND_DFAC 0xe +#define CUDA_RESET_SYSTEM 0x11 +#define CUDA_SET_IPL 0x12 +#define CUDA_SET_AUTO_RATE 0x14 +#define CUDA_GET_AUTO_RATE 0x16 +#define CUDA_SET_DEVICE_LIST 0x19 +#define CUDA_GET_DEVICE_LIST 0x1a +#define CUDA_GET_SET_IIC 0x22 + +#ifdef __KERNEL__ + +struct adb_request { + unsigned char data[16]; + int nbytes; + unsigned char reply[16]; + int reply_len; + unsigned char reply_expected; + unsigned char sent; + unsigned char got_reply; + void (*done)(struct adb_request *); + void *arg; + struct adb_request *next; +}; + +void via_adb_init(void); +int adb_request(struct adb_request *req, + void (*done)(struct adb_request *), int nbytes, ...); +int adb_send_request(struct adb_request *req); +void adb_poll(void); +int adb_register(int default_id, + void (*handler)(unsigned char *, int, struct pt_regs *)); + +#endif /* __KERNEL */ diff --git a/include/asm-m68k/amifd.h b/include/asm-m68k/amifd.h deleted file mode 100644 index ea21e69fd..000000000 --- a/include/asm-m68k/amifd.h +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef _ASM_M68K_AMIFD_H -#define _ASM_M68K_AMIFD_H - -/* Definitions for the Amiga floppy driver */ - -#include <linux/fd.h> - -#define FD_MAX_UNITS 4 /* Max. Number of drives */ -#define FLOPPY_MAX_SECTORS 22 /* Max. Number of sectors per track */ - -#ifndef ASSEMBLER - -struct fd_data_type { - char *name; /* description of data type */ - int sects; /* sectors per track */ -#ifdef __STDC__ - int (*read_fkt)(int); - void (*write_fkt)(int); -#else - int (*read_fkt)(); /* read whole track */ - void (*write_fkt)(); /* write whole track */ -#endif -}; - -/* -** Floppy type descriptions -*/ - -struct fd_drive_type { - unsigned long code; /* code returned from drive */ - char *name; /* description of drive */ - unsigned int tracks; /* number of tracks */ - unsigned int heads; /* number of heads */ - unsigned int read_size; /* raw read size for one track */ - unsigned int write_size; /* raw write size for one track */ - unsigned int sect_mult; /* sectors and gap multiplier (HD = 2) */ - unsigned int precomp1; /* start track for precomp 1 */ - unsigned int precomp2; /* start track for precomp 2 */ - unsigned int step_delay; /* time (in ms) for delay after step */ - unsigned int settle_time; /* time to settle after dir change */ - unsigned int side_time; /* time needed to change sides */ -}; - -struct amiga_floppy_struct { - struct fd_drive_type *type; /* type of floppy for this unit */ - struct fd_data_type *dtype; /* type of floppy for this unit */ - int track; /* current track (-1 == unknown) */ - unsigned char *trackbuf; /* current track (kmaloc()'d */ - - int blocks; /* total # blocks on disk */ - - int changed; /* true when not known */ - int disk; /* disk in drive (-1 == unknown) */ - int motor; /* true when motor is at speed */ - int busy; /* true when drive is active */ - int dirty; /* true when trackbuf is not on disk */ - int status; /* current error code for unit */ -}; -#endif - -#endif diff --git a/include/asm-m68k/amifdreg.h b/include/asm-m68k/amifdreg.h deleted file mode 100644 index 76188bf48..000000000 --- a/include/asm-m68k/amifdreg.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef _LINUX_AMIFDREG_H -#define _LINUX_AMIFDREG_H - -/* -** CIAAPRA bits (read only) -*/ - -#define DSKRDY (0x1<<5) /* disk ready when low */ -#define DSKTRACK0 (0x1<<4) /* head at track zero when low */ -#define DSKPROT (0x1<<3) /* disk protected when low */ -#define DSKCHANGE (0x1<<2) /* low when disk removed */ - -/* -** CIAAPRB bits (read/write) -*/ - -#define DSKMOTOR (0x1<<7) /* motor on when low */ -#define DSKSEL3 (0x1<<6) /* select drive 3 when low */ -#define DSKSEL2 (0x1<<5) /* select drive 2 when low */ -#define DSKSEL1 (0x1<<4) /* select drive 1 when low */ -#define DSKSEL0 (0x1<<3) /* select drive 0 when low */ -#define DSKSIDE (0x1<<2) /* side selection: 0 = upper, 1 = lower */ -#define DSKDIREC (0x1<<1) /* step direction: 0=in, 1=out (to trk 0) */ -#define DSKSTEP (0x1) /* pulse low to step head 1 track */ - -/* -** DSKBYTR bits (read only) -*/ - -#define DSKBYT (1<<15) /* register contains valid byte when set */ -#define DMAON (1<<14) /* disk DMA enabled */ -#define DISKWRITE (1<<13) /* disk write bit in DSKLEN enabled */ -#define WORDEQUAL (1<<12) /* DSKSYNC register match when true */ -/* bits 7-0 are data */ - -/* -** ADKCON/ADKCONR bits -*/ - -#ifndef SETCLR -#define ADK_SETCLR (1<<15) /* control bit */ -#endif -#define ADK_PRECOMP1 (1<<14) /* precompensation selection */ -#define ADK_PRECOMP0 (1<<13) /* 00=none, 01=140ns, 10=280ns, 11=500ns */ -#define ADK_MFMPREC (1<<12) /* 0=GCR precomp., 1=MFM precomp. */ -#define ADK_WORDSYNC (1<<10) /* enable DSKSYNC auto DMA */ -#define ADK_MSBSYNC (1<<9) /* when 1, enable sync on MSbit (for GCR) */ -#define ADK_FAST (1<<8) /* bit cell: 0=2us (GCR), 1=1us (MFM) */ - -/* -** DSKLEN bits -*/ - -#define DSKLEN_DMAEN (1<<15) -#define DSKLEN_WRITE (1<<14) - -/* -** INTENA/INTREQ bits -*/ - -#define DSKINDEX (0x1<<4) /* DSKINDEX bit */ - -/* -** Misc -*/ - -#define MFM_SYNC 0x4489 /* standard MFM sync value */ - -/* Values for FD_COMMAND */ -#define FD_RECALIBRATE 0x07 /* move to track 0 */ -#define FD_SEEK 0x0F /* seek track */ -#define FD_READ 0xE6 /* read with MT, MFM, SKip deleted */ -#define FD_WRITE 0xC5 /* write with MT, MFM */ -#define FD_SENSEI 0x08 /* Sense Interrupt Status */ -#define FD_SPECIFY 0x03 /* specify HUT etc */ -#define FD_FORMAT 0x4D /* format one track */ -#define FD_VERSION 0x10 /* get version code */ -#define FD_CONFIGURE 0x13 /* configure FIFO operation */ -#define FD_PERPENDICULAR 0x12 /* perpendicular r/w mode */ - -#endif /* _LINUX_AMIFDREG_H */ diff --git a/include/asm-m68k/amigahw.h b/include/asm-m68k/amigahw.h index caaa8d0de..a5d105979 100644 --- a/include/asm-m68k/amigahw.h +++ b/include/asm-m68k/amigahw.h @@ -332,4 +332,4 @@ struct tod2000 { #define TOD2000_HOUR1_PM (1<<2) #define TOD_2000 ((struct tod2000 *)(zTwoBase+0xDC0000)) -#endif /* __ASMm68k_AMIGAHW_H */ +#endif /* _M68K_AMIGAHW_H */ diff --git a/include/asm-m68k/amigardb.h b/include/asm-m68k/amigardb.h deleted file mode 100644 index 57032469d..000000000 --- a/include/asm-m68k/amigardb.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef _LINUX_AMIGARDB_H -#define _LINUX_AMIGARDB_H 1 - -#define ULONG u_long -#define LONG long -#define UBYTE u_char - -/* definitions for the Amiga RigidDiskBlock layout, which always starts in - cylinder 0 of a medium. Taken from page 254f of the RKM: Devices */ - -struct RigidDiskBlock { - ULONG rdb_ID; /* 4 character identifier */ - ULONG rdb_SummedLongs; /* size of this checksummed structure */ - LONG rdb_ChkSum; /* block checksum (longword sum to zero) */ - ULONG rdb_HostID; /* SCSI Target ID of host */ - ULONG rdb_BlockBytes; /* size of disk blocks */ - ULONG rdb_Flags; /* see below for defines */ - /* block list heads */ - ULONG rdb_BadBlockList; /* optional bad block list */ - ULONG rdb_PartitionList; /* optional first partition block */ - ULONG rdb_FileSysHeaderList; /* optional file system header block */ - ULONG rdb_DriveInit; /* optional drive-specific init code */ - /* DriveInit(lun,rdb,ior): "C" stk & d0/a0/a1 */ - ULONG rdb_Reserved1[6]; /* set to $ffffffff */ - /* physical drive characteristics */ - ULONG rdb_Cylinders; /* number of drive cylinders */ - ULONG rdb_Sectors; /* sectors per track */ - ULONG rdb_Heads; /* number of drive heads */ - ULONG rdb_Interleave; /* interleave */ - ULONG rdb_Park; /* landing zone cylinder */ - ULONG rdb_Reserved2[3]; - ULONG rdb_WritePreComp; /* starting cylinder: write precompensation */ - ULONG rdb_ReducedWrite; /* starting cylinder: reduced write current */ - ULONG rdb_StepRate; /* drive step rate */ - ULONG rdb_Reserved3[5]; - /* logical drive characteristics */ - ULONG rdb_RDBBlocksLo; /* low block of range reserved for hardblocks */ - ULONG rdb_RDBBlocksHi; /* high block of range for these hardblocks */ - ULONG rdb_LoCylinder; /* low cylinder of partitionable disk area */ - ULONG rdb_HiCylinder; /* high cylinder of partitionable data area */ - ULONG rdb_CylBlocks; /* number of blocks available per cylinder */ - ULONG rdb_AutoParkSeconds; /* zero for no auto park */ - ULONG rdb_HighRDSKBlock; /* highest block used by RDSK */ - /* (not including replacement bad blocks) */ - ULONG rdb_Reserved4; - /* drive identification */ - char rdb_DiskVendor[8]; - char rdb_DiskProduct[16]; - char rdb_DiskRevision[4]; - char rdb_ControllerVendor[8]; - char rdb_ControllerProduct[16]; - char rdb_ControllerRevision[4]; - ULONG rdb_Reserved5[10]; -}; - -#define IDNAME_RIGIDDISK 0x5244534B /* 'RDSK' */ - -#define RDB_LOCATION_LIMIT 16 - -#define RDBFB_LAST 0 /* no disks exist to be configured after */ -#define RDBFF_LAST 0x01L /* this one on this controller */ -#define RDBFB_LASTLUN 1 /* no LUNs exist to be configured greater */ -#define RDBFF_LASTLUN 0x02L /* than this one at this SCSI Target ID */ -#define RDBFB_LASTTID 2 /* no Target IDs exist to be configured */ -#define RDBFF_LASTTID 0x04L /* greater than this one on this SCSI bus */ -#define RDBFB_NORESELECT 3 /* don't bother trying to perform reselection */ -#define RDBFF_NORESELECT 0x08L /* when talking to this drive */ -#define RDBFB_DISKID 4 /* rdb_Disk... identification valid */ -#define RDBFF_DISKID 0x10L -#define RDBFB_CTRLRID 5 /* rdb_Controller... identification valid */ -#define RDBFF_CTRLRID 0x20L - /* added 7/20/89 by commodore: */ -#define RDBFB_SYNCH 6 /* drive supports scsi synchronous mode */ -#define RDBFF_SYNCH 0x40L /* CAN BE DANGEROUS TO USE IF IT DOESN'T! */ - -struct PartitionBlock { - ULONG pb_ID; /* 4 character identifier */ - ULONG pb_SummedLongs; /* size of this checksummed structure */ - LONG pb_ChkSum; /* block checksum (longword sum to zero) */ - ULONG pb_HostID; /* SCSI Target ID of host */ - ULONG pb_Next; /* block number of the next PartitionBlock */ - ULONG pb_Flags; /* see below for defines */ - ULONG pb_Reserved1[2]; - ULONG pb_DevFlags; /* preferred flags for OpenDevice */ - UBYTE pb_DriveName[32]; /* preferred DOS device name: BSTR form */ - /* (not used if this name is in use) */ - ULONG pb_Reserved2[15]; /* filler to 32 longwords */ - ULONG pb_Environment[17]; /* environment vector for this partition */ - ULONG pb_EReserved[15]; /* reserved for future environment vector */ -}; - -#define IDNAME_PARTITION 0x50415254 /* 'PART' */ - -#define PBFB_BOOTABLE 0 /* this partition is intended to be bootable */ -#define PBFF_BOOTABLE 1L /* (expected directories and files exist) */ -#define PBFB_NOMOUNT 1 /* do not mount this partition (e.g. manually */ -#define PBFF_NOMOUNT 2L /* mounted, but space reserved here) */ - -/* this is from <dos/filehandler.h> */ - -#define DE_TABLESIZE 0 /* minimum value is 11 (includes NumBuffers) */ -#define DE_SIZEBLOCK 1 /* in longwords: standard value is 128 */ -#define DE_SECORG 2 /* not used; must be 0 */ -#define DE_NUMHEADS 3 /* # of heads (surfaces). drive specific */ -#define DE_SECSPERBLK 4 /* not used; must be 1 */ -#define DE_BLKSPERTRACK 5 /* blocks per track. drive specific */ -#define DE_RESERVEDBLKS 6 /* unavailable blocks at start. usually 2 */ -#define DE_PREFAC 7 /* not used; must be 0 */ -#define DE_INTERLEAVE 8 /* usually 0 */ -#define DE_LOWCYL 9 /* starting cylinder. typically 0 */ -#define DE_UPPERCYL 10 /* max cylinder. drive specific */ -#define DE_NUMBUFFERS 11 /* starting # of buffers. typically 5 */ -#define DE_MEMBUFTYPE 12 /* type of mem to allocate for buffers. */ -#define DE_BUFMEMTYPE 12 /* same as above, better name - * 1 is public, 3 is chip, 5 is fast */ -#define DE_MAXTRANSFER 13 /* Max number bytes to transfer at a time */ -#define DE_MASK 14 /* Address Mask to block out certain memory */ -#define DE_BOOTPRI 15 /* Boot priority for autoboot */ -#define DE_DOSTYPE 16 /* ASCII (HEX) string showing filesystem type; - * 0X444F5300 is old filesystem, - * 0X444F5301 is fast file system */ -#define DE_BAUD 17 /* Baud rate for serial handler */ -#define DE_CONTROL 18 /* Control word for handler/filesystem */ -#define DE_BOOTBLOCKS 19 /* Number of blocks containing boot code */ - -#endif /* _LINUX_AMIGARDB_H */ diff --git a/include/asm-m68k/amigayle.h b/include/asm-m68k/amigayle.h new file mode 100644 index 000000000..f890d41ae --- /dev/null +++ b/include/asm-m68k/amigayle.h @@ -0,0 +1,105 @@ +/* +** asm-m68k/amigayle.h -- This header defines the registers of the gayle chip +** found on the Amiga 1200 +** This information was found by disassembling card.resource, +** so the definitions may not be 100% correct +** anyone has an official doc ? +** +** Copyright 1997 by Alain Malek +** +** 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: 11/28/97 by Alain Malek +*/ + +#ifndef _M68K_AMIGAYLE_H_ +#define _M68K_AMIGAYLE_H_ + +#include <asm/amigahw.h> +#include <asm/io.h> + +/* memory layout */ + +#define GAYLE_RAM (0x600000+zTwoBase) +#define GAYLE_RAMSIZE (0x400000) +#define GAYLE_ATTRIBUTE (0xa00000+zTwoBase) +#define GAYLE_ATTRIBUTESIZE (0x020000) +#define GAYLE_IO (0xa20000+zTwoBase) /* 16bit and even 8bit registers */ +#define GAYLE_IOSIZE (0x010000) +#define GAYLE_IO_8BITODD (0xa30000+zTwoBase) /* odd 8bit registers */ + +/* offset for accessing odd IO registers */ +#define GAYLE_ODD (GAYLE_IO_8BITODD-GAYLE_IO-1) + +/* GAYLE registers */ + +struct GAYLE { + u_char cardstatus; + u_char pad0[0x1000-1]; + + u_char intreq; + u_char pad1[0x1000-1]; + + u_char inten; + u_char pad2[0x1000-1]; + + u_char config; + u_char pad3[0x1000-1]; +}; + +#define GAYLE_ADDRESS (0xda8000) /* gayle main registers base address */ + +#define GAYLE_RESET (0xa40000) /* write 0x00 to start reset, + read 1 byte to stop reset */ + +#define gayle (*(volatile struct GAYLE *)(zTwoBase+GAYLE_ADDRESS)) +#define gayle_reset (*(volatile u_char *)(zTwoBase+GAYLE_RESET)) + +#define gayle_attribute ((volatile u_char *)(GAYLE_ATTRIBUTE)) + +#define gayle_inb(a) readb( GAYLE_IO+(a)+(((a)&1)*GAYLE_ODD) ) +#define gayle_outb(v,a) writeb( v, GAYLE_IO+(a)+(((a)&1)*GAYLE_ODD) ) + +#define gayle_inw(a) readw( GAYLE_IO+(a) ) +#define gayle_outw(v,a) writew( v, GAYLE_IO+(a) ) + +/* GAYLE_CARDSTATUS bit def */ + +#define GAYLE_CS_CCDET 0x40 /* credit card detect */ +#define GAYLE_CS_BVD1 0x20 /* battery voltage detect 1 */ +#define GAYLE_CS_SC 0x20 /* credit card status change */ +#define GAYLE_CS_BVD2 0x10 /* battery voltage detect 2 */ +#define GAYLE_CS_DA 0x10 /* digital audio */ +#define GAYLE_CS_WR 0x08 /* write enable (1 == enabled) */ +#define GAYLE_CS_BSY 0x04 /* credit card busy */ +#define GAYLE_CS_IRQ 0x04 /* interrupt request */ + +/* GAYLE_IRQ bit def */ + +#define GAYLE_IRQ_IDE 0x80 +#define GAYLE_IRQ_CCDET 0x40 +#define GAYLE_IRQ_BVD1 0x20 +#define GAYLE_IRQ_SC 0x20 +#define GAYLE_IRQ_BVD2 0x10 +#define GAYLE_IRQ_DA 0x10 +#define GAYLE_IRQ_WR 0x08 +#define GAYLE_IRQ_BSY 0x04 +#define GAYLE_IRQ_IRQ 0x04 +#define GAYLE_IRQ_IDEACK1 0x02 +#define GAYLE_IRQ_IDEACK0 0x01 + +/* GAYLE_CONFIG bit def + (bit 0-1 for program voltage, bit 2-3 for access speed */ + +#define GAYLE_CFG_0V 0x00 +#define GAYLE_CFG_5V 0x01 +#define GAYLE_CFG_12V 0x02 + +#define GAYLE_CFG_100NS 0x08 +#define GAYLE_CFG_150NS 0x04 +#define GAYLE_CFG_250NS 0x00 +#define GAYLE_CFG_720NS 0x0c + +#endif /* asm-m68k/amigayle.h */ diff --git a/include/asm-m68k/amipcmcia.h b/include/asm-m68k/amipcmcia.h new file mode 100644 index 000000000..78ffce6aa --- /dev/null +++ b/include/asm-m68k/amipcmcia.h @@ -0,0 +1,110 @@ +/* +** asm-m68k/pcmcia.h -- Amiga Linux PCMCIA Definitions +** +** Copyright 1997 by Alain Malek +** +** 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: 12/10/97 by Alain Malek +*/ + +#ifndef __AMIGA_PCMCIA_H__ +#define __AMIGA_PCMCIA_H__ + +#include <asm/amigayle.h> + +/* prototypes */ + +void pcmcia_reset(void); +int pcmcia_copy_tuple(unsigned char tuple_id, void *tuple, int max_len); +void pcmcia_program_voltage(int voltage); +void pcmcia_access_speed(int speed); +void pcmcia_write_enable(void); +void pcmcia_write_disable(void); + +static inline u_char pcmcia_read_status(void) +{ + return (gayle.cardstatus & 0x7c); +} + +static inline u_char pcmcia_get_intreq(void) +{ + return (gayle.intreq); +} + +static inline void pcmcia_ack_int(u_char intreq) +{ + gayle.intreq = ((intreq & 0x2c) ^ 0x2c) | 0xc0; +} + +static inline void pcmcia_enable_irq(void) +{ + gayle.inten = GAYLE_IRQ_IDE|GAYLE_IRQ_IRQ; +} + +static inline void pcmcia_disable_irq(void) +{ + gayle.inten = GAYLE_IRQ_IDE; +} + +#define PCMCIA_INSERTED (gayle.cardstatus & GAYLE_CS_CCDET) + +/* valid voltages for pcmcia_ProgramVoltage */ + +#define PCMCIA_0V 0 +#define PCMCIA_5V 5 +#define PCMCIA_12V 12 + +/* valid speeds for pcmcia_AccessSpeed */ + +#define PCMCIA_SPEED_100NS 100 +#define PCMCIA_SPEED_150NS 150 +#define PCMCIA_SPEED_250NS 250 +#define PCMCIA_SPEED_720NS 720 + +/* PCMCIA Tuple codes */ + +#define CISTPL_NULL 0x00 +#define CISTPL_DEVICE 0x01 +#define CISTPL_LONGLINK_CB 0x02 +#define CISTPL_CONFIG_CB 0x04 +#define CISTPL_CFTABLE_ENTRY_CB 0x05 +#define CISTPL_LONGLINK_MFC 0x06 +#define CISTPL_BAR 0x07 +#define CISTPL_CHECKSUM 0x10 +#define CISTPL_LONGLINK_A 0x11 +#define CISTPL_LONGLINK_C 0x12 +#define CISTPL_LINKTARGET 0x13 +#define CISTPL_NO_LINK 0x14 +#define CISTPL_VERS_1 0x15 +#define CISTPL_ALTSTR 0x16 +#define CISTPL_DEVICE_A 0x17 +#define CISTPL_JEDEC_C 0x18 +#define CISTPL_JEDEC_A 0x19 +#define CISTPL_CONFIG 0x1a +#define CISTPL_CFTABLE_ENTRY 0x1b +#define CISTPL_DEVICE_OC 0x1c +#define CISTPL_DEVICE_OA 0x1d +#define CISTPL_DEVICE_GEO 0x1e +#define CISTPL_DEVICE_GEO_A 0x1f +#define CISTPL_MANFID 0x20 +#define CISTPL_FUNCID 0x21 +#define CISTPL_FUNCE 0x22 +#define CISTPL_SWIL 0x23 +#define CISTPL_END 0xff + +/* FUNCID */ + +#define CISTPL_FUNCID_MULTI 0x00 +#define CISTPL_FUNCID_MEMORY 0x01 +#define CISTPL_FUNCID_SERIAL 0x02 +#define CISTPL_FUNCID_PARALLEL 0x03 +#define CISTPL_FUNCID_FIXED 0x04 +#define CISTPL_FUNCID_VIDEO 0x05 +#define CISTPL_FUNCID_NETWORK 0x06 +#define CISTPL_FUNCID_AIMS 0x07 +#define CISTPL_FUNCID_SCSI 0x08 + +#endif diff --git a/include/asm-m68k/atari_SCCserial.h b/include/asm-m68k/atari_SCCserial.h index 0ab7c15d0..481bd0e11 100644 --- a/include/asm-m68k/atari_SCCserial.h +++ b/include/asm-m68k/atari_SCCserial.h @@ -29,8 +29,9 @@ * clock sources */ #define SCC_BAUD_BASE_MVME_PCLK 781250 /* 12.5 MHz */ -#define SCC_BAUD_BASE_BVM 460800 /* 7.3728 MHz */ #define SCC_BAUD_BASE_MVME 625000 /* 10.000 MHz */ +#define SCC_BAUD_BASE_BVME_PCLK 781250 /* 12.5 MHz */ /* XXX ??? */ +#define SCC_BAUD_BASE_BVME 460800 /* 7.3728 MHz */ /* The SCC configuration structure */ diff --git a/include/asm-m68k/atari_mouse.h b/include/asm-m68k/atari_mouse.h deleted file mode 100644 index 003bf2b21..000000000 --- a/include/asm-m68k/atari_mouse.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _LINUX_ATARI_MOUSE_H -#define _LINUX_ATARI_MOUSE_H - -/* - * linux/include/linux/atari_mouse.h - * header file for Atari Mouse driver - * by Robert de Vries (robert@and.nl) on 19Jul93 - */ - -struct mouse_status { - char buttons; - short dx; - short dy; - int ready; - int active; - struct wait_queue *wait; - struct fasync_struct *fasyncptr; -}; - -#endif diff --git a/include/asm-m68k/bitops.h b/include/asm-m68k/bitops.h index b2a335a7d..97aac09b2 100644 --- a/include/asm-m68k/bitops.h +++ b/include/asm-m68k/bitops.h @@ -210,6 +210,34 @@ extern __inline__ unsigned long ffz(unsigned long word) return res ^ 31; } +#ifdef __KERNEL__ + +/* + * ffs: find first bit set. This is defined the same way as + * the libc and compiler builtin ffs routines, therefore + * differs in spirit from the above ffz (man ffs). + */ + +extern __inline__ int ffs(int x) +{ + int cnt; + + asm ("bfffo %1{#0:#0}" : "=d" (cnt) : "dm" (x & -x)); + + return 32 - cnt; +} + +/* + * hweightN: returns the hamming weight (i.e. the number + * of bits set) of a N-bit word + */ + +#define hweight32(x) generic_hweight32(x) +#define hweight16(x) generic_hweight16(x) +#define hweight8(x) generic_hweight8(x) + +#endif /* __KERNEL__ */ + /* Bitmap functions for the minix filesystem */ extern __inline__ int diff --git a/include/asm-m68k/blinken.h b/include/asm-m68k/blinken.h new file mode 100644 index 000000000..a6b60dec2 --- /dev/null +++ b/include/asm-m68k/blinken.h @@ -0,0 +1,27 @@ +/* +** asm/blinken.h -- m68k blinkenlights support (currently hp300 only) +** +** (c) 1998 Phil Blundell <philb@gnu.org> +** +** 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 _M68K_BLINKEN_H +#define _M68K_BLINKEN_H + +#include <asm/setup.h> + +#define HP300_LEDS 0xf001ffff + +static __inline__ void blinken_leds(int x) +{ + if (MACH_IS_HP300) + { + *((volatile unsigned char *)HP300_LEDS) = (x); + } +} + +#endif diff --git a/include/asm-m68k/bootinfo.h b/include/asm-m68k/bootinfo.h index 279f82a16..c0a7e6cb0 100644 --- a/include/asm-m68k/bootinfo.h +++ b/include/asm-m68k/bootinfo.h @@ -109,7 +109,7 @@ BIR_data = BIR_size+2 #define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */ /* - * Macintosh-specific tags + * Macintosh-specific tags (all u_long) */ #define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */ @@ -123,9 +123,37 @@ BIR_data = BIR_size+2 #define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */ #define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */ #define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */ +#define BI_MAC_ROMBASE 0x800b /* Mac system ROM base address */ + + /* + * Macintosh hardware profile data - unused, see macintosh.h for + * resonable type values + */ + +#define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */ +#define BI_MAC_VIA2BASE 0x8011 /* Mac VIA2 base address (type varies) */ +#define BI_MAC_VIA2TYPE 0x8012 /* Mac VIA2 type (VIA, RBV, OSS) */ +#define BI_MAC_ADBTYPE 0x8013 /* Mac ADB interface type */ +#define BI_MAC_ASCBASE 0x8014 /* Mac Apple Sound Chip base address */ +#define BI_MAC_SCSI5380 0x8015 /* Mac NCR 5380 SCSI (base address, multi) */ +#define BI_MAC_SCSIDMA 0x8016 /* Mac SCSI DMA (base address) */ +#define BI_MAC_SCSI5396 0x8017 /* Mac NCR 53C96 SCSI (base address, multi) */ +#define BI_MAC_IDETYPE 0x8018 /* Mac IDE interface type */ +#define BI_MAC_IDEBASE 0x8019 /* Mac IDE interface base address */ +#define BI_MAC_NUBUS 0x801a /* Mac Nubus type (none, regular, pseudo) */ +#define BI_MAC_SLOTMASK 0x801b /* Mac Nubus slots present */ +#define BI_MAC_SCCTYPE 0x801c /* Mac SCC serial type (normal, IOP) */ +#define BI_MAC_ETHTYPE 0x801d /* Mac builtin ethernet type (Sonic, MACE */ +#define BI_MAC_ETHBASE 0x801e /* Mac builtin ethernet base address */ +#define BI_MAC_PMU 0x801f /* Mac power managment / poweroff hardware */ +#define BI_MAC_IOP_SWIM 0x8020 /* Mac SWIM floppy IOP */ +#define BI_MAC_IOP_ADB 0x8021 /* Mac ADB IOP */ /* * Mac: compatibility with old booter data format (temporarily) + * Fields unused with the new bootinfo can be deleted now; instead of + * adding new fields the struct might be splitted into a hardware address + * part and a hardware type part */ #ifndef __ASSEMBLY__ @@ -198,6 +226,7 @@ struct bootversion { #define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 1 ) #define MAC_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) #define MVME16x_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) +#define BVME6000_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) #ifdef BOOTINFO_COMPAT_1_0 @@ -233,10 +262,6 @@ struct compat_bi_Atari { #ifndef __ASSEMBLY__ -#define MACHW_DECLARE(name) unsigned name : 1 -#define MACHW_SET(name) (boot_info.bi_mac.hw_present.name = 1) -#define MACHW_PRESENT(name) (boot_info.bi_mac.hw_present.name) - struct compat_bi_Macintosh { unsigned long videoaddr; @@ -261,25 +286,6 @@ struct compat_bi_Macintosh unsigned long rombase; unsigned long adbdelay; unsigned long timedbra; - struct { - /* video hardware */ - /* sound hardware */ - /* disk storage interfaces */ - MACHW_DECLARE(MAC_SCSI); /* Directly mapped NCR5380 */ - MACHW_DECLARE(IDE); /* IDE Interface */ - /* other I/O hardware */ - MACHW_DECLARE(SCC); /* Serial Communications Contr. */ - /* DMA */ - MACHW_DECLARE(SCSI_DMA); /* DMA for the NCR5380 */ - /* real time clocks */ - MACHW_DECLARE(RTC_CLK); /* clock chip */ - /* supporting hardware */ - MACHW_DECLARE(VIA1); /* Versatile Interface Ad. 1 */ - MACHW_DECLARE(VIA2); /* Versatile Interface Ad. 2 */ - MACHW_DECLARE(RBV); /* Versatile Interface Ad. 2+ */ - /* NUBUS */ - MACHW_DECLARE(NUBUS); /* NUBUS */ - } hw_present; }; #else diff --git a/include/asm-m68k/bvme6000hw.h b/include/asm-m68k/bvme6000hw.h new file mode 100644 index 000000000..0218c29dc --- /dev/null +++ b/include/asm-m68k/bvme6000hw.h @@ -0,0 +1,129 @@ +#ifndef _M68K_BVME6000HW_H_ +#define _M68K_BVME6000HW_H_ + +#include <asm/irq.h> + +/* + * PIT structure + */ + +#define BVME_PIT_BASE 0xffa00000 + +typedef struct { + unsigned char + pad_a[3], pgcr, + pad_b[3], psrr, + pad_c[3], paddr, + pad_d[3], pbddr, + pad_e[3], pcddr, + pad_f[3], pivr, + pad_g[3], pacr, + pad_h[3], pbcr, + pad_i[3], padr, + pad_j[3], pbdr, + pad_k[3], paar, + pad_l[3], pbar, + pad_m[3], pcdr, + pad_n[3], psr, + pad_o[3], res1, + pad_p[3], res2, + pad_q[3], tcr, + pad_r[3], tivr, + pad_s[3], res3, + pad_t[3], cprh, + pad_u[3], cprm, + pad_v[3], cprl, + pad_w[3], res4, + pad_x[3], crh, + pad_y[3], crm, + pad_z[3], crl, + pad_A[3], tsr, + pad_B[3], res5; +} PitRegs_t, *PitRegsPtr; + +#define bvmepit ((*(volatile PitRegsPtr)(BVME_PIT_BASE))) + +#define BVME_RTC_BASE 0xff900000 + +typedef struct { + unsigned char + pad_a[3], msr, + pad_b[3], t0cr_rtmr, + pad_c[3], t1cr_omr, + pad_d[3], pfr_icr0, + pad_e[3], irr_icr1, + pad_f[3], bcd_tenms, + pad_g[3], bcd_sec, + pad_h[3], bcd_min, + pad_i[3], bcd_hr, + pad_j[3], bcd_dom, + pad_k[3], bcd_mth, + pad_l[3], bcd_year, + pad_m[3], bcd_ujcc, + pad_n[3], bcd_hjcc, + pad_o[3], bcd_dow, + pad_p[3], t0lsb, + pad_q[3], t0msb, + pad_r[3], t1lsb, + pad_s[3], t1msb, + pad_t[3], cmp_sec, + pad_u[3], cmp_min, + pad_v[3], cmp_hr, + pad_w[3], cmp_dom, + pad_x[3], cmp_mth, + pad_y[3], cmp_dow, + pad_z[3], sav_sec, + pad_A[3], sav_min, + pad_B[3], sav_hr, + pad_C[3], sav_dom, + pad_D[3], sav_mth, + pad_E[3], ram, + pad_F[3], test; +} RtcRegs_t, *RtcPtr_t; + + +#define BVME_I596_BASE 0xff100000 + +#define BVME_ETHIRQ_REG 0xff20000b + +#define BVME_LOCAL_IRQ_STAT 0xff20000f + +#define BVME_ETHERR 0x02 +#define BVME_ABORT_STATUS 0x08 + +#define BVME_NCR53C710_BASE 0xff000000 + +#define BVME_SCC_A_ADDR 0xffb0000b +#define BVME_SCC_B_ADDR 0xffb00003 + +#define BVME_CONFIG_REG 0xff500003 + +#define config_reg_ptr (unsigned char *)BVME_CONFIG_REG + +#define BVME_CONFIG_SW1 0x08 +#define BVME_CONFIG_SW2 0x04 +#define BVME_CONFIG_SW3 0x02 +#define BVME_CONFIG_SW4 0x01 + + +#define BVME_IRQ_TYPE_PRIO 0 + +#define BVME_IRQ_PRN 0x54 +#define BVME_IRQ_I596 0x1a +#define BVME_IRQ_SCSI 0x1b +#define BVME_IRQ_TIMER 0x59 +#define BVME_IRQ_RTC 0x1e +#define BVME_IRQ_ABORT 0x1f + +/* SCC interrupts */ +#define BVME_IRQ_SCC_BASE 0x40 +#define BVME_IRQ_SCCB_TX 0x40 +#define BVME_IRQ_SCCB_STAT 0x42 +#define BVME_IRQ_SCCB_RX 0x44 +#define BVME_IRQ_SCCB_SPCOND 0x46 +#define BVME_IRQ_SCCA_TX 0x48 +#define BVME_IRQ_SCCA_STAT 0x4a +#define BVME_IRQ_SCCA_RX 0x4c +#define BVME_IRQ_SCCA_SPCOND 0x4e + +#endif diff --git a/include/asm-m68k/checksum.h b/include/asm-m68k/checksum.h index 8b7f9d162..d4a6e6fb9 100644 --- a/include/asm-m68k/checksum.h +++ b/include/asm-m68k/checksum.h @@ -39,6 +39,10 @@ extern unsigned int csum_partial_copy_from_user ( const char *src, char *dst, int len, int sum, int *csum_err); +/* FIXME: this needs to be written to really do no check -- Cort */ +#define csum_partial_copy_nocheck(src, dst, len, sum) \ + csum_partial_copy((src), (dst), (len), (sum)) + /* * This is a version of ip_compute_csum() optimized for IP headers, * which always checksum on 4 octet boundaries. diff --git a/include/asm-m68k/entry.h b/include/asm-m68k/entry.h index 2c3182696..b1c102ce2 100644 --- a/include/asm-m68k/entry.h +++ b/include/asm-m68k/entry.h @@ -45,6 +45,7 @@ LTASK_FLAGS = 4 LTASK_SIGPENDING = 8 LTASK_ADDRLIMIT = 12 LTASK_EXECDOMAIN = 16 +LTASK_NEEDRESCHED = 20 LTSS_KSP = 0 LTSS_USP = 4 @@ -54,7 +55,7 @@ LTSS_CRP = 12 LTSS_FPCTXT = 24 /* the following macro is used when enabling interrupts */ -#if defined(MACH_ATARI_ONLY) && !defined(CONFIG_HADES) +#if defined(CONFIG_ATARI_ONLY) && !defined(CONFIG_HADES) /* block out HSYNC on the atari */ #define ALLOWINT 0xfbff #define MAX_NOINT_IPL 3 diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h index 76968803b..350fc0f69 100644 --- a/include/asm-m68k/hardirq.h +++ b/include/asm-m68k/hardirq.h @@ -5,6 +5,8 @@ extern unsigned int local_irq_count[NR_CPUS]; +#define in_interrupt() (local_irq_count[smp_processor_id()] + local_bh_count[smp_processor_id()] != 0) + #define hardirq_trylock(cpu) (++local_irq_count[cpu], (cpu) == 0) #define hardirq_endlock(cpu) (--local_irq_count[cpu]) diff --git a/include/asm-m68k/hwtest.h b/include/asm-m68k/hwtest.h new file mode 100644 index 000000000..17d3f0ad7 --- /dev/null +++ b/include/asm-m68k/hwtest.h @@ -0,0 +1,15 @@ +/* Routines to test for presence/absence of hardware registers: + * see arch/m68k/mm/hwtest.c. + * -- PMM <pmaydell@chiark.greenend.org.uk> 05/1998 + * + * Removed initfunc from decls. We might want them in modules, and + * the code is tiny anyway. 16/5/98 pb + */ + +#ifndef __ASM_HWTEST_H +#define __ASM_HWTEST_H + +extern int hwreg_present(volatile void *regp); +extern int hwreg_write(volatile void *regp, unsigned short val); + +#endif diff --git a/include/asm-m68k/ide.h b/include/asm-m68k/ide.h index a69ef5b18..abcd0da25 100644 --- a/include/asm-m68k/ide.h +++ b/include/asm-m68k/ide.h @@ -41,6 +41,10 @@ #include <asm/atari_stdma.h> #endif +#ifdef CONFIG_MAC +#include <asm/macints.h> +#endif + typedef unsigned char * ide_ioreg_t; #ifndef MAX_HWIFS @@ -71,6 +75,10 @@ typedef union { } b; } select_t; +#ifdef CONFIG_MAC /* MSch: Hack; wrapper for ide_intr */ +void mac_ide_intr(int irq, void *dev_id, struct pt_regs *regs); +#endif + static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *device, void *dev_id) { @@ -78,6 +86,14 @@ static __inline__ int ide_request_irq(unsigned int irq, void (*handler)(int, voi if (MACH_IS_AMIGA) return request_irq(irq, handler, 0, device, dev_id); #endif /* CONFIG_AMIGA */ +#ifdef CONFIG_MAC + if (MACH_IS_MAC) +#if 0 /* MSch Hack: maybe later we'll call ide_intr without a wrapper */ + return nubus_request_irq(12, dev_id, handler); +#else + return nubus_request_irq(12, dev_id, mac_ide_intr); +#endif +#endif /* CONFIG_MAC */ return 0; } @@ -87,6 +103,10 @@ static __inline__ void ide_free_irq(unsigned int irq, void *dev_id) if (MACH_IS_AMIGA) free_irq(irq, dev_id); #endif /* CONFIG_AMIGA */ +#ifdef CONFIG_MAC + if (MACH_IS_MAC) + nubus_free_irq(12); +#endif /* CONFIG_MAC */ } /* @@ -117,81 +137,83 @@ static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent #define insl(data_reg, buffer, wcount) insw(data_reg, buffer, (wcount)<<1) #define outsl(data_reg, buffer, wcount) outsw(data_reg, buffer, (wcount)<<1) -#define insw(port, buf, nr) \ - if ((nr) % 16) \ - __asm__ __volatile__ \ - ("movel %0,%/a0; \ - movel %1,%/a1; \ - movel %2,%/d6; \ - subql #1,%/d6; \ - 1:movew %/a0@,%/a1@+; \ - dbra %/d6,1b" : \ - : "g" (port), "g" (buf), "g" (nr) \ - : "a0", "a1", "d6"); \ - else \ - __asm__ __volatile__ \ - ("movel %0,%/a0; \ - movel %1,%/a1; \ - movel %2,%/d6; \ - lsrl #4,%/d6; \ - subql #1,%/d6; \ - 1:movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - movew %/a0@,%/a1@+; \ - dbra %/d6,1b" : \ - : "g" (port), "g" (buf), "g" (nr) \ - : "a0", "a1", "d6") - -#define outsw(port, buf, nr) \ - if ((nr) % 16) \ - __asm__ __volatile__ \ - ("movel %0,%/a0; \ - movel %1,%/a1; \ - movel %2,%/d6; \ - subql #1,%/d6; \ - 1:movew %/a1@+,%/a0@; \ - dbra %/d6,1b" : \ - : "g" (port), "g" (buf), "g" (nr) \ - : "a0", "a1", "d6"); \ - else \ - __asm__ __volatile__ \ - ("movel %0,%/a0; \ - movel %1,%/a1; \ - movel %2,%/d6; \ - lsrl #4,%/d6; \ - subql #1,%/d6; \ - 1:movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - movew %/a1@+,%/a0@; \ - dbra %/d6,1b" : \ - : "g" (port), "g" (buf), "g" (nr) \ - : "a0", "a1", "d6") +#define insw(port, buf, nr) ({ \ + unsigned char *_port = (unsigned char *)(port); \ + unsigned char *_buf = (buf); \ + int _nr = (nr); \ + unsigned long _tmp; \ + \ + if (_nr & 15) { \ + _tmp = (_nr & 15) - 1; \ + asm volatile ( \ + "1: movew %2@,%3@+; dbra %4,1b" \ + : "=a" (_buf), "=d" (_tmp) \ + : "a" (_port), "0" (_buf), \ + "1" (_tmp)); \ + } \ + _tmp = (_nr >> 4) - 1; \ + asm volatile ( \ + "1: " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "movew %2@,%3@+; " \ + "dbra %4,1b" \ + : "=a" (_buf), "=d" (_tmp) \ + : "a" (_port), "0" (_buf), \ + "1" (_tmp)); \ +}) + +#define outsw(port, buf, nr) ({ \ + unsigned char *_port = (unsigned char *)(port); \ + unsigned char *_buf = (buf); \ + int _nr = (nr); \ + unsigned long _tmp; \ + \ + if (_nr & 15) { \ + _tmp = (_nr & 15) - 1; \ + asm volatile ( \ + "1: movew %3@,%2@+; dbra %4,1b" \ + : "=a" (_buf), "=d" (_tmp) \ + : "a" (_port), "0" (_buf), \ + "1" (_tmp)); \ + } \ + _tmp = (_nr >> 4) - 1; \ + asm volatile ( \ + "1: " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "movew %3@+,%2@; " \ + "dbra %4,1b" \ + : "=a" (_buf), "=d" (_tmp) \ + : "a" (_port), "0" (_buf), \ + "1" (_tmp)); \ +}) #ifdef CONFIG_ATARI #define insl_swapw(data_reg, buffer, wcount) \ @@ -310,11 +332,11 @@ static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent #define D_INT(cnt) (T_INT | (cnt)) #define D_TEXT(cnt) (T_TEXT | (cnt)) -#ifdef CONFIG_AMIGA +#if defined(CONFIG_AMIGA) || defined (CONFIG_MAC) static u_short driveid_types[] = { D_SHORT(10), /* config - vendor2 */ D_TEXT(20), /* serial_no */ - D_SHORT(3), /* buf_type - ecc_bytes */ + D_SHORT(3), /* buf_type, buf_size - ecc_bytes */ D_TEXT(48), /* fw_rev - model */ D_CHAR(2), /* max_multsect - vendor3 */ D_SHORT(1), /* dword_io */ @@ -333,12 +355,12 @@ static u_short driveid_types[] = { static __inline__ void ide_fix_driveid(struct hd_driveid *id) { -#ifdef CONFIG_AMIGA +#if defined(CONFIG_AMIGA) || defined (CONFIG_MAC) u_char *p = (u_char *)id; int i, j, cnt; u_char t; - if (!MACH_IS_AMIGA) + if (!MACH_IS_AMIGA && !MACH_IS_MAC) return; for (i = 0; i < num_driveid_types; i++) { cnt = driveid_types[i] & T_MASK_COUNT; @@ -423,7 +445,7 @@ static __inline__ void ide_get_lock (int *ide_lock, void (*handler)(int, void *, * an interrupt, and in that case it does nothing. Hope that is reasonable and * works. (Roman) */ -#if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) +#ifdef CONFIG_ATARI_ONLY #define ide__sti() \ do { \ if (!in_interrupt()) __sti(); \ diff --git a/include/asm-m68k/io.h b/include/asm-m68k/io.h index 8cee601e6..a002fe2a0 100644 --- a/include/asm-m68k/io.h +++ b/include/asm-m68k/io.h @@ -28,9 +28,9 @@ #define readl(addr) \ ({ unsigned int __v = (*(volatile unsigned int *) (addr)); __v; }) -#define writeb(b,addr) ((*(volatile unsigned char *) (addr)) = (b)) -#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b)) -#define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b)) +#define writeb(b,addr) (void)((*(volatile unsigned char *) (addr)) = (b)) +#define writew(b,addr) (void)((*(volatile unsigned short *) (addr)) = (b)) +#define writel(b,addr) (void)((*(volatile unsigned int *) (addr)) = (b)) #define memset_io(a,b,c) memset((void *)(a),(b),(c)) #define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) diff --git a/include/asm-m68k/keyboard.h b/include/asm-m68k/keyboard.h index cb013200b..c30c8dc04 100644 --- a/include/asm-m68k/keyboard.h +++ b/include/asm-m68k/keyboard.h @@ -24,7 +24,7 @@ static __inline__ int kbd_setkeycode(unsigned int scancode, static __inline__ int kbd_getkeycode(unsigned int scancode) { - return -EOPNOTSUPP; + return scancode > 127 ? -EINVAL : scancode; } static __inline__ int kbd_pretranslate(unsigned char scancode, char raw_mode) diff --git a/include/asm-m68k/kgdb.h b/include/asm-m68k/kgdb.h new file mode 100644 index 000000000..e1d3c493f --- /dev/null +++ b/include/asm-m68k/kgdb.h @@ -0,0 +1,83 @@ +/* + * include/asm-m68k/kgdb.h + * + * Copyright (C) 1996 Roman Hodek + */ + +#ifndef __ASM_M68k_KGDB_H +#define __ASM_M68k_KGDB_H + +/* + * Structure to save all register values in, already in the order gdb wants + * it. Note that the upper half of the SR field is recycled for the FORMAT and + * VECTOR fields. Hope that doesn't confuse gdb... That upper half is ignored + * on exiting the stub, so gdb can modify it as it likes. + */ + +#define GDBREG_A6 14 +#define GDBREG_A7 15 +#define GDBREG_SP 15 +#define GDBREG_SR 16 +#define GDBREG_PC 17 +#define GDBREG_FP0 18 +#define GDBREG_FP7 25 +#define GDBREG_FPCR 26 +#define GDBREG_FPIAR 28 + +#define GDBOFFA_D6 (6*4) +#define GDBOFFA_A3 (11*4) + +#define NUMREGSBYTES 180 + +#ifndef __ASSEMBLY__ + +struct gdb_regs { + long regs[16]; /* d0-a7 */ + unsigned format : 4; /* frame format specifier */ + unsigned vector : 12; /* vector offset */ + unsigned short sr; /* status register */ + unsigned long pc; /* program counter */ + unsigned long fpregs[8*3]; /* fp0-fp7 */ + unsigned long fpcntl[3]; /* fpcr, fpsr, fpiar */ +}; + +extern struct gdb_regs kgdb_registers; +extern void kgdb_init( void ); +struct frame; +extern asmlinkage void enter_kgdb( struct pt_regs *fp ); + +extern int kgdb_initialized; + +/* + * This function will generate a breakpoint exception. It is used at the + * beginning of a program to sync up with a debugger and can be used + * otherwise as a quick means to stop program execution and "break" into + * the debugger. + */ +extern inline void breakpoint( void ) +{ + if (!kgdb_initialized) + /* if kgdb not inited, do nothing */ + return; + + /* breakpoint instruction is TRAP #15 */ + __asm__ __volatile__ ( "trap #15" ); +} + +/* + * This function will report a SIGABORT to gdb. + */ +extern inline void kgdb_abort( void ) +{ + if (!kgdb_initialized) + /* if kgdb not inited, do nothing */ + return; + + /* TRAP #14 is reported as SIGABORT */ + __asm__ __volatile__ ( "trap #14" ); +} + +#endif /* __ASSEMBLY__ */ + +#endif /* __ASM_M68k_KGDB_H */ + diff --git a/include/asm-m68k/linux_logo.h b/include/asm-m68k/linux_logo.h new file mode 100644 index 000000000..e57168b1e --- /dev/null +++ b/include/asm-m68k/linux_logo.h @@ -0,0 +1,46 @@ +/* $Id: linux_logo.h,v 1.1 1997/04/16 17:51:24 jj Exp $ + * include/asm-m68k/linux_logo.h: This is a linux logo + * to be displayed on boot. + * + * Copyright (C) 1996 Larry Ewing (lewing@isc.tamu.edu) + * Copyright (C) 1996 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * + * You can put anything here, but: + * LINUX_LOGO_COLORS has to be less than 224 + * image size has to be 80x80 + * values have to start from 0x20 + * (i.e. RGB(linux_logo_red[0], + * linux_logo_green[0], + * linux_logo_blue[0]) is color 0x20) + * BW image has to be 80x80 as well, with MS bit + * on the left + * Serial_console ascii image can be any size, + * but should contain %s to display the version + */ + +#include <linux/init.h> +#include <linux/version.h> + +#define linux_logo_banner "Linux/m68k version " UTS_RELEASE + +#define LINUX_LOGO_COLORS 221 + +#ifdef INCLUDE_LINUX_LOGO_DATA + +#define INCLUDE_LINUX_LOGO16 +#include <linux/linux_logo.h> + +#else + +/* prototypes only */ +extern unsigned char linux_logo_red[]; +extern unsigned char linux_logo_green[]; +extern unsigned char linux_logo_blue[]; +extern unsigned char linux_logo[]; +extern unsigned char linux_logo_bw[]; +extern unsigned char linux_logo16_red[]; +extern unsigned char linux_logo16_green[]; +extern unsigned char linux_logo16_blue[]; +extern unsigned char linux_logo16[]; + +#endif diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h index b5be7c65d..5e2b138e9 100644 --- a/include/asm-m68k/machdep.h +++ b/include/asm-m68k/machdep.h @@ -13,6 +13,7 @@ extern void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *)); extern int (*mach_keyb_init) (void); extern int (*mach_kbdrate) (struct kbd_repeat *); extern void (*mach_kbd_leds) (unsigned int); +extern void (*kbd_reset_setup) (char *, int); /* machine dependent irq functions */ extern void (*mach_init_IRQ) (void); extern void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *); diff --git a/include/asm-m68k/machw.h b/include/asm-m68k/machw.h index 4012d8111..90ff6b627 100644 --- a/include/asm-m68k/machw.h +++ b/include/asm-m68k/machw.h @@ -99,10 +99,48 @@ struct VIA # define via_1 ((*(volatile struct VIA *)VIA1_BAS)) # define via_2 ((*(volatile struct VIA *)VIA2_BAS)) -# define via1_regp ((volatile unsigned char *)VIA1_BAS) - -# define via2_regp ((volatile unsigned char *)VIA2_BAS) -# define via2_ci_regp ((volatile unsigned char *)VIA2_BAS_IIci) -# define rbv_regp ((volatile unsigned char *)VIA2_BAS_IIci) +# define via1_regp ((volatile unsigned char *)VIA1_BAS) +/* + * OSS/RBV base address + */ + +#define OSS_BAS 0x50f1a000 +#define PSC_BAS 0x50f31000 + +/* move to oss.h?? */ +#define nIFR 0x203 +#define oIFR 0x202 + + +/* hardware stuff */ + +#define MACHW_DECLARE(name) unsigned name : 1 +#define MACHW_SET(name) (mac_hw_present.name = 1) +#define MACHW_PRESENT(name) (mac_hw_present.name) + +struct { + /* video hardware */ + /* sound hardware */ + /* disk storage interfaces */ + MACHW_DECLARE(MAC_SCSI_80); /* Directly mapped NCR5380 */ + MACHW_DECLARE(MAC_SCSI_96); /* 53c9[46] */ + MACHW_DECLARE(MAC_SCSI_96_2); /* 2nd 53c9[46] Q900 and Q950 */ + MACHW_DECLARE(IDE); /* IDE Interface */ + /* other I/O hardware */ + MACHW_DECLARE(SCC); /* Serial Communications Contr. */ + /* DMA */ + MACHW_DECLARE(SCSI_DMA); /* DMA for the NCR5380 */ + /* real time clocks */ + MACHW_DECLARE(RTC_CLK); /* clock chip */ + /* supporting hardware */ + MACHW_DECLARE(VIA1); /* Versatile Interface Ad. 1 */ + MACHW_DECLARE(VIA2); /* Versatile Interface Ad. 2 */ + MACHW_DECLARE(RBV); /* Versatile Interface Ad. 2+ */ + /* NUBUS */ + MACHW_DECLARE(NUBUS); /* NUBUS */ +} mac_hw_present; + +/* extern struct mac_hw_present mac_hw_present; */ + #endif /* linux/machw.h */ diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h index f40ff86c5..a084447f5 100644 --- a/include/asm-m68k/macintosh.h +++ b/include/asm-m68k/macintosh.h @@ -56,6 +56,8 @@ struct mac_model #define MAC_ADB_II 1 #define MAC_ADB_IISI 2 #define MAC_ADB_CUDA 3 +#define MAC_ADB_PB1 4 +#define MAC_ADB_PB2 5 #define MAC_VIA_II 1 #define MAC_VIA_IIci 2 @@ -74,6 +76,7 @@ struct mac_model #define MAC_SCC_II 1 #define MAC_SCC_QUADRA 2 #define MAC_SCC_QUADRA2 3 +#define MAC_SCC_IOP 4 #define MAC_ETHER_NONE 0 #define MAC_ETHER_SONIC 1 @@ -92,8 +95,9 @@ struct mac_model #define MAC_MODEL_IICI 11 #define MAC_MODEL_IIFX 13 /* And well numbered it is too */ #define MAC_MODEL_IISI 18 +#define MAC_MODEL_LC 19 #define MAC_MODEL_Q900 20 -#define MAC_MODEL_PB170 25 +#define MAC_MODEL_PB170 21 #define MAC_MODEL_Q700 22 #define MAC_MODEL_CLII 23 #define MAC_MODEL_PB140 25 @@ -109,6 +113,7 @@ struct mac_model #define MAC_MODEL_LCII 37 /* aka: P400/405/410/430 */ #define MAC_MODEL_PB250 38 #define MAC_MODEL_IIVI 44 +#define MAC_MODEL_P600 45 #define MAC_MODEL_IIVX 48 #define MAC_MODEL_CCL 49 #define MAC_MODEL_PB165C 50 @@ -123,13 +128,16 @@ struct mac_model #define MAC_MODEL_PB270C 77 #define MAC_MODEL_Q840 78 #define MAC_MODEL_P550 80 +#define MAC_MODEL_CCLII 83 #define MAC_MODEL_PB165 84 #define MAC_MODEL_PB190 85 #define MAC_MODEL_TV 88 #define MAC_MODEL_P475 89 /* aka: LC475, P476 */ +#define MAC_MODEL_P475F 90 /* aka: P475 w/ FPU (no LC040) */ #define MAC_MODEL_P575 92 /* aka: LC575/580, P577/578/508 */ #define MAC_MODEL_Q605 94 #define MAC_MODEL_Q630 98 /* aka: LC630, P630/631/636/640 */ +#define MAC_MODEL_P588 99 /* aka: ?? */ #define MAC_MODEL_PB280 102 #define MAC_MODEL_PB280C 103 #define MAC_MODEL_PB150 115 diff --git a/include/asm-m68k/macints.h b/include/asm-m68k/macints.h index b2522f78d..e731c0e7f 100644 --- a/include/asm-m68k/macints.h +++ b/include/asm-m68k/macints.h @@ -26,9 +26,9 @@ #define VIA1_SOURCE_BASE 8 #define VIA2_SOURCE_BASE 16 -#define RBF_SOURCE_BASE 24 +#define RBV_SOURCE_BASE 24 #define MAC_SCC_SOURCE_BASE 32 -#define NUBUS_SOURCE_BASE 40 +#define NUBUS_SOURCE_BASE 56 #define NUBUS_MAX_SOURCES 8 /* FIXME: sources not contigous ... */ @@ -42,14 +42,6 @@ */ #define IRQ_IDX(irq) (irq) -#if 0 -/* convert vector number to int source number */ -#define IRQ_VECTOR_TO_SOURCE(v) (v) - -/* convert irq_handler index to vector number */ -#define IRQ_SOURCE_TO_VECTOR(i) (i) -#endif - /* interrupt service types */ #define IRQ_TYPE_SLOW 0 #define IRQ_TYPE_FAST 1 @@ -96,6 +88,7 @@ #define IRQ_VIA2_6 (22) #define IRQ_VIA2_7 (23) +#if 0 /* RBV interrupts */ #define IRQ_RBV_0 (24) #define IRQ_RBV_1 (25) @@ -105,10 +98,19 @@ #define IRQ_RBV_5 (29) #define IRQ_RBV_6 (30) #define IRQ_RBV_7 (31) +#endif + +/* Level 3 (PSC, AV Macs only) interrupts */ +#define IRQ_PSC3_0 (24) +#define IRQ_MAC_MACE IRQ_PSC3_0 +#define IRQ_PSC3_1 (25) +#define IRQ_PSC3_2 (26) +#define IRQ_PSC3_3 (27) +/* Level 4 (SCC) interrupts */ #define IRQ_SCC (32) -#define IRQ_SCCB (32) -#define IRQ_SCCA (33) +#define IRQ_SCCB (33) +#define IRQ_SCCA (34) #if 0 /* FIXME: are there multiple interrupt conditions on the SCC ?? */ /* SCC interrupts */ #define IRQ_SCCB_TX (32) @@ -121,7 +123,27 @@ #define IRQ_SCCA_SPCOND (39) #endif -#define IRQ_NUBUS_1 (40) +/* Level 4 (PSC, AV Macs only) interrupts */ +#define IRQ_PSC4_0 (32) +#define IRQ_PSC4_1 (33) +#define IRQ_PSC4_2 (34) +#define IRQ_PSC4_3 (35) +#define IRQ_MAC_MACE_DMA IRQ_PSC4_3 + +/* Level 5 (PSC, AV Macs only) interrupts */ +#define IRQ_PSC5_0 (40) +#define IRQ_PSC5_1 (41) +#define IRQ_PSC5_2 (42) +#define IRQ_PSC5_3 (43) + +/* Level 6 (PSC, AV Macs only) interrupts */ +#define IRQ_PSC6_0 (48) +#define IRQ_PSC6_1 (49) +#define IRQ_PSC6_2 (50) +#define IRQ_PSC6_3 (51) + +/* Nubus interrupts (cascaded to VIA2) */ +#define IRQ_NUBUS_1 (56) #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */ #define INT_TICKS 246 /* to make sched_time = 99.902... HZ */ @@ -143,7 +165,7 @@ void mac_turnon_irq( unsigned irq ); void mac_turnoff_irq( unsigned irq ); void mac_clear_pending_irq( unsigned irq ); int mac_irq_pending( unsigned irq ); -int nubus_request_irq(int slot, void (*handler)(int,void *,struct pt_regs *)); +int nubus_request_irq(int slot, void *dev_id, void (*handler)(int,void *,struct pt_regs *)); int nubus_free_irq(int slot); unsigned long mac_register_nubus_int( void ); diff --git a/include/asm-m68k/md.h b/include/asm-m68k/md.h new file mode 100644 index 000000000..1d15aae21 --- /dev/null +++ b/include/asm-m68k/md.h @@ -0,0 +1,13 @@ +/* $Id: md.h,v 1.1 1997/12/15 15:12:04 jj Exp $ + * md.h: High speed xor_block operation for RAID4/5 + * + */ + +#ifndef __ASM_MD_H +#define __ASM_MD_H + +/* #define HAVE_ARCH_XORBLOCK */ + +#define MD_XORBLOCK_ALIGNMENT sizeof(long) + +#endif /* __ASM_MD_H */ diff --git a/include/asm-m68k/mvme16xhw.h b/include/asm-m68k/mvme16xhw.h index dbcee2672..75a21d8a4 100644 --- a/include/asm-m68k/mvme16xhw.h +++ b/include/asm-m68k/mvme16xhw.h @@ -34,37 +34,59 @@ typedef struct { spare3, spare4, data; -} lpr_ctrl; +} MVMElp, *MVMElpPtr; -#define LPR_REGS ((volatile lpr_ctrl *)0xfff42030) +#define MVME_LPR_BASE 0xfff42030 -#define I596_BASE 0xfff46000 +#define mvmelp ((*(volatile MVMElpPtr)(MVME_LPR_BASE))) -#define SCC_A_ADDR 0xfff45005 -#define SCC_B_ADDR 0xfff45001 - -#define IRQ_MVME162_TYPE_PRIO 0 - -#define IRQ_MVME167_PRN 0x54 -#define IRQ_MVME16x_I596 0x57 -#define IRQ_MVME16x_SCSI 0x55 -#define IRQ_MVME16x_FLY 0x7f -#define IRQ_MVME167_SER_ERR 0x5c -#define IRQ_MVME167_SER_MODEM 0x5d -#define IRQ_MVME167_SER_TX 0x5e -#define IRQ_MVME167_SER_RX 0x5f -#define IRQ_MVME16x_TIMER 0x59 +typedef struct { + unsigned char + ctrl, + bcd_sec, + bcd_min, + bcd_hr, + bcd_dow, + bcd_dom, + bcd_mth, + bcd_year; +} MK48T08_t, *MK48T08ptr_t; + +#define RTC_WRITE 0x80 +#define RTC_READ 0x40 +#define RTC_STOP 0x20 + +#define MVME_RTC_BASE 0xfffc1ff8 + +#define MVME_I596_BASE 0xfff46000 + +#define MVME_SCC_A_ADDR 0xfff45005 +#define MVME_SCC_B_ADDR 0xfff45001 + +#define MVME162_IRQ_TYPE_PRIO 0 + +#define MVME167_IRQ_PRN 0x54 +#define MVME16x_IRQ_I596 0x57 +#define MVME16x_IRQ_SCSI 0x55 +#define MVME16x_IRQ_FLY 0x7f +#define MVME167_IRQ_SER_ERR 0x5c +#define MVME167_IRQ_SER_MODEM 0x5d +#define MVME167_IRQ_SER_TX 0x5e +#define MVME167_IRQ_SER_RX 0x5f +#define MVME16x_IRQ_TIMER 0x59 +#define MVME167_IRQ_ABORT 0x6e +#define MVME162_IRQ_ABORT 0x5e /* SCC interrupts, for MVME162 */ -#define IRQ_MVME162_SCC_BASE 0x40 -#define IRQ_MVME162_SCCB_TX 0x40 -#define IRQ_MVME162_SCCB_STAT 0x42 -#define IRQ_MVME162_SCCB_RX 0x44 -#define IRQ_MVME162_SCCB_SPCOND 0x46 -#define IRQ_MVME162_SCCA_TX 0x48 -#define IRQ_MVME162_SCCA_STAT 0x4a -#define IRQ_MVME162_SCCA_RX 0x4c -#define IRQ_MVME162_SCCA_SPCOND 0x4e +#define MVME162_IRQ_SCC_BASE 0x40 +#define MVME162_IRQ_SCCB_TX 0x40 +#define MVME162_IRQ_SCCB_STAT 0x42 +#define MVME162_IRQ_SCCB_RX 0x44 +#define MVME162_IRQ_SCCB_SPCOND 0x46 +#define MVME162_IRQ_SCCA_TX 0x48 +#define MVME162_IRQ_SCCA_STAT 0x4a +#define MVME162_IRQ_SCCA_RX 0x4c +#define MVME162_IRQ_SCCA_SPCOND 0x4e /* MVME162 version register */ @@ -85,34 +107,4 @@ extern unsigned short mvme16x_config; #define MVME16x_CONFIG_GOT_SCCA 0x0400 #define MVME16x_CONFIG_GOT_SCCB 0x0800 -/* Specials for the ethernet driver */ - -#define CA() (((struct i596_reg *)dev->base_addr)->ca = 1) - -#define MPU_PORT(c,x) \ - ((struct i596_reg *)(dev->base_addr))->porthi = ((c) | (u32)(x)) & 0xffff; \ - ((struct i596_reg *)(dev->base_addr))->portlo = ((c) | (u32)(x)) >> 16 - -#define SCP_SYSBUS 0x00000054 - -#define WSWAPrfd(x) ((struct i596_rfd *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) -#define WSWAPrbd(x) ((struct i596_rbd *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) -#define WSWAPiscp(x) ((struct i596_iscp *)(((u32)(x)<<16) | ((((u32)(x)))>>16))) -#define WSWAPscb(x) ((struct i596_scb *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) -#define WSWAPcmd(x) ((struct i596_cmd *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) -#define WSWAPtbd(x) ((struct i596_tbd *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) -#define WSWAPchar(x) ((char *) (((u32)(x)<<16) | ((((u32)(x)))>>16))) - -/* - * The MPU_PORT command allows direct access to the 82596. With PORT access - * the following commands are available (p5-18). The 32-bit port command - * must be word-swapped with the most significant word written first. - */ -#define PORT_RESET 0x00 /* reset 82596 */ -#define PORT_SELFTEST 0x01 /* selftest */ -#define PORT_ALTSCP 0x02 /* alternate SCB address */ -#define PORT_ALTDUMP 0x03 /* Alternate DUMP address */ - -#define ISCP_BUSY 0x00010000 - -#endif /* _M68K_MVME16xHW_H_ */ +#endif diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h index d8d0beafe..f9f50bff7 100644 --- a/include/asm-m68k/page.h +++ b/include/asm-m68k/page.h @@ -12,6 +12,9 @@ #define STRICT_MM_TYPECHECKS +#define get_user_page(vaddr) __get_free_page(GFP_KERNEL) +#define free_user_page(page, addr) free_page(addr) + /* * We don't need to check for alignment etc. */ diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h index d20bc6144..d49f985bf 100644 --- a/include/asm-m68k/pgtable.h +++ b/include/asm-m68k/pgtable.h @@ -1,9 +1,12 @@ #ifndef _M68K_PGTABLE_H #define _M68K_PGTABLE_H +#include <linux/config.h> #include <asm/setup.h> #ifndef __ASSEMBLY__ +#include <asm/processor.h> +#include <linux/tasks.h> /* * This file contains the functions and defines necessary to modify and use @@ -263,6 +266,7 @@ extern inline void flush_tlb_kernel_page(unsigned long addr) #define PTRS_PER_PTE 1024 #define PTRS_PER_PMD 8 #define PTRS_PER_PGD 128 +#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) /* the no. of pointers that fit on a page: this will go away */ #define PTRS_PER_PAGE (PAGE_SIZE/sizeof(void*)) @@ -279,6 +283,10 @@ typedef pgd_table pgd_tablepage[PGD_TABLES_PER_PAGE]; typedef pmd_table pmd_tablepage[PMD_TABLES_PER_PAGE]; typedef pte_table pte_tablepage[PTE_TABLES_PER_PAGE]; +/* Virtual address region for use by kernel_map() */ +#define KMAP_START 0xd0000000 +#define KMAP_END 0xf0000000 + /* Just any arbitrary offset to the start of the vmalloc VM area: the * current 8MB value just means that there will be a 8MB "hole" after the * physical memory until the kernel virtual memory starts. That means that @@ -289,6 +297,7 @@ typedef pte_table pte_tablepage[PTE_TABLES_PER_PAGE]; #define VMALLOC_OFFSET (8*1024*1024) #define VMALLOC_START (((unsigned long) high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)) #define VMALLOC_VMADDR(x) ((unsigned long)(x)) +#define VMALLOC_END KMAP_START #endif /* __ASSEMBLY__ */ @@ -325,6 +334,16 @@ typedef pte_table pte_tablepage[PTE_TABLES_PER_PAGE]; * and initialized in head.S */ extern int m68k_pgtable_cachemode; +/* This is the cache mode for normal pages, for supervisor access on + * processors >= '040. It is used in pte_mkcache(), and the variable is + * defined and initialized in head.S */ + +#if defined(CONFIG_060_WRITETHROUGH) +extern int m68k_supervisor_cachemode; +#else +#define m68k_supervisor_cachemode _PAGE_CACHE040 +#endif + #if defined(CPU_M68040_OR_M68060_ONLY) #define mm_cachebits _PAGE_CACHE040 #elif defined(CPU_M68020_OR_M68030_ONLY) @@ -492,7 +511,7 @@ extern inline pte_t pte_mknocache(pte_t pte) pte_val(pte) = (pte_val(pte) & _CACHEMASK040) | m68k_pgtable_cachemode; return pte; } -extern inline pte_t pte_mkcache(pte_t pte) { pte_val(pte) = (pte_val(pte) & _CACHEMASK040) | _PAGE_CACHE040; return pte; } +extern inline pte_t pte_mkcache(pte_t pte) { pte_val(pte) = (pte_val(pte) & _CACHEMASK040) | m68k_supervisor_cachemode; return pte; } /* to set the page-dir */ extern inline void SET_PAGE_DIR(struct task_struct * tsk, pgd_t * pgdir) @@ -584,73 +603,137 @@ static inline void cache_page (unsigned long vaddr) } } +extern struct pgtable_cache_struct { + unsigned long *pmd_cache; + unsigned long *pte_cache; +/* This counts in units of pointer tables, of which can be eight per page. */ + unsigned long pgtable_cache_sz; +} quicklists; -extern const char PgtabStr_bad_pmd[]; -extern const char PgtabStr_bad_pgd[]; -extern const char PgtabStr_bad_pmdk[]; -extern const char PgtabStr_bad_pgdk[]; +#define pgd_quicklist ((unsigned long *)0) +#define pmd_quicklist (quicklists.pmd_cache) +#define pte_quicklist (quicklists.pte_cache) +/* This isn't accurate because of fragmentation of allocated pages for + pointer tables, but that should not be a problem. */ +#define pgtable_cache_size ((quicklists.pgtable_cache_sz+7)/8) -extern inline void pte_free(pte_t * pte) +extern pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset); +extern pmd_t *get_pmd_slow(pgd_t *pgd, unsigned long offset); + +extern pmd_t *get_pointer_table(void); +extern int free_pointer_table(pmd_t *); +extern pmd_t *get_kpointer_table(void); +extern void free_kpointer_table(pmd_t *); + +extern __inline__ pte_t *get_pte_fast(void) +{ + unsigned long *ret; + + ret = pte_quicklist; + if (ret) { + pte_quicklist = (unsigned long *)*ret; + ret[0] = ret[1]; + quicklists.pgtable_cache_sz -= 8; + } + return (pte_t *)ret; +} + +extern __inline__ void free_pte_fast(pte_t *pte) +{ + *(unsigned long *)pte = (unsigned long)pte_quicklist; + pte_quicklist = (unsigned long *)pte; + quicklists.pgtable_cache_sz += 8; +} + +extern __inline__ void free_pte_slow(pte_t *pte) { cache_page((unsigned long)pte); free_page((unsigned long) pte); } +extern __inline__ pmd_t *get_pmd_fast(void) +{ + unsigned long *ret; + + ret = pmd_quicklist; + if (ret) { + pmd_quicklist = (unsigned long *)*ret; + ret[0] = ret[1]; + quicklists.pgtable_cache_sz--; + } + return (pmd_t *)ret; +} + +extern __inline__ void free_pmd_fast(pmd_t *pmd) +{ + *(unsigned long *)pmd = (unsigned long)pmd_quicklist; + pmd_quicklist = (unsigned long *) pmd; + quicklists.pgtable_cache_sz++; +} + +extern __inline__ int free_pmd_slow(pmd_t *pmd) +{ + return free_pointer_table(pmd); +} + +/* The pgd cache is folded into the pmd cache, so these are dummy routines. */ +extern __inline__ pgd_t *get_pgd_fast(void) +{ + return (pgd_t *)0; +} + +extern __inline__ void free_pgd_fast(pgd_t *pgd) +{ +} + +extern __inline__ void free_pgd_slow(pgd_t *pgd) +{ +} + +extern void __bad_pte(pmd_t *pmd); +extern void __bad_pmd(pgd_t *pgd); + +extern inline void pte_free(pte_t * pte) +{ + free_pte_fast(pte); +} + extern inline pte_t * pte_alloc(pmd_t * pmd, unsigned long address) { address = (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); if (pmd_none(*pmd)) { - pte_t * page = (pte_t *)__get_free_page(GFP_KERNEL); - 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; - } - pmd_set(pmd, BAD_PAGETABLE); - return NULL; - } - free_page((unsigned long)page); + pte_t * page = get_pte_fast(); + + if (!page) + return get_pte_slow(pmd, address); + pmd_set(pmd,page); + return page + address; } if (pmd_bad(*pmd)) { - printk(PgtabStr_bad_pmd, pmd_val(*pmd)); - pmd_set(pmd, BAD_PAGETABLE); + __bad_pte(pmd); return NULL; } return (pte_t *) pmd_page(*pmd) + address; } -extern pmd_t *get_pointer_table (void); -extern void free_pointer_table (pmd_t *); -extern pmd_t *get_kpointer_table (void); -extern void free_kpointer_table (pmd_t *); - extern inline void pmd_free(pmd_t * pmd) { - free_pointer_table (pmd); + free_pmd_fast(pmd); } extern inline pmd_t * pmd_alloc(pgd_t * pgd, unsigned long address) { address = (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1); if (pgd_none(*pgd)) { - pmd_t *page = get_pointer_table(); - if (pgd_none(*pgd)) { - if (page) { - pgd_set(pgd, page); - return page + address; - } - pgd_set(pgd, (pmd_t *)BAD_PAGETABLE); - return NULL; - } - free_pointer_table(page); + pmd_t *page = get_pmd_fast(); + + if (!page) + return get_pmd_slow(pgd, address); + pgd_set(pgd, page); + return page + address; } if (pgd_bad(*pgd)) { - printk(PgtabStr_bad_pgd, pgd_val(*pgd)); - pgd_set(pgd, (pmd_t *)BAD_PAGETABLE); + __bad_pmd(pgd); return NULL; } return (pmd_t *) pgd_page(*pgd) + address; @@ -658,33 +741,12 @@ extern inline pmd_t * pmd_alloc(pgd_t * pgd, unsigned long address) extern inline void pte_free_kernel(pte_t * pte) { - cache_page((unsigned long)pte); - free_page((unsigned long) pte); + free_pte_fast(pte); } extern inline pte_t * pte_alloc_kernel(pmd_t * pmd, unsigned long address) { - address = (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); - if (pmd_none(*pmd)) { - 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; - } - pmd_set(pmd, BAD_PAGETABLE); - return NULL; - } - free_page((unsigned long) page); - } - if (pmd_bad(*pmd)) { - printk(PgtabStr_bad_pmdk, pmd_val(*pmd)); - pmd_set(pmd, BAD_PAGETABLE); - return NULL; - } - return (pte_t *) pmd_page(*pmd) + address; + return pte_alloc(pmd, address); } extern inline void pmd_free_kernel(pmd_t * pmd) @@ -708,8 +770,7 @@ extern inline pmd_t * pmd_alloc_kernel(pgd_t * pgd, unsigned long address) free_kpointer_table(page); } if (pgd_bad(*pgd)) { - printk(PgtabStr_bad_pgdk, pgd_val(*pgd)); - pgd_set(pgd, (pmd_t *)BAD_PAGETABLE); + __bad_pmd(pgd); return NULL; } return (pmd_t *) pgd_page(*pgd) + address; @@ -717,12 +778,21 @@ extern inline pmd_t * pmd_alloc_kernel(pgd_t * pgd, unsigned long address) extern inline void pgd_free(pgd_t * pgd) { - free_pointer_table ((pmd_t *) pgd); + free_pmd_fast((pmd_t *)pgd); } extern inline pgd_t * pgd_alloc(void) { - return (pgd_t *)get_pointer_table (); + pgd_t *pgd = (pgd_t *)get_pmd_fast(); + if (!pgd) + pgd = (pgd_t *)get_pointer_table(); + return pgd; +} + +extern int do_check_pgt_cache(int, int); + +extern inline void set_pgdir(unsigned long address, pgd_t entry) +{ } /* @@ -782,4 +852,7 @@ extern inline void update_mmu_cache(struct vm_area_struct * vma, #define module_map vmalloc #define module_unmap vfree +/* Needs to be defined here and not in linux/mm.h, as it is arch dependent */ +#define PageSkip(page) (0) + #endif /* _M68K_PGTABLE_H */ diff --git a/include/asm-m68k/posix_types.h b/include/asm-m68k/posix_types.h index 33c423980..460de0b30 100644 --- a/include/asm-m68k/posix_types.h +++ b/include/asm-m68k/posix_types.h @@ -37,6 +37,8 @@ typedef struct { #endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */ } __kernel_fsid_t; +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) + #undef __FD_SET #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) @@ -49,4 +51,6 @@ typedef struct { #undef __FD_ZERO #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp))) +#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */ + #endif diff --git a/include/asm-m68k/processor.h b/include/asm-m68k/processor.h index 6d04e36d0..8246efd95 100644 --- a/include/asm-m68k/processor.h +++ b/include/asm-m68k/processor.h @@ -20,6 +20,7 @@ * space during mmap's. */ #define TASK_UNMAPPED_BASE 0xC0000000UL +#define TASK_UNMAPPED_ALIGN(addr, off) PAGE_ALIGN(addr) /* * Bus types @@ -71,6 +72,9 @@ static inline void release_thread(struct task_struct *dead_task) { } +#define copy_segments(nr, tsk, mm) do { } while (0) +#define release_segments(mm) do { } while (0) + /* * Free current thread data structures etc.. */ @@ -83,12 +87,12 @@ static inline void exit_thread(void) */ extern inline unsigned long thread_saved_pc(struct thread_struct *t) { - extern int sys_pause(void); - extern void schedule(void); + extern void scheduling_functions_start_here(void); + extern void scheduling_functions_end_here(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) + if (sw->retpc > (unsigned long)scheduling_functions_start_here && + sw->retpc < (unsigned long)scheduling_functions_end_here) return ((unsigned long *)sw->a6)[1]; else return sw->retpc; diff --git a/include/asm-m68k/serial.h b/include/asm-m68k/serial.h index bc30f6e56..191c5d551 100644 --- a/include/asm-m68k/serial.h +++ b/include/asm-m68k/serial.h @@ -34,6 +34,8 @@ #define SER_WHIPPET 108 /* Amiga Hisoft Whippet PCMCIA (16c550B) */ #define SER_SCC_MVME 109 /* MVME162/MVME172 ports */ #define SER_SCC_MAC 110 /* Macintosh SCC channel */ +#define SER_HPDCA 111 /* HP DCA serial */ +#define SER_SCC_BVME 112 /* BVME6000 ports */ struct serial_struct { int type; diff --git a/include/asm-m68k/setup.h b/include/asm-m68k/setup.h index 16cd23c12..a3084e04d 100644 --- a/include/asm-m68k/setup.h +++ b/include/asm-m68k/setup.h @@ -38,6 +38,7 @@ #define MACH_MVME147 6 #define MACH_MVME16x 7 #define MACH_BVME6000 8 +#define MACH_HP300 9 #ifdef __KERNEL__ @@ -48,10 +49,10 @@ extern u_long m68k_machtype; #if !defined(CONFIG_AMIGA) # define MACH_IS_AMIGA (0) #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \ - || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) + || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) # define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA) #else -# define MACH_AMIGA_ONLY +# define CONFIG_AMIGA_ONLY # define MACH_IS_AMIGA (1) # define MACH_TYPE (MACH_AMIGA) #endif @@ -59,17 +60,18 @@ extern u_long m68k_machtype; #if !defined(CONFIG_ATARI) # define MACH_IS_ATARI (0) #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \ - || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) + || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) # define MACH_IS_ATARI (m68k_machtype == MACH_ATARI) #else -# define MACH_ATARI_ONLY +# define CONFIG_ATARI_ONLY # define MACH_IS_ATARI (1) # define MACH_TYPE (MACH_ATARI) #endif #if !defined(CONFIG_MAC) # define MACH_IS_MAC (0) -#elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) +#elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \ + || defined(CONFIG_HP300) || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) # define MACH_IS_MAC (m68k_machtype == MACH_MAC) #else # define CONFIG_MAC_ONLY @@ -86,7 +88,7 @@ extern u_long m68k_machtype; #if !defined (CONFIG_APOLLO) # define MACH_IS_APOLLO (0) #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ - || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) + || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) # define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO) #else # define CONFIG_APOLLO_ONLY @@ -97,7 +99,7 @@ extern u_long m68k_machtype; #if !defined (CONFIG_MVME16x) # define MACH_IS_MVME16x (0) #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ - || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) + || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000) || defined(CONFIG_HP300) # define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x) #else # define CONFIG_MVME16x_ONLY @@ -108,7 +110,7 @@ extern u_long m68k_machtype; #if !defined (CONFIG_BVME6000) # define MACH_IS_BVME6000 (0) #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ - || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) + || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) || defined(CONFIG_HP300) # define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000) #else # define CONFIG_BVME6000_ONLY @@ -116,6 +118,16 @@ extern u_long m68k_machtype; # define MACH_TYPE (MACH_BVME6000) #endif +#if !defined (CONFIG_HP300) +# define MACH_IS_HP300 (0) +#elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \ + || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000) +# define MAC_IS_HP300 (m68k_machtype == MACH_HP300) +#else +# define CONFIG_HP300_ONLY +# define MACH_IS_HP300 (1) +# define MACH_TYPE (MACH_HP300) +#endif #ifndef MACH_TYPE # define MACH_TYPE (m68k_machtype) diff --git a/include/asm-m68k/siginfo.h b/include/asm-m68k/siginfo.h index e53589ef9..f6799d2b1 100644 --- a/include/asm-m68k/siginfo.h +++ b/include/asm-m68k/siginfo.h @@ -43,6 +43,7 @@ typedef struct siginfo { /* SIGCHLD */ struct { pid_t _pid; /* which child */ + uid_t _uid; /* sender's uid */ int _status; /* exit code */ clock_t _utime; clock_t _stime; diff --git a/include/asm-m68k/signal.h b/include/asm-m68k/signal.h index 5fa3fa67e..3524a0bf3 100644 --- a/include/asm-m68k/signal.h +++ b/include/asm-m68k/signal.h @@ -72,8 +72,7 @@ typedef unsigned long sigset_t; /* * SA_FLAGS values: * - * SA_ONSTACK is not currently supported, but will allow sigaltstack(2). - * (++roman: SA_ONSTACK is supported on m68k) + * SA_ONSTACK indicates that a registered stack_t will be used. * SA_INTERRUPT is a no-op, but left due to historical reasons. Use the * SA_RESTART flag to get restarting signals (which were the default long ago) * SA_NOCLDSTOP flag to turn off SIGCHLD when children stop. @@ -96,6 +95,15 @@ typedef unsigned long sigset_t; #define SA_ONESHOT SA_RESETHAND #define SA_INTERRUPT 0x20000000 /* dummy -- ignored */ +/* + * sigaltstack controls + */ +#define SS_ONSTACK 1 +#define SS_DISABLE 2 + +#define MINSIGSTKSZ 2048 +#define SIGSTKSZ 8192 + #ifdef __KERNEL__ /* * These values of sa_flags are used only by the kernel as part of the @@ -142,11 +150,18 @@ struct k_sigaction { /* Here we must cater to libcs that poke about in kernel headers. */ struct sigaction { - __sighandler_t sa_handler; + union { + __sighandler_t _sa_handler; + void (*_sa_sigaction)(int, struct siginfo *, void *); + } _u; sigset_t sa_mask; unsigned long sa_flags; void (*sa_restorer)(void); }; + +#define sa_handler _u._sa_handler +#define sa_sigaction _u._sa_sigaction + #endif /* __KERNEL__ */ typedef struct sigaltstack { diff --git a/include/asm-m68k/smp_lock.h b/include/asm-m68k/smp_lock.h deleted file mode 100644 index 6bc9a781b..000000000 --- a/include/asm-m68k/smp_lock.h +++ /dev/null @@ -1,14 +0,0 @@ -#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 diff --git a/include/asm-m68k/smplock.h b/include/asm-m68k/smplock.h new file mode 100644 index 000000000..e62326a10 --- /dev/null +++ b/include/asm-m68k/smplock.h @@ -0,0 +1,49 @@ +/* + * <asm/smplock.h> + * + * Default SMP lock implementation + */ +#include <linux/interrupt.h> +#include <asm/spinlock.h> + +extern spinlock_t kernel_flag; + +/* + * Release global kernel lock and global interrupt lock + */ +#define release_kernel_lock(task, cpu) \ +do { \ + if (task->lock_depth >= 0) \ + spin_unlock(&kernel_flag); \ + release_irqlock(cpu); \ + __sti(); \ +} while (0) + +/* + * Re-acquire the kernel lock + */ +#define reacquire_kernel_lock(task) \ +do { \ + if (task->lock_depth >= 0) \ + spin_lock(&kernel_flag); \ +} while (0) + + +/* + * Getting the big kernel lock. + * + * This cannot happen asynchronously, + * so we only need to worry about other + * CPU's. + */ +extern __inline__ void lock_kernel(void) +{ + if (!++current->lock_depth) + spin_lock(&kernel_flag); +} + +extern __inline__ void unlock_kernel(void) +{ + if (--current->lock_depth < 0) + spin_unlock(&kernel_flag); +} diff --git a/include/asm-m68k/softirq.h b/include/asm-m68k/softirq.h index bed386d44..0798b0d7d 100644 --- a/include/asm-m68k/softirq.h +++ b/include/asm-m68k/softirq.h @@ -61,5 +61,6 @@ extern inline void end_bh_atomic(void) /* These are for the irq's testing the lock */ #define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1)) #define softirq_endlock(cpu) (local_bh_count[cpu] = 0) +#define synchronize_bh() do { } while (0) #endif diff --git a/include/asm-m68k/stat.h b/include/asm-m68k/stat.h index 919520ff1..2e35a9e82 100644 --- a/include/asm-m68k/stat.h +++ b/include/asm-m68k/stat.h @@ -38,4 +38,42 @@ struct stat { unsigned long __unused5; }; +#if 0 +typedef struct { + unsigned int major; + unsigned int minor; +} __new_dev_t; + +struct stat64 { + __new_dev_t st_dev; + __u64 st_ino; + unsigned int st_mode; + unsigned int st_nlink; + unsigned int st_uid; + unsigned int st_gid; + __new_dev_t st_rdev; + __s64 st_size; + __u64 st_blocks; + unsigned long st_atime; + unsigned long __unused1; + unsigned long st_mtime; + unsigned long __unused2; + unsigned long st_ctime; + unsigned long __unused3; + unsigned long st_blksize; + unsigned long __unused4; +}; +#endif + +#define __XSTAT_VER_1 1 +#define __XSTAT_VER_2 2 +#define __XSTAT_VER_MASK 0xff + +#define __XSTAT_VER_XSTAT 0x000 +#define __XSTAT_VER_LXSTAT 0x100 +#define __XSTAT_VER_FXSTAT 0x200 +#define __XSTAT_VER_TYPEMASK 0xff00 + +#define __XMKNOD_VER_1 1 + #endif /* _M68K_STAT_H */ diff --git a/include/asm-m68k/system.h b/include/asm-m68k/system.h index 729f7b34b..cee722633 100644 --- a/include/asm-m68k/system.h +++ b/include/asm-m68k/system.h @@ -60,7 +60,7 @@ asmlinkage void resume(void); struct __xchg_dummy { unsigned long a[100]; }; #define __xg(x) ((volatile struct __xchg_dummy *)(x)) -#if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) && !defined(CONFIG_MAC) && !defined(CONFIG_HADES) +#if defined(CONFIG_ATARI) && !defined(CONFIG_AMIGA) && !defined(CONFIG_MAC) && !defined(CONFIG_HADES) && !defined(CONFIG_VME) && !defined(CONFIG_APOLLO) /* block out HSYNC on the atari */ #define __sti() __asm__ __volatile__ ("andiw #0xfbff,%/sr": : : "memory") #else /* portable version */ diff --git a/include/asm-m68k/termios.h b/include/asm-m68k/termios.h index 43d6707e7..24408872e 100644 --- a/include/asm-m68k/termios.h +++ b/include/asm-m68k/termios.h @@ -55,6 +55,7 @@ struct termio { #define N_AX25 5 #define N_X25 6 /* X.25 async */ #define N_6PACK 7 +#define N_MASC 8 /* Reserved fo Mobitex module <kaz@cafe.net> */ #ifdef __KERNEL__ diff --git a/include/asm-m68k/timex.h b/include/asm-m68k/timex.h new file mode 100644 index 000000000..fe5cff581 --- /dev/null +++ b/include/asm-m68k/timex.h @@ -0,0 +1,15 @@ +/* + * linux/include/asm-m68k/timex.h + * + * m68k architecture timex specifications + */ +#ifndef _ASMm68k_TIMEX_H +#define _ASMm68k_TIMEX_H + +#define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ +#define CLOCK_TICK_FACTOR 20 /* Factor of both 1000000 and CLOCK_TICK_RATE */ +#define FINETUNE ((((((long)LATCH * HZ - CLOCK_TICK_RATE) << SHIFT_HZ) * \ + (1000000/CLOCK_TICK_FACTOR) / (CLOCK_TICK_RATE/CLOCK_TICK_FACTOR)) \ + << (SHIFT_SCALE-SHIFT_HZ)) / HZ) + +#endif diff --git a/include/asm-m68k/uaccess.h b/include/asm-m68k/uaccess.h index 864c49657..64b8be7bd 100644 --- a/include/asm-m68k/uaccess.h +++ b/include/asm-m68k/uaccess.h @@ -200,6 +200,7 @@ __generic_copy_to_user(void *to, const void *from, unsigned long n) "5:\n" ".section .fixup,\"ax\"\n" " .even\n" + "60:addql #1,%2\n" "6: lsll #2,%2\n" " addl %4,%2\n" " jra 5b\n" @@ -210,9 +211,11 @@ __generic_copy_to_user(void *to, const void *from, unsigned long n) ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" + " .long 1b,60b\n" " .long 22b,6b\n" " .long 2b,6b\n" " .long 24b,7b\n" + " .long 3b,60b\n" " .long 4b,7b\n" " .long 25b,8b\n" " .long 5b,8b\n" @@ -458,16 +461,20 @@ __constant_copy_from_user(void *to, const void *from, unsigned long n) "31: movesl %%d0,(%0)+\n" \ "11: subql #1,%2\n" \ " jne 10b\n" \ + "41:\n" \ ".section .fixup,\"ax\"\n" \ " .even\n" \ + "22: addql #1,%2\n" \ "12: lsll #2,%2\n" \ fixup "\n" \ " jra 13f\n" \ ".previous\n" \ ".section __ex_table,\"a\"\n" \ " .align 4\n" \ + " .long 10b,22b\n" \ " .long 31b,12b\n" \ " .long 11b,12b\n" \ + " .long 41b,22b\n" \ ".previous\n" \ copy "\n" \ "13:" \ @@ -803,6 +810,7 @@ clear_user(void *to, unsigned long n) "5:\n" ".section .fixup,\"ax\"\n" " .even\n" + "61:addql #1,%1\n" "6: lsll #2,%1\n" " addl %2,%1\n" " jra 5b\n" @@ -813,8 +821,9 @@ clear_user(void *to, unsigned long n) ".previous\n" ".section __ex_table,\"a\"\n" " .align 4\n" - " .long 1b,6b\n" + " .long 1b,61b\n" " .long 2b,6b\n" + " .long 3b,61b\n" " .long 24b,7b\n" " .long 4b,7b\n" " .long 25b,8b\n" diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h index df55187a6..4ed5d9f34 100644 --- a/include/asm-m68k/unistd.h +++ b/include/asm-m68k/unistd.h @@ -27,7 +27,7 @@ #define __NR_lseek 19 #define __NR_getpid 20 #define __NR_mount 21 -#define __NR_umount 22 +#define __NR_oldumount 22 #define __NR_setuid 23 #define __NR_getuid 24 #define __NR_stime 25 @@ -57,7 +57,7 @@ #define __NR_geteuid 49 #define __NR_getegid 50 #define __NR_acct 51 -#define __NR_phys 52 +#define __NR_umount 52 #define __NR_lock 53 #define __NR_ioctl 54 #define __NR_fcntl 55 @@ -187,6 +187,13 @@ #define __NR_pread 180 #define __NR_pwrite 181 #define __NR_lchown 182 +#define __NR_getcwd 183 +#define __NR_capget 184 +#define __NR_capset 185 +#define __NR_sigaltstack 186 +#define __NR_sendfile 187 +#define __NR_streams1 188 /* some people actually want it */ +#define __NR_streams2 189 /* some people actually want it */ /* user-visible error numbers are in the range -1 - -122: see <asm-m68k/errno.h> */ @@ -326,13 +333,16 @@ static inline _syscall1(int,delete_module,const char *,name) */ static inline pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) { - register long retval __asm__ ("d0") = __NR_clone; - register long clone_arg __asm__ ("d1") = flags | CLONE_VM; + pid_t pid; mm_segment_t fs; fs = get_fs(); set_fs (KERNEL_DS); + { + register long retval __asm__ ("d0"); + register long clone_arg __asm__ ("d1") = flags | CLONE_VM; + __asm__ __volatile__ ("clrl %%d2\n\t" "trap #0\n\t" /* Linux/m68k system call */ @@ -349,9 +359,11 @@ static inline pid_t kernel_thread(int (*fn)(void *), void * arg, unsigned long f : "0" (__NR_clone), "i" (__NR_exit), "r" (arg), "a" (fn), "d" (clone_arg), "r" (current) : "d0", "d2"); + pid = retval; + } set_fs (fs); - return retval; + return pid; } static inline pid_t wait(int * wait_stat) diff --git a/include/asm-m68k/xstat.h b/include/asm-m68k/xstat.h new file mode 100644 index 000000000..a0374fcfd --- /dev/null +++ b/include/asm-m68k/xstat.h @@ -0,0 +1,35 @@ +/* $Id: xstat.h,v 1.1 1998/02/06 12:51:30 jj Exp $ + * xstat.h: sys_xstat/xmknod architecture dependent stuff. + * + * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz) + */ + +extern __inline__ int cp_xstat(struct inode *inode, struct stat64 *s, unsigned long blocks, int blksize) +{ + struct stat64 tmp; + + memset (&tmp, 0, sizeof(tmp)); + tmp.st_dev.major = MAJOR(inode->i_dev); + tmp.st_dev.minor = MINOR(inode->i_dev); + tmp.st_ino = inode->i_ino; + tmp.st_mode = inode->i_mode; + tmp.st_nlink = inode->i_nlink; + tmp.st_uid = inode->i_uid; + tmp.st_gid = inode->i_gid; + tmp.st_rdev.major = MAJOR(inode->i_rdev); + tmp.st_rdev.minor = MINOR(inode->i_rdev); + tmp.st_size = inode->i_size; + tmp.st_blksize = blksize; + tmp.st_blocks = blocks; + tmp.st_atime = inode->i_atime; + tmp.st_mtime = inode->i_mtime; + tmp.st_ctime = inode->i_ctime; + return copy_to_user(s,&tmp,sizeof(tmp)); +} + +extern __inline__ int get_user_new_dev_t(kdev_t *kdev, __new_dev_t *udev) { + __new_dev_t ndev; + if (copy_from_user (&ndev, udev, sizeof(__new_dev_t))) return -EFAULT; + *kdev = MKDEV(ndev.major, ndev.minor); + return 0; +} |