summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author"Jan-Benedict Glaw" <jbglaw@lug-owl.de>2006-01-27 21:20:28 +0000
committer"Jan-Benedict Glaw" <jbglaw@lug-owl.de>2006-01-27 21:20:28 +0000
commit0934f142036f12292711770d353f1c01ab718db7 (patch)
treebad0873c1bbd8c81ec70180d6ca4e4006d01fa62
parent9f341620c14e959d333fb26d8ec5e9f9dc5209d6 (diff)
First round of VAX patches. This isn't complete right now, there are for
sure still bugs (properly hidden, of course), a libm is completely missing (I've got one that implements some basic stuff, but that's really not ready for checking in...) I've also got a list of other things that need touch-ups, but that's mostly minor stuff that'll be done during the next days.
-rw-r--r--MAINTAINERS5
-rw-r--r--extra/Configs/Config.in7
-rw-r--r--extra/Configs/Config.vax31
-rw-r--r--libc/sysdeps/linux/vax/Makefile15
-rw-r--r--libc/sysdeps/linux/vax/Makefile.arch41
-rw-r--r--libc/sysdeps/linux/vax/__longjmp.S43
-rw-r--r--libc/sysdeps/linux/vax/_mmap.c11
-rw-r--r--libc/sysdeps/linux/vax/_setjmp.S54
-rw-r--r--libc/sysdeps/linux/vax/bits/byteswap.h64
-rw-r--r--libc/sysdeps/linux/vax/bits/endian.h9
-rw-r--r--libc/sysdeps/linux/vax/bits/fcntl.h141
-rw-r--r--libc/sysdeps/linux/vax/bits/ipc.h50
-rw-r--r--libc/sysdeps/linux/vax/bits/kernel_stat.h56
-rw-r--r--libc/sysdeps/linux/vax/bits/kernel_types.h45
-rw-r--r--libc/sysdeps/linux/vax/bits/machine-gmon.h41
-rw-r--r--libc/sysdeps/linux/vax/bits/mman.h94
-rw-r--r--libc/sysdeps/linux/vax/bits/profil-counter.h32
-rw-r--r--libc/sysdeps/linux/vax/bits/resource.h209
-rw-r--r--libc/sysdeps/linux/vax/bits/sem.h87
-rw-r--r--libc/sysdeps/linux/vax/bits/setjmp.h37
-rw-r--r--libc/sysdeps/linux/vax/bits/shm.h88
-rw-r--r--libc/sysdeps/linux/vax/bits/sigcontext.h29
-rw-r--r--libc/sysdeps/linux/vax/bits/sockaddr.h44
-rw-r--r--libc/sysdeps/linux/vax/bits/socket.h316
-rw-r--r--libc/sysdeps/linux/vax/bits/stackinfo.h7
-rw-r--r--libc/sysdeps/linux/vax/bits/statfs.h61
-rw-r--r--libc/sysdeps/linux/vax/bits/syscalls.h264
-rw-r--r--libc/sysdeps/linux/vax/bits/wordsize.h19
-rw-r--r--libc/sysdeps/linux/vax/brk.c54
-rw-r--r--libc/sysdeps/linux/vax/clone.S87
-rw-r--r--libc/sysdeps/linux/vax/crt1.S73
-rw-r--r--libc/sysdeps/linux/vax/crti.S30
-rw-r--r--libc/sysdeps/linux/vax/crtn.S29
-rw-r--r--libc/sysdeps/linux/vax/setjmp.S34
-rw-r--r--libc/sysdeps/linux/vax/sys/procfs.h123
-rw-r--r--libc/sysdeps/linux/vax/sys/ucontext.h80
-rw-r--r--libc/sysdeps/linux/vax/vfork.c14
37 files changed, 2424 insertions, 0 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index afc0a3ca0..33b859184 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -108,6 +108,11 @@ S: Maintained
SPARC
S: Unmaintained
+VAX
+P: Jan-Benedict Glaw
+E: jbglaw@lug-owl.de (personal), linux-vax@pergamentum.com (mailing list)
+W: http://linux-vax.sourceforge.net/
+S: Maintained
V850
S: Unmaintained
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 3efe627e2..c979408ae 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -71,6 +71,9 @@ config TARGET_sparc
config TARGET_v850
bool "v850 (BROKEN)"
+config TARGET_vax
+ bool "vax"
+
config TARGET_x86_64
bool "x86_64"
@@ -159,6 +162,10 @@ if TARGET_v850
source "extra/Configs/Config.v850"
endif
+if TARGET_vax
+source "extra/Configs/Config.vax"
+endif
+
if TARGET_x86_64
source "extra/Configs/Config.x86_64"
endif
diff --git a/extra/Configs/Config.vax b/extra/Configs/Config.vax
new file mode 100644
index 000000000..1c7de1590
--- /dev/null
+++ b/extra/Configs/Config.vax
@@ -0,0 +1,31 @@
+#
+# For a description of the syntax of this configuration file,
+# see extra/config/Kconfig-language.txt
+#
+
+config TARGET_ARCH
+ default "vax"
+
+config HAVE_ELF
+ bool
+ select HAVE_NO_SHARED
+ select ARCH_HAS_NO_LDSO
+ default y
+
+config ARCH_SUPPORTS_LITTLE_ENDIAN
+ bool
+ default y
+
+config ARCH_CFLAGS
+ string
+
+config ARCH_LDFLAGS
+ string
+
+config LIBGCC_CFLAGS
+ string
+
+config CROSS
+ string
+ default "vax-linux-uclibc-"
+
diff --git a/libc/sysdeps/linux/vax/Makefile b/libc/sysdeps/linux/vax/Makefile
new file mode 100644
index 000000000..b1bf1ef10
--- /dev/null
+++ b/libc/sysdeps/linux/vax/Makefile
@@ -0,0 +1,15 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+TOPDIR=../../../../
+
+top_srcdir=$(TOPDIR)
+top_builddir=../../../../
+all: objs
+include $(top_builddir)Rules.mak
+include Makefile.arch
+include $(top_srcdir)Makerules
diff --git a/libc/sysdeps/linux/vax/Makefile.arch b/libc/sysdeps/linux/vax/Makefile.arch
new file mode 100644
index 000000000..0b3c1f619
--- /dev/null
+++ b/libc/sysdeps/linux/vax/Makefile.arch
@@ -0,0 +1,41 @@
+# Makefile for uClibc
+#
+# Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
+# Copyright (C) 2005 Jan-Benedict Glaw <jbglaw@lug-owl.de>
+#
+# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+#
+
+CSRC:=brk.c _mmap.c vfork.c
+SSRC:=__longjmp.S setjmp.S _setjmp.S clone.S
+
+ARCH_DIR:=$(top_srcdir)libc/sysdeps/linux/vax
+ARCH_OUT:=$(top_builddir)libc/sysdeps/linux/vax
+
+ARCH_CSRC:=$(patsubst %.c,$(ARCH_DIR)/%.c,$(CSRC))
+ARCH_COBJ:=$(patsubst %.c,$(ARCH_OUT)/%.o,$(CSRC))
+ARCH_SSRC:=$(patsubst %.S,$(ARCH_DIR)/%.S,$(SSRC))
+ARCH_SOBJ:=$(patsubst %.S,$(ARCH_OUT)/%.o,$(SSRC))
+
+ARCH_OBJS:=$(ARCH_COBJ) $(ARCH_SOBJ)
+
+crt-y:=create
+libc-a-y+=$(ARCH_OBJS)
+libc-a-pic-y+=$(ARCH_OBJS:.o=.os)
+libc-so-y+=$(ARCH_OBJS:.o=.os)
+
+#libc-multi-y+=$(ARCH_CSRC)
+libc-nomulti-y+=$(ARCH_OBJS)
+
+objclean-y+=arch_objclean
+
+arch_objclean:
+ $(RM) $(ARCH_OUT)/*.{o,os}
+
+headers-y+=arch_headers
+#
+arch_headers:
+# arm has this, but we don't (yet?)...
+# $(LN) -fs ../libc/sysdeps/linux/vax/fpu_control.h $(top_builddir)include/
+#
+
diff --git a/libc/sysdeps/linux/vax/__longjmp.S b/libc/sysdeps/linux/vax/__longjmp.S
new file mode 100644
index 000000000..a48581fa9
--- /dev/null
+++ b/libc/sysdeps/linux/vax/__longjmp.S
@@ -0,0 +1,43 @@
+#include <features.h>
+
+# longjmp.S atp sept 2001
+# restore regs and info and jmp back to a previous setjmp
+
+.globl __longjmp
+.align 4
+__longjmp:
+ .word 0x0040 # this matches setjmp and PLT
+ movl 0x4(%ap), %r0 # our scratch reg
+# movl $0, %r0
+# movl (%r0), %r0
+ # we are going to modify our stack frame
+ # to the same as that of the setjmp we called earlier
+ movl (%r0), (%fp) # cond handler
+ movl 0x4(%r0), 0x4(%fp) # psw
+ movl 0x8(%r0), 0x8(%fp) # ap
+ movl 0xc(%r0), 0xc(%fp) # fp
+ movl 0x10(%r0), 0x10(%fp) # pc
+
+ # restore the regs
+ movl 0x14(%r0), %r1
+ movl 0x18(%r0), %r2
+ movl 0x1c(%r0), %r3
+ movl 0x20(%r0), %r4
+ movl 0x24(%r0), %r5
+ movl 0x28(%r0), %r6
+ movl 0x2c(%r0), %r7
+ movl 0x30(%r0), %r8
+ movl 0x34(%r0), %r9
+ movl 0x38(%r0), %r10
+ movl 0x3c(%r0), %r11
+
+ # check val and set to 1 if set to zero
+ movl 0x8(%ap), %r0
+ tstl %r0
+ bneq exit_ok
+ movl $0x1, %r0
+exit_ok:
+ ret
+.size __longjmp,.-__longjmp
+libc_hidden_def(__longjmp)
+
diff --git a/libc/sysdeps/linux/vax/_mmap.c b/libc/sysdeps/linux/vax/_mmap.c
new file mode 100644
index 000000000..41bfb79f1
--- /dev/null
+++ b/libc/sysdeps/linux/vax/_mmap.c
@@ -0,0 +1,11 @@
+
+#include <unistd.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include <sys/syscall.h>
+
+libc_hidden_proto(mmap)
+_syscall6 (void *, mmap, void *, start, size_t, length, int, prot, int, flags,
+ int, fd, off_t, offset);
+libc_hidden_def(mmap)
+
diff --git a/libc/sysdeps/linux/vax/_setjmp.S b/libc/sysdeps/linux/vax/_setjmp.S
new file mode 100644
index 000000000..17d3160d8
--- /dev/null
+++ b/libc/sysdeps/linux/vax/_setjmp.S
@@ -0,0 +1,54 @@
+
+.globl _setjmp
+.align 4
+_setjmp:
+ .word 0x0040
+
+ /* push an empty word onto the stack */
+ pushl $0
+
+ /* now copy handler, psw, ap, fp and pc on the stack up one word */
+ movl 4(%sp), (%sp) /* copy handler */
+ movl 8(%sp), 4(%sp) /* psw */
+ movl 12(%sp), 8(%sp) /* ap */
+ movl 16(%sp), 12(%sp) /* fp */
+ movl 20(%sp), 16(%sp) /* pc */
+ movl 24(%sp), 20(%sp) /* r6 from register mask */
+
+ movl $2, 24(%sp) /* set the number of arguments to 2 */
+ movl 32(%sp), 28(%sp) /* copy the jmp_buf */
+ movl $1, 32(%sp) /* put the 1 on the stack */
+
+ addl3 $24, %sp, %ap
+ movl %sp, %fp
+
+ moval __sigsetjmp, %r0
+ addl2 $2, %r0
+ pushl %r0
+ rsb
+
+.globl setjmp
+.align 4
+setjmp:
+ .word 0x0040
+ pushl $0
+
+ /* now copy handler, psw, ap, fp and pc on the stack up one word */
+ movl 4(%sp), (%sp)
+ movl 8(%sp), 4(%sp)
+ movl 12(%sp), 8(%sp)
+ movl 16(%sp), 12(%sp)
+ movl 20(%sp), 16(%sp)
+ movl 24(%sp), 20(%sp) /* r6 from register mask */
+
+ movl $2, 24(%sp) /* set the number of arguments to 2 */
+ movl 32(%sp), 28(%sp) /* copy the jmp_buf */
+ movl $0, 32(%sp) /* put the 0 on the stack */
+
+ addl3 $24, %sp, %ap
+ movl %sp, %fp
+
+ moval __sigsetjmp, %r0
+ addl2 $2, %r0
+ pushl %r0
+ rsb
diff --git a/libc/sysdeps/linux/vax/bits/byteswap.h b/libc/sysdeps/linux/vax/bits/byteswap.h
new file mode 100644
index 000000000..6b5115658
--- /dev/null
+++ b/libc/sysdeps/linux/vax/bits/byteswap.h
@@ -0,0 +1,64 @@
+/* Macros to swap the order of bytes in integer values.
+ Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
+
+/* Swap bytes in 16 bit value. */
+#ifdef __GNUC__
+# define __bswap_16(x) \
+ (__extension__ \
+ ({ unsigned short int __bsx = (x); \
+ ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8)); }))
+#else
+static __inline unsigned short int
+__bswap_16 (unsigned short int __bsx)
+{
+ return ((((__bsx) >> 8) & 0xff) | (((__bsx) & 0xff) << 8));
+}
+#endif
+
+/* Swap bytes in 32 bit value. */
+#ifdef __GNUC__
+# define __bswap_32(x) \
+ (__extension__ \
+ ({ unsigned int __bsx = (x); \
+ ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) | \
+ (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24)); }))
+#else
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+ return ((((__bsx) & 0xff000000) >> 24) | (((__bsx) & 0x00ff0000) >> 8) |
+ (((__bsx) & 0x0000ff00) << 8) | (((__bsx) & 0x000000ff) << 24));
+}
+#endif
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* Swap bytes in 64 bit value. */
+# define __bswap_64(x) \
+ (__extension__ \
+ ({ union { unsigned long long int __ll; \
+ unsigned long int __l[2]; } __v, __r; \
+ __v.__ll = (x); \
+ __r.__l[0] = __bswap_32 (__v.__l[1]); \
+ __r.__l[1] = __bswap_32 (__v.__l[0]); \
+ __r.__ll; }))
+#endif
diff --git a/libc/sysdeps/linux/vax/bits/endian.h b/libc/sysdeps/linux/vax/bits/endian.h
new file mode 100644
index 000000000..9f0c4e2a9
--- /dev/null
+++ b/libc/sysdeps/linux/vax/bits/endian.h
@@ -0,0 +1,9 @@
+/* VAX is little endian */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
+
+/*#define __FLOAT_WORD_ORDER __BIG_ENDIAN*/
diff --git a/libc/sysdeps/linux/vax/bits/fcntl.h b/libc/sysdeps/linux/vax/bits/fcntl.h
new file mode 100644
index 000000000..0c94c6b9a
--- /dev/null
+++ b/libc/sysdeps/linux/vax/bits/fcntl.h
@@ -0,0 +1,141 @@
+/* O_*, F_*, FD_* bit values for Linux.
+ Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 0100 /* not fcntl */
+#define O_EXCL 0200 /* not fcntl */
+#define O_NOCTTY 0400 /* not fcntl */
+#define O_TRUNC 01000 /* not fcntl */
+#define O_APPEND 02000
+#define O_NONBLOCK 04000
+#define O_NDELAY O_NONBLOCK
+#define O_SYNC 010000
+#define O_FSYNC O_SYNC
+#define O_ASYNC 020000
+
+#ifdef __USE_GNU
+# define O_DIRECTORY 040000 /* Must be a directory. */
+# define O_NOFOLLOW 0100000 /* Do not follow links. */
+#endif
+
+/* XXX missing */
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE 0
+#endif
+
+/* For now Linux has synchronisity options for data and read operations.
+ We define the symbols here but let them do the same as O_SYNC since
+ this is a superset. */
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_RSYNC O_SYNC /* Synchronize read operations. */
+#endif
+
+/* Values for the second argument to `fcntl'. */
+#define F_DUPFD 0 /* Duplicate file descriptor. */
+#define F_GETFD 1 /* Get file descriptor flags. */
+#define F_SETFD 2 /* Set file descriptor flags. */
+#define F_GETFL 3 /* Get file status flags. */
+#define F_SETFL 4 /* Set file status flags. */
+#define F_GETLK 5 /* Get record locking info. */
+#define F_SETLK 6 /* Set record locking info (non-blocking). */
+#define F_SETLKW 7 /* Set record locking info (blocking). */
+
+/* XXX missing */
+#define F_GETLK64 5 /* Get record locking info. */
+#define F_SETLK64 6 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 7 /* Set record locking info (blocking). */
+
+#ifdef __USE_BSD
+# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
+# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
+#endif
+
+/* For F_[GET|SET]FL. */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
+#define F_RDLCK 0 /* Read lock. */
+#define F_WRLCK 1 /* Write lock. */
+#define F_UNLCK 2 /* Remove lock. */
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+
+#ifdef __USE_BSD
+/* Operations for bsd flock(), also used by the kernel implementation */
+# define LOCK_SH 1 /* shared lock */
+# define LOCK_EX 2 /* exclusive lock */
+# define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+# define LOCK_UN 8 /* remove lock */
+#endif
+
+struct flock
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+#ifndef __USE_FILE_OFFSET64
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+#else
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+#endif
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+ BSD systems which did not managed to hide these kernel macros. */
+#ifdef __USE_BSD
+# define FAPPEND O_APPEND
+# define FFSYNC O_FSYNC
+# define FASYNC O_ASYNC
+# define FNONBLOCK O_NONBLOCK
+# define FNDELAY O_NDELAY
+#endif /* Use BSD. */
diff --git a/libc/sysdeps/linux/vax/bits/ipc.h b/libc/sysdeps/linux/vax/bits/ipc.h
new file mode 100644
index 000000000..c4e37358e
--- /dev/null
+++ b/libc/sysdeps/linux/vax/bits/ipc.h
@@ -0,0 +1,50 @@
+/* Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _SYS_IPC_H
+# error "Never use <bits/ipc.h> directly; include <sys/ipc.h> instead."
+#endif
+
+#include <sys/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'. */
+#define IPC_CREAT 01000 /* Create key if key does not exist. */
+#define IPC_EXCL 02000 /* Fail if key exists. */
+#define IPC_NOWAIT 04000 /* Return error on wait. */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'. */
+#define IPC_RMID 0 /* Remove identifier. */
+#define IPC_SET 1 /* Set `ipc_perm' options. */
+#define IPC_STAT 2 /* Get `ipc_perm' options. */
+#define IPC_INFO 3 /* See ipcs. */
+
+/* Special key values. */
+#define IPC_PRIVATE ((__key_t) 0) /* Private key. */
+
+
+/* Data structure used to pass permission information to IPC operations. */
+struct ipc_perm
+ {
+ __key_t __key; /* Key. */
+ unsigned short int uid; /* Owner's user ID. */
+ unsigned short int gid; /* Owner's group ID. */
+ unsigned short int cuid; /* Creator's user ID. */
+ unsigned short int cgid; /* Creator's group ID. */
+ unsigned short int mode; /* Read/write permission. */
+ unsigned short int __seq; /* Sequence number. */
+ };
diff --git a/libc/sysdeps/linux/vax/bits/kernel_stat.h b/libc/sysdeps/linux/vax/bits/kernel_stat.h
new file mode 100644
index 000000000..ece9d347b
--- /dev/null
+++ b/libc/sysdeps/linux/vax/bits/kernel_stat.h
@@ -0,0 +1,56 @@
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+/* This file provides whatever this particular arch's kernel thinks
+ * struct stat should look like... It turns out each arch has a
+ * different opinion on the subject... */
+
+struct kernel_stat {
+ unsigned short st_dev;
+ unsigned short __pad1;
+ unsigned long st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned short st_rdev;
+ unsigned short __pad2;
+ unsigned long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ unsigned long st_atime;
+ unsigned long __unused1;
+ unsigned long st_mtime;
+ unsigned long __unused2;
+ unsigned long st_ctime;
+ unsigned long __unused3;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+struct kernel_stat64 {
+ unsigned short st_dev;
+ unsigned char __pad0[10];
+#define _HAVE_STAT64___ST_INO 1
+ unsigned long __st_ino;
+ unsigned int st_mode;
+ unsigned int st_nlink;
+ unsigned long st_uid;
+ unsigned long st_gid;
+ unsigned short st_rdev;
+ unsigned char __pad3[10];
+ long long st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks; /* Number 512-byte blocks allocated. */
+ unsigned long __pad4; /* future possible st_blocks high bits */
+ unsigned long st_atime;
+ unsigned long __pad5;
+ unsigned long st_mtime;
+ unsigned long __pad6;
+ unsigned long st_ctime;
+ unsigned long __pad7; /* will be high 32 bits of ctime someday */
+ unsigned long long st_ino;
+};
+
+#endif /* _BITS_STAT_STRUCT_H */
+
diff --git a/libc/sysdeps/linux/vax/bits/kernel_types.h b/libc/sysdeps/linux/vax/bits/kernel_types.h
new file mode 100644
index 000000000..aef74b549
--- /dev/null
+++ b/libc/sysdeps/linux/vax/bits/kernel_types.h
@@ -0,0 +1,45 @@
+#ifndef _VAX_POSIX_TYPES_H
+#define _VAX_POSIX_TYPES_H
+/*
+ * Note that we use the exact same include guard #define names
+ * as asm/posix_types.h. This will avoid gratuitous conflicts
+ * with the posix_types.h kernel header, and will ensure that
+ * our private content, and not the kernel header, will win.
+ * -Erik
+ */
+
+
+typedef unsigned short __kernel_dev_t;
+typedef unsigned long __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned short __kernel_uid_t;
+typedef unsigned short __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int __kernel_uid32_t;
+typedef unsigned int __kernel_gid32_t;
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+typedef long long __kernel_loff_t;
+
+typedef struct {
+#if defined(__KERNEL__) || defined(__USE_ALL)
+ int val[2];
+#else
+ int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* _VAX_POSIX_TYPES_H */
diff --git a/libc/sysdeps/linux/vax/bits/machine-gmon.h b/libc/sysdeps/linux/vax/bits/machine-gmon.h
new file mode 100644
index 000000000..841518f06
--- /dev/null
+++ b/libc/sysdeps/linux/vax/bits/machine-gmon.h
@@ -0,0 +1,41 @@
+/* i386-specific implementation of profiling support.
+ Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <sysdep.h>
+
+/* We need a special version of the `mcount' function since for ix86 it
+ must not clobber any register. This has several reasons:
+ - there is a bug in gcc as of version 2.7.2.2 which prohibits the
+ use of profiling together with nested functions
+ - the ELF `fixup' function uses GCC's regparm feature
+ - some (future) systems might want to pass parameters in registers. */
+
+/* We must not pollute the global namespace. */
+#define mcount_internal __mcount_internal
+
+extern void mcount_internal (u_long frompc, u_long selfpc);
+
+#define _MCOUNT_DECL(frompc, selfpc) \
+void __attribute__ (( regparm (2) )) mcount_internal (u_long frompc, u_long selfpc)
+
+
+/* Define MCOUNT as empty since we have the implementation in another
+ file. */
+#define MCOUNT
diff --git a/libc/sysdeps/linux/vax/bits/mman.h b/libc/sysdeps/linux/vax/bits/mman.h
new file mode 100644
index 000000000..e29dfcc61
--- /dev/null
+++ b/libc/sysdeps/linux/vax/bits/mman.h
@@ -0,0 +1,94 @@
+/* Definitions for POSIX memory map interface. Linux/i386 version.
+ Copyright (C) 1997, 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+ But the kernel header is not namespace clean. */
+
+
+/* Protections are chosen from these bits, OR'd together. The
+ implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ without PROT_READ. The only guarantees are that no writing will be
+ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ 0x1 /* Page can be read. */
+#define PROT_WRITE 0x2 /* Page can be written. */
+#define PROT_EXEC 0x4 /* Page can be exec