]> rtime.felk.cvut.cz Git - l4.git/commitdiff
update
authorl4check <l4check@d050ee49-bd90-4346-b210-929a50b99cfc>
Thu, 19 Aug 2010 11:31:49 +0000 (11:31 +0000)
committerl4check <l4check@d050ee49-bd90-4346-b210-929a50b99cfc>
Thu, 19 Aug 2010 11:31:49 +0000 (11:31 +0000)
git-svn-id: http://svn.tudos.org/repos/oc/tudos/trunk@17 d050ee49-bd90-4346-b210-929a50b99cfc

23 files changed:
kernel/fiasco/src/jdb/jdb_tcb.cpp
kernel/fiasco/src/kern/ia32/64/trap_state-amd64.cpp
kernel/fiasco/src/kern/sched_context-fixed_prio.cpp
kernel/fiasco/src/kern/sched_context-fp_wfq.cpp
l4/conf/examples/arm-rv-lcd.cfg
l4/conf/examples/x86-fb.cfg
l4/pkg/bootstrap/server/src/Make.rules
l4/pkg/bootstrap/server/src/region.cc
l4/pkg/bootstrap/server/src/startup.cc
l4/pkg/l4re/util/include/cap_alloc_impl.h
l4/pkg/l4re/util/libs/cap_alloc.cc
l4/pkg/l4sys/include/ARCH-amd64/__vcpu-arch.h
l4/pkg/l4sys/lib/src/errtostr.c
l4/pkg/l4util/include/ARCH-x86/rdtsc.h
l4/pkg/libio-io/include/types.h
l4/pkg/libio-io/lib/src/io.cc
l4/pkg/sqlite/lib/README
l4/pkg/sqlite/lib/contrib/configure
l4/pkg/sqlite/lib/contrib/configure.ac
l4/pkg/sqlite/lib/contrib/sqlite3.c
l4/pkg/sqlite/lib/contrib/sqlite3.h
l4/pkg/sqlite/lib/contrib/sqlite3.pc
l4/pkg/tmpfs/lib/src/fs.cc

index f55ff55a12da048c10ea63205ef7eda5f38f0c6d..3bb0fa9b298ecd08f23b142a0aa6a301a30045b1 100644 (file)
@@ -441,8 +441,8 @@ Jdb_tcb::vcpu_state_str(Mword state, char *s, int len)
   snprintf(s, len, "%c%c%c%c%c%c",
            (state & Vcpu_state::F_fpu_enabled) ? 'F' : 'f',
            (state & Vcpu_state::F_user_mode)   ? 'U' : 'u',
-           (state & Vcpu_state::F_exceptions)  ? 'E' : 'e',
            (state & Vcpu_state::F_debug_exc)   ? 'D' : 'd',
+           (state & Vcpu_state::F_exceptions)  ? 'E' : 'e',
            (state & Vcpu_state::F_page_faults) ? 'P' : 'p',
            (state & Vcpu_state::F_irqs)        ? 'I' : 'i');
   s[len - 1] = 0;
index 7c2a1eb87bc6087198b937d2dd5ebe934734b5d4..2bba048f5176443e15b7503199a25a063714320a 100644 (file)
@@ -62,6 +62,7 @@ void
 Trap_state::sanitize_user_state()
 {
   _cs = Gdt::gdt_code_user | Gdt::Selector_user;
+  _ss = Gdt::gdt_data_user | Gdt::Selector_user;
   _flags = (_flags & ~(EFLAGS_IOPL | EFLAGS_NT)) | EFLAGS_IF;
 }
 
index 03eb5a23227c43ef32f5c1dcd970430825ebde8f..318aebff1fd6923e6b4af602f07fc3b57f50a138 100644 (file)
@@ -60,7 +60,8 @@ IMPLEMENTATION [sched_fixed_prio]:
  */
 PUBLIC
 Sched_context::Sched_context()
-: _prio(Config::boot_prio),
+: _ready_next(0),
+  _prio(Config::boot_prio),
   _quantum(Config::default_time_slice),
   _left(Config::default_time_slice)
 {}
index 7067b5de35083d13ee4220bd7e2b74c19513729d..454660202da2a5f190470e30bcf1c226db5e23c5 100644 (file)
@@ -113,6 +113,7 @@ Sched_context::Sched_context()
   _sc.fp._p = Config::boot_prio;
   _sc.fp._q = Config::default_time_slice;
   _sc.fp._left = Config::default_time_slice;
+  _sc.fp._ready_next = 0;
 }
 
 IMPLEMENT inline
index 5be0b6fbd069f24444ad8769a9e8128a4cd69714..ddb8eb7486f93125e5f54f2cfac88583c88fb3eb 100644 (file)
@@ -61,7 +61,7 @@ l:start({
 e = l:start({ caps = {
                 fb = mag_caps.svc:create(L4.Proto.Goos, "640x480"),
              },
-              log      = { "png", "b" },
+              log      = { "spectrum", "b" },
              l4re_dbg = L4.Dbg.Warn,
              -- scheduler = L4.Env.user_factory:create(L4.Proto.Scheduler, 0x18, 0x8),
            },
index 968ecc40c067668201ffe32daf9182734a901c1f..60e3819a058bacebc63ea395f6ffe892bc88a347 100644 (file)
@@ -60,7 +60,7 @@ l:start({
 e = l:start({ caps = {
                 fb = mag_caps.svc:create(L4.Proto.Goos, "640x480"),
              },
-              log      = { "png", "b" },
+              log      = { "spectrum", "b" },
              l4re_dbg = L4.Dbg.Warn,
              -- scheduler = L4.Env.user_factory:create(L4.Proto.Scheduler, 0x18, 0x8),
            },
index 94b59adcbc6591f42fe380b40b2ff8a7f54b7ec8..a237d1b5822341a6eb176f8a0a4bed63a77d1437 100644 (file)
@@ -408,7 +408,7 @@ clean cleanall::
 else
 bootstrap: $(BOOTSTRAP_ELF_NAME)
        $(VERBOSE)$(LN) -f $^ $@
+endif
 
 bootstrap_$(ENTRY_FN): $(BOOTSTRAP_ELF_NAME)
        $(VERBOSE)$(LN) -f $^ $@
-endif
index 0a7cb2496532815a346bb37a1434f8aa4525a609..bd261730bfa8025160b9d5866404e89472fa019d 100644 (file)
@@ -152,7 +152,7 @@ Region_list::contains(Region const &o)
 void
 Region::print() const
 {
-  printf("  [%9llx, %9llx]", begin(), end());
+  printf("  [%9llx, %9llx] {%9llx}", begin(), end(), end() - begin() + 1);
 }
 
 void
index 6aee7c3dcf92745491f4699198e5cfd9ff62313b..99505a0519ea8b4e8cc9897261164701f63e4047 100644 (file)
@@ -401,8 +401,8 @@ static void
 move_modules(l4util_mb_info_t *mbi, unsigned long modaddr)
 {
   long offset = modaddr - (L4_MB_MOD_PTR(mbi->mods_addr))[0].mod_start;
-  unsigned i;
-  unsigned dir = offset > 0 ? mbi->mods_count : 1;
+  unsigned i, i_end;
+  unsigned dir = offset > 0 ? -1 : 1;
 
   if (!offset)
     {
@@ -410,15 +410,18 @@ move_modules(l4util_mb_info_t *mbi, unsigned long modaddr)
       return;
     }
 
-  printf("  move modules to %lx with offset %lx\n", modaddr, offset);
+  printf("  Moving %d modules to %lx with offset %lx\n",
+         mbi->mods_count, modaddr, offset);
 
-  for (i = dir; i != mbi->mods_count - dir ; offset > 0 ? i-- : i++)
+  i     = dir == 1 ? 1 : mbi->mods_count;
+  i_end = dir == 1 ? mbi->mods_count + 1 : 0;
+  for (; i != i_end ; i += dir)
     {
       unsigned long start = (L4_MB_MOD_PTR(mbi->mods_addr))[i-1].mod_start;
       unsigned long end = (L4_MB_MOD_PTR(mbi->mods_addr))[i-1].mod_end;
 
       if (start == end)
-       continue;
+        continue;
 
 #ifdef VERBOSE_LOAD
       unsigned char c[5];
@@ -431,14 +434,14 @@ move_modules(l4util_mb_info_t *mbi, unsigned long modaddr)
       c[1] = c[1] < 32 ? '.' : c[1];
       c[2] = c[2] < 32 ? '.' : c[2];
       c[3] = c[3] < 32 ? '.' : c[3];
-      printf("  move module %02d { %lx, %lx } (%s) -> { %lx - %lx }\n",
+      printf("  moving module %02d { %lx, %lx } (%s) -> { %lx - %lx }\n",
              i, start, end, c, start + offset, end + offset);
 
       for (int a = 0; a < 0x100; a += 4)
        printf("%08lx%s", *(unsigned long *)(start + a), (a % 32 == 28) ? "\n" : " ");
       printf("\n");
 #else
-      printf("  move module %02d { %lx-%lx } -> { %lx-%lx }\n",
+      printf("  moving module %02d { %lx-%lx } -> { %lx-%lx }\n",
              i, start, end, start + offset, end + offset);
 #endif
 
index 35a4333755acab0d0027030ae4e9d75efca53083..f4fb92178a5ca898f87c1eadf6f6091b10cfdc8d 100644 (file)
@@ -24,7 +24,8 @@
 
 #pragma once
 
-#if defined(L4RE_NO_COUNTING_CAP_ALLOC)
+//#define L4RE_STATIC_CAP_ALLOC
+#if defined(L4RE_STATIC_CAP_ALLOC)
 
 #include <l4/re/util/bitmap_cap_alloc>
 
index 272fc72a620e917769e0e6935c0dfa1650cc3265..0467e7c681ac36cb50aef20a6c31d4c21a8173aa 100644 (file)
  * invalidate any other reasons why the executable file might be covered by
  * the GNU General Public License.
  */
-#include <l4/re/util/cap_alloc>
-#include <l4/re/env>
+
 #include <l4/crtn/initpriorities.h>
-#include <l4/re/dataspace>
-#include <l4/re/mem_alloc>
+#include <l4/re/env>
+#include <l4/re/util/cap_alloc>
+
+//#define L4RE_STATIC_CAP_ALLOC
+#if defined(L4RE_STATIC_CAP_ALLOC)
 
 namespace
 {
-#if defined(L4RE_NO_COUNTING_CAP_ALLOC)
-
   L4Re::Util::Cap_alloc<4096> __attribute__((init_priority(INIT_PRIO_L4RE_UTIL_CAP_ALLOC))) __cap_alloc(L4Re::Env::env()->first_free_cap());
+};
 #else
 
+#include <l4/re/dataspace>
+#include <l4/re/mem_alloc>
+
+namespace
+{
   struct Ca : public L4Re::Util::_Cap_alloc
   {
     enum { Caps = 4096 };
@@ -51,8 +57,8 @@ namespace
   };
 
   Ca __attribute__((init_priority(INIT_PRIO_L4RE_UTIL_CAP_ALLOC))) __cap_alloc;
-#endif
 };
+#endif
 
 
 namespace L4Re { namespace Util {
index bb898dbed2ada26c878a819bdeef32dfa1a0a6ea..e47f30e75780bb7f99954bcca57d62622c9215d0 100644 (file)
 typedef struct l4_vcpu_regs_t
 {
 #if 0
-  l4_umword_t es;      /**< gs register */
-  l4_umword_t ds;      /**< fs register */
+  l4_umword_t es;      /**< es register */
+  l4_umword_t ds;      /**< ds register */
   l4_umword_t gs;      /**< gs register */
   l4_umword_t fs;      /**< fs register */
 #endif
-  l4_umword_t r15;     /**< edi register */
-  l4_umword_t r14;     /**< esi register */
-  l4_umword_t r13;     /**< ebp register */
-  l4_umword_t r12;     /**< page fault address */
-  l4_umword_t r11;     /**< edi register */
-  l4_umword_t r10;     /**< esi register */
-  l4_umword_t r9;     /**< ebp register */
-  l4_umword_t r8;     /**< page fault address */
+  l4_umword_t r15;     /**< r15 register */
+  l4_umword_t r14;     /**< r14 register */
+  l4_umword_t r13;     /**< r13 register */
+  l4_umword_t r12;     /**< r12 register */
+  l4_umword_t r11;     /**< r11 register */
+  l4_umword_t r10;     /**< r10 register */
+  l4_umword_t r9;      /**< r9 register */
+  l4_umword_t r8;      /**< r8 reigster */
 
-  l4_umword_t di;     /**< edi register */
-  l4_umword_t si;     /**< esi register */
-  l4_umword_t bp;     /**< ebp register */
+  l4_umword_t di;      /**< rdi register */
+  l4_umword_t si;      /**< rsi register */
+  l4_umword_t bp;      /**< rbp register */
   l4_umword_t pfa;     /**< page fault address */
-  l4_umword_t bx;     /**< ebx register */
-  l4_umword_t dx;     /**< edx register */
-  l4_umword_t cx;     /**< ecx register */
-  l4_umword_t ax;     /**< eax register */
+  l4_umword_t bx;      /**< rbx register */
+  l4_umword_t dx;      /**< rdx register */
+  l4_umword_t cx;      /**< rcx register */
+  l4_umword_t ax;      /**< rax register */
 
   l4_umword_t trapno;  /**< trap number */
   l4_umword_t err;     /**< error code */
 
-  l4_umword_t ip;     /**< instruction pointer */
+  l4_umword_t ip;      /**< instruction pointer */
   l4_umword_t dummy1;  /**< dummy \internal */
-  l4_umword_t flags;  /**< eflags */
-  l4_umword_t sp;     /**< stack pointer */
+  l4_umword_t flags;   /**< eflags */
+  l4_umword_t sp;      /**< stack pointer */
   l4_umword_t ss;
 } l4_vcpu_regs_t;
 
index 0070493873028c91e55531bbb0fa2a9241380ec8..b8d9ec27c000905da4fd592697d404d3e93ff179 100644 (file)
@@ -30,6 +30,7 @@ static char const *const _l4sys_errortab[L4_ERRNOMAX] = {
     [L4_EAGAIN]        = "Try again",
     [L4_ENOMEM]        = "Insufficient memory",
     [L4_EACCESS]       = "Access not permitted",
+    [L4_EBUSY]         = "Function busy",
     [L4_EEXIST]        = "Object exists",
     [L4_ENODEV]        = "No such device",
     [L4_EINVAL]        = "Invalid argument",
index e607273d5d12b6fe803db067d22a36781b1862e8..18c5bfd428d30e14aff4cd904a533405cbd0fc80 100644 (file)
@@ -2,7 +2,7 @@
  * \file
  * \brief  time stamp counter related functions
  *
- * \date   Frank Mehnert <fm3@os.inf.tu-dresden.de>
+ * \author  Frank Mehnert <fm3@os.inf.tu-dresden.de>
  * \ingroup l4util_tsc
  */
 
@@ -157,7 +157,7 @@ l4_calibrate_tsc (l4_kernel_info_t *kip);
  *                         calibration using the PIT.
  * \param kip            KIP pointer
  * \return 0 on error (no scalers exported by kernel, calibrating failed ...)
- *         otherwise returns (2^32 / (tsc per µsec)). This value has the
+ *         otherwise returns (2^32 / (tsc per Âµsec)). This value has the
  *         same semantics as the value returned by the calibrate_delay_loop()
  *         function of the Linux kernel.
  */
index 8e2bd42fcd896fddf08d931c706f18c19bca203d..dfbd00db8f2cdf83ca663abec9dfedb3ca813651 100644 (file)
@@ -20,12 +20,15 @@ enum l4io_iomem_flags_t
     L4IO_MEM_USE_MTRR  = 2, /**< Use MTRR */
     L4IO_MEM_ATTR_MASK = 0xf,
 
-    /** Use reserved area for mapping I/O memory. Flag only valid
-     *  for l4io_request_iomem_region() */
-    L4IO_MEM_USE_RESERVED_AREA = 0x10,
-
     // combinations
     L4IO_MEM_WRITE_COMBINED = L4IO_MEM_USE_MTRR | L4IO_MEM_CACHED,
+
+
+    /** Use reserved area for mapping I/O memory. Flag only valid
+     *  for l4io_request_iomem_region() */
+    L4IO_MEM_USE_RESERVED_AREA = 0x40 << 8,
+    /** Eagerly map the I/O memory. Passthrough to the l4re-rm. */
+    L4IO_MEM_EAGER_MAP         = 0x80 << 8,
 };
 
 /**
index 57739f8579afdb9aad30ec7c6f0ed48da41dcffc..4907fc5b2a5739df0604aaaeaa39f3e29d76bf4d 100644 (file)
@@ -149,11 +149,23 @@ static long
 __map_iomem(l4_addr_t phys, l4_addr_t* virt, unsigned long size, int flags)
 {
   Cap<L4Re::Dataspace> iomem = L4::cap_cast<L4Re::Dataspace>(vbus());
+  unsigned char align = L4_PAGESHIFT;
 
-  int res = L4Re::Env::env()->rm()->attach(virt, size,
-                               *virt
-                                ? (flags & L4IO_MEM_USE_RESERVED_AREA ? L4Re::Rm::In_area : 0)
-                                : L4Re::Rm::Search_addr, iomem, phys);
+  if (size >= L4_SUPERPAGESIZE)
+    align = L4_SUPERPAGESHIFT;
+
+  unsigned long rmflags = 0;
+
+  if (flags & L4IO_MEM_EAGER_MAP)
+    rmflags |= L4Re::Rm::Eager_map;
+
+  if (*virt && (flags & L4IO_MEM_USE_RESERVED_AREA))
+    rmflags |= L4Re::Rm::In_area;
+
+  if (!*virt)
+    rmflags |= L4Re::Rm::Search_addr;
+
+  int res = L4Re::Env::env()->rm()->attach(virt, size, rmflags, iomem, phys, align);
   if (res)
     {
       printf("Cannot attach iomem to virtual address %lx with size %lx: %s(%d).\n",
index 1f1c82a5b56bcc3cd13dae37c5068447cc5df6e0..1df330bba292d87a33333e3a79483fa0c8240050 100644 (file)
@@ -1,4 +1,4 @@
 
 
 The contrib directory contains the unmodified contents of
-sqlite-amalgamation-3.7.0.tar.gz
+sqlite-amalgamation-3.7.0.1.tar.gz
index 10aa07dee7b8d1ddf3d1feeba57bd4a11df1c55b..809d5730302dd8db0dca60e34cb932bf62e7afdd 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for sqlite 3.7.0.
+# Generated by GNU Autoconf 2.62 for sqlite 3.7.0.1.
 #
 # Report bugs to <http://www.sqlite.org>.
 #
@@ -750,8 +750,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='sqlite'
 PACKAGE_TARNAME='sqlite'
-PACKAGE_VERSION='3.7.0'
-PACKAGE_STRING='sqlite 3.7.0'
+PACKAGE_VERSION='3.7.0.1'
+PACKAGE_STRING='sqlite 3.7.0.1'
 PACKAGE_BUGREPORT='http://www.sqlite.org'
 
 ac_unique_file="sqlite3.c"
@@ -1480,7 +1480,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures sqlite 3.7.0 to adapt to many kinds of systems.
+\`configure' configures sqlite 3.7.0.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1550,7 +1550,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of sqlite 3.7.0:";;
+     short | recursive ) echo "Configuration of sqlite 3.7.0.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1660,7 +1660,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-sqlite configure 3.7.0
+sqlite configure 3.7.0.1
 generated by GNU Autoconf 2.62
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1674,7 +1674,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by sqlite $as_me 3.7.0, which was
+It was created by sqlite $as_me 3.7.0.1, which was
 generated by GNU Autoconf 2.62.  Invocation command line was
 
   $ $0 $@
@@ -2371,7 +2371,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='sqlite'
- VERSION='3.7.0'
+ VERSION='3.7.0.1'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -21733,7 +21733,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by sqlite $as_me 3.7.0, which was
+This file was extended by sqlite $as_me 3.7.0.1, which was
 generated by GNU Autoconf 2.62.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21780,7 +21780,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-sqlite config.status 3.7.0
+sqlite config.status 3.7.0.1
 configured by $0, generated by GNU Autoconf 2.62,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
index 5bea1a3d39626c7489cb3128e540ae47e8f344e2..95af2c17f31b18f9c0b0327caff7c64c36e26d53 100644 (file)
@@ -8,7 +8,7 @@
 #
 
 AC_PREREQ(2.61)
-AC_INIT(sqlite, 3.7.0, http://www.sqlite.org)
+AC_INIT(sqlite, 3.7.0.1, http://www.sqlite.org)
 AC_CONFIG_SRCDIR([sqlite3.c])
 
 # Use automake.
index 925c15ad247d05ac1bfa4f9ba4bfd4b8dea4644d..53dcf4f81abd4846161f22bb1b57dba85461e1d0 100644 (file)
@@ -1,6 +1,6 @@
 /******************************************************************************
 ** This file is an amalgamation of many separate C source files from SQLite
-** version 3.7.0.  By combining all the individual C code files into this 
+** version 3.7.0.1.  By combining all the individual C code files into this 
 ** single large file, the entire code can be compiled as a one translation
 ** unit.  This allows many compilers to do optimizations that would not be
 ** possible if the files were compiled separately.  Performance improvements
@@ -643,9 +643,9 @@ extern "C" {
 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
 ** [sqlite_version()] and [sqlite_source_id()].
 */
-#define SQLITE_VERSION        "3.7.0"
+#define SQLITE_VERSION        "3.7.0.1"
 #define SQLITE_VERSION_NUMBER 3007000
-#define SQLITE_SOURCE_ID      "2010-07-20 20:23:38 13ed106c8c279422a6159e28c6887d13a88b7b8b"
+#define SQLITE_SOURCE_ID      "2010-08-04 12:31:11 042a1abb030a0711386add7eb6e10832cc8b0f57"
 
 /*
 ** CAPI3REF: Run-Time Library Version Numbers
@@ -5776,7 +5776,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r
 ** <dd>^This parameter returns the approximate number of of bytes of heap
 ** memory used by all pager caches associated with the database connection.
 ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0.
-** checked out.</dd>)^
+** </dd>
 ** </dl>
 */
 #define SQLITE_DBSTATUS_LOOKASIDE_USED     0
@@ -21893,7 +21893,7 @@ static int os2Open(
 
   memset( pFile, 0, sizeof(*pFile) );
 
-  OSTRACE( "OPEN want %d\n", flags ));
+  OSTRACE(( "OPEN want %d\n", flags ));
 
   if( flags & SQLITE_OPEN_READWRITE ){
     ulOpenMode |= OPEN_ACCESS_READWRITE;
@@ -46250,13 +46250,27 @@ SQLITE_PRIVATE int sqlite3BtreeBeginTrans(Btree *p, int wrflag){
     if( p->inTrans>pBt->inTransaction ){
       pBt->inTransaction = p->inTrans;
     }
-#ifndef SQLITE_OMIT_SHARED_CACHE
     if( wrflag ){
+      MemPage *pPage1 = pBt->pPage1;
+#ifndef SQLITE_OMIT_SHARED_CACHE
       assert( !pBt->pWriter );
       pBt->pWriter = p;
       pBt->isExclusive = (u8)(wrflag>1);
-    }
 #endif
+
+      /* If the db-size header field is incorrect (as it may be if an old
+      ** client has been writing the database file), update it now. Doing
+      ** this sooner rather than later means the database size can safely 
+      ** re-read the database size from page 1 if a savepoint or transaction
+      ** rollback occurs within the transaction.
+      */
+      if( pBt->nPage!=get4byte(&pPage1->aData[28]) ){
+        rc = sqlite3PagerWrite(pPage1->pDbPage);
+        if( rc==SQLITE_OK ){
+          put4byte(&pPage1->aData[28], pBt->nPage);
+        }
+      }
+    }
   }
 
 
@@ -68264,14 +68278,20 @@ SQLITE_PRIVATE int sqlite3FindInIndex(Parse *pParse, Expr *pX, int *prNotFound){
     /* Could not found an existing table or index to use as the RHS b-tree.
     ** We will have to generate an ephemeral table to do the job.
     */
+    double savedNQueryLoop = pParse->nQueryLoop;
     int rMayHaveNull = 0;
     eType = IN_INDEX_EPH;
     if( prNotFound ){
       *prNotFound = rMayHaveNull = ++pParse->nMem;
-    }else if( pX->pLeft->iColumn<0 && !ExprHasAnyProperty(pX, EP_xIsSelect) ){
-      eType = IN_INDEX_ROWID;
+    }else{
+      testcase( pParse->nQueryLoop>(double)1 );
+      pParse->nQueryLoop = (double)1;
+      if( pX->pLeft->iColumn<0 && !ExprHasAnyProperty(pX, EP_xIsSelect) ){
+        eType = IN_INDEX_ROWID;
+      }
     }
     sqlite3CodeSubselect(pParse, pX, rMayHaveNull, eType==IN_INDEX_ROWID);
+    pParse->nQueryLoop = savedNQueryLoop;
   }else{
     pX->iTable = iTab;
   }
index 7fea578f08fb0e8ec9af6844569b0a71a26cd40d..3d02c7cca6849bbc826133ba313eeb12f8094da3 100644 (file)
@@ -107,9 +107,9 @@ extern "C" {
 ** [sqlite3_libversion_number()], [sqlite3_sourceid()],
 ** [sqlite_version()] and [sqlite_source_id()].
 */
-#define SQLITE_VERSION        "3.7.0"
+#define SQLITE_VERSION        "3.7.0.1"
 #define SQLITE_VERSION_NUMBER 3007000
-#define SQLITE_SOURCE_ID      "2010-07-20 20:23:38 13ed106c8c279422a6159e28c6887d13a88b7b8b"
+#define SQLITE_SOURCE_ID      "2010-08-04 12:31:11 042a1abb030a0711386add7eb6e10832cc8b0f57"
 
 /*
 ** CAPI3REF: Run-Time Library Version Numbers
@@ -5240,7 +5240,7 @@ SQLITE_API int sqlite3_db_status(sqlite3*, int op, int *pCur, int *pHiwtr, int r
 ** <dd>^This parameter returns the approximate number of of bytes of heap
 ** memory used by all pager caches associated with the database connection.
 ** ^The highwater mark associated with SQLITE_DBSTATUS_CACHE_USED is always 0.
-** checked out.</dd>)^
+** </dd>
 ** </dl>
 */
 #define SQLITE_DBSTATUS_LOOKASIDE_USED     0
index 74d679ef23d9ac5141cbbd3ccd154819be46eacb..1beeefa92d00cecbe89f1b9a47d450afdaa8d9ed 100644 (file)
@@ -7,7 +7,7 @@ includedir=${prefix}/include
 
 Name: SQLite
 Description: SQL database engine
-Version: 3.7.0
+Version: 3.7.0.1
 Libs: -L${libdir} -lsqlite3
 Libs.private: -ldl -lpthread 
 Cflags: -I${includedir}
index 0a8fa1ac632b140e5dd4bbada83e047a1a31e4a5..2820f20b5970eeab561d8d75353c3f26a4c61c45 100644 (file)
@@ -15,7 +15,7 @@
 
 #include <sys/stat.h>
 #include <sys/ioctl.h>
-#include <errno.h>
+#include <dirent.h>
 
 #include <cstdio>
 
@@ -127,15 +127,19 @@ private:
 
 class Pers_dir : public Node
 {
+private:
+  typedef cxx::Avl_tree<Node, Node_get_key, Path_avl_tree_compare> Tree;
+  Tree _tree;
+
 public:
   Pers_dir(const char *name, mode_t mode)
     : Node(name, (mode & 0777) | __S_IFDIR) {}
   Ref_ptr<Node> find_path(cxx::String);
   int add_node(Ref_ptr<Node> const &);
 
-private:
-  typedef cxx::Avl_tree<Node, Node_get_key, Path_avl_tree_compare> Tree;
-  Tree _tree;
+  typedef Tree::Const_iterator Const_iterator;
+  Const_iterator begin() const { return _tree.begin(); }
+  Const_iterator end() const { return _tree.end(); }
 };
 
 Ref_ptr<Node> Pers_dir::find_path(cxx::String path)
@@ -156,8 +160,9 @@ class Tmpfs_dir : public Be_file
 {
 public:
   explicit Tmpfs_dir(Ref_ptr<Pers_dir> const &d) throw()
-    : _dir(d) {}
+    : _dir(d), _getdents_state(false) {}
   int get_entry(const char *, int, mode_t, Ref_ptr<File> *) throw();
+  ssize_t getdents(char *, size_t) throw();
   int fstat64(struct stat64 *buf) const throw();
   int mkdir(const char *, mode_t) throw();
   int unlink(const char *) throw();
@@ -168,6 +173,8 @@ private:
                 Ref_ptr<Node> *ret, cxx::String *remaining = 0);
 
   Ref_ptr<Pers_dir> _dir;
+  bool _getdents_state;
+  Pers_dir::Const_iterator _getdents_iter;
 };
 
 class Tmpfs_file : public Be_file
@@ -218,6 +225,7 @@ ssize_t Tmpfs_file::writev(const struct iovec *v, int iovcnt) throw()
 
 int Tmpfs_file::fstat64(struct stat64 *buf) const throw()
 {
+  _file->info()->st_size = _file->data().size();
   memcpy(buf, _file->info(), sizeof(*buf));
   return 0;
 }
@@ -297,6 +305,47 @@ Tmpfs_dir::get_entry(const char *name, int flags, mode_t mode,
   return 0;
 }
 
+ssize_t
+Tmpfs_dir::getdents(char *buf, size_t sz) throw()
+{
+  struct dirent64 *d = (struct dirent64 *)buf;
+  ssize_t ret = 0;
+
+  if (!_getdents_state)
+    {
+      _getdents_iter = _dir->begin();
+      _getdents_state = true;
+    }
+  else if (_getdents_iter == _dir->end())
+    {
+      _getdents_state = false;
+      return 0;
+    }
+
+  for (; _getdents_iter != _dir->end(); ++_getdents_iter)
+    {
+      unsigned l = strlen(_getdents_iter->path()) + 1;
+      if (l > sizeof(d->d_name))
+        l = sizeof(d->d_name);
+
+      unsigned n = offsetof (struct dirent64, d_name) + l;
+
+      if (n > sz)
+        break;
+
+      d->d_ino = 1;
+      d->d_off = 0;
+      memcpy(d->d_name, _getdents_iter->path(), l);
+      d->d_reclen = n;
+      d->d_type   = DT_REG;
+      ret += n;
+      sz  -= n;
+      d    = (struct dirent64 *)((unsigned long)d + n);
+    }
+
+  return ret;
+}
+
 int
 Tmpfs_dir::fstat64(struct stat64 *buf) const throw()
 {