Lots of header fixes
authorDavid Bartley <dtbartle@maltodextrin.csclub.uwaterloo.ca>
Mon, 8 Sep 2008 01:21:01 +0000 (01:21 +0000)
committerDavid Bartley <dtbartle@maltodextrin.csclub.uwaterloo.ca>
Mon, 8 Sep 2008 01:21:01 +0000 (01:21 +0000)
13 files changed:
nptl/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/synch.h
nptl/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/malloc-machine.h
nptl_db/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/proc_service.h
sysdeps/unix/sysv/solaris2/kopensolaris-gnu/Makefile
sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/elfclass.h [new file with mode: 0644]
sysdeps/unix/sysv/solaris2/kopensolaris-gnu/procfs.h
sysdeps/unix/sysv/solaris2/kopensolaris-gnu/rtld_db.h
sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/elf.h
sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machelf.h [new file with mode: 0644]
sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/old_procfs.h
sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/param.h
sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/proc.h [new file with mode: 0644]
sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/zone.h

index 44fcbce..c977614 100644 (file)
@@ -27,42 +27,50 @@ typedef struct
 # else
 typedef struct _lwp_mutex
 # endif
-{
-       struct {
-               uint16_t        flag1;
-               uint8_t         flag2;
-               uint8_t         ceiling;
-               union {
-                       uint16_t bcptype;
-                       struct {
-                               uint8_t count_type1;
-                               uint8_t count_type2;
-                       } mtype_rcount;
-               } mbcp_type_un;
-               uint16_t        magic;
-       } flags;
-       union {
-               struct {
-                       uint8_t pad[8];
-               } lock64;
-               struct {
-                       uint32_t ownerpid;
-                       uint32_t lockword;
-               } lock32;
-               uint64_t owner64;
+  {
+       struct
+         {
+               __uint16_t flag1;
+               __uint8_t flag2;
+               __uint8_t ceiling;
+               union
+                 {
+                       __uint16_t bcptype;
+                       struct
+                         {
+                               __uint8_t count_type1;
+                               __uint8_t count_type2;
+                         } mtype_rcount;
+                 } mbcp_type_un;
+               __uint16_t magic;
+         } flags;
+       union
+         {
+               struct
+                 {
+                       __uint8_t pad[8];
+                 } lock64;
+               struct
+                 {
+                       __uint32_t ownerpid;
+                       __uint32_t lockword;
+                 } lock32;
+               __uint64_t owner64;
        } lock;
 /* XXX: This is a non-standard use of data (see NOTES.opensolaris).  */
-       union {
-               uint64_t data64;
-               struct {
-                       uint32_t owner;
-                       uint32_t cond_waiters;
-               } data32;
-       } data;
+       union
+         {
+               __uint64_t data64;
+               struct
+                 {
+                       __uint32_t owner;
+                       __uint32_t cond_waiters;
+                 } data32;
+         } data;
 # ifdef __need_pthread_bits
-} pthread_mutex_t;
+  } pthread_mutex_t;
 # else
-} lwp_mutex_t;
+  } lwp_mutex_t;
 # endif
 
 # ifdef __need_pthread_bits
@@ -71,16 +79,17 @@ typedef struct
 typedef struct _lwp_cond
 # endif
 {
-       struct {
-               uint8_t         flag[4];
-               uint16_t        type;
-               uint16_t        magic;
-       } flags;
-       uint64_t data;
+       struct
+         {
+               __uint8_t flag[4];
+               __uint16_t type;
+               __uint16_t magic;
+         } flags;
+       __uint64_t data;
 # ifdef __need_pthread_bits
-} pthread_cond_t;
+  } pthread_cond_t;
 # else
-} lwp_cond_t;
+  } lwp_cond_t;
 # endif
 
 #endif /* defined __need_pthread_bits  && !defined ... */
@@ -94,10 +103,10 @@ typedef struct
 # else
 typedef struct _lwp_rwlock
 # endif
-{
-       int32_t readers;
-       uint16_t type;
-       uint16_t magic;
+  {
+       __int32_t readers;
+       __uint16_t type;
+       __uint16_t magic;
 # ifdef __need_pthread_bits
        pthread_mutex_t mutex;
        pthread_cond_t readercv;
@@ -108,11 +117,11 @@ typedef struct _lwp_rwlock
        lwp_cond_t writercv;
 # endif
 /* XXX: These are non-standard additions (see NOTES.opensolaris).  */
-    uint64_t owner;
-       uint32_t ownerpid;
-       uint32_t pad;
+    __uint64_t owner;
+       __uint32_t ownerpid;
+       __uint32_t pad;
 # ifdef __need_pthread_bits
-} pthread_rwlock_t;
+  } pthread_rwlock_t;
 # else
 } lwp_rwlock_t;
 # endif
@@ -127,16 +136,16 @@ typedef struct
 #else
 typedef struct _lwp_sema
 #endif
-{
-       uint32_t        count;
-       uint16_t        type;
-       uint16_t        magic;
-       uint8_t         flags[8];
-       uint64_t        data;
+  {
+       __uint32_t count;
+       __uint16_t type;
+       __uint16_t magic;
+       __uint8_t flags[8];
+       __uint64_t data;
 #ifdef __need_semaphore_bits
-} sem_t;
+  } sem_t;
 #else
-} lwp_sema_t;
+  } lwp_sema_t;
 #endif
 
 #endif /* defined __need_semaphore_bits && !defined ... */
index a09badb..a0003d3 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <synch.h>
 
+#define mutex_t                        pthread_mutex_t
 #define mutex_init(m)          __libc_lock_init (*(m))
 #define mutex_lock(m)          __libc_lock_lock (*(m))
 #define mutex_trylock(m)       __libc_lock_trylock (*(m))
index 53b30cd..93453e0 100644 (file)
 
 /* The definitions in this file must correspond to those in the debugger.  */
 #include <procfs.h>
+#include <elf.h>
+#include <sys/isa_defs.h>
+
+#ifdef _LP64
+typedef Elf64_Sym      ps_sym_t;
+#else
+typedef Elf32_Sym      ps_sym_t;
+#endif
 
 /* Functions in this interface return one of these status codes.  */
 typedef enum
index 6cf4f6e..e61fe4a 100644 (file)
@@ -42,7 +42,7 @@ sysdep_headers += sys/feature_tests.h sys/mount.h sys/cred.h \
     sys/time_impl.h sys/mutex.h sys/tsol/label.h sys/exacct.h sys/acct.h \
     sys/sid.h sys/siginfo.h sys/vm.h sys/vmparam.h sys/kd.h sys/filio.h \
     sys/link.h sys/rctl_impl.h sys/procfs_isa.h sys/frame.h sys/kbio.h \
-    sys/port.h
+    sys/port.h sys/machelf.h sys/proc.h
 sysdep_headers += ucred.h priv.h bits/regset.h door.h zone.h \
     rtld_db.h pcsample.h port.h
 endif
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/elfclass.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/bits/elfclass.h
new file mode 100644 (file)
index 0000000..21d7fd0
--- /dev/null
@@ -0,0 +1,75 @@
+/* This file specifies the native word size of the machine, which indicates
+   the ELF file class used for executables and shared objects on this
+   machine.  */
+
+#ifndef _LINK_H
+# error "Never use <bits/elfclass.h> directly; include <link.h> instead."
+#endif
+
+#include <bits/wordsize.h>
+
+#define __ELF_NATIVE_CLASS __WORDSIZE
+
+/* The entries in the .hash table always have a size of 32 bits.  */
+typedef uint32_t Elf_Symndx;
+
+typedef struct
+  {
+       Elf32_Sword eb_tag;
+       union
+         {
+               Elf32_Word eb_val;
+               Elf32_Addr eb_ptr;
+               Elf32_Off eb_off;
+         } eb_un;
+  } Elf32_Boot;
+
+typedef struct
+  {
+       Elf64_Xword eb_tag;
+       union
+         {
+               Elf64_Xword eb_val;
+               Elf64_Addr eb_ptr;
+               Elf64_Off eb_off;
+         } eb_un;
+  } Elf64_Boot;
+
+typedef uint64_t       Elf32_Lword;
+typedef uint64_t       Elf64_Lword;
+
+#define DT_SUNW_AUXILIARY      0x6000000d
+#define DT_SUNW_RTLDINF                0x6000000e
+#define DT_SUNW_FILTER         0x6000000f
+#define DT_SUNW_CAP            0x60000010
+#define DT_SUNW_SYMTAB         0x60000011
+#define DT_SUNW_SYMSZ          0x60000012
+#define DT_SUNW_ENCODING       0x60000013
+#define DT_SUNW_SORTENT                0x60000013
+#define DT_SUNW_SYMSORT                0x60000014
+#define DT_SUNW_SYMSORTSZ      0x60000015
+#define DT_SUNW_TLSSORT                0x60000016
+#define DT_SUNW_TLSSORTSZ      0x60000017
+#define DT_SUNW_STRPAD         0x60000019
+#define DT_SUNW_LDMACH         0x6000001b
+
+#define NT_PRSTATUS    1
+#define NT_PRFPREG     2
+#define NT_PRPSINFO    3
+#define NT_PRXREG      4
+#define NT_PLATFORM    5
+#define NT_AUXV                6
+#define NT_GWINDOWS    7
+#define NT_ASRS                8
+#define NT_LDT         9
+#define NT_PSTATUS     10
+#define NT_PSINFO      13
+#define NT_PRCRED      14
+#define NT_UTSNAME     15
+#define NT_LWPSTATUS   16
+#define NT_LWPSINFO    17
+#define NT_PRPRIV      18
+#define NT_PRPRIVINFO  19
+#define NT_CONTENT     20
+#define NT_ZONENAME    21
+#define NT_NUM         21
index 0f1bf9a..6b06e5b 100644 (file)
 #ifndef _PROCFS_H
 #define _PROCFS_H
 
-#ifndef _STRUCTURED_PROC
-# define _STRUCTURED_PROC      1
+#ifdef _STRUCTURED_PROC
+# undef _STRUCTURED_PROC
 #endif
+#define _STRUCTURED_PROC    1
 
 #include <sys/procfs.h>
 
index 8ec3846..72743bc 100644 (file)
 #include <features.h>
 #include <proc_service.h>
 
+#define RD_VERSION1    1
+#define RD_VERSION2    2
+#define RD_VERSION3    3
+#define RD_VERSION4    4
+#define RD_VERSION     RD_VERSION4
+
+typedef enum
+  {
+       RD_ERR,
+       RD_OK,
+       RD_NOCAPAB,
+       RD_DBERR,
+       RD_NOBASE,
+       RD_NODYNAM,
+       RD_NOMAPS
+  } rd_err_e;
+
 typedef unsigned long Lmid_t;
 
 typedef struct rd_agent rd_agent_t;
index ce42f33..93cac60 100644 (file)
 #define        SHT_SUNW_verneed        SHT_GNU_verneed
 #define        SHT_SUNW_versym         SHT_GNU_versym
 
+typedef struct
+  {
+       Elf32_Word c_tag;
+       union
+         {
+               Elf32_Word c_val;
+               Elf32_Addr c_ptr;
+         } c_un;
+  } Elf32_Cap;
+
+typedef struct
+  {
+       Elf64_Xword c_tag;
+       union
+         {
+               Elf64_Xword c_val;
+               Elf64_Addr c_ptr;
+         } c_un;
+  } Elf64_Cap;
+
 #endif /* _SYS_ELF_H */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machelf.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/machelf.h
new file mode 100644 (file)
index 0000000..4b9caa7
--- /dev/null
@@ -0,0 +1,88 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+   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_MACHELF_H
+#define _SYS_MACHELF_H
+
+#include <sys/isa_defs.h>
+#include <sys/elf.h>
+#include <link.h>
+
+#ifdef _LP64
+
+typedef Elf64_Xword    Xword;
+typedef Elf64_Lword    Lword;
+typedef Elf64_Sxword   Sxword;
+typedef Elf64_Word     Word;
+typedef Elf64_Sword    Sword;
+typedef Elf64_Half     Half;
+typedef Elf64_Addr     Addr;
+typedef Elf64_Off      Off;
+typedef uchar_t                Byte;
+
+typedef Elf64_Ehdr     Ehdr;
+typedef Elf64_Shdr     Shdr;
+typedef Elf64_Sym      Sym;
+typedef Elf64_Syminfo  Syminfo;
+typedef Elf64_Rela     Rela;
+typedef Elf64_Rel      Rel;
+typedef Elf64_Nhdr     Nhdr;
+typedef Elf64_Phdr     Phdr;
+typedef Elf64_Dyn      Dyn;
+typedef Elf64_Boot     Boot;
+typedef Elf64_Verdef   Verdef;
+typedef Elf64_Verdaux  Verdaux;
+typedef Elf64_Verneed  Verneed;
+typedef Elf64_Vernaux  Vernaux;
+typedef Elf64_Versym   Versym;
+typedef Elf64_Move     Move;
+typedef Elf64_Cap      Cap;
+
+#else
+
+typedef Elf32_Word     Xword;
+typedef Elf32_Lword    Lword;
+typedef Elf32_Sword    Sxword;
+typedef Elf32_Word     Word;
+typedef Elf32_Sword    Sword;
+typedef Elf32_Half     Half;
+typedef Elf32_Addr     Addr;
+typedef Elf32_Off      Off;
+
+typedef Elf32_Ehdr     Ehdr;
+typedef Elf32_Shdr     Shdr;
+typedef Elf32_Sym      Sym;
+typedef Elf32_Syminfo  Syminfo;
+typedef Elf32_Rela     Rela;
+typedef Elf32_Rel      Rel;
+typedef Elf32_Nhdr     Nhdr;
+typedef Elf32_Phdr     Phdr;
+typedef Elf32_Dyn      Dyn;
+typedef Elf32_Boot     Boot;
+typedef Elf32_Verdef   Verdef;
+typedef Elf32_Verdaux  Verdaux;
+typedef Elf32_Verneed  Verneed;
+typedef Elf32_Vernaux  Vernaux;
+typedef Elf32_Versym   Versym;
+typedef Elf32_Move     Move;
+typedef Elf32_Cap      Cap;
+
+#endif /* _LP64 */
+
+#endif /* _SYS_MACHELF_H */
index 704ffc1..e5f9833 100644 (file)
@@ -20,6 +20,8 @@
 #ifndef _SYS_OLD_PROCFS_H
 #define _SYS_OLD_PROCFS_H      1
 
+#if _STRUCTURED_PROC == 0
+
 #include <sys/types.h>
 #include <sys/procset.h>
 #include <sys/ucontext.h>
@@ -84,6 +86,8 @@
 #define PRCLSZ         8
 #define PRSYSARGS      8
 
+#endif /* _STRUCTURED_PROC == 0 */
+
 typedef struct prstatus
   {
        int pr_flags;
@@ -121,6 +125,8 @@ typedef struct prstatus
        prgregset_t pr_reg;
   } prstatus_t;
 
+#if _STRUCTURED_PROC == 0
+
 #define        PR_STOPPED      0x0001
 #define        PR_ISTOP        0x0002
 #define        PR_DSTOP        0x0004
@@ -150,6 +156,8 @@ typedef struct prstatus
 #define        PRFNSZ          16
 #define        PRARGSZ         80
 
+#endif /* _STRUCTURED_PROC == 0 */
+
 typedef struct prpsinfo
   {
        char pr_state;
@@ -196,6 +204,8 @@ typedef struct prpsinfo
        int pr_filler[6];
   } prpsinfo_t;
 
+#if _STRUCTURED_PROC == 0
+
 typedef struct prrun
   {
        int pr_flags;
@@ -323,4 +333,6 @@ typedef struct prasmap
 #define prismember(set, flag) \
        ((((uint32_t *)(set))[__prword (flag)] & __prmask (flag)) ? 1 : 0)
 
+#endif /* _STRUCTURED_PROC == 0 */
+
 #endif /* _SYS_OLD_PROCFS_H */
index 47d8d4f..3792dc0 100644 (file)
@@ -59,4 +59,8 @@
 /* Maximum hostname length.  */
 #define MAXHOSTNAMELEN  256
 
+#include <unistd.h>
+
+#define PAGESIZE       sysconf(_SC_PAGESIZE)
+
 #endif /* sys/param.h */
diff --git a/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/proc.h b/sysdeps/unix/sysv/solaris2/kopensolaris-gnu/sys/proc.h
new file mode 100644 (file)
index 0000000..14b75e5
--- /dev/null
@@ -0,0 +1,31 @@
+/* Copyright (C) 2008 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by David Bartley <dtbartle@csclub.uwaterloo.ca>, 2008.
+
+   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_PROC_H
+#define _SYS_PROC_H
+
+#define SSLEEP         1
+#define SRUN           2
+#define SZOMB          3
+#define SSTOP          4
+#define SIDL           5
+#define SONPROC                6
+#define SWAIT          7
+
+#endif /* _SYS_PROC_H */
index 8a1a4aa..deb11b6 100644 (file)
@@ -42,6 +42,8 @@
 #define ZONE_ATTR_SCHED_CLASS  13
 #define ZONE_ATTR_FLAGS                14
 
+#define ZONENAME_MAX           64
+
 typedef struct
   {
        const char *zone_name;