]> Zhao Yanbai Git Server - minix.git/commitdiff
Move even more includes to common/include.
authorGianluca Guida <gianluca@minix3.org>
Thu, 3 Mar 2011 16:39:02 +0000 (16:39 +0000)
committerGianluca Guida <gianluca@minix3.org>
Thu, 3 Mar 2011 16:39:02 +0000 (16:39 +0000)
This patch moves more includes (most of them, to tell the truth) to
common/include directory. This completes the list of includes needed
to compile current trunk with the new libc (but to do that you need
more patches in queue).

This patch also contains some modification (for compilation with new
headers) to the common includes under __NBSD_LIBC, the define used
in mk script to specialize compilation with new includes.

67 files changed:
common/include/Makefile.inc
common/include/curses.h [moved from include/curses.h with 100% similarity]
common/include/ddekit/assert.h [moved from include/ddekit/assert.h with 100% similarity]
common/include/ddekit/attribs.h [moved from include/ddekit/attribs.h with 100% similarity]
common/include/ddekit/condvar.h [moved from include/ddekit/condvar.h with 100% similarity]
common/include/ddekit/ddekit.h [moved from include/ddekit/ddekit.h with 100% similarity]
common/include/ddekit/debug.h [moved from include/ddekit/debug.h with 100% similarity]
common/include/ddekit/initcall.h [moved from include/ddekit/initcall.h with 100% similarity]
common/include/ddekit/inline.h [moved from include/ddekit/inline.h with 100% similarity]
common/include/ddekit/interrupt.h [moved from include/ddekit/interrupt.h with 100% similarity]
common/include/ddekit/lock.h [moved from include/ddekit/lock.h with 100% similarity]
common/include/ddekit/memory.h [moved from include/ddekit/memory.h with 100% similarity]
common/include/ddekit/minix/msg_queue.h [moved from include/ddekit/minix/msg_queue.h with 100% similarity]
common/include/ddekit/minix/pci.h [moved from include/ddekit/minix/pci.h with 100% similarity]
common/include/ddekit/panic.h [moved from include/ddekit/panic.h with 100% similarity]
common/include/ddekit/pci.h [moved from include/ddekit/pci.h with 100% similarity]
common/include/ddekit/pgtab.h [moved from include/ddekit/pgtab.h with 100% similarity]
common/include/ddekit/printf.h [moved from include/ddekit/printf.h with 100% similarity]
common/include/ddekit/resources.h [moved from include/ddekit/resources.h with 100% similarity]
common/include/ddekit/semaphore.h [moved from include/ddekit/semaphore.h with 100% similarity]
common/include/ddekit/thread.h [moved from include/ddekit/thread.h with 100% similarity]
common/include/ddekit/timer.h [moved from include/ddekit/timer.h with 100% similarity]
common/include/ddekit/types.h [moved from include/ddekit/types.h with 100% similarity]
common/include/ddekit/usb.h [moved from include/ddekit/usb.h with 100% similarity]
common/include/env.h [moved from include/env.h with 84% similarity]
common/include/fetch.h [moved from include/fetch.h with 100% similarity]
common/include/hgfs.h [moved from include/hgfs.h with 100% similarity]
common/include/lib.h
common/include/libutil.h [moved from include/libutil.h with 100% similarity]
common/include/minix/acpi.h [moved from include/minix/acpi.h with 100% similarity]
common/include/minix/ansi.h
common/include/minix/audio_fw.h [moved from include/minix/audio_fw.h with 100% similarity]
common/include/minix/cpufeature.h [moved from include/minix/cpufeature.h with 100% similarity]
common/include/minix/crtso.h [moved from include/minix/crtso.h with 100% similarity]
common/include/minix/devman.h [moved from include/minix/devman.h with 100% similarity]
common/include/minix/dir.h [moved from include/minix/dir.h with 75% similarity]
common/include/minix/dmap.h [moved from include/minix/dmap.h with 100% similarity]
common/include/minix/driver.h [moved from include/minix/driver.h with 100% similarity]
common/include/minix/drivers.h [moved from include/minix/drivers.h with 100% similarity]
common/include/minix/drvlib.h [moved from include/minix/drvlib.h with 100% similarity]
common/include/minix/fslib.h [moved from include/minix/fslib.h with 100% similarity]
common/include/minix/hash.h [moved from include/minix/hash.h with 100% similarity]
common/include/minix/input.h [moved from include/minix/input.h with 100% similarity]
common/include/minix/ipc.h
common/include/minix/minlib.h
common/include/minix/mq.h [moved from include/minix/mq.h with 100% similarity]
common/include/minix/mthread.h [moved from include/minix/mthread.h with 98% similarity]
common/include/minix/netdriver.h [moved from include/minix/netdriver.h with 100% similarity]
common/include/minix/partition.h [moved from include/minix/partition.h with 100% similarity]
common/include/minix/procfs.h [moved from include/minix/procfs.h with 100% similarity]
common/include/minix/queryparam.h [moved from include/minix/queryparam.h with 100% similarity]
common/include/minix/sched.h [moved from include/minix/sched.h with 100% similarity]
common/include/minix/sound.h [moved from include/minix/sound.h with 100% similarity]
common/include/minix/tty.h [moved from include/minix/tty.h with 100% similarity]
common/include/minix/usb.h [moved from include/minix/usb.h with 100% similarity]
common/include/minix/usb_ch9.h [moved from include/minix/usb_ch9.h with 100% similarity]
common/include/minix/vfsif.h [moved from include/minix/vfsif.h with 100% similarity]
common/include/minix/vtreefs.h [moved from include/minix/vtreefs.h with 100% similarity]
common/include/net/gen/dhcp.h
common/include/sys/Makefile.inc
common/include/sys/kbdio.h [moved from include/sys/kbdio.h with 100% similarity]
common/include/sys/mtio.h [moved from include/sys/mtio.h with 100% similarity]
common/include/sys/svrctl.h [moved from include/sys/svrctl.h with 100% similarity]
common/include/sys/video.h [moved from include/sys/video.h with 100% similarity]
common/include/sys/vm.h [moved from include/sys/vm.h with 100% similarity]
common/include/timers.h [moved from include/timers.h with 100% similarity]
include/Makefile

index 62a4454a08dbc9531a8f4f4bccebecfec42810c4..2d606d8d022d25981f6715781d05637122dbbe6f 100644 (file)
@@ -2,16 +2,23 @@
 
 .PATH: ${MINIXSRCDIR}/common/include
 
-INCS+=         lib.h
+INCS+=         curses.h env.h fetch.h hgfs.h lib.h libutil.h timers.h
 
-INCS+=         minix/ansi.h minix/bitmap.h minix/callnr.h minix/com.h \
-       minix/compiler.h minix/config.h minix/const.h minix/debug.h \
-       minix/devio.h minix/ds.h minix/endpoint.h minix/gcov.h \
-       minix/ioctl.h minix/ipc.h minix/ipcconst.h minix/keymap.h \
-       minix/limits.h minix/minlib.h minix/portio.h minix/priv.h \
-       minix/profile.h minix/rs.h minix/safecopies.h minix/sef.h \
-       minix/spin.h minix/sys_config.h minix/sysinfo.h minix/syslib.h \
-       minix/sysutil.h minix/timers.h minix/type.h minix/u64.h minix/vm.h
+INCS+=         minix/acpi.h minix/ansi.h minix/audio_fw.h minix/bitmap.h \
+       minix/callnr.h minix/com.h minix/compiler.h minix/config.h \
+       minix/const.h minix/cpufeature.h minix/crtso.h minix/debug.h \
+       minix/devio.h minix/devman.h minix/dir.h minix/dmap.h \
+       minix/driver.h minix/drivers.h minix/drvlib.h minix/ds.h \
+       minix/endpoint.h minix/fslib.h minix/gcov.h minix/hash.h \
+       minix/ioctl.h minix/input.h minix/ipc.h minix/ipcconst.h \
+       minix/keymap.h minix/limits.h minix/mthread.h minix/minlib.h \
+       minix/mq.h minix/netdriver.h minix/partition.h minix/portio.h \
+       minix/priv.h minix/procfs.h minix/profile.h minix/queryparam.h \
+       minix/rs.h minix/safecopies.h minix/sched.h minix/sef.h \
+       minix/sound.h minix/spin.h minix/sys_config.h minix/sysinfo.h \
+       minix/syslib.h minix/sysutil.h minix/timers.h minix/type.h \
+       minix/tty.h minix/u64.h minix/usb.h minix/usb_ch9.h minix/vm.h \
+       minix/vfsif.h minix/vtreefs.h
 
 INCS+= net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \
        net/gen/eth_hdr.h net/gen/eth_io.h net/gen/icmp.h \
@@ -23,3 +30,10 @@ INCS+=       net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \
        net/gen/tcp.h net/gen/tcp_hdr.h net/gen/tcp_io.h \
        net/gen/udp.h net/gen/udp_hdr.h net/gen/udp_io.h \
        net/gen/vjhc.h
+
+INCS+= ddekit/assert.h ddekit/initcall.h ddekit/memory.h  ddekit/pgtab.h \
+        ddekit/thread.h ddekit/attribs.h ddekit/inline.h  ddekit/printf.h \
+        ddekit/timer.h ddekit/condvar.h ddekit/interrupt.h ddekit/panic.h \
+        ddekit/resources.h  ddekit/types.h  ddekit/debug.h  ddekit/lock.h \
+        ddekit/pci.h ddekit/semaphore.h  ddekit/usb.h  ddekit/minix/pci.h \
+        ddekit/minix/msg_queue.h ddekit/ddekit.h
similarity index 100%
rename from include/curses.h
rename to common/include/curses.h
similarity index 84%
rename from include/env.h
rename to common/include/env.h
index 81011fc7c5ebf575cca63ba20a01fac3ecce7de2..d0352b509eb0890e0b26c252a904afa4cf3416c4 100644 (file)
@@ -1,3 +1,6 @@
+#ifdef __NBSD_LIBC
+#include <minix/ansi.h>
+#endif
 _PROTOTYPE( int env_parse, (char *env, char *fmt, int field,
                        long *param, long min, long max)                );
 _PROTOTYPE( void env_panic, (char *env)                                        );
similarity index 100%
rename from include/fetch.h
rename to common/include/fetch.h
similarity index 100%
rename from include/hgfs.h
rename to common/include/hgfs.h
index 4b2f445033ce1f0185030a469271de7eacd71e13..bbe91189812fdb55f01975341f625463bf324f0a 100644 (file)
@@ -6,7 +6,12 @@
 #define _LIB_H
 
 /* First come the defines. */
+#ifdef __NBSD_LIBC
+#include <sys/featuretest.h>   /* tell headers to include NetBSD stuff. */
+#else /* !__NBSD_LIBC */
 #define _POSIX_SOURCE      1   /* tell headers to include POSIX stuff */
+#endif
+
 #define _MINIX             1   /* tell headers to include MINIX stuff */
 
 /* The following are so basic, all the lib files get them automatically. */
similarity index 100%
rename from include/libutil.h
rename to common/include/libutil.h
index ede54fa330d20619221ef00abbfd463f2b2938ee..316f4d027bb2ce1f95ab7f4dce0c6cd24cc85b1f 100644 (file)
 /* This should be defined as restrict when a C99 compiler is used. */
 #define _RESTRICT
 
+#ifdef __NBSD_LIBC
+/* Setting of _POSIX_SOURCE (or _NETBSD_SOURCE) in NBSD headers is 
+ * done in <sys/featuretest.h> */
+#include <sys/featuretest.h>
+
+/* Also, do not redefine _BSD_VA_LIST */
+
+#else /* !__NBSD_LIBC */
+
 /* Setting any of _MINIX, _POSIX_C_SOURCE or _POSIX2_SOURCE implies
  * _POSIX_SOURCE.  (Seems wrong to put this here in ANSI space.)
  */
@@ -69,7 +78,6 @@
 #define _POSIX_SOURCE  1
 #endif
 
-#ifndef __NBSD_LIBC
 /* What is a va_list? */
 #include <stdarg.h>
 #define _BSD_VA_LIST_ va_list
similarity index 75%
rename from include/minix/dir.h
rename to common/include/minix/dir.h
index 9c0a7dd5a599ba3da44171b666d8e7d148d7800e..ca9324061f257f93bff764454c408c18878c7959 100644 (file)
@@ -3,6 +3,9 @@
 #ifndef _DIR_H
 #define _DIR_H
 
+#ifdef __NBSD_LIBC
+#include <sys/cdefs.h>
+#endif
 #include <minix/types.h>
 
 #define        DIRBLKSIZ       512     /* size of directory block */
 struct direct {
   ino_t d_ino;
   char d_name[DIRSIZ];
+#ifdef __NBSD_LIBC 
+} __packed;
+#else
 };
+#endif
 
 #endif /* _DIR_H */
index c744256444330018ae083d81408f161ba2c18b8e..b53af790dc1a5d81c5f6865eb372d365f6cc98d8 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef _IPC_H
 #define _IPC_H
 
+#ifdef __NBSD_LIBC
+#include <minix/ansi.h>
+#endif
 #include <minix/ipcconst.h>
 #include <minix/type.h>
 
index aea58b96f940b679fee6e5eb7fa789b1bf81f74f..82f9cd9987741d779c219631fda002995473fb7e 100644 (file)
@@ -6,9 +6,11 @@
 #endif
 
 /* Miscellaneous BSD. */
-_PROTOTYPE(void swab, (char *_from, char *_to, int _count));
 _PROTOTYPE(char *itoa, (int _n));
+#ifndef __NBSD_LIBC
 _PROTOTYPE(char *getpass, (const char *_prompt));
+_PROTOTYPE(void swab, (char *_from, char *_to, int _count));
+#endif /* !_NBSD_LIBC */
 
 /* Miscellaneous MINIX. */
 _PROTOTYPE(void std_err, (const char *_s));
similarity index 100%
rename from include/minix/mq.h
rename to common/include/minix/mq.h
similarity index 98%
rename from include/minix/mthread.h
rename to common/include/minix/mthread.h
index 9adcf59ab428dcd3a74d49d6795781cc450f7458..8098db037efb03d2ec378b4ad7e3d40414748b76 100644 (file)
@@ -9,8 +9,13 @@
 #include <ucontext.h>
 #include <errno.h>
 #include <stdlib.h>
+#ifndef __NBSD_LIBC
 #include <alloca.h>
+#endif
 #include <limits.h>
+#ifdef __NBSD_LIBC
+#include <sys/signal.h>
+#endif
 
 typedef int mthread_thread_t;
 typedef int mthread_once_t;
index d782e341c1d90bb0dd6f12a4a942a08e4cfef2ba..911d29380bf5aed3aa3b557bfb891be0cf8953a3 100644 (file)
@@ -32,7 +32,11 @@ typedef struct dhcp {
 #define DHCP_FLAGS_BCAST    0x8000U    /* Reply must be broadcast to client. */
 
                                        /* "Magic" first four option bytes. */
+#ifdef __NBSD_LIBC
+#define DHCP_MAGIC     htonl(0x63825363UL)
+#else
 #define DHCP_MAGIC     HTONL(0x63825363UL)
+#endif
 
 /* DHCP common tags: */
 #define DHCP_TAG_NETMASK        1      /* Netmask. */
index 780636f52d3a7687266fc1cd80861aad29128bba..e5b9fbd15a64281f47ed32cea161ef95dbbc657d 100644 (file)
@@ -3,5 +3,6 @@
 .PATH: ${MINIXSRCDIR}/common/include/sys
 
 INCS+=         ioc_cmos.h ioc_file.h ioc_scsi.h ioc_tape.h \
-       ioc_disk.h ioc_memory.h ioc_sound.h ioc_tty.h
+       ioc_disk.h ioc_memory.h ioc_sound.h ioc_tty.h \
+       kbdio.h mtio.h svrctl.h video.h vm.h
 
similarity index 100%
rename from include/sys/mtio.h
rename to common/include/sys/mtio.h
similarity index 100%
rename from include/sys/vm.h
rename to common/include/sys/vm.h
similarity index 100%
rename from include/timers.h
rename to common/include/timers.h
index c7fa23139b2b6960dfc2cb67b20d15bf772eaf54..d8f9ffd24b3afa96b5a22f190653e2aa3c11f706 100644 (file)
@@ -12,34 +12,12 @@ INCS=       alloca.h a.out.h ar.h assert.h configfile.h ctype.h \
        hgfs.h tzfile.h util.h fetch.h mpool.h ndbm.h db.h poll.h resolv.h \
        memory.h paths.h libexec.h complex.h
 INCS+= arpa/inet.h arpa/nameser.h
-INCS+= minix/a.out.h minix/cdrom.h minix/cpufeature.h \
-       minix/crtso.h minix/dirent.h \
-       minix/dir.h minix/dl_eth.h minix/dmap.h minix/driver.h \
-       minix/acpi.h \
-       minix/drivers.h minix/drvlib.h \
-       minix/fslib.h \
-       minix/mq.h minix/mthread.h \
-       minix/netdriver.h minix/partition.h \
-       minix/procfs.h \
-       minix/queryparam.h \
-       minix/sched.h minix/sound.h \
-       minix/tty.h minix/types.h \
-       minix/vfsif.h minix/vtreefs.h \
-       minix/compiler-ack.h minix/sha2.h minix/sha1.h minix/md5.h \
-       minix/audio_fw.h minix/hash.h minix/input.h \
-       minix/devman.h minix/usb.h minix/usb_ch9.h 
+INCS+= minix/a.out.h minix/cdrom.h minix/compiler-ack.h minix/dirent.h \
+       minix/dl_eth.h minix/md5.h minix/sha1.h minix/sha2.h minix/types.h
        
 INCS+= net/hton.h net/if.h net/ioctl.h net/netlib.h
 INCS+= netinet/if_ether.h netinet/in.h netinet/tcp.h
 
-INCS+= ddekit/assert.h ddekit/initcall.h ddekit/memory.h  ddekit/pgtab.h \
-        ddekit/thread.h ddekit/attribs.h ddekit/inline.h  ddekit/printf.h \
-        ddekit/timer.h ddekit/condvar.h ddekit/interrupt.h ddekit/panic.h \
-        ddekit/resources.h  ddekit/types.h  ddekit/debug.h  ddekit/lock.h \
-        ddekit/pci.h ddekit/semaphore.h  ddekit/usb.h  ddekit/minix/pci.h \
-        ddekit/minix/msg_queue.h ddekit/ddekit.h
-
-
 .include <bsd.own.mk>
 
 INCSDIR=        /usr/include