summaryrefslogtreecommitdiff
path: root/klibc/include/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'klibc/include/arch/mips')
-rw-r--r--klibc/include/arch/mips/klibc/archfcntl.h87
-rw-r--r--klibc/include/arch/mips/klibc/archsetjmp.h39
-rw-r--r--klibc/include/arch/mips/klibc/archsignal.h13
-rw-r--r--klibc/include/arch/mips/klibc/archstat.h39
-rw-r--r--klibc/include/arch/mips/klibc/archsys.h12
-rw-r--r--klibc/include/arch/mips/machine/asm.h11
-rw-r--r--klibc/include/arch/mips/sgidefs.h20
-rw-r--r--klibc/include/arch/mips/spaces.h1
8 files changed, 222 insertions, 0 deletions
diff --git a/klibc/include/arch/mips/klibc/archfcntl.h b/klibc/include/arch/mips/klibc/archfcntl.h
new file mode 100644
index 0000000000..54462ea69f
--- /dev/null
+++ b/klibc/include/arch/mips/klibc/archfcntl.h
@@ -0,0 +1,87 @@
+/*
+ * arch/mips/include/klibc/archfcntl.h
+ *
+ * On MIPS, <asm/fcntl.h> isn't usable (compiling struct stat with
+ * the correct definitions doesn't "just work"), so we need to provide
+ * our own definitions.
+ */
+
+#ifndef _KLIBC_ARCHFCNTL_H
+#define _KLIBC_ARCHFCNTL_H
+
+#ifdef _ASM_FCNTL_H /* We were too late! */
+# error "<asm/fcntl.h> included before <klibc/archfcntl.h>"
+#endif
+#define _ASM_FCNTL_H /* Keep <asm/fcntl.h> from getting included */
+
+#define O_ACCMODE 0x0003
+#define O_RDONLY 0x0000
+#define O_WRONLY 0x0001
+#define O_RDWR 0x0002
+#define O_APPEND 0x0008
+#define O_SYNC 0x0010
+#define O_NONBLOCK 0x0080
+#define O_CREAT 0x0100
+#define O_TRUNC 0x0200
+#define O_EXCL 0x0400
+#define O_NOCTTY 0x0800
+#define FASYNC 0x1000
+#define O_LARGEFILE 0x2000
+#define O_DIRECT 0x8000
+#define O_DIRECTORY 0x10000
+#define O_NOFOLLOW 0x20000
+#define O_NOATIME 0x40000
+
+#define O_NDELAY O_NONBLOCK
+
+#define F_DUPFD 0
+#define F_GETFD 1
+#define F_SETFD 2
+#define F_GETFL 3
+#define F_SETFL 4
+#define F_GETLK 14
+#define F_SETLK 6
+#define F_SETLKW 7
+
+#define F_SETOWN 24
+#define F_GETOWN 23
+#define F_SETSIG 10
+#define F_GETSIG 11
+
+#define F_GETLK64 33
+#define F_SETLK64 34
+#define F_SETLKW64 35
+
+#define FD_CLOEXEC 1
+
+#define F_RDLCK 0
+#define F_WRLCK 1
+#define F_UNLCK 2
+
+#define F_EXLCK 4
+#define F_SHLCK 8
+
+#define F_INPROGRESS 16
+
+#define LOCK_SH 1
+#define LOCK_EX 2
+#define LOCK_NB 4
+#define LOCK_UN 8
+
+#define LOCK_MAND 32
+#define LOCK_READ 64
+#define LOCK_WRITE 128
+#define LOCK_RW 192
+
+typedef struct flock {
+ short l_type;
+ short l_whence;
+ loff_t l_start;
+ loff_t l_len;
+ pid_t l_pid;
+} flock_t;
+
+#define F_LINUX_SPECIFIC_BASE 1024
+
+#endif /* _KLIBC_ARCHFCNTL_H */
+
diff --git a/klibc/include/arch/mips/klibc/archsetjmp.h b/klibc/include/arch/mips/klibc/archsetjmp.h
new file mode 100644
index 0000000000..40e5be2736
--- /dev/null
+++ b/klibc/include/arch/mips/klibc/archsetjmp.h
@@ -0,0 +1,39 @@
+/*
+ * arch/mips/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 __s6;
+ unsigned long __s7;
+ unsigned long __gp;
+ unsigned long __sp;
+ unsigned long __s8;
+ unsigned long __ra;
+ unsigned long __f20;
+ unsigned long __f21;
+ unsigned long __f22;
+ unsigned long __f23;
+ unsigned long __f24;
+ unsigned long __f25;
+ unsigned long __f26;
+ unsigned long __f27;
+ unsigned long __f28;
+ unsigned long __f29;
+ unsigned long __f30;
+ unsigned long __f31;
+ unsigned long __fcr31;
+ unsigned long __unused;
+} __attribute__((aligned(8)));
+
+typedef struct __jmp_buf jmp_buf[1];
+
+#endif /* _KLIBC_ARCHSETJMP_H */
diff --git a/klibc/include/arch/mips/klibc/archsignal.h b/klibc/include/arch/mips/klibc/archsignal.h
new file mode 100644
index 0000000000..3b72908636
--- /dev/null
+++ b/klibc/include/arch/mips/klibc/archsignal.h
@@ -0,0 +1,13 @@
+/*
+ * arch/mips/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/mips/klibc/archstat.h b/klibc/include/arch/mips/klibc/archstat.h
new file mode 100644
index 0000000000..612bbfa85b
--- /dev/null
+++ b/klibc/include/arch/mips/klibc/archstat.h
@@ -0,0 +1,39 @@
+#ifndef _KLIBC_ARCHSTAT_H
+#define _KLIBC_ARCHSTAT_H
+
+#define _STATBUF_ST_NSEC
+
+/*
+ * This matches struct stat64 in glibc2.1, hence the absolutely insane
+ * amounts of padding around dev_t's. The memory layout is the same as of
+ * struct stat of the 64-bit kernel.
+ */
+
+struct stat {
+ unsigned long st_dev;
+ unsigned long st_pad0[3]; /* Reserved for st_dev expansion */
+
+ unsigned long long st_ino;
+
+ mode_t st_mode;
+ nlink_t st_nlink;
+
+ uid_t st_uid;
+ gid_t st_gid;
+
+ unsigned long st_rdev;
+ unsigned long st_pad1[3]; /* Reserved for st_rdev expansion */
+
+ long long st_size;
+
+ struct timespec st_atim;
+ struct timespec st_mtim;
+ struct timespec st_ctim;
+
+ unsigned long st_blksize;
+ unsigned long st_pad2;
+
+ long long st_blocks;
+};
+
+#endif
diff --git a/klibc/include/arch/mips/klibc/archsys.h b/klibc/include/arch/mips/klibc/archsys.h
new file mode 100644
index 0000000000..f696cdfaa7
--- /dev/null
+++ b/klibc/include/arch/mips/klibc/archsys.h
@@ -0,0 +1,12 @@
+/*
+ * arch/mips/include/klibc/archsys.h
+ *
+ * Architecture-specific syscall definitions
+ */
+
+#ifndef _KLIBC_ARCHSYS_H
+#define _KLIBC_ARCHSYS_H
+
+/* No special syscall definitions for this architecture */
+
+#endif /* _KLIBC_ARCHSYS_H */
diff --git a/klibc/include/arch/mips/machine/asm.h b/klibc/include/arch/mips/machine/asm.h
new file mode 100644
index 0000000000..e5239a6cef
--- /dev/null
+++ b/klibc/include/arch/mips/machine/asm.h
@@ -0,0 +1,11 @@
+/*
+ * arch/mips/include/machine/asm.h
+ */
+
+#ifndef _MACHINE_ASM_H
+#define _MACHINE_ASM_H
+
+#include <asm/regdef.h>
+#include <asm/asm.h>
+
+#endif /* _MACHINE_ASM_H */
diff --git a/klibc/include/arch/mips/sgidefs.h b/klibc/include/arch/mips/sgidefs.h
new file mode 100644
index 0000000000..eb103ace2c
--- /dev/null
+++ b/klibc/include/arch/mips/sgidefs.h
@@ -0,0 +1,20 @@
+/*
+ * arch/mips/include/sgidefs.h
+ */
+
+/* Some ABI constants */
+
+#ifndef _SGIDEFS_H
+#define _SGIDEFS_H
+
+#define _MIPS_ISA_MIPS1 1
+#define _MIPS_ISA_MIPS2 2
+#define _MIPS_ISA_MIPS3 3
+#define _MIPS_ISA_MIPS4 4
+#define _MIPS_ISA_MIPS5 5
+
+#define _MIPS_SIM_ABI32 1
+#define _MIPS_SIM_NABI32 2
+#define _MIPS_SIM_ABI64 3
+
+#endif /* _SGIDEFS_H */
diff --git a/klibc/include/arch/mips/spaces.h b/klibc/include/arch/mips/spaces.h
new file mode 100644
index 0000000000..b5f530b753
--- /dev/null
+++ b/klibc/include/arch/mips/spaces.h
@@ -0,0 +1 @@
+/* Included by <asm/page.h> but not actually needed */