We have a nice little collection of text files describing various high
level things.  But they're all over the place.  This commits moves
them all to the new docs/internals/ directory, and gives them 
a consistent naming scheme.




git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4196 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/Makefile.am b/Makefile.am
index d9e42f8..ce6740a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,9 +43,8 @@
 	ACKNOWLEDGEMENTS \
 	README_DEVELOPERS \
 	README_PACKAGERS \
-	README_XML_OUTPUT.txt \
 	THREADS_SYSCALLS_SIGNALS.txt \
-	README_MISSING_SYSCALL_OR_IOCTL TODO NOTES.txt \
+	README_MISSING_SYSCALL_OR_IOCTL \
 	valgrind.spec valgrind.spec.in valgrind.pc.in \
 	Makefile.all.am Makefile.tool.am Makefile.core-AM_CPPFLAGS.am \
 	Makefile.tool-inplace.am
diff --git a/NOTES.syscalls b/NOTES.syscalls
deleted file mode 100644
index 86e3231..0000000
--- a/NOTES.syscalls
+++ /dev/null
@@ -1,195 +0,0 @@
-- works on stock 2.4 kernels, but the scheduler loop must poll
-- works on RH9 2.4.20-18.9 kernel, but doesn't seem quite as stable 
-  as 2.5/2.6
-  for pending signals rather than relying on the kernel delivering them
-  to the right place.
-- most tested on 2.6.0-test1 and up
-
-- running job-control programs (ie, bash) under Valgrind won't work
-  properly without a kernel patch (as of 2.6.0-test2-mm2).  This is because
-  threads in a thread group don't follow the thread group leader's changes
-  in process group ID, and they can't change it for themselves.
-
-- SA_NOCLDWAIT doesn't work properly if the program is actually blocked
-  in wait4() when SIGCHLD arrives; the wait4() will return details for
-  the exiting child.  In other circumstances children should be quietly reaped.
-  [ This may be fixable when running under RH2.4 and 2.6, since we can
-    set NOCLDWAIT in the kernel's state without risk of losing our child
-    threads. ]
-
-- 2.4 has somewhat disfunctional thread/signal interactions, so many test
-  do not work as well under 2.4.  In general, it should be no worse than
-  the old signal code.  I don't intend spending a lot of time fixing this
-  because 2.6 is nearly ready for widespread use.
-
-TODO:
-
-- support application use of clone().  Interesting question is which
-  options do we support?  Do we need to implement futex as well, or can
-  we just use the kernel's implementation?
-
-========================================
-Testing
-
-I've been testing with the Posix test suite:
-http://sourceforge.net/projects/posixtest/, version 1.2.0.  
-
-----------------------------------------
-Expected failures:
-
-conformance/interfaces/sigwaitinfo/6-1.test
-	pthread_kill() calls the tkill syscall, which causes a code of
-	SI_TKILL rather than the SI_USER which this test expects.
-
-conformance/interfaces/sigrelse/3-*.test
-	glibc bug in sigrelse(), which fails without Valgrind too.
-
-conformance/interfaces/pthread_barrier_*/*
-	Valgrind's libpthreads doesn't implement pthread_barrier_*.
-	(There are some passes, but I don't know why.)
-
-conformance/interfaces/pthread_cond_timedwait/2-3
-	This test is just completely broken.  It does expose a problem
-	in Valgrind's mutex implementation - it is too dependent on
-	the client code not doing stupid stuff.  This test makes
-	Valgrind have an assertion failure.
-
-conformance/interfaces/pthread_condattr_getpshared/*
-	pthread_condattr_getpshared not implemented
-
-conformance/interfaces/pthread_condattr_setpshared/*
-	pthread_condattr_setpshared not implemented
-
-conformance/interfaces/pthread_key_create/speculative/5-1
-	Valgrind should cope with key overload
-
-conformance/interfaces/pthread_mutex_timedlock/*
-	not implemented
-
-conformance/interfaces/pthread_rwlock_rdlock/2-1:
-	relies on pthread_setschedparam
-
-conformance/interfaces/pthread_rwlock_timedrdlock/*
-	valgrind's libpthread.so: UNIMPLEMENTED FUNCTION: pthread_rwlock_timedrdlock
-
-conformance/interfaces/pthread_rwlockattr_getpshared/*
-	pthread_rwlockattr_getpshared not implemented
-
-conformance/interfaces/pthread_rwlockattr_setpshared/*
-	pthread_rwlockattr_setpshared not implemented
-
-conformance/interfaces/sched_rr_get_interval/*
-	syscall 161 (sched_rr_get_interval) not implemented
-
-conformance/interfaces/sigaction/21-1
-	Subtle problem: if app specifies SA_NOCLDWAIT on their SIGCHLD
-	signal handler, Valgrind will attempt to catch the SIGCHLD and
-	wait4() on all the children before returning to the app.
-	However, if the app was running a wait4() at the time the
-	SIGCHLD arrives, it will get the child's status.  Quite what
-	the app is doing running wait4() when it explicitly asked for
-	it to be useless, I'm not sure...
-
-conformance/interfaces/sigaction/17-{3,6,8,12}
-	(2.4) These fail under 2.4 because they deal with SIGSEGV, SIGBUS
-	and SIGILL.  These signals can only be delivered if there's a
-	thread immediately ready to handle them, but cannot be left
-	pending indefinitely.  These tests hang forever because the
-	signal is discarded rather than delivered.
-
-conformance/interfaces/sigqueue/{1,4,8}-1
-	(2.4) Signals that we route manually do not have queued data
-	associated with them - they are routed with tkill.  Also
-	pending signals are only kept in a mask, not in a queue, so
-	there can only be one at a time.
-
-----------------------------------------
-
-Still to investigate:
-
-conformance/interfaces/pthread_detach/4-1
-
-+conformance/interfaces/pthread_rwlock_rdlock/4-1: execution: FAILED: Output:
-+main: attempt write lock
-+main: acquired write lock
-+sig_thread: attemp read lock
-+main: fire SIGUSR1 to sig_thread
-+SIGUSR1 was not caught by sig_thread
-
-
-+conformance/interfaces/pthread_rwlock_unlock/4-1: execution: FAILED: Output:
-+Test FAILED: Incorrect error code, expected 0 or EINVAL, got 1
-
-+conformance/interfaces/pthread_rwlock_wrlock/2-1: execution: FAILED: Output:
-+main: attempt write lock
-+sig_thread: attempt write lock
-+main: fire SIGUSR1 to sig_thread
-+The signal handler did not get called.
-
-+conformance/interfaces/pthread_rwlock_wrlock/3-1: execution: FAILED: Output:
-+
-+sched status:
-+
-+Thread 1: status = WaitCV, associated_mx = 0x40115910, associated_cv = 0x401158E0
-+==11243==    at 0x40102962: pthread_cond_wait (vg_libpthread.c:1093)
-+==11243==    by 0x40104976: __pthread_rwlock_wrlock (vg_libpthread.c:2619)
-+==11243==    by 0x8048588: main (3-1.c:53)
-+==11243==    by 0x4013DA46: __libc_start_main (in /lib/libc-2.3.2.so)
-+
-+==11243== Warning: pthread scheduler exited due to deadlock
-+
-+valgrind: vg_main.c:1619 (vgPlain_main): Assertion `vgPlain_threads[vgPlain_last_run_tid].status == VgTs_Runnable' failed.
-+
-+sched status:
-+
-+Thread 1: status = WaitCV, associated_mx = 0x40115910, associated_cv = 0x401158E0
-+==11243==    at 0x40102962: pthread_cond_wait (vg_libpthread.c:1093)
-+==11243==    by 0x40104976: __pthread_rwlock_wrlock (vg_libpthread.c:2619)
-+==11243==    by 0x8048588: main (3-1.c:53)
-+==11243==    by 0x4013DA46: __libc_start_main (in /lib/libc-2.3.2.so)
-
-
-+conformance/interfaces/sem_close/1-1.test:
-/home/jeremy/bk/valgrind/syscalls/coregrind/.in_place/libpthread.so.0:
-version `GLIBC_2.1.1' not found (required by
-conformance/interfaces/sem_close/1-1.test)
-
-+conformance/interfaces/sem_timedwait/6-1: execution: FAILED: Output:
-+TEST FAILED
-+conformance/interfaces/sem_timedwait/6-2: execution: FAILED: Output:
-+TEST FAILED
-
-+conformance/interfaces/sem_timedwait/9-1: execution: FAILED: Output:
-+In handler
-+TEST FAILED: errno != EINTR
-
-
-conformance/interfaces/sigaction/10-1: 
-	Used to work.  Mysterious.  Works everywhere except in the test harness...
-
-
-+conformance/interfaces/sigpause/1-2: execution: FAILED: Output:
-+
-+valgrind: vg_mylibc.c:1324 (vgPlain_read_millisecond_timer): Assertion `rdtsc_now > rdtsc_cal_end_raw' failed.
-+
-+sched status:
-+
-+Thread 1: status = Sleeping, associated_mx = 0x0, associated_cv = 0x0
-+==19929==    at 0x401D6765: __GI___libc_nanosleep (in /lib/libc-2.3.2.so)
-+==19929==    by 0x80485C1: main (1-2.c:65)
-+==19929==    by 0x4013DA46: __libc_start_main (in /lib/libc-2.3.2.so)
-+==19929==    by 0x8048494: ??? (start.S:81)
-+
-+Thread 2: status = WaitSys, associated_mx = 0x0, associated_cv = 0x0
-+==19929==    at 0x40150796: __libc_sigsuspend (in /lib/libc-2.3.2.so)
-+==19929==    by 0x401509B3: __GI___sigpause (in /lib/libc-2.3.2.so)
-+==19929==    by 0x804857C: a_thread_func (1-2.c:48)
-+==19929==    by 0x40102099: thread_wrapper (vg_libpthread.c:667)
-
-
-
-----------------------------------------
-
-Fixes:
-conformance/interfaces/pthread_detach/4-2
-	This fails under NPTL, but passes under Valgrind
diff --git a/TODO b/TODO
deleted file mode 100644
index 738e509..0000000
--- a/TODO
+++ /dev/null
@@ -1,15 +0,0 @@
-
-Doesn't run
-~~~~~~~~~~~
-User Mode Linux.
-Wine.
-
-
-Desirable
-~~~~~~~~~
-Stack: make return address into NoAccess ?
-
-
-Future
-~~~~~~
-Automatic invariant inference and checking.
diff --git a/configure.in b/configure.in
index 46acbb0..e2d4b1a 100644
--- a/configure.in
+++ b/configure.in
@@ -455,6 +455,7 @@
    docs/Makefile 
    docs/lib/Makefile
    docs/images/Makefile
+   docs/internals/Makefile
    docs/xml/Makefile
    tests/Makefile 
    tests/vg_regtest 
diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am
index d58cd2d..978e8bb 100644
--- a/coregrind/Makefile.am
+++ b/coregrind/Makefile.am
@@ -80,10 +80,6 @@
 	vki_unistd-ppc32-linux.h\
 	vki_unistd-x86-linux.h
 
-EXTRA_DIST = \
-	README_MODULES.txt \
-	README_TRACKING_FN_ENTRY_EXIT
-
 BUILT_SOURCES = stage2.lds
 CLEANFILES = stage2.lds
 	
diff --git a/coregrind/m_aspacemgr/Makefile.am b/coregrind/m_aspacemgr/Makefile.am
index c2685f5..c9ea0cc 100644
--- a/coregrind/m_aspacemgr/Makefile.am
+++ b/coregrind/m_aspacemgr/Makefile.am
@@ -1,8 +1,6 @@
 include $(top_srcdir)/Makefile.all.am
 include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
 
-EXTRA_DIST = README_SEGMENTS
-
 noinst_LIBRARIES = libaspacemgr.a
 
 libaspacemgr_a_SOURCES = \
diff --git a/coregrind/m_replacemalloc/Makefile.am b/coregrind/m_replacemalloc/Makefile.am
index 4e1942d..0fcccb2 100644
--- a/coregrind/m_replacemalloc/Makefile.am
+++ b/coregrind/m_replacemalloc/Makefile.am
@@ -1,9 +1,6 @@
 include $(top_srcdir)/Makefile.all.am
 include $(top_srcdir)/Makefile.core-AM_CPPFLAGS.am
 
-EXTRA_DIST = \
-	README_REPLACEMALLOC.txt
-
 noinst_LIBRARIES = \
 	libreplacemalloc_core.a \
 	libreplacemalloc_toolpreload.a
diff --git a/coregrind/m_syswrap/Makefile.am b/coregrind/m_syswrap/Makefile.am
index d380e93..a08df24 100644
--- a/coregrind/m_syswrap/Makefile.am
+++ b/coregrind/m_syswrap/Makefile.am
@@ -3,7 +3,6 @@
 
 # Remember to include all the OS/platform-specific files in the distribution.
 EXTRA_DIST = \
-	README_SYSWRAP.txt \
 	$(addsuffix .S,$(addprefix syscall-,$(VG_PLATFORM_ALL))) \
 	$(addsuffix .c,$(addprefix syswrap-,$(VG_OS_ALL))) \
 	$(addsuffix .c,$(addprefix syswrap-,$(VG_PLATFORM_ALL)))
diff --git a/docs/Makefile.am b/docs/Makefile.am
index bf55b6d..e266b30 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -1,11 +1,6 @@
-SUBDIRS = xml lib images
+SUBDIRS = xml lib images internals
 
-EXTRA_DIST = \
-	64-bit-cleanness \
-	directory-structure \
-	README \
-	porting-HOWTO porting-to-ARM \
-	tm-mutexstates.dot tm-threadstates.dot
+EXTRA_DIST = README
 
 dist_man_MANS = valgrind.1
 
diff --git a/docs/README b/docs/README
index 250aa5c..57cafd3 100644
--- a/docs/README
+++ b/docs/README
@@ -26,6 +26,8 @@
   docs/xml/vg-entities.xml: Various strings, dates etc. used all over
   docs/xml/xml_help.txt:    Basic guide to common XML tags.
 
+The docs/internals directory contains some useful high-level stuff about
+Valgrind's internals.  It's not relevant for the rest of this discussion.
 
 Overview
 ---------
diff --git a/docs/64-bit-cleanness b/docs/internals/64-bit-cleanness.txt
similarity index 89%
rename from docs/64-bit-cleanness
rename to docs/internals/64-bit-cleanness.txt
index 45d4241..f0a3013 100644
--- a/docs/64-bit-cleanness
+++ b/docs/internals/64-bit-cleanness.txt
@@ -1,6 +1,12 @@
 -----------------------------------------------------------------------------
 64-bit cleanness
 -----------------------------------------------------------------------------
+
+[19-Jul-2005:  I assume most of these are gone, now that AMD64 is working
+pretty well.  The Addrcheck and Helgrind ones are probably still true,
+though.  --njn]
+
+
 The following are places I know or suspect contain code that is not 64-bit
 clean.  Please mark them off this list as they are fixed, and add any new ones
 you know of.
diff --git a/docs/directory-structure b/docs/internals/directory-structure.txt
similarity index 100%
rename from docs/directory-structure
rename to docs/internals/directory-structure.txt
diff --git a/coregrind/m_replacemalloc/README_REPLACEMALLOC.txt b/docs/internals/m_replacemalloc.txt
similarity index 100%
rename from coregrind/m_replacemalloc/README_REPLACEMALLOC.txt
rename to docs/internals/m_replacemalloc.txt
diff --git a/coregrind/m_syswrap/README_SYSWRAP.txt b/docs/internals/m_syswrap.txt
similarity index 100%
rename from coregrind/m_syswrap/README_SYSWRAP.txt
rename to docs/internals/m_syswrap.txt
diff --git a/coregrind/README_MODULES.txt b/docs/internals/module-structure.txt
similarity index 100%
rename from coregrind/README_MODULES.txt
rename to docs/internals/module-structure.txt
diff --git a/NOTES.txt b/docs/internals/notes.txt
similarity index 100%
rename from NOTES.txt
rename to docs/internals/notes.txt
diff --git a/docs/porting-HOWTO b/docs/internals/porting-HOWTO.txt
similarity index 100%
rename from docs/porting-HOWTO
rename to docs/internals/porting-HOWTO.txt
diff --git a/docs/porting-to-ARM b/docs/internals/porting-to-ARM.txt
similarity index 100%
rename from docs/porting-to-ARM
rename to docs/internals/porting-to-ARM.txt
diff --git a/coregrind/m_aspacemgr/README_SEGMENTS b/docs/internals/segments-seginfos.txt
similarity index 100%
rename from coregrind/m_aspacemgr/README_SEGMENTS
rename to docs/internals/segments-seginfos.txt
diff --git a/THREADS_SYSCALLS_SIGNALS.txt b/docs/internals/threads-syscalls-signals.txt
similarity index 100%
rename from THREADS_SYSCALLS_SIGNALS.txt
rename to docs/internals/threads-syscalls-signals.txt
diff --git a/docs/tm-mutexstates.dot b/docs/internals/tm-mutexstates.dot
similarity index 100%
rename from docs/tm-mutexstates.dot
rename to docs/internals/tm-mutexstates.dot
diff --git a/docs/tm-threadstates.dot b/docs/internals/tm-threadstates.dot
similarity index 100%
rename from docs/tm-threadstates.dot
rename to docs/internals/tm-threadstates.dot
diff --git a/coregrind/README_TRACKING_FN_ENTRY_EXIT b/docs/internals/tracking-fn-entry-exit.txt
similarity index 100%
rename from coregrind/README_TRACKING_FN_ENTRY_EXIT
rename to docs/internals/tracking-fn-entry-exit.txt
diff --git a/README_XML_OUTPUT.txt b/docs/internals/xml-output.txt
similarity index 100%
rename from README_XML_OUTPUT.txt
rename to docs/internals/xml-output.txt