diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2006-02-23 17:21:39 +0000 |
---|---|---|
committer | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2006-02-23 17:21:39 +0000 |
commit | 1583fb7f92973cdbba391bd32a1b42cbdb5839b8 (patch) | |
tree | 1d0cdadd951d29a0cdec8a0116bc6576ff8590cc /libc/sysdeps/linux/cris/sysdep.h | |
parent | d340072c9a51379eb7e754b50173269974c9bc5c (diff) |
Added support for the new CRISv32 architecture.
Diffstat (limited to 'libc/sysdeps/linux/cris/sysdep.h')
-rw-r--r-- | libc/sysdeps/linux/cris/sysdep.h | 46 |
1 files changed, 40 insertions, 6 deletions
diff --git a/libc/sysdeps/linux/cris/sysdep.h b/libc/sysdeps/linux/cris/sysdep.h index 08cf6221c..593e7772e 100644 --- a/libc/sysdeps/linux/cris/sysdep.h +++ b/libc/sysdeps/linux/cris/sysdep.h @@ -40,8 +40,14 @@ #define END(sym) #endif +#undef SYS_ify +#define SYS_ify(syscall_name) (__NR_##syscall_name) + #ifdef __ASSEMBLER__ +#undef SYS_ify +#define SYS_ify(syscall_name) __NR_##syscall_name + /* Syntactic details of assembly-code. */ /* It is *not* generally true that "ELF uses byte-counts for .align, most @@ -58,6 +64,37 @@ /* The non-PIC jump is preferred, since it does not stall, and does not invoke generation of a PLT. These macros assume that $r0 is set up as GOT register. */ +#ifdef __arch_v32 +#ifdef __PIC__ +#define PLTJUMP(_x) \ + ba C_SYMBOL_NAME (_x):PLT @ \ + nop + +#define PLTCALL(_x) \ + bsr C_SYMBOL_NAME (_x):PLT @ \ + nop + +#define SETUP_PIC \ + subq 4,$sp @ \ + move.d $r0,[$sp] @ \ + lapc _GLOBAL_OFFSET_TABLE_,$r0 + +#define TEARDOWN_PIC move.d [$sp+],$r0 +#else +#define PLTJUMP(_x) \ + ba C_SYMBOL_NAME (_x) @ \ + nop + +#define PLTCALL(_x) \ + bsr C_SYMBOL_NAME (_x) @ \ + nop + +#define SETUP_PIC +#define TEARDOWN_PIC +#endif + +#else + #ifdef __PIC__ #define PLTJUMP(_x) \ add.d C_SYMBOL_NAME (_x):PLT,$pc @@ -78,14 +115,15 @@ #define TEARDOWN_PIC #endif +#endif /* __arch_v32 */ + /* Define an entry point visible from C. */ #define ENTRY(name) \ .text @ \ ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (name) @ \ ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME (name), function) @ \ .align ALIGNARG (2) @ \ - C_LABEL(name) @ \ - CALL_MCOUNT + C_LABEL(name) #undef END #define END(name) \ @@ -107,9 +145,5 @@ PLTJUMP (__syscall_error) @ \ END (name) -/* If compiled for profiling, do nothing */ -#define CALL_MCOUNT /* Do nothing. */ - - #endif /* __ASSEMBLER__ */ #endif /* _SYSDEP_H_ */ |