X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-sparc64%2Felf.h;h=303d85e2f82ee003b1a6866b766ebb1731975d0d;hb=refs%2Fheads%2Fvserver;hp=88a7ee8dbbcb26812b4c0843bf18c6d33e8646c4;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h index 88a7ee8db..303d85e2f 100644 --- a/include/asm-sparc64/elf.h +++ b/include/asm-sparc64/elf.h @@ -10,6 +10,7 @@ #ifdef __KERNEL__ #include #include +#include #endif /* @@ -68,6 +69,7 @@ #define HWCAP_SPARC_MULDIV 8 #define HWCAP_SPARC_V9 16 #define HWCAP_SPARC_ULTRA3 32 +#define HWCAP_SPARC_BLKINIT 64 /* * These are used to set parameters in the core dumps. @@ -94,12 +96,12 @@ typedef elf_greg_t elf_gregset_t[ELF_NGREG]; #define ELF_CORE_COPY_REGS(__elf_regs, __pt_regs) \ do { unsigned long *dest = &(__elf_regs[0]); \ struct pt_regs *src = (__pt_regs); \ - unsigned long *sp; \ + unsigned long __user *sp; \ int i; \ for(i = 0; i < 16; i++) \ dest[i] = src->u_regs[i]; \ /* Don't try this at home kids... */ \ - sp = (unsigned long *) \ + sp = (unsigned long __user *) \ ((src->u_regs[14] + STACK_BIAS) \ & 0xfffffffffffffff8UL); \ for(i = 0; i < 16; i++) \ @@ -119,7 +121,7 @@ typedef struct { #endif #define ELF_CORE_COPY_TASK_REGS(__tsk, __elf_regs) \ - ({ ELF_CORE_COPY_REGS((*(__elf_regs)), (__tsk)->thread_info->kregs); 1; }) + ({ ELF_CORE_COPY_REGS((*(__elf_regs)), task_pt_regs(__tsk)); 1; }) /* * This is used to ensure we don't load something for the wrong architecture. @@ -145,11 +147,21 @@ typedef struct { instruction set this cpu supports. */ /* On Ultra, we support all of the v8 capabilities. */ -#define ELF_HWCAP ((HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | \ - HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV | \ - HWCAP_SPARC_V9) | \ - ((tlb_type == cheetah || tlb_type == cheetah_plus) ? \ - HWCAP_SPARC_ULTRA3 : 0)) +static inline unsigned int sparc64_elf_hwcap(void) +{ + unsigned int cap = (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR | + HWCAP_SPARC_SWAP | HWCAP_SPARC_MULDIV | + HWCAP_SPARC_V9); + + if (tlb_type == cheetah || tlb_type == cheetah_plus) + cap |= HWCAP_SPARC_ULTRA3; + else if (tlb_type == hypervisor) + cap |= HWCAP_SPARC_BLKINIT; + + return cap; +} + +#define ELF_HWCAP sparc64_elf_hwcap(); /* This yields a string that ld.so will use to load implementation specific libraries for optimization. This is more specific in