diff options
Diffstat (limited to 'klibc/include/arch/alpha')
-rw-r--r-- | klibc/include/arch/alpha/klibc/archsetjmp.h | 33 | ||||
-rw-r--r-- | klibc/include/arch/alpha/klibc/archsignal.h | 13 | ||||
-rw-r--r-- | klibc/include/arch/alpha/klibc/archstat.h | 26 | ||||
-rw-r--r-- | klibc/include/arch/alpha/klibc/archsys.h | 53 | ||||
-rw-r--r-- | klibc/include/arch/alpha/machine/asm.h | 44 |
5 files changed, 169 insertions, 0 deletions
diff --git a/klibc/include/arch/alpha/klibc/archsetjmp.h b/klibc/include/arch/alpha/klibc/archsetjmp.h new file mode 100644 index 0000000000..9dc570a6f5 --- /dev/null +++ b/klibc/include/arch/alpha/klibc/archsetjmp.h @@ -0,0 +1,33 @@ +/* + * arch/alpha/include/klibc/archsetjmp.h + */ + +#ifndef _KLIBC_ARCHSETJMP_H +#define _KLIBC_ARCHSETJMP_H + +struct __jmp_buf { + unsigned long __s0; + unsigned long __s1; + unsigned long __s2; + unsigned long __s3; + unsigned long __s4; + unsigned long __s5; + unsigned long __fp; + unsigned long __ra; + unsigned long __gp; + unsigned long __sp; + + unsigned long __f2; + unsigned long __f3; + unsigned long __f4; + unsigned long __f5; + unsigned long __f6; + unsigned long __f7; + unsigned long __f8; + unsigned long __f9; +}; + +/* Must be an array so it will decay to a pointer when a function is called */ +typedef struct __jmp_buf jmp_buf[1]; + +#endif /* _KLIBC_ARCHSETJMP_H */ diff --git a/klibc/include/arch/alpha/klibc/archsignal.h b/klibc/include/arch/alpha/klibc/archsignal.h new file mode 100644 index 0000000000..b870a05131 --- /dev/null +++ b/klibc/include/arch/alpha/klibc/archsignal.h @@ -0,0 +1,13 @@ +/* + * arch/alpha/include/klibc/archsignal.h + * + * Architecture-specific signal definitions + * + */ + +#ifndef _KLIBC_ARCHSIGNAL_H +#define _KLIBC_ARCHSIGNAL_H + +/* No special stuff for this architecture */ + +#endif diff --git a/klibc/include/arch/alpha/klibc/archstat.h b/klibc/include/arch/alpha/klibc/archstat.h new file mode 100644 index 0000000000..23302d737d --- /dev/null +++ b/klibc/include/arch/alpha/klibc/archstat.h @@ -0,0 +1,26 @@ +#ifndef _KLIBC_ARCHSTAT_H +#define _KLIBC_ARCHSTAT_H + +#define _STATBUF_ST_NSEC + +struct stat { + unsigned long st_dev; + unsigned long st_ino; + unsigned long st_rdev; + long st_size; + unsigned long st_blocks; + + unsigned int st_mode; + unsigned int st_uid; + unsigned int st_gid; + unsigned int st_blksize; + unsigned int st_nlink; + unsigned int __pad0; + + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; + long __unused[3]; +}; + +#endif diff --git a/klibc/include/arch/alpha/klibc/archsys.h b/klibc/include/arch/alpha/klibc/archsys.h new file mode 100644 index 0000000000..16ed658987 --- /dev/null +++ b/klibc/include/arch/alpha/klibc/archsys.h @@ -0,0 +1,53 @@ +/* + * arch/alpha/include/klibc/archsys.h + * + * Architecture-specific syscall definitions + */ + +#ifndef _KLIBC_ARCHSYS_H +#define _KLIBC_ARCHSYS_H + +/* Alpha has some bizarre Tru64-derived system calls which return two + different values in $0 and $20(!), respectively. The standard + macros can't deal with these; even the ones that give the right + return value have the wrong clobbers. */ + +#define _syscall0_dual0(type, name) \ +type name(void) \ +{ \ + long _sc_ret, _sc_err; \ + { \ + register long _sc_0 __asm__("$0"); \ + register long _sc_19 __asm__("$19"); \ + register long _sc_20 __asm__("$20"); \ + \ + _sc_0 = __NR_##name; \ + __asm__("callsys" \ + : "=r"(_sc_0), "=r"(_sc_19), "=r" (_sc_20) \ + : "0"(_sc_0) \ + : _syscall_clobbers); \ + _sc_ret = _sc_0, _sc_err = _sc_19; (void)(_sc_20); \ + } \ + _syscall_return(type); \ +} + +#define _syscall0_dual1(type, name) \ +type name(void) \ +{ \ + long _sc_ret, _sc_err; \ + { \ + register long _sc_0 __asm__("$0"); \ + register long _sc_19 __asm__("$19"); \ + register long _sc_20 __asm__("$20"); \ + \ + _sc_0 = __NR_##name; \ + __asm__("callsys" \ + : "=r"(_sc_0), "=r"(_sc_19), "=r" (_sc_20) \ + : "0"(_sc_0) \ + : _syscall_clobbers); \ + _sc_ret = _sc_20, _sc_err = _sc_19; (void)(_sc_0); \ + } \ + _syscall_return(type); \ +} + +#endif /* _KLIBC_ARCHSYS_H */ diff --git a/klibc/include/arch/alpha/machine/asm.h b/klibc/include/arch/alpha/machine/asm.h new file mode 100644 index 0000000000..e22db90412 --- /dev/null +++ b/klibc/include/arch/alpha/machine/asm.h @@ -0,0 +1,44 @@ +/* + * machine/asm.h + */ + +#ifndef _MACHINE_ASM_H +#define _MACHINE_ASM_H + +/* Standard aliases for Alpha register names */ + +#define v0 $0 +#define t0 $1 +#define t1 $2 +#define t2 $3 +#define t3 $4 +#define t4 $5 +#define t5 $6 +#define t6 $7 +#define t7 $8 +#define s0 $9 +#define s1 $10 +#define s2 $11 +#define s3 $12 +#define s4 $13 +#define s5 $14 +#define fp $15 +#define a0 $16 +#define a1 $17 +#define a2 $18 +#define a3 $19 +#define a4 $20 +#define a5 $21 +#define t8 $22 +#define t9 $23 +#define t10 $24 +#define t11 $25 +#define ra $26 +#define t12 $27 /* t12 and pv are both used for $27 */ +#define pv $27 /* t12 and pv are both used for $27 */ +#define at $28 +#define gp $29 +#define sp $30 +#define zero $31 + +#endif /* _MACHINE_ASM_H */ |