diff options
| author | Matthew Wilcox <willy@debian.org> | 2003-09-30 08:06:44 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.osdl.org> | 2003-09-30 08:06:44 -0700 |
| commit | 56f41d502fa117964cdb327326000bbe320fa8a9 (patch) | |
| tree | ff5c285802d9c0560030907c93b6d0446fc0e9ab /include | |
| parent | 7e2552dc4a71f92c9b2241ecb4ba8f7e87a247d4 (diff) | |
[PATCH] PA-RISC updates
PA-RISC updates for 2.6.0-test6
- Some more support for 64-bit userspace
- Move many EXPORT_SYMBOLs out of parisc_ksyms.c
- Make both the OSS and ALSA harmony drivers build
- ioctl typechecking
- Make math-emu build without warnings.
- Persuade SuckyIO to not crash the machine.
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-parisc/atomic.h | 24 | ||||
| -rw-r--r-- | include/asm-parisc/bitops.h | 14 | ||||
| -rw-r--r-- | include/asm-parisc/dma-mapping.h | 1 | ||||
| -rw-r--r-- | include/asm-parisc/elf.h | 29 | ||||
| -rw-r--r-- | include/asm-parisc/ioctl.h | 16 | ||||
| -rw-r--r-- | include/asm-parisc/irq.h | 1 | ||||
| -rw-r--r-- | include/asm-parisc/keyboard.h | 2 | ||||
| -rw-r--r-- | include/asm-parisc/page.h | 1 | ||||
| -rw-r--r-- | include/asm-parisc/param.h | 1 | ||||
| -rw-r--r-- | include/asm-parisc/pci.h | 1 | ||||
| -rw-r--r-- | include/asm-parisc/pdc.h | 9 | ||||
| -rw-r--r-- | include/asm-parisc/pgalloc.h | 1 | ||||
| -rw-r--r-- | include/asm-parisc/pgtable.h | 1 | ||||
| -rw-r--r-- | include/asm-parisc/processor.h | 32 | ||||
| -rw-r--r-- | include/asm-parisc/rt_sigframe.h | 15 | ||||
| -rw-r--r-- | include/asm-parisc/tlbflush.h | 1 | ||||
| -rw-r--r-- | include/sound/sndmagic.h | 2 |
17 files changed, 113 insertions, 38 deletions
diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h index 808373512d6c..20ee097b599d 100644 --- a/include/asm-parisc/atomic.h +++ b/include/asm-parisc/atomic.h @@ -129,8 +129,9 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) /* It's possible to reduce all atomic operations to either - * __atomic_add_return, __atomic_set and __atomic_ret (the latter - * is there only for consistency). */ + * __atomic_add_return, atomic_set and atomic_read (the latter + * is there only for consistency). + */ static __inline__ int __atomic_add_return(int i, atomic_t *v) { @@ -144,7 +145,7 @@ static __inline__ int __atomic_add_return(int i, atomic_t *v) return ret; } -static __inline__ void __atomic_set(atomic_t *v, int i) +static __inline__ void atomic_set(atomic_t *v, int i) { unsigned long flags; SPIN_LOCK_IRQSAVE(ATOMIC_HASH(v), flags); @@ -154,28 +155,25 @@ static __inline__ void __atomic_set(atomic_t *v, int i) SPIN_UNLOCK_IRQRESTORE(ATOMIC_HASH(v), flags); } -static __inline__ int __atomic_read(atomic_t *v) +static __inline__ int atomic_read(const atomic_t *v) { return v->counter; } /* exported interface */ -#define atomic_add(i,v) ((void)(__atomic_add_return( (i),(v)))) -#define atomic_sub(i,v) ((void)(__atomic_add_return(-(i),(v)))) -#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) -#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) +#define atomic_add(i,v) ((void)(__atomic_add_return( ((int)i),(v)))) +#define atomic_sub(i,v) ((void)(__atomic_add_return(-((int)i),(v)))) +#define atomic_inc(v) ((void)(__atomic_add_return( 1,(v)))) +#define atomic_dec(v) ((void)(__atomic_add_return( -1,(v)))) -#define atomic_add_return(i,v) (__atomic_add_return( (i),(v))) -#define atomic_sub_return(i,v) (__atomic_add_return(-(i),(v))) +#define atomic_add_return(i,v) (__atomic_add_return( ((int)i),(v))) +#define atomic_sub_return(i,v) (__atomic_add_return(-((int)i),(v))) #define atomic_inc_return(v) (__atomic_add_return( 1,(v))) #define atomic_dec_return(v) (__atomic_add_return( -1,(v))) #define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) -#define atomic_set(v,i) (__atomic_set((v),i)) -#define atomic_read(v) (__atomic_read(v)) - #define ATOMIC_INIT(i) { (i) } #define smp_mb__before_atomic_dec() smp_mb() diff --git a/include/asm-parisc/bitops.h b/include/asm-parisc/bitops.h index 51f4871ac6ce..0ecabe5a2ec1 100644 --- a/include/asm-parisc/bitops.h +++ b/include/asm-parisc/bitops.h @@ -232,24 +232,24 @@ static __inline__ unsigned long __ffs(unsigned long x) #if BITS_PER_LONG > 32 " ldi 63,%1\n" " extrd,u,*<> %0,63,32,%%r0\n" - " extrd,u,*TR %0,31,32,%0\n" + " extrd,u,*TR %0,31,32,%0\n" /* move top 32-bits down */ " addi -32,%1,%1\n" #else " ldi 31,%1\n" #endif " extru,<> %0,31,16,%%r0\n" - " extru,TR %0,15,16,%0\n" + " extru,TR %0,15,16,%0\n" /* xxxx0000 -> 0000xxxx */ " addi -16,%1,%1\n" " extru,<> %0,31,8,%%r0\n" - " extru,TR %0,23,8,%0\n" + " extru,TR %0,23,8,%0\n" /* 0000xx00 -> 000000xx */ " addi -8,%1,%1\n" " extru,<> %0,31,4,%%r0\n" - " extru,TR %0,27,4,%0\n" + " extru,TR %0,27,4,%0\n" /* 000000x0 -> 0000000x */ " addi -4,%1,%1\n" " extru,<> %0,31,2,%%r0\n" - " extru,TR %0,29,2,%0\n" + " extru,TR %0,29,2,%0\n" /* 0000000y, 1100b -> 0011b */ " addi -2,%1,%1\n" - " extru,= %0,31,1,%%r0\n" + " extru,= %0,31,1,%%r0\n" /* check last bit */ " addi -1,%1,%1\n" : "+r" (x), "=r" (ret) ); return ret; @@ -291,7 +291,7 @@ static __inline__ int fls(int x) " zdep,TR %0,27,28,%0\n" /* x0000000 */ " addi 4,%1,%1\n" " extru,<> %0,1,2,%%r0\n" - " zdep,TR %0,29,30,%0\n" /* y0000000 (y&3 = 0 */ + " zdep,TR %0,29,30,%0\n" /* y0000000 (y&3 = 0) */ " addi 2,%1,%1\n" " extru,= %0,0,1,%%r0\n" " addi 1,%1,%1\n" /* if y & 8, add 1 */ diff --git a/include/asm-parisc/dma-mapping.h b/include/asm-parisc/dma-mapping.h index a4c2bf437b61..3c7a4901537e 100644 --- a/include/asm-parisc/dma-mapping.h +++ b/include/asm-parisc/dma-mapping.h @@ -2,6 +2,7 @@ #define _PARISC_DMA_MAPPING_H #include <linux/mm.h> +#include <linux/config.h> #include <asm/cacheflush.h> /* diff --git a/include/asm-parisc/elf.h b/include/asm-parisc/elf.h index a01e946dfc57..adea65fc43c9 100644 --- a/include/asm-parisc/elf.h +++ b/include/asm-parisc/elf.h @@ -144,6 +144,30 @@ #define R_PARISC_LTOFF_TP16DF 231 /* 16 bits LT-TP-rel. address. */ #define R_PARISC_HIRESERVE 255 +#define PA_PLABEL_FDESC 0x02 /* bit set if PLABEL points to + * a function descriptor, not + * an address */ + +/* The following are PA function descriptors + * + * addr: the absolute address of the function + * gp: either the data pointer (r27) for non-PIC code or the + * the PLT pointer (r19) for PIC code */ + +/* Format for the Elf32 Function descriptor */ +typedef struct elf32_fdesc { + __u32 addr; + __u32 gp; +} Elf32_Fdesc; + +/* Format for the Elf64 Function descriptor */ +typedef struct elf64_fdesc { + __u64 dummy[2]; /* FIXME: nothing uses these, why waste + * the space */ + __u64 addr; + __u64 gp; +} Elf64_Fdesc; + /* Legal values for p_type field of Elf32_Phdr/Elf64_Phdr. */ #define PT_HP_TLS (PT_LOOS + 0x0) @@ -215,7 +239,10 @@ typedef unsigned long elf_greg_t; #ifdef __KERNEL__ #define SET_PERSONALITY(ex, ibcs2) \ - current->personality = PER_LINUX + current->personality = PER_LINUX; \ + current->thread.map_base = DEFAULT_MAP_BASE; \ + current->thread.task_size = DEFAULT_TASK_SIZE \ + #endif /* diff --git a/include/asm-parisc/ioctl.h b/include/asm-parisc/ioctl.h index ff78546f6efa..75dc3e956457 100644 --- a/include/asm-parisc/ioctl.h +++ b/include/asm-parisc/ioctl.h @@ -44,11 +44,21 @@ ((nr) << _IOC_NRSHIFT) | \ ((size) << _IOC_SIZESHIFT)) +/* provoke compile error for invalid uses of size argument */ +extern int __invalid_size_argument_for_IOC; +#define _IOC_TYPECHECK(t) \ + ((sizeof(t) == sizeof(t[1]) && \ + sizeof(t) < (1 << _IOC_SIZEBITS)) ? \ + sizeof(t) : __invalid_size_argument_for_IOC) + /* used to create numbers */ #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) -#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) -#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) -#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) +#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),(_IOC_TYPECHECK(size))) +#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) +#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),(_IOC_TYPECHECK(size))) +#define _IOR_BAD(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) +#define _IOW_BAD(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) +#define _IOWR_BAD(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) /* used to decode ioctl numbers.. */ #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) diff --git a/include/asm-parisc/irq.h b/include/asm-parisc/irq.h index f7ad20b692ef..39db70230740 100644 --- a/include/asm-parisc/irq.h +++ b/include/asm-parisc/irq.h @@ -17,6 +17,7 @@ #include <linux/string.h> #include <linux/interrupt.h> +#include <linux/config.h> #define CPU_IRQ_REGION 1 diff --git a/include/asm-parisc/keyboard.h b/include/asm-parisc/keyboard.h index a5f701806107..a7cec346b7d9 100644 --- a/include/asm-parisc/keyboard.h +++ b/include/asm-parisc/keyboard.h @@ -25,8 +25,6 @@ #ifndef _PARISC_KEYBOARD_H #define _PARISC_KEYBOARD_H -#include <linux/config.h> - #ifdef __KERNEL__ #include <linux/kernel.h> diff --git a/include/asm-parisc/page.h b/include/asm-parisc/page.h index b5db7b3da584..7d848d2721c2 100644 --- a/include/asm-parisc/page.h +++ b/include/asm-parisc/page.h @@ -7,6 +7,7 @@ #define PAGE_MASK (~(PAGE_SIZE-1)) #ifdef __KERNEL__ +#include <linux/config.h> #ifndef __ASSEMBLY__ #include <asm/cache.h> diff --git a/include/asm-parisc/param.h b/include/asm-parisc/param.h index bf926025eb8c..139b92553500 100644 --- a/include/asm-parisc/param.h +++ b/include/asm-parisc/param.h @@ -2,6 +2,7 @@ #define _ASMPARISC_PARAM_H #ifdef __KERNEL__ +#include <linux/config.h> # ifdef CONFIG_PA20 # define HZ 1000 /* Faster machines */ # else diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h index c326ff050502..ce754492efa2 100644 --- a/include/asm-parisc/pci.h +++ b/include/asm-parisc/pci.h @@ -1,6 +1,7 @@ #ifndef __ASM_PARISC_PCI_H #define __ASM_PARISC_PCI_H +#include <linux/config.h> #include <asm/scatterlist.h> /* diff --git a/include/asm-parisc/pdc.h b/include/asm-parisc/pdc.h index f9dea09157fa..b3214f1bfe53 100644 --- a/include/asm-parisc/pdc.h +++ b/include/asm-parisc/pdc.h @@ -1,6 +1,8 @@ #ifndef _PARISC_PDC_H #define _PARISC_PDC_H +#include <linux/config.h> + /* * PDC return values ... * All PDC calls return a subset of these errors. @@ -191,8 +193,8 @@ typedef struct { #define PDC_IO 135 /* log error info, reset IO system */ #define PDC_IO_READ_AND_CLEAR_ERRORS 0 -#define PDC_IO_READ_AND_LOG_ERRORS 1 -#define PDC_IO_SUSPEND_USB 2 +#define PDC_IO_RESET 1 +#define PDC_IO_RESET_DEVICES 2 /* sets bits 6&7 (little endian) of the HcControl Register */ #define PDC_IO_USB_SUSPEND 0xC000000000000000 #define PDC_IO_EEPROM_IO_ERR_TABLE_FULL -5 /* return value */ @@ -951,7 +953,8 @@ int pdc_do_firm_test_reset(unsigned long ftc_bitmap); int pdc_do_reset(void); int pdc_soft_power_info(unsigned long *power_reg); int pdc_soft_power_button(int sw_control); -void pdc_suspend_usb(void); +void pdc_io_reset(void); +void pdc_io_reset_devices(void); int pdc_iodc_getc(void); void pdc_iodc_putc(unsigned char c); void pdc_iodc_outc(unsigned char c); diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h index bbc02cb134b7..eb97d25ff353 100644 --- a/include/asm-parisc/pgalloc.h +++ b/include/asm-parisc/pgalloc.h @@ -1,7 +1,6 @@ #ifndef _ASM_PGALLOC_H #define _ASM_PGALLOC_H -#include <linux/config.h> #include <linux/gfp.h> #include <linux/mm.h> #include <linux/threads.h> diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h index be75436b1e51..79d19128946f 100644 --- a/include/asm-parisc/pgtable.h +++ b/include/asm-parisc/pgtable.h @@ -1,6 +1,7 @@ #ifndef _PARISC_PGTABLE_H #define _PARISC_PGTABLE_H +#include <linux/config.h> #include <asm/fixmap.h> #ifndef __ASSEMBLY__ diff --git a/include/asm-parisc/processor.h b/include/asm-parisc/processor.h index 4779a6efeb91..3f407809ba73 100644 --- a/include/asm-parisc/processor.h +++ b/include/asm-parisc/processor.h @@ -36,10 +36,18 @@ #define current_text_addr() ({ void *pc; __asm__("\n\tblr 0,%0\n\tnop":"=r" (pc)); pc; }) #define TASK_SIZE (current->thread.task_size) -#define DEFAULT_TASK_SIZE (0xFFF00000UL) - #define TASK_UNMAPPED_BASE (current->thread.map_base) -#define DEFAULT_MAP_BASE (0x40000000UL) + +#define DEFAULT_TASK_SIZE32 (0xFFF00000UL) +#define DEFAULT_MAP_BASE32 (0x40000000UL) + +#ifdef __LP64__ +#define DEFAULT_TASK_SIZE (MAX_ADDRESS-0xf000000) +#define DEFAULT_MAP_BASE (0x200000000UL) +#else +#define DEFAULT_TASK_SIZE DEFAULT_TASK_SIZE32 +#define DEFAULT_MAP_BASE DEFAULT_MAP_BASE32 +#endif #ifndef __ASSEMBLY__ @@ -247,8 +255,18 @@ on downward growing arches, it looks like this: * * Note that the S/390 people took the easy way out and hacked their * GCC to make the stack grow downwards. + * + * Final Note: For entry from syscall, the W (wide) bit of the PSW + * is stuffed into the lowest bit of the user sp (%r30), so we fill + * it in here from the current->personality */ +#ifdef __LP64__ +#define USER_WIDE_MODE (personality(current->personality) == PER_LINUX) +#else +#define USER_WIDE_MODE 0 +#endif + #define start_thread(regs, new_pc, new_sp) do { \ elf_addr_t *sp = (elf_addr_t *)new_sp; \ __u32 spaceid = (__u32)current->mm->context; \ @@ -266,12 +284,12 @@ on downward growing arches, it looks like this: regs->sr[5] = spaceid; \ regs->sr[6] = spaceid; \ regs->sr[7] = spaceid; \ - regs->gr[ 0] = USER_PSW; \ + regs->gr[ 0] = USER_PSW | (USER_WIDE_MODE ? PSW_W : 0); \ regs->fr[ 0] = 0LL; \ regs->fr[ 1] = 0LL; \ regs->fr[ 2] = 0LL; \ regs->fr[ 3] = 0LL; \ - regs->gr[30] = ((unsigned long)sp + 63) &~ 63; \ + regs->gr[30] = (((unsigned long)sp + 63) &~ 63) | (USER_WIDE_MODE ? 1 : 0); \ regs->gr[31] = pc; \ \ get_user(regs->gr[25], (argv - 1)); \ @@ -299,8 +317,6 @@ static inline unsigned long get_wchan(struct task_struct *p) #define KSTK_EIP(tsk) ((tsk)->thread.regs.iaoq[0]) #define KSTK_ESP(tsk) ((tsk)->thread.regs.gr[30]) -#endif /* __ASSEMBLY__ */ - #ifdef CONFIG_PA20 #define ARCH_HAS_PREFETCH extern inline void prefetch(const void *addr) @@ -317,4 +333,6 @@ extern inline void prefetchw(const void *addr) #define cpu_relax() barrier() +#endif /* __ASSEMBLY__ */ + #endif /* __ASM_PARISC_PROCESSOR_H */ diff --git a/include/asm-parisc/rt_sigframe.h b/include/asm-parisc/rt_sigframe.h index 5bae2e0c3152..a9b5193ff27a 100644 --- a/include/asm-parisc/rt_sigframe.h +++ b/include/asm-parisc/rt_sigframe.h @@ -13,7 +13,20 @@ struct rt_sigframe { * which Linux/parisc uses is sp-20 for the saved return pointer...) * Then, the stack pointer must be rounded to a cache line (64 bytes). */ +#define SIGFRAME32 64 +#define FUNCTIONCALLFRAME32 48 +#define PARISC_RT_SIGFRAME_SIZE32 \ + (((sizeof(struct rt_sigframe) + FUNCTIONCALLFRAME32) + SIGFRAME32) & -SIGFRAME32) + +#ifdef __LP64__ +#define SIGFRAME 128 +#define FUNCTIONCALLFRAME 96 #define PARISC_RT_SIGFRAME_SIZE \ - (((sizeof(struct rt_sigframe) + 48) + 63) & -64) + (((sizeof(struct rt_sigframe) + FUNCTIONCALLFRAME) + SIGFRAME) & -SIGFRAME) +#else +#define SIGFRAME SIGFRAME32 +#define FUNCTIONCALLFRAME FUNCTIONCALLFRAME32 +#define PARISC_RT_SIGFRAME_SIZE PARISC_RT_SIGFRAME_SIZE32 +#endif #endif diff --git a/include/asm-parisc/tlbflush.h b/include/asm-parisc/tlbflush.h index ea8cf008dad9..a5b731f654cb 100644 --- a/include/asm-parisc/tlbflush.h +++ b/include/asm-parisc/tlbflush.h @@ -3,6 +3,7 @@ /* TLB flushing routines.... */ +#include <linux/config.h> #include <linux/mm.h> #include <asm/mmu_context.h> diff --git a/include/sound/sndmagic.h b/include/sound/sndmagic.h index 646f7dc6369a..c88c332ccc93 100644 --- a/include/sound/sndmagic.h +++ b/include/sound/sndmagic.h @@ -198,6 +198,8 @@ static inline int _snd_magic_bad(void *obj, unsigned long magic) #define vx_pipe_t_magic 0xa15a4112 #define azf3328_t_magic 0xa15a4200 +#define snd_card_harmony_t_magic 0xa15a4300 + #else #define snd_magic_kcalloc(type, extra, flags) (type *) snd_kcalloc(sizeof(type) + extra, flags) |
