diff options
Diffstat (limited to 'include/asm-ppc')
-rw-r--r-- | include/asm-ppc/hw_irq.h | 21 | ||||
-rw-r--r-- | include/asm-ppc/io.h | 98 | ||||
-rw-r--r-- | include/asm-ppc/irq.h | 56 | ||||
-rw-r--r-- | include/asm-ppc/pci.h | 3 | ||||
-rw-r--r-- | include/asm-ppc/processor.h | 11 | ||||
-rw-r--r-- | include/asm-ppc/system.h | 1 | ||||
-rw-r--r-- | include/asm-ppc/types.h | 9 | ||||
-rw-r--r-- | include/asm-ppc/vga.h | 4 |
8 files changed, 106 insertions, 97 deletions
diff --git a/include/asm-ppc/hw_irq.h b/include/asm-ppc/hw_irq.h index 6a417940b..28a47906c 100644 --- a/include/asm-ppc/hw_irq.h +++ b/include/asm-ppc/hw_irq.h @@ -6,30 +6,13 @@ #ifndef _PPC_HW_IRQ_H #define _PPC_HW_IRQ_H -#if 0 -/* Structure describing interrupts */ -struct hw_interrupt_type { - const char * typename; - void (*startup)(unsigned int irq); - void (*shutdown)(unsigned int irq); - void (*enable)(unsigned int irq); - void (*disable)(unsigned int irq); - void (*mask_and_ack)(unsigned int irq); - int irq_offset; -}; - -struct irqdesc { - struct irqaction *action; - struct hw_interrupt_type *ctl; -}; -#endif - struct int_control_struct { void (*int_cli)(void); void (*int_sti)(void); void (*int_restore_flags)(unsigned long); void (*int_save_flags)(unsigned long *); + void (*int_set_lost)(unsigned long); }; extern struct int_control_struct int_control; extern unsigned long timer_interrupt_intercept; @@ -40,12 +23,14 @@ extern void __no_use_sti(void); extern void __no_use_cli(void); extern void __no_use_restore_flags(unsigned long); extern void __no_use_save_flags(unsigned long *); +extern void __no_use_set_lost(unsigned long); #define __cli() int_control.int_cli() #define __sti() int_control.int_sti() #define __save_flags(flags) int_control.int_save_flags(&flags) #define __restore_flags(flags) int_control.int_restore_flags(flags) #define __save_and_cli(flags) ({__save_flags(flags);__cli();}) +#define __set_lost(irq) ({ if ((ulong)int_control.int_set_lost) int_control.int_set_lost(irq); }) extern void do_lost_interrupts(unsigned long); extern atomic_t ppc_n_lost_interrupts; diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index 21e4930de..7bb3d901d 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h @@ -38,73 +38,73 @@ extern unsigned long pci_dram_offset; #endif /* CONFIG_APUS */ #endif -#define readb(addr) in_8((volatile unsigned char *)(addr)) -#define writeb(b,addr) out_8((volatile unsigned char *)(addr), (b)) +#define readb(addr) in_8((volatile u8 *)(addr)) +#define writeb(b,addr) out_8((volatile u8 *)(addr), (b)) #if defined(CONFIG_APUS) -#define readw(addr) (*(volatile unsigned short *) (addr)) -#define readl(addr) (*(volatile unsigned int *) (addr)) -#define writew(b,addr) ((*(volatile unsigned short *) (addr)) = (b)) -#define writel(b,addr) ((*(volatile unsigned int *) (addr)) = (b)) +#define readw(addr) (*(volatile u16 *) (addr)) +#define readl(addr) (*(volatile u32 *) (addr)) +#define writew(b,addr) ((*(volatile u16 *) (addr)) = (b)) +#define writel(b,addr) ((*(volatile u32 *) (addr)) = (b)) #else -#define readw(addr) in_le16((volatile unsigned short *)(addr)) -#define readl(addr) in_le32((volatile unsigned *)(addr)) -#define writew(b,addr) out_le16((volatile unsigned short *)(addr),(b)) -#define writel(b,addr) out_le32((volatile unsigned *)(addr),(b)) +#define readw(addr) in_le16((volatile u16 *)(addr)) +#define readl(addr) in_le32((volatile u32 *)(addr)) +#define writew(b,addr) out_le16((volatile u16 *)(addr),(b)) +#define writel(b,addr) out_le32((volatile u32 *)(addr),(b)) #endif -#define insb(port, buf, ns) _insb((unsigned char *)((port)+_IO_BASE), (buf), (ns)) -#define outsb(port, buf, ns) _outsb((unsigned char *)((port)+_IO_BASE), (buf), (ns)) -#define insw(port, buf, ns) _insw((unsigned short *)((port)+_IO_BASE), (buf), (ns)) -#define outsw(port, buf, ns) _outsw((unsigned short *)((port)+_IO_BASE), (buf), (ns)) -#define insl(port, buf, nl) _insl((unsigned long *)((port)+_IO_BASE), (buf), (nl)) -#define outsl(port, buf, nl) _outsl((unsigned long *)((port)+_IO_BASE), (buf), (nl)) +#define insb(port, buf, ns) _insb((u8 *)((port)+_IO_BASE), (buf), (ns)) +#define outsb(port, buf, ns) _outsb((u8 *)((port)+_IO_BASE), (buf), (ns)) +#define insw(port, buf, ns) _insw((u16 *)((port)+_IO_BASE), (buf), (ns)) +#define outsw(port, buf, ns) _outsw((u16 *)((port)+_IO_BASE), (buf), (ns)) +#define insl(port, buf, nl) _insl((u32 *)((port)+_IO_BASE), (buf), (nl)) +#define outsl(port, buf, nl) _outsl((u32 *)((port)+_IO_BASE), (buf), (nl)) -#define inb(port) in_8((unsigned char *)((port)+_IO_BASE)) -#define outb(val, port) out_8((unsigned char *)((port)+_IO_BASE), (val)) +#define inb(port) in_8((u8 *)((port)+_IO_BASE)) +#define outb(val, port) out_8((u8 *)((port)+_IO_BASE), (val)) #if defined(CONFIG_APUS) -#define inw(port) in_be16((unsigned short *)((port)+_IO_BASE)) -#define outw(val, port) out_be16((unsigned short *)((port)+_IO_BASE), (val)) -#define inl(port) in_be32((unsigned *)((port)+_IO_BASE)) -#define outl(val, port) out_be32((unsigned *)((port)+_IO_BASE), (val)) +#define inw(port) in_be16((u16 *)((port)+_IO_BASE)) +#define outw(val, port) out_be16((u16 *)((port)+_IO_BASE), (val)) +#define inl(port) in_be32((u32 *)((port)+_IO_BASE)) +#define outl(val, port) out_be32((u32 *)((port)+_IO_BASE), (val)) #else -#define inw(port) in_le16((unsigned short *)((port)+_IO_BASE)) -#define outw(val, port) out_le16((unsigned short *)((port)+_IO_BASE), (val)) -#define inl(port) in_le32((unsigned *)((port)+_IO_BASE)) -#define outl(val, port) out_le32((unsigned *)((port)+_IO_BASE), (val)) +#define inw(port) in_le16((u16 *)((port)+_IO_BASE)) +#define outw(val, port) out_le16((u16 *)((port)+_IO_BASE), (val)) +#define inl(port) in_le32((u32 *)((port)+_IO_BASE)) +#define outl(val, port) out_le32((u32 *)((port)+_IO_BASE), (val)) #endif -#define inb_p(port) in_8((unsigned char *)((port)+_IO_BASE)) -#define outb_p(val, port) out_8((unsigned char *)((port)+_IO_BASE), (val)) -#define inw_p(port) in_le16((unsigned short *)((port)+_IO_BASE)) -#define outw_p(val, port) out_le16((unsigned short *)((port)+_IO_BASE), (val)) -#define inl_p(port) in_le32((unsigned *)((port)+_IO_BASE)) -#define outl_p(val, port) out_le32((unsigned *)((port)+_IO_BASE), (val)) +#define inb_p(port) in_8((u8 *)((port)+_IO_BASE)) +#define outb_p(val, port) out_8((u8 *)((port)+_IO_BASE), (val)) +#define inw_p(port) in_le16((u16 *)((port)+_IO_BASE)) +#define outw_p(val, port) out_le16((u16 *)((port)+_IO_BASE), (val)) +#define inl_p(port) in_le32((u32 *)((port)+_IO_BASE)) +#define outl_p(val, port) out_le32((u32 *)((port)+_IO_BASE), (val)) -extern void _insb(volatile unsigned char *port, void *buf, int ns); -extern void _outsb(volatile unsigned char *port, const void *buf, int ns); -extern void _insw(volatile unsigned short *port, void *buf, int ns); -extern void _outsw(volatile unsigned short *port, const void *buf, int ns); -extern void _insl(volatile unsigned long *port, void *buf, int nl); -extern void _outsl(volatile unsigned long *port, const void *buf, int nl); +extern void _insb(volatile u8 *port, void *buf, int ns); +extern void _outsb(volatile u8 *port, const void *buf, int ns); +extern void _insw(volatile u16 *port, void *buf, int ns); +extern void _outsw(volatile u16 *port, const void *buf, int ns); +extern void _insl(volatile u32 *port, void *buf, int nl); +extern void _outsl(volatile u32 *port, const void *buf, int nl); /* * The *_ns versions below don't do byte-swapping. */ -#define insw_ns(port, buf, ns) _insw_ns((unsigned short *)((port)+_IO_BASE), (buf), (ns)) -#define outsw_ns(port, buf, ns) _outsw_ns((unsigned short *)((port)+_IO_BASE), (buf), (ns)) -#define insl_ns(port, buf, nl) _insl_ns((unsigned long *)((port)+_IO_BASE), (buf), (nl)) -#define outsl_ns(port, buf, nl) _outsl_ns((unsigned long *)((port)+_IO_BASE), (buf), (nl)) +#define insw_ns(port, buf, ns) _insw_ns((u16 *)((port)+_IO_BASE), (buf), (ns)) +#define outsw_ns(port, buf, ns) _outsw_ns((u16 *)((port)+_IO_BASE), (buf), (ns)) +#define insl_ns(port, buf, nl) _insl_ns((u32 *)((port)+_IO_BASE), (buf), (nl)) +#define outsl_ns(port, buf, nl) _outsl_ns((u32 *)((port)+_IO_BASE), (buf), (nl)) -extern void _insw_ns(volatile unsigned short *port, void *buf, int ns); -extern void _outsw_ns(volatile unsigned short *port, const void *buf, int ns); -extern void _insl_ns(volatile unsigned long *port, void *buf, int nl); -extern void _outsl_ns(volatile unsigned long *port, const void *buf, int nl); +extern void _insw_ns(volatile u16 *port, void *buf, int ns); +extern void _outsw_ns(volatile u16 *port, const void *buf, int ns); +extern void _insl_ns(volatile u32 *port, void *buf, int nl); +extern void _outsl_ns(volatile u32 *port, const void *buf, int nl); #define IO_SPACE_LIMIT ~0 -#define memset_io(a,b,c) memset((a),(b),(c)) -#define memcpy_fromio(a,b,c) memcpy((a),(b),(c)) -#define memcpy_toio(a,b,c) memcpy((a),(b),(c)) +#define memset_io(a,b,c) memset((void *)(a),(b),(c)) +#define memcpy_fromio(a,b,c) memcpy((a),(void *)(b),(c)) +#define memcpy_toio(a,b,c) memcpy((void *)(a),(b),(c)) #ifdef __KERNEL__ /* diff --git a/include/asm-ppc/irq.h b/include/asm-ppc/irq.h index 009229882..867dd0bab 100644 --- a/include/asm-ppc/irq.h +++ b/include/asm-ppc/irq.h @@ -117,15 +117,48 @@ static __inline__ int irq_cannonicalize(int irq) return irq; } -#else +#else /* CONFIG_4xx + CONFIG_8xx */ -#ifdef CONFIG_APUS -#define enable_irq m68k_enable_irq -#define disable_irq m68k_disable_irq -#include <asm-m68k/irq.h> -#undef enable_irq -#undef disable_irq -#else /* CONFIG_APUS */ +#if defined(CONFIG_APUS) +/* + * This structure is used to chain together the ISRs for a particular + * interrupt source (if it supports chaining). + */ +typedef struct irq_node { + void (*handler)(int, void *, struct pt_regs *); + unsigned long flags; + void *dev_id; + const char *devname; + struct irq_node *next; +} irq_node_t; + +/* + * This structure has only 4 elements for speed reasons + */ +typedef struct irq_handler { + void (*handler)(int, void *, struct pt_regs *); + unsigned long flags; + void *dev_id; + const char *devname; +} irq_handler_t; + +/* count of spurious interrupts */ +extern volatile unsigned int num_spurious; + +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 *); + +/* + * This function returns a new irq_node_t + */ +extern irq_node_t *new_irq_node(void); + +/* Number of m68k interrupts */ +#define SYS_IRQS 8 + +#endif /* CONFIG_APUS */ /* * this is the # irq's for all ppc arch's (pmac/chrp/prep) @@ -133,14 +166,11 @@ static __inline__ int irq_cannonicalize(int irq) */ #define NR_IRQS 256 -#endif /* CONFIG_APUS */ - #define NUM_8259_INTERRUPTS 16 #define IRQ_8259_CASCADE 16 #define openpic_to_irq(n) ((n)+NUM_8259_INTERRUPTS) #define irq_to_openpic(n) ((n)-NUM_8259_INTERRUPTS) -#ifndef CONFIG_APUS /* * This gets called from serial.c, which is now used on * powermacs as well as prep/chrp boxes. @@ -157,8 +187,10 @@ static __inline__ int irq_cannonicalize(int irq) return irq; } } -#endif /* !CONFIG_APUS */ #endif +#define NR_MASK_WORDS ((NR_IRQS + 31) / 32) +extern unsigned int ppc_lost_interrupts[NR_MASK_WORDS]; + #endif /* _ASM_IRQ_H */ diff --git a/include/asm-ppc/pci.h b/include/asm-ppc/pci.h index 5d022e02c..d543c90cc 100644 --- a/include/asm-ppc/pci.h +++ b/include/asm-ppc/pci.h @@ -62,7 +62,8 @@ extern inline void pci_dma_sync_single(struct pci_dev *hwdev, BUG(); /* nothing to do */ } -extern inline void pci_dma_syng_sg(struct pci_dev *hwdev, + +extern inline void pci_dma_sync_sg(struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) { diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index 704bd68ab..5212c5b71 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -692,16 +692,7 @@ void _nmask_and_or_msr(unsigned long nmask, unsigned long or_val); #endif /* ndef ASSEMBLY*/ #ifdef CONFIG_MACH_SPECIFIC -#if defined(CONFIG_PREP) -#define _machine _MACH_prep -#define have_of 0 -#elif defined(CONFIG_CHRP) -#define _machine _MACH_chrp -#define have_of 1 -#elif defined(CONFIG_PMAC) -#define _machine _MACH_Pmac -#define have_of 1 -#elif defined(CONFIG_8xx) +#if defined(CONFIG_8xx) #define _machine _MACH_8xx #define have_of 0 #elif defined(CONFIG_OAK) diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index d567a9975..cd4d055bb 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h @@ -66,6 +66,7 @@ extern void load_up_altivec(struct task_struct *); extern void cvt_fd(float *from, double *to, unsigned long *fpscr); extern void cvt_df(double *from, float *to, unsigned long *fpscr); extern int call_rtas(const char *, int, int, unsigned long *, ...); +extern int abs(int); struct device_node; extern void note_scsi_host(struct device_node *, void *); diff --git a/include/asm-ppc/types.h b/include/asm-ppc/types.h index d39f91cf9..4cbcd7850 100644 --- a/include/asm-ppc/types.h +++ b/include/asm-ppc/types.h @@ -26,8 +26,6 @@ typedef unsigned long long __u64; /* * These aren't exported outside the kernel to avoid name space clashes */ -#ifdef __KERNEL__ - typedef signed char s8; typedef unsigned char u8; @@ -40,14 +38,15 @@ typedef unsigned int u32; typedef signed long long s64; typedef unsigned long long u64; -#define BITS_PER_LONG 32 - typedef struct { u32 u[4]; } __attribute((aligned(16))) vector128; -/* DMA addresses are 32-bits wide */ +#ifdef __KERNEL__ + +#define BITS_PER_LONG 32 +/* DMA addresses are 32-bits wide */ typedef u32 dma_addr_t; #endif /* __KERNEL__ */ diff --git a/include/asm-ppc/vga.h b/include/asm-ppc/vga.h index e6a7f9a53..d7ead205f 100644 --- a/include/asm-ppc/vga.h +++ b/include/asm-ppc/vga.h @@ -23,12 +23,12 @@ extern inline void scr_writew(u16 val, u16 *addr) { - writew(val, (unsigned long)addr); + st_le16(addr, val); } extern inline u16 scr_readw(const u16 *addr) { - return readw((unsigned long)addr); + return ld_le16(addr); } #define VT_BUF_HAVE_MEMCPYW |