From 482368b1a8e45430672c58c9a42e7d2004367126 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 24 Feb 2000 00:12:35 +0000 Subject: Merge with 2.3.47. Guys, this is buggy as shit. You've been warned. --- include/asm-m68k/adb_iop.h | 44 ++++++++++++++++++++++++++++++++++++++ include/asm-m68k/hardirq.h | 2 ++ include/asm-m68k/irq.h | 2 +- include/asm-m68k/mac_baboon.h | 34 ++++++++++++++++++++++++++++++ include/asm-m68k/macintosh.h | 1 + include/asm-m68k/macints.h | 13 +++++++++--- include/asm-m68k/page.h | 14 +++++++++++++ include/asm-m68k/pgtable.h | 4 +++- include/asm-m68k/softirq.h | 49 +------------------------------------------ 9 files changed, 110 insertions(+), 53 deletions(-) create mode 100644 include/asm-m68k/adb_iop.h create mode 100644 include/asm-m68k/mac_baboon.h (limited to 'include/asm-m68k') diff --git a/include/asm-m68k/adb_iop.h b/include/asm-m68k/adb_iop.h new file mode 100644 index 000000000..8a48e56f2 --- /dev/null +++ b/include/asm-m68k/adb_iop.h @@ -0,0 +1,44 @@ +/* + * ADB through the IOP + * Written by Joshua M. Thompson + */ + +/* IOP number and channel number for ADB */ + +#define ADB_IOP IOP_NUM_ISM +#define ADB_CHAN 2 + +/* From the A/UX headers...maybe important, maybe not */ + +#define ADB_IOP_LISTEN 0x01 +#define ADB_IOP_TALK 0x02 +#define ADB_IOP_EXISTS 0x04 +#define ADB_IOP_FLUSH 0x08 +#define ADB_IOP_RESET 0x10 +#define ADB_IOP_INT 0x20 +#define ADB_IOP_POLL 0x40 +#define ADB_IOP_UNINT 0x80 + +#define AIF_RESET 0x00 +#define AIF_FLUSH 0x01 +#define AIF_LISTEN 0x08 +#define AIF_TALK 0x0C + +/* Flag bits in struct adb_iopmsg */ + +#define ADB_IOP_EXPLICIT 0x80 /* nonzero if explicit command */ +#define ADB_IOP_AUTOPOLL 0x40 /* auto/SRQ polling enabled */ +#define ADB_IOP_SRQ 0x04 /* SRQ detected */ +#define ADB_IOP_TIMEOUT 0x02 /* nonzero if timeout */ + +#ifndef __ASSEMBLY__ + +struct adb_iopmsg { + __u8 flags; /* ADB flags */ + __u8 count; /* no. of data bytes */ + __u8 cmd; /* ADB command */ + __u8 data[8]; /* ADB data */ + __u8 spare[21]; /* spare */ +}; + +#endif /* __ASSEMBLY__ */ diff --git a/include/asm-m68k/hardirq.h b/include/asm-m68k/hardirq.h index 0e3cd0c6f..aac7e8597 100644 --- a/include/asm-m68k/hardirq.h +++ b/include/asm-m68k/hardirq.h @@ -7,6 +7,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 in_irq() (local_irq_count[smp_processor_id()] != 0) + #define hardirq_trylock(cpu) (local_irq_count[cpu] == 0) #define hardirq_endlock(cpu) do { } while (0) diff --git a/include/asm-m68k/irq.h b/include/asm-m68k/irq.h index 0a62d30ef..be2dfbd61 100644 --- a/include/asm-m68k/irq.h +++ b/include/asm-m68k/irq.h @@ -15,7 +15,7 @@ * Currently the Atari has 72 and the Amiga 24, but if both are * supported in the kernel it is better to make room for 72. */ -#if defined(CONFIG_ATARI) +#if defined(CONFIG_ATARI) || defined(CONFIG_MAC) #define NR_IRQS (72+SYS_IRQS) #else #define NR_IRQS (24+SYS_IRQS) diff --git a/include/asm-m68k/mac_baboon.h b/include/asm-m68k/mac_baboon.h new file mode 100644 index 000000000..e87850830 --- /dev/null +++ b/include/asm-m68k/mac_baboon.h @@ -0,0 +1,34 @@ +/* + * Definitions for the "Baboon" custom IC on the PowerBook 190. + */ + +#define BABOON_BASE (0x50F1A000) /* same as IDE controller base */ + +#ifndef __ASSEMBLY__ + +struct baboon { + char pad1[208]; /* generic IDE registers, not used here */ + short mb_control; /* Control register: + * bit 5 : slot 2 power control + * bit 6 : slot 1 power control + */ + char pad2[2]; + short mb_status; /* (0xD4) media bay status register: + * + * bit 0: ???? + * bit 1: IDE interrupt active? + * bit 2: bay status, 0 = full, 1 = empty + * bit 3: ???? + */ + char pad3[2]; /* (0xD6) not used */ + short mb_ifr; /* (0xD8) media bay interrupt flags register: + * + * bit 0: ???? + * bit 1: IDE controller interrupt + * bit 2: media bay status change interrupt + */ +}; + +extern volatile struct baboon *baboon; + +#endif /* __ASSEMBLY **/ diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h index 40905e74d..e71462a8b 100644 --- a/include/asm-m68k/macintosh.h +++ b/include/asm-m68k/macintosh.h @@ -74,6 +74,7 @@ struct mac_model #define MAC_IDE_NONE 0 #define MAC_IDE_QUADRA 1 #define MAC_IDE_PB 2 +#define MAC_IDE_BABOON 3 #define MAC_SCC_II 1 #define MAC_SCC_QUADRA 2 diff --git a/include/asm-m68k/macints.h b/include/asm-m68k/macints.h index 1014df89d..f60ffdc8b 100644 --- a/include/asm-m68k/macints.h +++ b/include/asm-m68k/macints.h @@ -43,13 +43,14 @@ #define PSC5_SOURCE_BASE 40 #define PSC6_SOURCE_BASE 48 #define NUBUS_SOURCE_BASE 56 +#define BABOON_SOURCE_BASE 64 /* - * Maximum IRQ number is NUBUS_SOURCE_BASE + 7, - * giving us IRQs up through 63. + * Maximum IRQ number is BABOON_SOURCE_BASE + 7, + * giving us IRQs up through 71 */ -#define NUM_MAC_SOURCES 64 +#define NUM_MAC_SOURCES 72 /* * clean way to separate IRQ into its source and index @@ -150,6 +151,12 @@ #define IRQ_NUBUS_E (61) #define IRQ_NUBUS_F (62) +/* Baboon interrupts (cascaded to nubus slot $C) */ +#define IRQ_BABOON_0 (64) +#define IRQ_BABOON_1 (65) +#define IRQ_BABOON_2 (66) +#define IRQ_BABOON_3 (67) + #define SLOT2IRQ(x) (x + 47) #define IRQ2SLOT(x) (x - 47) diff --git a/include/asm-m68k/page.h b/include/asm-m68k/page.h index 23dd731c8..117abf25d 100644 --- a/include/asm-m68k/page.h +++ b/include/asm-m68k/page.h @@ -97,6 +97,20 @@ typedef struct { unsigned long pgprot; } pgprot_t; /* to align the pointer to the (next) page boundary */ #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK) +/* Pure 2^n version of get_order */ +extern __inline__ int get_order(unsigned long size) +{ + int order; + + size = (size-1) >> (PAGE_SHIFT-1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + return order; +} + #endif /* !__ASSEMBLY__ */ #include diff --git a/include/asm-m68k/pgtable.h b/include/asm-m68k/pgtable.h index 9df773f9f..a92c28b12 100644 --- a/include/asm-m68k/pgtable.h +++ b/include/asm-m68k/pgtable.h @@ -285,10 +285,12 @@ extern inline pte_t pte_mkcache(pte_t pte) { pte_val(pte) = (pte_val(pte) & _CAC #define PAGE_DIR_OFFSET(tsk,address) pgd_offset((tsk),(address)) +#define pgd_index(address) ((address) >> PGDIR_SHIFT) + /* to find an entry in a page-table-directory */ extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address) { - return mm->pgd + (address >> PGDIR_SHIFT); + return mm->pgd + pgd_index(address); } #define swapper_pg_dir kernel_pg_dir diff --git a/include/asm-m68k/softirq.h b/include/asm-m68k/softirq.h index f27b11256..a51563cd7 100644 --- a/include/asm-m68k/softirq.h +++ b/include/asm-m68k/softirq.h @@ -7,59 +7,12 @@ #include -#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; - atomic_set(&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); - atomic_inc(&bh_mask_count[nr]); -} - -extern inline void enable_bh(int nr) -{ - if (atomic_dec_and_test(&bh_mask_count[nr])) - bh_mask |= 1 << nr; -} - -extern inline void remove_bh(int nr) -{ - bh_base[nr] = NULL; - bh_mask &= ~(1 << nr); -} - extern unsigned int local_bh_count[NR_CPUS]; #define local_bh_disable() (local_bh_count[smp_processor_id()]++) #define local_bh_enable() (local_bh_count[smp_processor_id()]--) -extern inline void start_bh_atomic(void) -{ - local_bh_count[smp_processor_id()]++; - barrier(); -} - -extern inline void end_bh_atomic(void) -{ - barrier(); - local_bh_count[smp_processor_id()]--; -} +#define in_softirq() (local_bh_count != 0) /* These are for the irq's testing the lock */ #define softirq_trylock(cpu) (local_bh_count[cpu] ? 0 : (local_bh_count[cpu]=1)) -- cgit v1.2.3