| Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 1 | #ifndef _ASM_CRIS_ELF_H | 
 | 2 | #define _ASM_CRIS_ELF_H | 
 | 3 |  | 
 | 4 | #define ELF_CORE_EFLAGS EF_CRIS_VARIANT_V32 | 
 | 5 |  | 
 | 6 | /* | 
 | 7 |  * This is used to ensure we don't load something for the wrong architecture. | 
 | 8 |  */ | 
 | 9 | #define elf_check_arch(x)			\ | 
 | 10 |  ((x)->e_machine == EM_CRIS			\ | 
 | 11 |   && ((((x)->e_flags & EF_CRIS_VARIANT_MASK) == EF_CRIS_VARIANT_V32	\ | 
 | 12 |       || (((x)->e_flags & EF_CRIS_VARIANT_MASK) == EF_CRIS_VARIANT_COMMON_V10_V32)))) | 
 | 13 |  | 
 | 14 | /* CRISv32 ELF register definitions. */ | 
 | 15 |  | 
 | 16 | #include <asm/ptrace.h> | 
 | 17 |  | 
 | 18 | /* Explicitly zero out registers to increase determinism. */ | 
 | 19 | #define ELF_PLAT_INIT(_r, load_addr)    do { \ | 
 | 20 |         (_r)->r13 = 0; (_r)->r12 = 0; (_r)->r11 = 0; (_r)->r10 = 0; \ | 
 | 21 |         (_r)->r9 = 0;  (_r)->r8 = 0;  (_r)->r7 = 0;  (_r)->r6 = 0;  \ | 
 | 22 |         (_r)->r5 = 0;  (_r)->r4 = 0;  (_r)->r3 = 0;  (_r)->r2 = 0;  \ | 
 | 23 |         (_r)->r1 = 0;  (_r)->r0 = 0;  (_r)->mof = 0; (_r)->srp = 0; \ | 
 | 24 |         (_r)->acr = 0; \ | 
 | 25 | } while (0) | 
 | 26 |  | 
 | 27 | /* | 
 | 28 |  * An executable for which elf_read_implies_exec() returns TRUE will | 
 | 29 |  * have the READ_IMPLIES_EXEC personality flag set automatically. | 
 | 30 |  */ | 
 | 31 | #define elf_read_implies_exec_binary(ex, have_pt_gnu_stack)	(!(have_pt_gnu_stack)) | 
 | 32 |  | 
 | 33 | /* | 
 | 34 |  * This is basically a pt_regs with the additional definition | 
 | 35 |  * of the stack pointer since it's needed in a core dump. | 
 | 36 |  * pr_regs is a elf_gregset_t and should be filled according | 
 | 37 |  * to the layout of user_regs_struct. | 
 | 38 |  */ | 
 | 39 | #define ELF_CORE_COPY_REGS(pr_reg, regs)                   \ | 
 | 40 |         pr_reg[0] = regs->r0;                              \ | 
 | 41 |         pr_reg[1] = regs->r1;                              \ | 
 | 42 |         pr_reg[2] = regs->r2;                              \ | 
 | 43 |         pr_reg[3] = regs->r3;                              \ | 
 | 44 |         pr_reg[4] = regs->r4;                              \ | 
 | 45 |         pr_reg[5] = regs->r5;                              \ | 
 | 46 |         pr_reg[6] = regs->r6;                              \ | 
 | 47 |         pr_reg[7] = regs->r7;                              \ | 
 | 48 |         pr_reg[8] = regs->r8;                              \ | 
 | 49 |         pr_reg[9] = regs->r9;                              \ | 
 | 50 |         pr_reg[10] = regs->r10;                            \ | 
 | 51 |         pr_reg[11] = regs->r11;                            \ | 
 | 52 |         pr_reg[12] = regs->r12;                            \ | 
 | 53 |         pr_reg[13] = regs->r13;                            \ | 
 | 54 |         pr_reg[14] = rdusp();               /* SP */       \ | 
 | 55 |         pr_reg[15] = regs->acr;             /* ACR */      \ | 
 | 56 |         pr_reg[16] = 0;                     /* BZ */       \ | 
 | 57 |         pr_reg[17] = rdvr();                /* VR */       \ | 
 | 58 |         pr_reg[18] = 0;                     /* PID */      \ | 
 | 59 |         pr_reg[19] = regs->srs;             /* SRS */      \ | 
 | 60 |         pr_reg[20] = 0;                     /* WZ */       \ | 
 | 61 |         pr_reg[21] = regs->exs;             /* EXS */      \ | 
 | 62 |         pr_reg[22] = regs->eda;             /* EDA */      \ | 
 | 63 |         pr_reg[23] = regs->mof;             /* MOF */      \ | 
 | 64 |         pr_reg[24] = 0;                     /* DZ */       \ | 
 | 65 |         pr_reg[25] = 0;                     /* EBP */      \ | 
 | 66 |         pr_reg[26] = regs->erp;             /* ERP */      \ | 
 | 67 |         pr_reg[27] = regs->srp;             /* SRP */      \ | 
 | 68 |         pr_reg[28] = 0;                     /* NRP */      \ | 
 | 69 |         pr_reg[29] = regs->ccs;             /* CCS */      \ | 
 | 70 |         pr_reg[30] = rdusp();               /* USP */      \ | 
 | 71 |         pr_reg[31] = regs->spc;             /* SPC */      \ | 
 | 72 |  | 
 | 73 | #endif /* _ASM_CRIS_ELF_H */ |