diff options
Diffstat (limited to 'include/asm-ppc')
-rw-r--r-- | include/asm-ppc/adb_mouse.h | 2 | ||||
-rw-r--r-- | include/asm-ppc/ide.h | 66 | ||||
-rw-r--r-- | include/asm-ppc/io.h | 7 | ||||
-rw-r--r-- | include/asm-ppc/mmu.h | 19 | ||||
-rw-r--r-- | include/asm-ppc/pgtable.h | 5 | ||||
-rw-r--r-- | include/asm-ppc/processor.h | 10 | ||||
-rw-r--r-- | include/asm-ppc/ptrace.h | 35 | ||||
-rw-r--r-- | include/asm-ppc/semaphore.h | 65 | ||||
-rw-r--r-- | include/asm-ppc/system.h | 6 |
9 files changed, 163 insertions, 52 deletions
diff --git a/include/asm-ppc/adb_mouse.h b/include/asm-ppc/adb_mouse.h index 879178043..3da07c813 100644 --- a/include/asm-ppc/adb_mouse.h +++ b/include/asm-ppc/adb_mouse.h @@ -16,7 +16,7 @@ struct mouse_status { short dy; int ready; int active; - struct wait_queue *wait; + wait_queue_head_t wait; struct fasync_struct *fasyncptr; }; diff --git a/include/asm-ppc/ide.h b/include/asm-ppc/ide.h index c53267b77..39d48b6d1 100644 --- a/include/asm-ppc/ide.h +++ b/include/asm-ppc/ide.h @@ -18,7 +18,7 @@ #define MAX_HWIFS 4 #endif -typedef unsigned int ide_ioreg_t; +#include <asm/hdreg.h> #ifdef __KERNEL__ @@ -49,16 +49,17 @@ struct ide_machdep_calls { void (*release_region)(ide_ioreg_t from, unsigned int extent); void (*fix_driveid)(struct hd_driveid *id); - void (*ide_init_hwif)(ide_ioreg_t *p, - ide_ioreg_t base, - int *irq); + void (*ide_init_hwif)(hw_regs_t *hw, + ide_ioreg_t data_port, + ide_ioreg_t ctrl_port, + int *irq); int io_base; }; extern struct ide_machdep_calls ppc_ide_md; -void ide_init_hwif_ports(ide_ioreg_t *p, ide_ioreg_t base, int *irq); +void ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq); void ide_insw(ide_ioreg_t port, void *buf, int ns); void ide_outsw(ide_ioreg_t port, void *buf, int ns); void ppc_generic_ide_fix_driveid(struct hd_driveid *id); @@ -82,31 +83,58 @@ void ppc_generic_ide_fix_driveid(struct hd_driveid *id); static __inline__ int ide_default_irq(ide_ioreg_t base) { - return ppc_ide_md.default_irq(base); + if ( ppc_ide_md.default_irq ) + return ppc_ide_md.default_irq(base); + else + return -1; } static __inline__ ide_ioreg_t ide_default_io_base(int index) { - return ppc_ide_md.default_io_base(index); + if ( ppc_ide_md.default_io_base ) + return ppc_ide_md.default_io_base(index); + else + return -1; +} + +static __inline__ void ide_init_default_hwifs(void) +{ +#ifdef __DO_I_NEED_THIS + hw_regs_t hw; + int index; + + for(index = 0; index < MAX_HWIFS; index++) { + ide_init_hwif_ports(&hw, ide_default_io_base(index), 0, NULL); + hw.irq = ide_default_irq(ide_default_io_base(index)); + ide_register_hw(&hw, NULL); + } +#endif /* __DO_I_NEED_THIS */ } static __inline__ int ide_check_region (ide_ioreg_t from, unsigned int extent) { - return ppc_ide_md.check_region(from, extent); + if ( ppc_ide_md.check_region ) + return ppc_ide_md.check_region(from, extent); + else + return -1; } static __inline__ void ide_request_region (ide_ioreg_t from, unsigned int extent, const char *name) { - ppc_ide_md.request_region(from, extent, name); + if ( ppc_ide_md.request_region ) + ppc_ide_md.request_region(from, extent, name); } static __inline__ void ide_release_region (ide_ioreg_t from, unsigned int extent) { - ppc_ide_md.release_region(from, extent); + if ( ppc_ide_md.release_region ) + ppc_ide_md.release_region(from, extent); } -static __inline__ void ide_fix_driveid (struct hd_driveid *id) { - ppc_ide_md.fix_driveid(id); +static __inline__ void ide_fix_driveid (struct hd_driveid *id) +{ + if ( ppc_ide_md.fix_driveid ) + ppc_ide_md.fix_driveid(id); } #undef inb @@ -131,21 +159,13 @@ typedef union { } b; } select_t; -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) -{ - return request_irq(irq, handler, flags, device, dev_id); -} - -static __inline__ void ide_free_irq(unsigned int irq, void *dev_id) -{ - free_irq(irq, dev_id); -} +#define ide_request_irq(irq,hand,flg,dev,id) request_irq((irq),(hand),(flg),(dev),(id)) +#define ide_free_irq(irq,dev_id) free_irq((irq), (dev_id)) /* * The following are not needed for the non-m68k ports */ -#define ide_ack_intr(base, irq) (1) +#define ide_ack_intr(hwif) (1) #define ide_release_lock(lock) do {} while (0) #define ide_get_lock(lock, hdlr, data) do {} while (0) diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index 92ac97729..bd8a7d16c 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h @@ -277,6 +277,13 @@ static inline int check_signature(unsigned long io_addr, out: return retval; } + +/* Nothing to do */ + +#define dma_cache_inv(_start,_size) do { } while (0) +#define dma_cache_wback(_start,_size) do { } while (0) +#define dma_cache_wback_inv(_start,_size) do { } while (0) + #endif /* __KERNEL__ */ #endif diff --git a/include/asm-ppc/mmu.h b/include/asm-ppc/mmu.h index f77ef3df4..81dadd22a 100644 --- a/include/asm-ppc/mmu.h +++ b/include/asm-ppc/mmu.h @@ -5,14 +5,25 @@ #ifndef _PPC_MMU_H_ #define _PPC_MMU_H_ +#include <linux/config.h> + #ifndef __ASSEMBLY__ /* Hardware Page Table Entry */ typedef struct _PTE { +#ifdef CONFIG_PPC64 + unsigned long long vsid:52; + unsigned long api:5; + unsigned long :5; + unsigned long h:1; + unsigned long v:1; + unsigned long long rpn:52; +#else /* CONFIG_PPC64 */ unsigned long v:1; /* Entry is valid */ unsigned long vsid:24; /* Virtual segment identifier */ unsigned long h:1; /* Hash algorithm indicator */ unsigned long api:6; /* Abbreviated page index */ unsigned long rpn:20; /* Real (physical) page number */ +#endif /* CONFIG_PPC64 */ unsigned long :3; /* Unused */ unsigned long r:1; /* Referenced */ unsigned long c:1; /* Changed */ @@ -53,7 +64,11 @@ typedef struct _P601_BATU { /* Upper part of BAT for 601 processor */ } P601_BATU; typedef struct _BATU { /* Upper part of BAT (all except 601) */ +#ifdef CONFIG_PPC64 + unsigned long long bepi:47; +#else /* CONFIG_PPC64 */ unsigned long bepi:15; /* Effective page index (virtual address) */ +#endif /* CONFIG_PPC64 */ unsigned long :4; /* Unused */ unsigned long bl:11; /* Block size mask */ unsigned long vs:1; /* Supervisor valid */ @@ -68,7 +83,11 @@ typedef struct _P601_BATL { /* Lower part of BAT for 601 processor */ } P601_BATL; typedef struct _BATL { /* Lower part of BAT (all except 601) */ +#ifdef CONFIG_PPC64 + unsigned long long brpn:47; +#else /* CONFIG_PPC64 */ unsigned long brpn:15; /* Real page index (physical address) */ +#endif /* CONFIG_PPC64 */ unsigned long :10; /* Unused */ unsigned long w:1; /* Write-thru cache */ unsigned long i:1; /* Cache inhibit */ diff --git a/include/asm-ppc/pgtable.h b/include/asm-ppc/pgtable.h index 2c481490e..10f1f0efc 100644 --- a/include/asm-ppc/pgtable.h +++ b/include/asm-ppc/pgtable.h @@ -20,6 +20,11 @@ extern void local_flush_tlb_range(struct mm_struct *mm, unsigned long start, #define flush_tlb_page local_flush_tlb_page #define flush_tlb_range local_flush_tlb_range +extern __inline__ void flush_tlb_pgtables(struct mm_struct *mm, unsigned long start, unsigned long end) +{ + /* PPC has hw page tables. */ +} + /* * No cache flushing is required when address mappings are * changed, because the caches on PowerPCs are physically diff --git a/include/asm-ppc/processor.h b/include/asm-ppc/processor.h index d3cca8a28..d46d46c3f 100644 --- a/include/asm-ppc/processor.h +++ b/include/asm-ppc/processor.h @@ -1,12 +1,22 @@ #ifndef __ASM_PPC_PROCESSOR_H #define __ASM_PPC_PROCESSOR_H +/* + * Default implementation of macro that returns current + * instruction pointer ("program counter"). + */ +#define current_text_addr() ({ __label__ _l; _l: &&_l;}) + #include <linux/config.h> #include <asm/ptrace.h> #include <asm/residual.h> /* Bit encodings for Machine State Register (MSR) */ +#ifdef CONFIG_PPC64 +#define MSR_SF (1<<63) +#define MSR_ISF (1<<61) +#endif /* CONFIG_PPC64 */ #define MSR_POW (1<<18) /* Enable Power Management */ #define MSR_TGPR (1<<17) /* TLB Update registers in use */ #define MSR_ILE (1<<16) /* Interrupt Little-Endian enable */ diff --git a/include/asm-ppc/ptrace.h b/include/asm-ppc/ptrace.h index 6909d7c3a..7ec33806a 100644 --- a/include/asm-ppc/ptrace.h +++ b/include/asm-ppc/ptrace.h @@ -17,22 +17,29 @@ * the PT_* values below. This simplifies arch/ppc/kernel/ptrace.c. */ +#include <linux/config.h> + #ifndef __ASSEMBLY__ +#ifdef CONFIG_PPC64 +#define REG unsigned long /*long*/ +#else +#define REG unsigned long +#endif struct pt_regs { - unsigned long gpr[32]; - unsigned long nip; - unsigned long msr; - unsigned long orig_gpr3; /* Used for restarting system calls */ - unsigned long ctr; - unsigned long link; - unsigned long xer; - unsigned long ccr; - unsigned long mq; /* 601 only (not used at present) */ - /* Used on APUS to hold IPL value. */ - unsigned long trap; /* Reason for being here */ - unsigned long dar; /* Fault registers */ - unsigned long dsisr; - unsigned long result; /* Result of a system call */ + REG gpr[32]; + REG nip; + REG msr; + REG orig_gpr3; /* Used for restarting system calls */ + REG ctr; + REG link; + REG xer; + REG ccr; + REG mq; /* 601 only (not used at present) */ + /* Used on APUS to hold IPL value. */ + REG trap; /* Reason for being here */ + REG dar; /* Fault registers */ + REG dsisr; + REG result; /* Result of a system call */ }; #endif diff --git a/include/asm-ppc/semaphore.h b/include/asm-ppc/semaphore.h index ab21c33a6..f7b87ff0d 100644 --- a/include/asm-ppc/semaphore.h +++ b/include/asm-ppc/semaphore.h @@ -1,27 +1,64 @@ -#ifndef _PPC_SEMAPHORE_H -#define _PPC_SEMAPHORE_H +#ifndef _SPARC_SEMAPHORE_H +#define _SPARC_SEMAPHORE_H /* - * SMP- and interrupt-safe semaphores.. - * - * (C) Copyright 1996 Linus Torvalds - * Adapted for PowerPC by Gary Thomas and Paul Mackerras + * Swiped from asm-sparc/semaphore.h and modified + * -- Cort (cort@cs.nmt.edu) */ +#ifdef __KERNEL__ + #include <asm/atomic.h> +#include <linux/wait.h> struct semaphore { atomic_t count; atomic_t waking; - struct wait_queue *wait; + wait_queue_head_t wait; +#if WAITQUEUE_DEBUG + long __magic; +#endif }; -#define sema_init(sem, val) atomic_set(&((sem)->count), (val)) +#if WAITQUEUE_DEBUG +# define __SEM_DEBUG_INIT(name) \ + , (long)&(name).__magic +#else +# define __SEM_DEBUG_INIT(name) +#endif + +#define __SEMAPHORE_INITIALIZER(name,count) \ +{ ATOMIC_INIT(count), ATOMIC_INIT(0), __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \ + __SEM_DEBUG_INIT(name) } + +#define __MUTEX_INITIALIZER(name) \ + __SEMAPHORE_INITIALIZER(name,1) + +#define __DECLARE_SEMAPHORE_GENERIC(name,count) \ + struct semaphore name = __SEMAPHORE_INITIALIZER(name,count) + +#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1) +#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0) + +extern inline void sema_init (struct semaphore *sem, int val) +{ + atomic_set(&sem->count, val); + atomic_set(&sem->waking, 0); + init_waitqueue_head(&sem->wait); +#if WAITQUEUE_DEBUG + sem->__magic = (long)&sem->__magic; +#endif +} + +static inline void init_MUTEX (struct semaphore *sem) +{ + sema_init(sem, 1); +} -#define MUTEX ((struct semaphore) \ - { ATOMIC_INIT(1), ATOMIC_INIT(0), NULL }) -#define MUTEX_LOCKED ((struct semaphore) \ - { ATOMIC_INIT(0), ATOMIC_INIT(0), NULL }) +static inline void init_MUTEX_LOCKED (struct semaphore *sem) +{ + sema_init(sem, 0); +} extern void __down(struct semaphore * sem); extern int __down_interruptible(struct semaphore * sem); @@ -65,4 +102,6 @@ extern inline void up(struct semaphore * sem) __up(sem); } -#endif /* !(_PPC_SEMAPHORE_H) */ +#endif /* __KERNEL__ */ + +#endif /* !(_SPARC_SEMAPHORE_H) */ diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h index 427bb5ddd..09790d0cd 100644 --- a/include/asm-ppc/system.h +++ b/include/asm-ppc/system.h @@ -58,7 +58,6 @@ extern void __cli(void); extern int _disable_interrupts(void); extern void _enable_interrupts(int); -extern void instruction_dump(unsigned long *); extern void print_backtrace(unsigned long *); extern void show_regs(struct pt_regs * regs); extern void flush_instruction_cache(void); @@ -75,6 +74,9 @@ extern void giveup_fpu(struct task_struct *); extern void enable_kernel_fp(void); 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 void chrp_progress(char *); +void chrp_event_scan(void); struct device_node; extern void note_scsi_host(struct device_node *, void *); @@ -89,6 +91,8 @@ extern struct task_struct *_switch(struct thread_struct *prev, struct thread_struct *next, unsigned long context); +extern unsigned int rtas_data; + struct pt_regs; extern void dump_regs(struct pt_regs *); |